15 #ifndef BORNAGAIN_BASE_UTILS_INTEGRATOR_H
16 #define BORNAGAIN_BASE_UTILS_INTEGRATOR_H
20 #include <gsl/gsl_integration.h>
28 double integrate(
const std::function<
double(
double)>& f,
double lmin,
double lmax);
33 return (*(
const std::function<
double(
double)>*)(
p))(x);
Defines complex_t, and a few elementary functions.
std::complex< double > complex_t
To integrate a complex function of a real variable.
complex_t integrate(const std::function< complex_t(double)> &f, double lmin, double lmax)
To integrate a real function of a real variable.
double integrate(const std::function< double(double)> &f, double lmin, double lmax)
static double m_Cfunction(double x, void *p)
gsl_integration_workspace * m_workspace