The class and methods defined here allow the integration of a real function. Each user-defined function to be integrated should be defined as a method in a class which inherits from the class defining the integration methods.
Real_integrable
double operator()(const double x) const
double simpson( const double x1, const double x2, // lower and upper limits of integration const double acc = 1.0e-6, // accuracy required const int maxrep = 10, // max times allowed to half step (0 => no limit) const int minsteps = 10, // min number of steps expected to be necessary const double eps = 1.0e-10 // numerical bandwidth used to detect stepsize underflow )
double romberg( const double x1, const double x2, // lower and upper limits of integration const double acc = 1.0e-6, // accuracy required const int iorder = 4, // order of integration, min 4, must be even const int maxrep = 10, // max times allowed to half step (0 => no limit) const int minsteps = 10, // min number of steps expected to be necessary const double eps = 1.0e-10 // numerical bandwidth used to detect stepsize underflow )