integration.cpp
Go to the documentation of this file.
#include <itpp/base/math/integration.h>
namespace itpp
{
//wrapper to convert double(*f)(double) to function object
class Integrand_Wrapper
{
typedef double(*Ftn)(double);
Ftn _f;
public:
explicit Integrand_Wrapper(Ftn f): _f(f) {}
double operator()(double x) const {return _f(x);}
};
template double quad(Integrand_Wrapper, double, double, double);
template double quadl(Integrand_Wrapper, double, double, double);
//--------------------- quad() ----------------------------------------
double quad(double(*f)(double), double a, double b,
double tol)
{
return quad(Integrand_Wrapper(f), a, b, tol);
}
//--------------------- quadl() ----------------------------------------
double quadl(double(*f)(double), double a, double b, double tol)
{
return quadl(Integrand_Wrapper(f), a, b, tol);
}
} // namespace itpp
itpp::quad
double quad(Ftn f, double a, double b, double tol=std::numeric_limits< double >::epsilon())
Definition: integration.h:162
itpp::quadl
double quadl(Ftn f, double a, double b, double tol=std::numeric_limits< double >::epsilon())
Definition: integration.h:264
integration.h
Definition of numerical integration.
itpp
itpp namespace
Definition: itmex.h:36

Generated on Thu Aug 20 2015 21:02:50 for IT++ by Doxygen 1.8.9.1