|
Boost Users : |
From: Anirban Pal (anirban.pal.iitkgp_at_[hidden])
Date: 2020-08-14 00:07:53
Hello everyone,
I'm new to using boost and I'm trying to use its quadrature routines,
specifically
the *tanh_sinh* integrator. I'm trying to run the examples here:
<goog_14736225>
https://www.boost.org/doc/libs/1_66_0/libs/math/doc/html/math_toolkit/double_exponential/de_tanh_sinh.html
I've been successful using it with the *double* datatype. However, I can't
seem to work with the *Real* datatype. When I run the following, I'm
successful.
tanh_sinh<double> integrator;auto f = [](double x) { return 5*x + 7;
};double Q = integrator.integrate(f);Q = integrator.integrate(f, 0.0,
1.1);
But when I run the following:
auto f = [](Real x) { return log(x)*log(1-x); };Real Q =
integrator.integrate(f, (Real) 0, (Real) 1);
I get the error:
boost_test.cxx: In function âint main(int, char**)â:
boost_test.cxx:47:15: error: âRealâ has not been declared
auto f2 = [](Real x) { return log(x)*log(1-x); };
^~~~
boost_test.cxx:48:2: error: âRealâ was not declared in this scope
Real Q2 = integrator.integrate(f2, (Real) 0, (Real) 1);
I think I need to include the right headers for this to go away. However,
I'm not sure what the correct header file is.
Thank you for your attention.
-- Anirban Pal
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net