📄 integrat.h
字号:
#pragma Integrate
typedef double FunctionType(double d);
double Simpson(double LowerLimit,
double UpperLimit,
unsigned int NumIntervals,
FunctionType function);
/* Given a function of TYPE FunctionType, Simpson computes the
integral of the function from LowerLimit to UpperLimit using
Simpson Composite Algorithm.
Variables: LowerLimit - Lower limit of integration
UpperLimit - Upper limit of integration
NumIntervals - Number of subintervals over which to
use Simpson's rule. */
double Trapezoid(double LowerLimit,
double UpperLimit,
unsigned int NumIntervals,
FunctionType function);
/* Given a function of TYPE FunctionType, Trapeziod computes the
integral of the function from LowerLimit to UpperLimit using
the Trapeziod Rule.
Variables: LowerLimit - Lower limit of integration
UpperLimit - Upper limit of integration
NumIntervals - Number of subintervals over which to
use the Trapeziod rule. */
double AdaptiveGauss(double LowerLimit,
double UpperLimit,
double Tolerance,
unsigned int MaxIntervals,
unsigned int &NumIntervals,
FunctionType function);
/* Given a function of TYPE FunctionType, AdaptiveGauss computes the
integral of the function from LowerLimit to UpperLimit using
Adaptive Quadrature and Gaussian Quadrature with a 16th
order Legendre polynomial.
Variables: LowerLimit - Lower limit of integration
UpperLimit - Upper limit of integration
Tolerance - Tolerance in answer
MaxIntervals - Max no. of subintervals over which to
approximate the integral
NumIntervals - Number of subintervals it actually
took to approximate integral. */
double Romberg(double LowerLimit,
double UpperLimit,
double Tolerance,
unsigned int MaxIter,
unsigned int &NumIter,
FunctionType function);
/* Given a function of TYPE FunctionType, Romberg computes the
integral of the function from LowerLimit to UpperLimit using
the Romberg Rule.
Variables: LowerLimit - Lower limit of integration
UpperLimit - Upper limit of integration
Tolerance - Tolerance in answer
MaxIter - Maximum number of iterations
NumIter - Number of iterations it actually took */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -