IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Numerical Integration
Basic and Miscellaneous Math Functions

Numerical integration routines. More...

Functions

double itpp::quad (double(*f)(double), double a, double b, double tol)
double itpp::quadl (double(*f)(double), double a, double b, double tol)

Detailed Description

Numerical integration routines.

Function Documentation

double itpp::quad ( double(*)(double)  f,
double  a,
double  b,
double  tol = std::numeric_limits< double >::epsilon() 
)

1-dimensional numerical Simpson quadrature integration

Calculate the 1-dimensional integral

\[ \int_a^b f(x) dx \]

Uses an adaptive Simpson quadrature method. See [Gander] for more details. The integrand is specified as a function

double
f(double)

.

Example:

#include "itpp/itbase.h"
double f(const double x)
{
return x*log(x);
}
int main()
{
double res = quad( f, 1.5, 3.5);
cout << "res = " << res << endl;
return 0;
}

References:

[Gander] Gander, W. and W. Gautschi, "Adaptive Quadrature - Revisited", BIT, Vol. 40, 2000, pp. 84-101. This document is also available at http://www.inf.ethz.ch/personal/gander.

Definition at line 71 of file integration.cpp.

References itpp::quadstep(), and itpp::sum().

Referenced by itpp::EXIT::apriori_mutual_info().

double itpp::quadl ( double(*)(double)  f,
double  a,
double  b,
double  tol = std::numeric_limits< double >::epsilon() 
)

1-dimensional numerical adaptive Lobatto quadrature integration

Calculate the 1-dimensional integral

\[ \int_a^b f(x) dx \]

Uses an adaptive Lobatto quadrature method. See [Gander] for more details. The integrand is specified as a function

double
f(double)

.

Example:

#include "itpp/itbase.h"
double f(const double x)
{
return x*log(x);
}
int main()
{
double res = quadl( f, 1.5, 3.5);
cout << "res = " << res << endl;
return 0;
}

References:

[Gander] Gander, W. and W. Gautschi, "Adaptive Quadrature - Revisited", BIT, Vol. 40, 2000, pp. 84-101. This document is also available at http:// www.inf.ethz.ch/personal/gander.

Definition at line 144 of file integration.cpp.

References itpp::abs(), itpp::quadlstep(), itpp::sign(), and itpp::sqrt().

SourceForge Logo

Generated on Fri Mar 21 2014 17:14:15 for IT++ by Doxygen 1.8.1.2