GammaLib 2.0.0
Loading...
Searching...
No Matches
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
52public:
53 // Constructors and destructors
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
67protected:
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 */
Sparse matrix class definition.
Optimizer parameters base class definition.
Vector class interface definition.
Sparse matrix class interface definition.
Optimizer function abstract base class.
GOptimizerFunction(void)
Void constructor.
virtual double value(void) const =0
virtual GOptimizerFunction & operator=(const GOptimizerFunction &fct)
Assignment operator.
virtual GMatrixSparse * curvature(void)=0
void copy_members(const GOptimizerFunction &fct)
Copy class members.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
virtual GVector * gradient(void)=0
virtual ~GOptimizerFunction(void)
Destructor.
virtual void eval(const GOptimizerPars &pars)=0
Optimizer parameter container class.
Vector class.
Definition GVector.hpp:46