GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GFunctions.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GFunctions.hpp - Single parameter functions abstract base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2020 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 GFunctions.hpp
23  * @brief Single parameter functions abstract base class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GFUNCTIONS_HPP
28 #define GFUNCTIONS_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 
32 /* __ Forward declarations _______________________________________________ */
33 class GVector;
34 
35 
36 /***********************************************************************//**
37  * @class GFunctions
38  *
39  * @brief Single parameter functions abstract base class
40  *
41  * This class implements the abstract interface for a set of one parameter
42  * functions.
43  *
44  * The set of functions is for example used for integration or numerical
45  * computation of derivatives. This class has no members. The only pure
46  * virtual method that needs to be implemented by the derived class is the
47  * eval() method that evaluates the functions at a given value x and returns
48  * the evaluation result as an GNdarray object.
49  ***************************************************************************/
50 class GFunctions {
51 
52 public:
53 
54  // Constructors and destructors
55  GFunctions(void);
56  GFunctions(const GFunctions& functions);
57  virtual ~GFunctions(void);
58 
59  // Operators
60  GFunctions& operator=(const GFunctions& functions);
61 
62  // Methods
63  virtual int size(void) const = 0;
64  virtual GVector eval(const double& x) = 0;
65 
66 protected:
67  // Protected methods
68  void init_members(void);
69  void copy_members(const GFunctions& functions);
70  void free_members(void);
71 };
72 
73 #endif /* GFUNCTIONS_HPP */
void free_members(void)
Delete class members.
Definition: GFunctions.cpp:159
virtual GVector eval(const double &x)=0
GFunctions & operator=(const GFunctions &functions)
Assignment operator.
Definition: GFunctions.cpp:101
void copy_members(const GFunctions &functions)
Copy class members.
Definition: GFunctions.cpp:149
virtual int size(void) const =0
GFunctions(void)
Void constructor.
Definition: GFunctions.cpp:48
virtual ~GFunctions(void)
Destructor.
Definition: GFunctions.cpp:79
Vector class.
Definition: GVector.hpp:46
void init_members(void)
Initialise class members.
Definition: GFunctions.cpp:137
Single parameter functions abstract base class.
Definition: GFunctions.hpp:50