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);
31 static double m_Cfunction(
double x,
void* p)
33 return (*(
const std::function<
double(
double)>*)(p))(x);
36 gsl_integration_workspace* m_workspace;
43 complex_t integrate(
const std::function<complex_t(
double)>& f,
double lmin,
double lmax);
Defines complex_t, and a few elementary functions.
To integrate a complex function of a real variable.
To integrate a real function of a real variable.