integrat.h

来自「eC++编译器源码」· C头文件 代码 · 共 71 行

H
71
字号
#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 + =
减小字号Ctrl + -
显示快捷键?