GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GFunction.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GFunction.hpp - Single parameter function abstract base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2011-2013 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GFunction.hpp
23  * @brief Single parameter function abstract base class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GFUNCTION_HPP
28 #define GFUNCTION_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 
32 
33 /***********************************************************************//**
34  * @class GFunction
35  *
36  * @brief Single parameter function abstract base class
37  *
38  * This class implements the abstract interface for a one parameter function.
39  * This function is for example used for integration or numerical computation
40  * of derivatives. This class has no members. The only pure virtual method
41  * that needs to be implemented by the derived class is the eval() method
42  * that provides function evaluation at a given value x, e.g. y=eval(x).
43  ***************************************************************************/
44 class GFunction {
45 
46 public:
47 
48  // Constructors and destructors
49  GFunction(void);
50  GFunction(const GFunction& function);
51  virtual ~GFunction(void);
52 
53  // Operators
54  GFunction& operator=(const GFunction& function);
55 
56  // Methods
57  virtual double eval(const double& x) = 0;
58 
59 protected:
60  // Protected methods
61  void init_members(void);
62  void copy_members(const GFunction& function);
63  void free_members(void);
64 };
65 
66 #endif /* GFUNCTION_HPP */
GFunction & operator=(const GFunction &function)
Assignment operator.
Definition: GFunction.cpp:101
void init_members(void)
Initialise class members.
Definition: GFunction.cpp:137
GFunction(void)
Void constructor.
Definition: GFunction.cpp:48
void free_members(void)
Delete class members.
Definition: GFunction.cpp:159
virtual double eval(const double &x)=0
virtual ~GFunction(void)
Destructor.
Definition: GFunction.cpp:79
Single parameter function abstract base class.
Definition: GFunction.hpp:44
void copy_members(const GFunction &function)
Copy class members.
Definition: GFunction.cpp:149