ROOT  6.06/09
Reference Guide
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ROOT::Math::GSLSimAnFunc Class Reference

GSLSimAnFunc class description.

Interface class for the objetive function to be used in simulated annealing If user wants to re-implement some of the methods (like the one defining the metric) which are used by the the simulated annealing algorithm must build a user derived class. NOTE: Derived classes must re-implement the assignment and copy constructor to call them of the parent class

Definition at line 50 of file GSLSimAnnealing.h.

Public Member Functions

 GSLSimAnFunc (const ROOT::Math::IMultiGenFunction &func, const double *x)
 construct from an interface of a multi-dimensional function More...
 
 GSLSimAnFunc (const ROOT::Math::IMultiGenFunction &func, const double *x, const double *scale)
 construct from an interface of a multi-dimensional function Use optionally a scale factor (for each coordinate) which can be used to scale the step sizes (this is used for example by the minimization algorithm) More...
 
virtual ~GSLSimAnFunc ()
 virtual distructor (no operations) More...
 
virtual GSLSimAnFuncFastCopy (const GSLSimAnFunc &f)
 fast copy method called by GSL simuated annealing internally copy only the things which have been changed must be re-implemented by derived classes if needed More...
 
virtual GSLSimAnFuncClone () const
 clone method. More...
 
virtual double Energy () const
 evaluate the energy ( objective function value) re-implement by derived classes if needed to be modified More...
 
virtual void Step (const GSLRandomEngine &r, double maxstep)
 change the x[i] value using a random value urndm generated between [0,1] up to a maximum value maxstep re-implement by derived classes if needed to be modified More...
 
virtual double Distance (const GSLSimAnFunc &func) const
 calculate the distance (metric) between this one and another configuration Presently a cartesian metric is used. More...
 
virtual void Print ()
 print the position in the standard output std::ostream GSL prints in addition n iteration, n function calls, temperature and energy re-implement by derived classes if necessary More...
 
void SetX (const double *x)
 change the x values (used by sim annealing to take a step) More...
 
template<class IT >
void SetX (IT begin, IT end)
 
unsigned int NDim () const
 
double X (unsigned int i) const
 
const std::vector< double > & X () const
 
double Scale (unsigned int i) const
 
void SetX (unsigned int i, double x)
 

Protected Member Functions

 GSLSimAnFunc ()
 derived classes might need to re-define completely the class More...
 

Private Attributes

std::vector< doublefX
 
std::vector< doublefScale
 
const ROOT::Math::IMultiGenFunctionfFunc
 

#include <Math/GSLSimAnnealing.h>

+ Inheritance diagram for ROOT::Math::GSLSimAnFunc:
+ Collaboration diagram for ROOT::Math::GSLSimAnFunc:

Constructor & Destructor Documentation

ROOT::Math::GSLSimAnFunc::GSLSimAnFunc ( const ROOT::Math::IMultiGenFunction func,
const double x 
)

construct from an interface of a multi-dimensional function

Definition at line 34 of file GSLSimAnnealing.cxx.

ROOT::Math::GSLSimAnFunc::GSLSimAnFunc ( const ROOT::Math::IMultiGenFunction func,
const double x,
const double scale 
)

construct from an interface of a multi-dimensional function Use optionally a scale factor (for each coordinate) which can be used to scale the step sizes (this is used for example by the minimization algorithm)

Definition at line 43 of file GSLSimAnnealing.cxx.

ROOT::Math::GSLSimAnFunc::GSLSimAnFunc ( )
inlineprotected

derived classes might need to re-define completely the class

Definition at line 70 of file GSLSimAnnealing.h.

Referenced by Clone().

virtual ROOT::Math::GSLSimAnFunc::~GSLSimAnFunc ( )
inlinevirtual

virtual distructor (no operations)

Definition at line 78 of file GSLSimAnnealing.h.

Member Function Documentation

virtual GSLSimAnFunc* ROOT::Math::GSLSimAnFunc::Clone ( ) const
inlinevirtual

