GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GOptimizerFunction.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GOptimizerFunction.hpp - Optimizer function abstract base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2009-2014 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 GOptimizerFunction.hpp
23  * @brief Optimizer function abstract base class
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GOPTIMIZERFUNCTION_HPP
28 #define GOPTIMIZERFUNCTION_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include "GOptimizerPars.hpp"
32 #include "GVector.hpp"
33 #include "GMatrixSparse.hpp"
34 
35 
36 /***********************************************************************//**
37  * @class GOptimizerFunction
38  *
39  * @brief Optimizer function abstract base class
40  *
41  * This class provides an abstract interface for the function that is used
42  * by the GOptimizer optimization class.
43  *
44  * The eval() method returns the function value at a given set of parameters
45  * that is defined by an instance of the optimizer parameter container class
46  * GOptimizerPars. The value() method returns the actual function value at
47  * these parameters, and the gradient() and covar() methods return pointers
48  * on the gradient vector and the covariance matrix at the parameter values.
49  ***************************************************************************/
51 
52 public:
53  // Constructors and destructors
54  GOptimizerFunction(void);
56  virtual ~GOptimizerFunction(void);
57 
58  // Operators
60 
61  // Virtual methods
62  virtual void eval(const GOptimizerPars& pars) = 0;
63  virtual double value(void) const = 0;
64  virtual GVector* gradient(void) = 0;
65  virtual GMatrixSparse* curvature(void) = 0;
66 
67 protected:
68  // Protected methods
69  void init_members(void);
70  void copy_members(const GOptimizerFunction& fct);
71  void free_members(void);
72 };
73 
74 #endif /* GOPTIMIZERFUNCTION_HPP */
void copy_members(const GOptimizerFunction &fct)
Copy class members.
Optimizer function abstract base class.
Sparse matrix class interface definition.
virtual GMatrixSparse * curvature(void)=0
Optimizer parameter container class.
GOptimizerFunction(void)
Void constructor.
virtual void eval(const GOptimizerPars &pars)=0
void init_members(void)
Initialise class members.
Optimizer parameters base class definition.
Vector class interface definition.
virtual GVector * gradient(void)=0
void free_members(void)
Delete class members.
Sparse matrix class definition.
virtual double value(void) const =0
Vector class.
Definition: GVector.hpp:46
virtual ~GOptimizerFunction(void)
Destructor.
virtual GOptimizerFunction & operator=(const GOptimizerFunction &fct)
Assignment operator.