GammaLib 2.0.0
Loading...
Searching...
No Matches
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 _______________________________________________ */
33class 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 ***************************************************************************/
51
52public:
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
66protected:
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 */
Single parameter functions abstract base class.
GFunctions & operator=(const GFunctions &functions)
Assignment operator.
virtual GVector eval(const double &x)=0
virtual ~GFunctions(void)
Destructor.
GFunctions(void)
Void constructor.
void copy_members(const GFunctions &functions)
Copy class members.
void free_members(void)
Delete class members.
virtual int size(void) const =0
void init_members(void)
Initialise class members.
Vector class.
Definition GVector.hpp:46