NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::integrate Namespace Reference

Data Structures

class  LegendrePolynomial
 

Functions

double gauss_legendre (const double low, const double high, const uint32 n, const std::function< double(double)> &f)
 
double romberg (const double low, const double high, const uint8 n, const std::function< double(double)> &f)
 
double simpson (const double low, const double high, const uint32 n, const std::function< double(double)> &f) noexcept
 
double trapazoidal (const double low, const double high, const uint32 n, const std::function< double(double)> &f) noexcept
 

Function Documentation

◆ gauss_legendre()

double nc::integrate::gauss_legendre ( const double  low,
const double  high,
const uint32  n,
const std::function< double(double)> &  f 
)
inline

Performs Gauss-Legendre integration of the input function

Parameters
lowthe lower bound of the integration
highthe upper bound of the integration
nthe number of iterations to perform
fthe function to integrate over
Returns
double

◆ romberg()

double nc::integrate::romberg ( const double  low,
const double  high,
const uint8  n,
const std::function< double(double)> &  f 
)
inline

Performs Newton-Cotes Romberg integration of the input function

Parameters
lowthe lower bound of the integration
highthe upper bound of the integration
nthe number of iterations
fthe function to integrate over
Returns
double

◆ simpson()

double nc::integrate::simpson ( const double  low,
const double  high,
const uint32  n,
const std::function< double(double)> &  f 
)
inlinenoexcept

Performs Newton-Cotes Simpson integration of the input function

Parameters
lowthe lower bound of the integration
highthe upper bound of the integration
nthe number of subdivisions
fthe function to integrate over
Returns
double

◆ trapazoidal()

double nc::integrate::trapazoidal ( const double  low,
const double  high,
const uint32  n,
const std::function< double(double)> &  f 
)
inlinenoexcept

Performs Newton-Cotes trapazoidal integration of the input function

Parameters
lowthe lower bound of the integration
highthe upper bound of the integration
nthe number of subdivisions
fthe function to integrate over
Returns
double