Theoretica
A C++ numerical and automatic mathematical library
|
Integral approximation. More...
#include "../core/constants.h"
#include "../core/function.h"
#include "../polynomial/polynomial.h"
#include "../polynomial/orthogonal.h"
#include "./gauss.h"
Go to the source code of this file.
Namespaces | |
theoretica | |
Main namespace of the library which contains all functions and objects. | |
Functions | |
template<typename T = real> | |
polynomial< T > | theoretica::integral (const polynomial< T > &p) |
Compute the indefinite integral of a polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_midpoint (RealFunction f, real a, real b, unsigned int steps=CALCULUS_INTEGRAL_STEPS) |
Approximate the definite integral of an arbitrary function using the midpoint method. More... | |
template<typename RealFunction > | |
real | theoretica::integral_trapezoid (RealFunction f, real a, real b, unsigned int steps=CALCULUS_INTEGRAL_STEPS) |
Approximate the definite integral of an arbitrary function using the trapezoid method. More... | |
template<typename RealFunction > | |
real | theoretica::integral_simpson (RealFunction f, real a, real b, unsigned int steps=CALCULUS_INTEGRAL_STEPS) |
Approximate the definite integral of an arbitrary function using Simpson's method. More... | |
template<typename RealFunction > | |
real | theoretica::integral_romberg (RealFunction f, real a, real b, unsigned int iter=8) |
Approximate the definite integral of an arbitrary function using Romberg's method accurate to the given order. More... | |
template<typename RealFunction > | |
real | theoretica::integral_romberg_tol (RealFunction f, real a, real b, real tolerance=CALCULUS_INTEGRAL_TOL) |
Approximate the definite integral of an arbitrary function using Romberg's method to the given tolerance. More... | |
template<typename RealFunction > | |
real | theoretica::integral_gauss (RealFunction f, const std::vector< real > &x, const std::vector< real > &w) |
Use Gaussian quadrature using the given points and weights. More... | |
template<typename RealFunction > | |
real | theoretica::integral_gauss (RealFunction f, real *x, real *w, unsigned int n) |
Use Gaussian quadrature using the given points and weights. More... | |
template<typename RealFunction > | |
real | theoretica::integral_gauss (RealFunction f, real *x, real *w, unsigned int n, real_function Winv) |
Use Gaussian quadrature using the given points and weights. More... | |
template<typename RealFunction > | |
real | theoretica::integral_legendre (RealFunction f, real a, real b, real *x, real *w, unsigned int n) |
Use Gauss-Legendre quadrature of arbitrary degree to approximate a definite integral providing the roots of the n degree Legendre polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_legendre (RealFunction f, real a, real b, const std::vector< real > &x, const std::vector< real > &w) |
Use Gauss-Legendre quadrature of arbitrary degree to approximate a definite integral providing the roots of the n degree Legendre polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_legendre (RealFunction f, real a, real b, const std::vector< real > &x) |
Use Gauss-Legendre quadrature of arbitrary degree to approximate a definite integral providing the roots of the n degree Legendre polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_legendre (RealFunction f, real a, real b, unsigned int n=16) |
Use Gauss-Legendre quadrature of degree 2, 4, 8 or 16, using pre-computed values, to approximate an integral over [a, b]. More... | |
template<typename RealFunction > | |
real | theoretica::integral_laguerre (RealFunction f, const std::vector< real > &x) |
Use Gauss-Laguerre quadrature of arbitrary degree to approximate an integral over [0, +inf) providing the roots of the n degree Legendre polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_laguerre (RealFunction f, real a, real b, const std::vector< real > &x) |
Use Gauss-Laguerre quadrature of arbitrary degree to approximate an integral over [a, b] providing the roots of the n degree Legendre polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_laguerre (RealFunction f, unsigned int n=16) |
Use Gauss-Laguerre quadrature of degree 2, 4, 8 or 16, using pre-computed values, to approximate an integral over [0, +inf). More... | |
template<typename RealFunction > | |
real | theoretica::integral_hermite (RealFunction f, const std::vector< real > &x) |
Use Gauss-Hermite quadrature of arbitrary degree to approximate an integral over (-inf, +inf) providing the roots of the n degree Hermite polynomial. More... | |
template<typename RealFunction > | |
real | theoretica::integral_hermite (RealFunction f, unsigned int n=16) |
Use Gauss-Hermite quadrature of degree 2, 4, 8 or 16, using pre-computed values, to approximate an integral over (-inf, +inf). More... | |
real | theoretica::integral_inf_riemann (real_function f, real a, real step_sz=1, real tol=CALCULUS_INTEGRAL_TOL, unsigned int max_iter=100) |
Integrate a function from a point up to infinity by integrating it by steps, stopping execution when the variation of the integral is small enough or the number of steps reaches a maximum value. | |
template<typename RealFunction > | |
real | theoretica::integral (RealFunction f, real a, real b) |
Use the best available algorithm to approximate the definite integral of a real function. More... | |
template<typename RealFunction > | |
real | theoretica::integral (RealFunction f, real a, real b, real tol) |
Use the best available algorithm to approximate the definite integral of a real function to a given tolerance. More... | |
Integral approximation.