GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GOptimizer Class Referenceabstract

Abstract optimizer abstract base class. More...

#include <GOptimizer.hpp>

Inheritance diagram for GOptimizer:
GBase GOptimizerLM

Public Member Functions

 GOptimizer (void)
 Constructor. More...
 
 GOptimizer (const GOptimizer &opt)
 Copy constructor. More...
 
virtual ~GOptimizer (void)
 Destructor. More...
 
virtual GOptimizeroperator= (const GOptimizer &opt)
 Assignment operator. More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GOptimizerclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual void optimize (GOptimizerFunction &fct, GOptimizerPars &pars)=0
 
virtual void errors (GOptimizerFunction &fct, GOptimizerPars &pars)=0
 
virtual double value (void) const =0
 
virtual int status (void) const =0
 
virtual int iter (void) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GOptimizer &opt)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Detailed Description

Abstract optimizer abstract base class.

This class defines the abstract interface for the optimizer class. The optimizer class is used to optimize the parameters of a function. The function is implemented using the abstract GOptimizerFunction class while the parameters are implemented using the abstract GOptimizerPars class.

The main driver of this class is the optimize() method which optimizes the parameters using a function. The function value can be accessed using the value() method, the status() method provides an integer with status information, the iter() method gives the number of iterations for iterative optimization algorithms.

Definition at line 54 of file GOptimizer.hpp.

Constructor & Destructor Documentation

GOptimizer::GOptimizer ( void  )

Constructor.

Definition at line 48 of file GOptimizer.cpp.

References init_members().

GOptimizer::GOptimizer ( const GOptimizer opt)

Copy constructor.

Parameters
[in]optOptimizer.

Definition at line 63 of file GOptimizer.cpp.

References copy_members(), and init_members().

GOptimizer::~GOptimizer ( void  )
virtual

Destructor.

Definition at line 79 of file GOptimizer.cpp.

References free_members().

Member Function Documentation

virtual std::string GOptimizer::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GBase.

Implemented in GOptimizerLM.

virtual void GOptimizer::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GBase.

Implemented in GOptimizerLM.

virtual GOptimizer* GOptimizer::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GBase.

Implemented in GOptimizerLM.

void GOptimizer::copy_members ( const GOptimizer opt)
protected

Copy class members.

Parameters
[in]optOptimizer.

Definition at line 149 of file GOptimizer.cpp.

Referenced by GOptimizer(), and operator=().

virtual void GOptimizer::errors ( GOptimizerFunction fct,
GOptimizerPars pars 
)
pure virtual

Implemented in GOptimizerLM.

Referenced by GObservations::errors().

void GOptimizer::free_members ( void  )
protected

Delete class members.

Definition at line 159 of file GOptimizer.cpp.

Referenced by GOptimizerLM::clear(), operator=(), and ~GOptimizer().

void GOptimizer::init_members ( void  )
protected

Initialise class members.

Definition at line 137 of file GOptimizer.cpp.

Referenced by GOptimizerLM::clear(), GOptimizer(), and operator=().

virtual int GOptimizer::iter ( void  ) const
pure virtual

Implemented in GOptimizerLM.

GOptimizer & GOptimizer::operator= ( const GOptimizer opt)
virtual

Assignment operator.

Parameters
[in]optOptimizer.
Returns
Optimizer.

Definition at line 101 of file GOptimizer.cpp.

References copy_members(), free_members(), and init_members().

Referenced by GOptimizerLM::operator=().

virtual void GOptimizer::optimize ( GOptimizerFunction fct,
GOptimizerPars pars 
)
pure virtual

Implemented in GOptimizerLM.

Referenced by GObservations::optimize().

virtual std::string GOptimizer::print ( const GChatter chatter = NORMAL) const
pure virtual

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GBase.

Implemented in GOptimizerLM.

virtual int GOptimizer::status ( void  ) const
pure virtual

Implemented in GOptimizerLM.

virtual double GOptimizer::value ( void  ) const
pure virtual

Implemented in GOptimizerLM.


The documentation for this class was generated from the following files: