Commit a72fc0c3 by Joseph Boudreau

### DefiniteIntegral now can handle improper integrals

parent 1dce6d26
 ... ... @@ -2,9 +2,14 @@ // \$Id: DefiniteIntegral.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp \$ //-------------------------------------------------------------// // // // This functional returns the definite integral of a function // // This functional performs Romberg integration on a function // // between lower bound and upper bound b. // // // // Two types: OPEN: use open quadrature formula // // for improper integrals // // CLOSED (default) use closed quadrature // // formula. // // // //-------------------------------------------------------------// #ifndef _DefiniteIntegral_h_ ... ... @@ -21,8 +26,17 @@ namespace Genfun { public: // Type definition: typedef enum {CLOSED, OPEN} Type; // Constructor: DefiniteIntegral(double a, double b); DefiniteIntegral(double a, double b, Type=CLOSED); // Copy Constructor: DefiniteIntegral(const DefiniteIntegral &); // Assignment Operator: DefiniteIntegral & operator=(const DefiniteIntegral &) ; // Destructor: ~DefiniteIntegral(); ... ... @@ -33,23 +47,23 @@ namespace Genfun { // Retrieve the number of function calls for the last operation: unsigned int numFunctionCalls() const; private: // Algorithmic parameters: // Desired precision (default 1.0E-06) void setEpsilon(double eps); // Trapezoid calculation: double _trapzd( const AbsFunction & function, double a, double b, int j) const; // Maximum number of iterations (default 20(closed) 14 (open)) void setMaxIter (unsigned int maxIter); // Polynomial interpolation: void _polint(double *xArray, double *yArray, double x, double & y, double & deltay) const; // Minimum order: void setMinOrder (unsigned int order); double _a; // lower limit of integration double _b; // upper limit of integration static const int _K; // Order static const int _KP; // Const dim of certain arrays. // buffered value for _trapzd calculation: mutable double _sTrap; mutable unsigned int _nFunctionCalls; private: class Clockwork; Clockwork *c; }; } // namespace Genfun #endif