CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

DefiniteIntegral.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: DefiniteIntegral.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
00003 //-------------------------------------------------------------//
00004 //                                                             //
00005 // This functional performs Romberg integration on a function  //
00006 // between lower bound and upper bound b.                      //
00007 //                                                             //
00008 // Two types:  OPEN: use open quadrature formula               //
00009 //                   for improper integrals                    //
00010 //             CLOSED (default) use closed quadrature          //
00011 //                   formula.                                  //
00012 //                                                             //
00013 //-------------------------------------------------------------//
00014 
00015 #ifndef _DefiniteIntegral_h_
00016 #define _DefiniteIntegral_h_
00017 #include "CLHEP/GenericFunctions/AbsFunctional.hh"
00018 
00019 namespace Genfun {
00020 
00025   class DefiniteIntegral:public AbsFunctional {
00026 
00027   public:
00028   
00029     // Type definition:
00030     typedef enum {CLOSED, OPEN} Type;
00031 
00032     // Constructor:
00033     DefiniteIntegral(double a, double b, Type=CLOSED);
00034 
00035     // Copy Constructor:
00036     DefiniteIntegral(const DefiniteIntegral &);
00037 
00038     // Assignment Operator:
00039     DefiniteIntegral & operator=(const DefiniteIntegral &) ;
00040 
00041     // Destructor:
00042     ~DefiniteIntegral();
00043 
00044     // Take the definite integral of a function between the bounds:
00045     virtual double operator [] (const AbsFunction & function) const;
00046 
00047     // Retrieve the number of function calls for the last operation:
00048     unsigned int numFunctionCalls() const;
00049 
00050     // Algorithmic parameters:
00051     
00052     // Desired precision (default 1.0E-06)
00053     void setEpsilon(double eps);
00054 
00055     // Maximum number of iterations (default 20(closed) 14 (open))
00056     void setMaxIter (unsigned int maxIter);
00057 
00058     // Minimum order:
00059     void setMinOrder (unsigned int order);
00060 
00061 
00062   private:
00063 
00064     class Clockwork;
00065     Clockwork *c;
00066 
00067   };
00068 } // namespace Genfun
00069 #endif

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7