Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:48

0001 #ifndef ATOOLS_Math_Function_Base_H
0002 #define ATOOLS_Math_Function_Base_H
0003 
0004 #include <string>
0005 
0006 namespace ATOOLS {
0007 
0008   class Function;
0009 
0010   class Function_Base {
0011   protected :
0012 
0013     double      m_defval;
0014 
0015     std::string m_type, m_name;
0016 
0017   public:
0018 
0019     // destructor
0020     virtual ~Function_Base();
0021 
0022     // setters
0023     virtual void SetParameters(double *parameters);
0024 
0025     Function *GetAIFunction();
0026     Function *GetAIGMeanFunction();
0027 
0028     // getters
0029     virtual std::string Type();
0030 
0031     // member functions
0032     virtual double GetValue(double x);
0033     virtual double operator()(double x);
0034     virtual double operator()();
0035 
0036     double FindZero(double, double, int MAX_ITR=150, double precision=2.2e-16);
0037     double WDBSolve(const double &y,const double &xmin,const double &xmax,
0038             const double &precision=1.0e-12,const int maxit=100);
0039 
0040     inline void SetType(const std::string &type) { m_type=type; }
0041 
0042     inline std::string Name() const { return m_name; }
0043 
0044     inline void SetDefault(const double &defval) { m_defval=defval; }
0045 
0046     inline double Default() const { return m_defval; }
0047     
0048   };
0049 
0050 // --------------------------------------------------
0051 //           Doxygen part starts here
0052 // --------------------------------------------------
0053 
0054 
0055 /*!
0056  \file
0057  \brief contains the class Function_Base
0058 */
0059 
0060 
0061 /*!
0062  \class Function_Base
0063  \brief this is a pure virtual base class for any function \f$y=f(x)\f$.
0064 
0065  This class provides an common interface to all function that 
0066  are only dependent on one parameter. All classes derived
0067  from this class might e.g. be itegrated by Gauss_Integrater.
0068 */
0069 
0070 /*!
0071  \fn virtual void Function_Base::SetParameters(double *)
0072   \brief  possibility to pass a number of paremters to the function.
0073 */
0074 
0075 /*!
0076  \fn virtual double Function_Base::GetValue(double xx)
0077  \brief synonym for calling Function_Base::operator()();
0078 */
0079 
0080 /*!
0081  \fn virtual double Function_Base::operator() (double x)
0082  \brief returns a value for \f$f(x)\f$
0083 */
0084 
0085 }
0086 
0087 #endif