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::Array::operator()
T & operator()(int i)
Get the i element.
Definition array.h:290
integration.h
Definition of numerical integration.
itpp
itpp namespace
Definition itmex.h:37
itpp::quadl
double quadl(Ftn f, double a, double b, double tol=std::numeric_limits< double >::epsilon())
Definition integration.h:264
itpp::quad
double quad(Ftn f, double a, double b, double tol=std::numeric_limits< double >::epsilon())
Definition integration.h:162

Generated on Mon Jun 10 2024 11:49:18 for IT++ by Doxygen 1.9.8