clone method.

Needs to be re-implemented by the derived classes for deep copying

Definition at line 92 of file GSLSimAnnealing.h.

Referenced by ROOT::Math::GSLSimAn::CopyCtor().

double ROOT::Math::GSLSimAnFunc::Distance ( const GSLSimAnFunc func) const
virtual

calculate the distance (metric) between this one and another configuration Presently a cartesian metric is used.

re-implement by derived classes if needed to be modified

Definition at line 66 of file GSLSimAnnealing.cxx.

Referenced by ROOT::Math::GSLSimAn::Dist().

double ROOT::Math::GSLSimAnFunc::Energy ( ) const
virtual

evaluate the energy ( objective function value) re-implement by derived classes if needed to be modified

Definition at line 50 of file GSLSimAnnealing.cxx.

Referenced by ROOT::Math::GSLSimAn::E().

GSLSimAnFunc & ROOT::Math::GSLSimAnFunc::FastCopy ( const GSLSimAnFunc f)
virtual

fast copy method called by GSL simuated annealing internally copy only the things which have been changed must be re-implemented by derived classes if needed

Definition at line 96 of file GSLSimAnnealing.cxx.

Referenced by ROOT::Math::GSLSimAn::Copy().

unsigned int ROOT::Math::GSLSimAnFunc::NDim ( ) const
inline

Definition at line 135 of file GSLSimAnnealing.h.

Referenced by Print(), and Step().

void ROOT::Math::GSLSimAnFunc::Print ( )
virtual

print the position in the standard output std::ostream GSL prints in addition n iteration, n function calls, temperature and energy re-implement by derived classes if necessary

Definition at line 83 of file GSLSimAnnealing.cxx.

Referenced by ROOT::Math::GSLSimAn::Print().

double ROOT::Math::GSLSimAnFunc::Scale ( unsigned int  i) const
inline

Definition at line 141 of file GSLSimAnnealing.h.

void ROOT::Math::GSLSimAnFunc::SetX ( const double x)
inline

change the x values (used by sim annealing to take a step)

Definition at line 126 of file GSLSimAnnealing.h.

template<class IT >
void ROOT::Math::GSLSimAnFunc::SetX ( IT  begin,
IT  end 
)
inline

Definition at line 131 of file GSLSimAnnealing.h.

void ROOT::Math::GSLSimAnFunc::SetX ( unsigned int  i,
double  x 
)
inline

Definition at line 143 of file GSLSimAnnealing.h.

void ROOT::Math::GSLSimAnFunc::Step ( const GSLRandomEngine r,
double  maxstep 
)
virtual

change the x[i] value using a random value urndm generated between [0,1] up to a maximum value maxstep re-implement by derived classes if needed to be modified

Definition at line 55 of file GSLSimAnnealing.cxx.

Referenced by ROOT::Math::GSLSimAn::Step().

double ROOT::Math::GSLSimAnFunc::X ( unsigned int  i) const
inline

Definition at line 137 of file GSLSimAnnealing.h.

Referenced by Distance(), and ROOT::Math::GSLSimAnnealing::Solve().

const std::vector<double>& ROOT::Math::GSLSimAnFunc::X ( ) const
inline

Definition at line 139 of file GSLSimAnnealing.h.

Member Data Documentation

const ROOT::Math::IMultiGenFunction* ROOT::Math::GSLSimAnFunc::fFunc
private

Definition at line 151 of file GSLSimAnnealing.h.

Referenced by Energy().

std::vector<double> ROOT::Math::GSLSimAnFunc::fScale
private

Definition at line 150 of file GSLSimAnnealing.h.

Referenced by GSLSimAnFunc(), Scale(), and Step().

std::vector<double> ROOT::Math::GSLSimAnFunc::fX
private

Definition at line 149 of file GSLSimAnnealing.h.

Referenced by Distance(), Energy(), FastCopy(), NDim(), Print(), SetX(), Step(), and X().


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