BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Math::GSLSimAnMinimizer Class Reference

Description

GSLSimAnMinimizer class for minimization using simulated annealing using the algorithm from GSL. It implements the ROOT::Minimizer interface and a plug-in (name "GSLSimAn") exists to instantiate this class via the plug-in manager

Definition at line 63 of file GSLSimAnMinimizer.h.

Inheritance diagram for ROOT::Math::GSLSimAnMinimizer:
[legend]
Collaboration diagram for ROOT::Math::GSLSimAnMinimizer:
[legend]

Public Member Functions

 GSLSimAnMinimizer (int type=0)
 
virtual ~GSLSimAnMinimizer ()
 
virtual void Clear ()
 reset for consecutive minimizations - implement if needed More...
 
virtual bool Contour (unsigned int ivar, unsigned int jvar, unsigned int &npoints, double *xi, double *xj)
 
virtual double Correlation (unsigned int i, unsigned int j) const
 
virtual double CovMatrix (unsigned int ivar, unsigned int jvar) const
 
virtual int CovMatrixStatus () const
 return status of covariance matrix using Minuit convention {0 not calculated 1 approximated 2 made pos def , 3 accurate} Minimizer who implements covariance matrix calculation will re-implement the method More...
 
virtual double Edm () const
 return expected distance reached from the minimum (re-implement if minimizer provides it More...
 
double ErrorDef () const
 return the statistical scale used for calculate the error is typically 1 for Chi2 and 0.5 for likelihood minimization More...
 
virtual const double * Errors () const
 return errors at the minimum More...
 
virtual bool FixVariable (unsigned int ivar)
 fix an existing variable More...
 
virtual bool GetCovMatrix (double *covMat) const
 
virtual bool GetHessianMatrix (double *hMat) const
 
virtual bool GetMinosError (unsigned int ivar, double &errLow, double &errUp, int option=0)
 
ROOT::Math::GSLSimAnnealinggetSolver ()
 
virtual bool GetVariableSettings (unsigned int ivar, ROOT::Fit::ParameterSettings &varObj) const
 get variable settings in a variable object (like ROOT::Fit::ParamsSettings) More...
 
virtual double GlobalCC (unsigned int ivar) const
 
const ROOT::Math::IMultiGradFunctionGradObjFunction () const
 return pointer to used gradient object function (NULL if gradient is not supported) More...
 
virtual bool Hesse ()
 
virtual bool IsFixedVariable (unsigned int ivar) const
 query if an existing variable is fixed (i.e. considered constant in the minimization) note that by default all variables are not fixed More...
 
bool IsValidError () const
 return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit) More...
 
unsigned int MaxFunctionCalls () const
 max number of function calls More...
 
unsigned int MaxIterations () const
 max iterations More...
 
virtual const double * MinGradient () const
 return pointer to gradient values at the minimum More...
 
virtual bool Minimize ()
 method to perform the minimization More...
 
virtual double MinValue () const
 return minimum function value More...
 
unsigned int NCalls () const
 number of function calls to reach the minimum More...
 
virtual unsigned int NDim () const
 number of dimensions More...
 
virtual unsigned int NFree () const
 number of free variables (real dimension of the problem) More...
 
virtual unsigned int NIterations () const
 number of iterations to reach the minimum More...
 
virtual unsigned int NPar () const
 total number of parameter defined More...
 
const ROOT::Math::IMultiGenFunctionObjFunction () const
 return pointer to used objective function More...
 
virtual MinimizerOptions Options () const
 retrieve the minimizer options (implement derived class if needed) More...
 
double Precision () const
 precision of minimizer in the evaluation of the objective function ( a value <=0 corresponds to the let the minimizer choose its default one) More...
 
int PrintLevel () const
 set print level More...
 
void PrintResult () const
 print result of minimization More...
 
virtual void PrintResults ()
 return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const = 0; More...
 
virtual bool ProvidesError () const
 minimizer provides error and error matrix More...
 
virtual bool ReleaseVariable (unsigned int ivar)
 release an existing variable More...
 
virtual bool Scan (unsigned int ivar, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0)
 
void SetDefaultOptions ()
 reset the defaut options (defined in MinimizerOptions) More...
 
void SetErrorDef (double up)
 set scale for calculating the errors More...
 
virtual bool SetFixedVariable (unsigned int, const std::string &, double)
 set fixed variable (override if minimizer supports them ) More...
 
virtual void SetFunction (const ROOT::Math::IMultiGenFunction &func)
 set the function to minimize More...
 
virtual void SetFunction (const ROOT::Math::IMultiGradFunction &func)
 set gradient the function to minimize More...
 
virtual bool SetLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double, double)
 set upper/lower limited variable (override if minimizer supports them ) More...
 
virtual bool SetLowerLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double lower)
 set lower limit variable (override if minimizer supports them ) More...
 
void SetMaxFunctionCalls (unsigned int maxfcn)
 set maximum of function calls More...
 
void SetMaxIterations (unsigned int maxiter)
 set maximum iterations (one iteration can have many function calls) More...
 
void SetOptions (const MinimizerOptions &opt)
 set all options in one go More...
 
void SetPrecision (double prec)
 set in the minimizer the objective function evaluation precision ( a value <=0 means the minimizer will choose its optimal value automatically, i.e. default case) More...
 
void SetPrintLevel (int level)
 set print level More...
 
void SetStrategy (int strategyLevel)
 set the strategy More...
 
void SetTolerance (double tol)
 set the tolerance More...
 
virtual bool SetUpperLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double upper)
 set upper limit variable (override if minimizer supports them ) More...
 
void SetValidError (bool on)
 flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit) More...
 
virtual bool SetVariable (unsigned int ivar, const std::string &name, double val, double step)
 set free variable More...
 
virtual bool SetVariableInitialRange (unsigned int, double, double)
 set the initial range of an existing variable More...
 
virtual bool SetVariableLimits (unsigned int ivar, double lower, double upper)
 set the limits of an already existing variable More...
 
virtual bool SetVariableLowerLimit (unsigned int ivar, double lower)
 set the lower-limit of an already existing variable More...
 
template<class VariableIterator >
int SetVariables (const VariableIterator &begin, const VariableIterator &end)
 add variables . Return number of variables successfully added More...
 
virtual bool SetVariableStepSize (unsigned int ivar, double step)
 set the step size of an already existing variable More...
 
virtual bool SetVariableUpperLimit (unsigned int ivar, double upper)
 set the upper-limit of an already existing variable More...
 
virtual bool SetVariableValue (unsigned int ivar, double val)
 set the value of an existing variable More...
 
virtual bool SetVariableValues (const double *x)
 set the values of all existing variables (array must be dimensioned to the size of existing parameters) More...
 
int Status () const
 status code of minimizer More...
 
virtual const double * StepSizes () const
 accessor methods More...
 
int Strategy () const
 strategy More...
 
double Tolerance () const
 absolute tolerance More...
 
const ROOT::Math::MinimTransformFunctionTransformFunction () const
 return transformation function (NULL if not having a transformation) More...
 
virtual int VariableIndex (const std::string &name) const
 get index of variable given a variable given a name return -1 if variable is not found More...
 
virtual std::string VariableName (unsigned int ivar) const
 get name of variables (override if minimizer support storing of variable names) More...
 
virtual const double * X () const
 return pointer to X values at the minimum More...
 

Protected Member Functions

bool CheckDimension () const
 
bool CheckObjFunction () const
 
MinimTransformFunctionCreateTransformation (std::vector< double > &startValues, const ROOT::Math::IMultiGradFunction *func=0)
 
void SetFinalValues (const double *x)
 
void SetMinValue (double val)
 

Protected Attributes

MinimizerOptions fOptions
 
int fStatus
 
bool fValidError
 

Private Member Functions

 GSLSimAnMinimizer (const GSLSimAnMinimizer &)
 
GSLSimAnMinimizeroperator= (const GSLSimAnMinimizer &rhs)
 

Private Attributes

std::map< unsigned int, std::pair< double, double > > fBounds
 
unsigned int fDim
 
double fMinVal
 
std::vector< std::string > fNames
 
const ROOT::Math::IMultiGenFunctionfObjFunc
 
ROOT::Math::GSLSimAnnealing fSolver
 
std::vector< double > fSteps
 
std::vector< double > fValues
 
std::vector< ROOT::Math::EMinimVariableTypefVarTypes
 

Constructor & Destructor Documentation

◆ GSLSimAnMinimizer() [1/2]

ROOT::Math::GSLSimAnMinimizer::GSLSimAnMinimizer ( int  type = 0)

Default constructor

◆ ~GSLSimAnMinimizer()

virtual ROOT::Math::GSLSimAnMinimizer::~GSLSimAnMinimizer ( )
virtual

Destructor (no operations)

◆ GSLSimAnMinimizer() [2/2]

ROOT::Math::GSLSimAnMinimizer::GSLSimAnMinimizer ( const GSLSimAnMinimizer )
inlineprivate

Copy constructor

Definition at line 83 of file GSLSimAnMinimizer.h.

Member Function Documentation

◆ CheckDimension()

bool ROOT::Math::BasicMinimizer::CheckDimension ( ) const
protectedinherited

◆ CheckObjFunction()

bool ROOT::Math::BasicMinimizer::CheckObjFunction ( ) const
protectedinherited

◆ Clear()

virtual void ROOT::Math::Minimizer::Clear ( )
inlinevirtualinherited

reset for consecutive minimizations - implement if needed

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 117 of file Minimizer.h.

117 {}

◆ Contour()

virtual bool ROOT::Math::Minimizer::Contour ( unsigned int  ivar,
unsigned int  jvar,
unsigned int &  npoints,
double *  xi,
double *  xj 
)
inlinevirtualinherited

find the contour points (xi, xj) of the function for parameter ivar and jvar around the minimum The contour will be find for value of the function = Min + ErrorUp();

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 379 of file Minimizer.h.

380  {
381  MATH_ERROR_MSG("Minimizer::Contour","Contour not implemented");
382  MATH_UNUSED(ivar); MATH_UNUSED(jvar); MATH_UNUSED(npoints);
383  MATH_UNUSED(xi); MATH_UNUSED(xj);
384  return false;
385  }
#define MATH_ERROR_MSG(loc, str)
Definition: Error.h:50
#define MATH_UNUSED(var)
Definition: Util.h:26

References MATH_ERROR_MSG, and MATH_UNUSED.

◆ Correlation()

virtual double ROOT::Math::Minimizer::Correlation ( unsigned int  i,
unsigned int  j 
) const
inlinevirtualinherited

return correlation coefficient between variable i and j. If the variable is fixed or const the return value is zero

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 326 of file Minimizer.h.

326  {
327  double tmp = CovMatrix(i,i) * CovMatrix(j,j);
328  return ( tmp < 0) ? 0 : CovMatrix(i,j) / std::sqrt( tmp );
329  }
virtual double CovMatrix(unsigned int ivar, unsigned int jvar) const
Definition: Minimizer.h:284

References ROOT::Math::Minimizer::CovMatrix().

Referenced by MinimizerAdapter::propagateResults().

Here is the call graph for this function:

◆ CovMatrix()

virtual double ROOT::Math::Minimizer::CovMatrix ( unsigned int  ivar,
unsigned int  jvar 
) const
inlinevirtualinherited

return covariance matrices element for variables ivar,jvar if the variable is fixed the return value is zero The ordering of the variables is the same as in the parameter and errors vectors

Reimplemented in ROOT::Math::GSLNLSMinimizer, ROOT::Math::GSLMinimizer, ROOT::Minuit2::Minuit2Minimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 284 of file Minimizer.h.

284  {
285  MATH_UNUSED(ivar); MATH_UNUSED(jvar);
286  return 0;
287  }

References MATH_UNUSED.

Referenced by ROOT::Math::Minimizer::Correlation().

◆ CovMatrixStatus()

virtual int ROOT::Math::Minimizer::CovMatrixStatus ( ) const
inlinevirtualinherited

return status of covariance matrix using Minuit convention {0 not calculated 1 approximated 2 made pos def , 3 accurate} Minimizer who implements covariance matrix calculation will re-implement the method

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, and ROOT::Math::GSLNLSMinimizer.

Definition at line 318 of file Minimizer.h.

318  {
319  return 0;
320  }

Referenced by GSLLevenbergMarquardtMinimizer::statusMap(), and Minuit2Minimizer::statusMap().

◆ CreateTransformation()

MinimTransformFunction* ROOT::Math::BasicMinimizer::CreateTransformation ( std::vector< double > &  startValues,
const ROOT::Math::IMultiGradFunction func = 0 
)
protectedinherited

◆ Edm()

virtual double ROOT::Math::Minimizer::Edm ( ) const
inlinevirtualinherited

return expected distance reached from the minimum (re-implement if minimizer provides it

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, ROOT::Math::GSLNLSMinimizer, ROOT::Math::GSLMinimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 254 of file Minimizer.h.

254 { return -1; }

◆ ErrorDef()

double ROOT::Math::Minimizer::ErrorDef ( ) const
inlineinherited

return the statistical scale used for calculate the error is typically 1 for Chi2 and 0.5 for likelihood minimization

Definition at line 434 of file Minimizer.h.

434 { return fOptions.ErrorDef(); }
double ErrorDef() const
error definition
MinimizerOptions fOptions
Definition: Minimizer.h:489

References ROOT::Math::MinimizerOptions::ErrorDef(), and ROOT::Math::Minimizer::fOptions.

Here is the call graph for this function:

◆ Errors()

virtual const double* ROOT::Math::Minimizer::Errors ( ) const
inlinevirtualinherited

return errors at the minimum

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, ROOT::Math::GSLNLSMinimizer, ROOT::Math::GSLMinimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 278 of file Minimizer.h.

278 { return NULL; }

◆ FixVariable()

virtual bool ROOT::Math::BasicMinimizer::FixVariable ( unsigned int  ivar)
virtualinherited

fix an existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ GetCovMatrix()

virtual bool ROOT::Math::Minimizer::GetCovMatrix ( double *  covMat) const
inlinevirtualinherited

Fill the passed array with the covariance matrix elements if the variable is fixed or const the value is zero. The array will be filled as cov[i *ndim + j] The ordering of the variables is the same as in errors and parameter value. This is different from the direct interface of Minuit2 or TMinuit where the values were obtained only to variable parameters

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 297 of file Minimizer.h.

297  {
298  MATH_UNUSED(covMat);
299  return false;
300  }

References MATH_UNUSED.

◆ GetHessianMatrix()

virtual bool ROOT::Math::Minimizer::GetHessianMatrix ( double *  hMat) const
inlinevirtualinherited

Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second derivatives and is the inverse of the covariance matrix If the variable is fixed or const the values for that variables are zero. The array will be filled as h[i *ndim + j]

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 309 of file Minimizer.h.

309  {
310  MATH_UNUSED(hMat);
311  return false;
312  }

References MATH_UNUSED.

◆ GetMinosError()

virtual bool ROOT::Math::Minimizer::GetMinosError ( unsigned int  ivar,
double &  errLow,
double &  errUp,
int  option = 0 
)
inlinevirtualinherited

minos error for variable i, return false if Minos failed or not supported and the lower and upper errors are returned in errLow and errUp An extra flag specifies if only the lower (option=-1) or the upper (option=+1) error calculation is run (This feature is not yet implemented)

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 349 of file Minimizer.h.

349  {
350  MATH_ERROR_MSG("Minimizer::GetMinosError","Minos Error not implemented");
351  MATH_UNUSED(ivar); MATH_UNUSED(errLow); MATH_UNUSED(errUp); MATH_UNUSED(option);
352  return false;
353  }

References MATH_ERROR_MSG, and MATH_UNUSED.

◆ getSolver()

ROOT::Math::GSLSimAnnealing& ROOT::Math::GSLSimAnMinimizer::getSolver ( )
inline

Definition at line 102 of file GSLSimAnMinimizer.h.

102 { return fSolver; }
ROOT::Math::GSLSimAnnealing fSolver

References fSolver.

◆ GetVariableSettings()

virtual bool ROOT::Math::BasicMinimizer::GetVariableSettings ( unsigned int  ivar,
ROOT::Fit::ParameterSettings varObj 
) const
virtualinherited

get variable settings in a variable object (like ROOT::Fit::ParamsSettings)

Reimplemented from ROOT::Math::Minimizer.

◆ GlobalCC()

virtual double ROOT::Math::Minimizer::GlobalCC ( unsigned int  ivar) const
inlinevirtualinherited

return global correlation coefficient for variable i This is a number between zero and one which gives the correlation between the i-th parameter and that linear combination of all other parameters which is most strongly correlated with i. Minimizer must overload method if implemented

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 338 of file Minimizer.h.

338  {
339  MATH_UNUSED(ivar);
340  return -1;
341  }

References MATH_UNUSED.

◆ GradObjFunction()

const ROOT::Math::IMultiGradFunction* ROOT::Math::BasicMinimizer::GradObjFunction ( ) const
inherited

return pointer to used gradient object function (NULL if gradient is not supported)

◆ Hesse()

virtual bool ROOT::Math::Minimizer::Hesse ( )
inlinevirtualinherited

perform a full calculation of the Hessian matrix for error calculation

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 358 of file Minimizer.h.

358  {
359  MATH_ERROR_MSG("Minimizer::Hesse","Hesse not implemented");
360  return false;
361  }

References MATH_ERROR_MSG.

◆ IsFixedVariable()

virtual bool ROOT::Math::BasicMinimizer::IsFixedVariable ( unsigned int  ivar) const
virtualinherited

query if an existing variable is fixed (i.e. considered constant in the minimization) note that by default all variables are not fixed

Reimplemented from ROOT::Math::Minimizer.

◆ IsValidError()

bool ROOT::Math::Minimizer::IsValidError ( ) const
inlineinherited

return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit)

Definition at line 437 of file Minimizer.h.

437 { return fValidError; }

References ROOT::Math::Minimizer::fValidError.

◆ MaxFunctionCalls()

unsigned int ROOT::Math::Minimizer::MaxFunctionCalls ( ) const
inlineinherited

max number of function calls

Definition at line 414 of file Minimizer.h.

414 { return fOptions.MaxFunctionCalls(); }
unsigned int MaxFunctionCalls() const
max number of function calls

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::MaxFunctionCalls().

Here is the call graph for this function:

◆ MaxIterations()

unsigned int ROOT::Math::Minimizer::MaxIterations ( ) const
inlineinherited

max iterations

Definition at line 417 of file Minimizer.h.

417 { return fOptions.MaxIterations(); }
unsigned int MaxIterations() const
max iterations

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::MaxIterations().

Here is the call graph for this function:

◆ MinGradient()

virtual const double* ROOT::Math::Minimizer::MinGradient ( ) const
inlinevirtualinherited

return pointer to gradient values at the minimum

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, ROOT::Math::GSLNLSMinimizer, ROOT::Math::GSLMinimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 257 of file Minimizer.h.

257 { return NULL; }

◆ Minimize()

virtual bool ROOT::Math::GSLSimAnMinimizer::Minimize ( )
virtual

method to perform the minimization

Reimplemented from ROOT::Math::BasicMinimizer.

◆ MinValue()

virtual double ROOT::Math::BasicMinimizer::MinValue ( ) const
inlinevirtualinherited

return minimum function value

Implements ROOT::Math::Minimizer.

Definition at line 136 of file BasicMinimizer.h.

136 { return fMinVal; }

References ROOT::Math::BasicMinimizer::fMinVal.

◆ NCalls()

unsigned int ROOT::Math::GSLSimAnMinimizer::NCalls ( ) const
virtual

number of function calls to reach the minimum

Reimplemented from ROOT::Math::Minimizer.

◆ NDim()

virtual unsigned int ROOT::Math::BasicMinimizer::NDim ( ) const
inlinevirtualinherited

number of dimensions

Implements ROOT::Math::Minimizer.

Definition at line 142 of file BasicMinimizer.h.

142 { return fDim; }

References ROOT::Math::BasicMinimizer::fDim.

◆ NFree()

virtual unsigned int ROOT::Math::BasicMinimizer::NFree ( ) const
virtualinherited

number of free variables (real dimension of the problem)

Reimplemented from ROOT::Math::Minimizer.

◆ NIterations()

virtual unsigned int ROOT::Math::Minimizer::NIterations ( ) const
inlinevirtualinherited

number of iterations to reach the minimum

Definition at line 263 of file Minimizer.h.

263 { return NCalls(); }
virtual unsigned int NCalls() const
number of function calls to reach the minimum
Definition: Minimizer.h:260

References ROOT::Math::Minimizer::NCalls().

Here is the call graph for this function:

◆ NPar()

virtual unsigned int ROOT::Math::BasicMinimizer::NPar ( ) const
inlinevirtualinherited

total number of parameter defined

Definition at line 148 of file BasicMinimizer.h.

148 { return fValues.size(); }
std::vector< double > fValues

References ROOT::Math::BasicMinimizer::fValues.

◆ ObjFunction()

const ROOT::Math::IMultiGenFunction* ROOT::Math::BasicMinimizer::ObjFunction ( ) const
inlineinherited

return pointer to used objective function

Definition at line 151 of file BasicMinimizer.h.

151 { return fObjFunc; }
const ROOT::Math::IMultiGenFunction * fObjFunc

References ROOT::Math::BasicMinimizer::fObjFunc.

◆ operator=()

GSLSimAnMinimizer& ROOT::Math::GSLSimAnMinimizer::operator= ( const GSLSimAnMinimizer rhs)
inlineprivate

Assignment operator

Definition at line 88 of file GSLSimAnMinimizer.h.

88  {
89  if (this == &rhs) return *this; // time saving self-test
90  return *this;
91  }

◆ Options()

virtual MinimizerOptions ROOT::Math::Minimizer::Options ( ) const
inlinevirtualinherited

retrieve the minimizer options (implement derived class if needed)

Reimplemented in ROOT::Math::GeneticMinimizer.

Definition at line 440 of file Minimizer.h.

440  {
441  return fOptions;
442  }

References ROOT::Math::Minimizer::fOptions.

◆ Precision()

double ROOT::Math::Minimizer::Precision ( ) const
inlineinherited

precision of minimizer in the evaluation of the objective function ( a value <=0 corresponds to the let the minimizer choose its default one)

Definition at line 424 of file Minimizer.h.

424 { return fOptions.Precision(); }
double Precision() const
precision in the objective funciton calculation (value <=0 means left to default)

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::Precision().

Here is the call graph for this function:

◆ PrintLevel()

int ROOT::Math::Minimizer::PrintLevel ( ) const
inlineinherited

set print level

minimizer configuration parameters

Definition at line 411 of file Minimizer.h.

411 { return fOptions.PrintLevel(); }
int PrintLevel() const
set print level

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::PrintLevel().

Here is the call graph for this function:

◆ PrintResult()

void ROOT::Math::BasicMinimizer::PrintResult ( ) const
inherited

print result of minimization

◆ PrintResults()

virtual void ROOT::Math::Minimizer::PrintResults ( )
inlinevirtualinherited

return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const = 0;

print the result according to set level (implemented for TMinuit for mantaining Minuit-style printing)

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 391 of file Minimizer.h.

391 {}

◆ ProvidesError()

virtual bool ROOT::Math::Minimizer::ProvidesError ( ) const
inlinevirtualinherited

minimizer provides error and error matrix

Reimplemented in ROOT::Minuit2::Minuit2Minimizer, ROOT::Math::GSLNLSMinimizer, ROOT::Math::GSLMinimizer, and ROOT::Math::GeneticMinimizer.

Definition at line 275 of file Minimizer.h.

275 { return false; }

Referenced by MinimizerAdapter::providesError().

◆ ReleaseVariable()

virtual bool ROOT::Math::BasicMinimizer::ReleaseVariable ( unsigned int  ivar)
virtualinherited

release an existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ Scan()

virtual bool ROOT::Math::Minimizer::Scan ( unsigned int  ivar,
unsigned int &  nstep,
double *  x,
double *  y,
double  xmin = 0,
double  xmax = 0 
)
inlinevirtualinherited

scan function minimum for variable i. Variable and function must be set before using Scan Return false if an error or if minimizer does not support this functionality

Reimplemented in ROOT::Minuit2::Minuit2Minimizer.

Definition at line 367 of file Minimizer.h.

368  {
369  MATH_ERROR_MSG("Minimizer::Scan","Scan not implemented");
370  MATH_UNUSED(ivar); MATH_UNUSED(nstep); MATH_UNUSED(x); MATH_UNUSED(y);
371  MATH_UNUSED(xmin); MATH_UNUSED(xmax);
372  return false;
373  }

References MATH_ERROR_MSG, and MATH_UNUSED.

◆ SetDefaultOptions()

void ROOT::Math::Minimizer::SetDefaultOptions ( )
inlineinherited

reset the defaut options (defined in MinimizerOptions)

Definition at line 475 of file Minimizer.h.

475  {
477  }

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::ResetToDefaultOptions().

Here is the call graph for this function:

◆ SetErrorDef()

void ROOT::Math::Minimizer::SetErrorDef ( double  up)
inlineinherited

set scale for calculating the errors

Definition at line 464 of file Minimizer.h.

464 { fOptions.SetErrorDef(up); }
void SetErrorDef(double err)
set error def

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetErrorDef().

Here is the call graph for this function:

◆ SetFinalValues()

void ROOT::Math::BasicMinimizer::SetFinalValues ( const double *  x)
protectedinherited

◆ SetFixedVariable()

virtual bool ROOT::Math::BasicMinimizer::SetFixedVariable ( unsigned int  ,
const std::string &  ,
double   
)
virtualinherited

set fixed variable (override if minimizer supports them )

Reimplemented from ROOT::Math::Minimizer.

◆ SetFunction() [1/2]

virtual void ROOT::Math::BasicMinimizer::SetFunction ( const ROOT::Math::IMultiGenFunction func)
virtualinherited

set the function to minimize

Implements ROOT::Math::Minimizer.

Reimplemented in ROOT::Math::GSLNLSMinimizer, and ROOT::Math::GSLMinimizer.

Referenced by ROOT::Math::GSLMinimizer::SetFunction().

◆ SetFunction() [2/2]

virtual void ROOT::Math::BasicMinimizer::SetFunction ( const ROOT::Math::IMultiGradFunction func)
virtualinherited

set gradient the function to minimize

Reimplemented from ROOT::Math::Minimizer.

Reimplemented in ROOT::Math::GSLNLSMinimizer, and ROOT::Math::GSLMinimizer.

◆ SetLimitedVariable()

virtual bool ROOT::Math::BasicMinimizer::SetLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  ,
double   
)
virtualinherited

set upper/lower limited variable (override if minimizer supports them )

Reimplemented from ROOT::Math::Minimizer.

◆ SetLowerLimitedVariable()

virtual bool ROOT::Math::BasicMinimizer::SetLowerLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  lower 
)
virtualinherited

set lower limit variable (override if minimizer supports them )

Reimplemented from ROOT::Math::Minimizer.

◆ SetMaxFunctionCalls()

void ROOT::Math::Minimizer::SetMaxFunctionCalls ( unsigned int  maxfcn)
inlineinherited

set maximum of function calls

Definition at line 448 of file Minimizer.h.

448 { if (maxfcn > 0) fOptions.SetMaxFunctionCalls(maxfcn); }
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetMaxFunctionCalls().

Here is the call graph for this function:

◆ SetMaxIterations()

void ROOT::Math::Minimizer::SetMaxIterations ( unsigned int  maxiter)
inlineinherited

set maximum iterations (one iteration can have many function calls)

Definition at line 451 of file Minimizer.h.

451 { if (maxiter > 0) fOptions.SetMaxIterations(maxiter); }
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetMaxIterations().

Here is the call graph for this function:

◆ SetMinValue()

void ROOT::Math::BasicMinimizer::SetMinValue ( double  val)
inlineprotectedinherited

Definition at line 175 of file BasicMinimizer.h.

175 { fMinVal = val; }

References ROOT::Math::BasicMinimizer::fMinVal.

◆ SetOptions()

void ROOT::Math::Minimizer::SetOptions ( const MinimizerOptions opt)
inlineinherited

set all options in one go

Definition at line 470 of file Minimizer.h.

470  {
471  fOptions = opt;
472  }

References ROOT::Math::Minimizer::fOptions.

◆ SetPrecision()

void ROOT::Math::Minimizer::SetPrecision ( double  prec)
inlineinherited

set in the minimizer the objective function evaluation precision ( a value <=0 means the minimizer will choose its optimal value automatically, i.e. default case)

Definition at line 458 of file Minimizer.h.

458 { fOptions.SetPrecision(prec); }
void SetPrecision(double prec)
set the precision

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetPrecision().

Here is the call graph for this function:

◆ SetPrintLevel()

void ROOT::Math::Minimizer::SetPrintLevel ( int  level)
inlineinherited

set print level

Definition at line 445 of file Minimizer.h.

445 { fOptions.SetPrintLevel(level); }
void SetPrintLevel(int level)
set print level

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetPrintLevel().

Here is the call graph for this function:

◆ SetStrategy()

void ROOT::Math::Minimizer::SetStrategy ( int  strategyLevel)
inlineinherited

set the strategy

Definition at line 461 of file Minimizer.h.

461 { fOptions.SetStrategy(strategyLevel); }
void SetStrategy(int stra)
set the strategy

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetStrategy().

Here is the call graph for this function:

◆ SetTolerance()

void ROOT::Math::Minimizer::SetTolerance ( double  tol)
inlineinherited

set the tolerance

Definition at line 454 of file Minimizer.h.

454 { fOptions.SetTolerance(tol); }
void SetTolerance(double tol)
set the tolerance

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::SetTolerance().

Here is the call graph for this function:

◆ SetUpperLimitedVariable()

virtual bool ROOT::Math::BasicMinimizer::SetUpperLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  upper 
)
virtualinherited

set upper limit variable (override if minimizer supports them )

Reimplemented from ROOT::Math::Minimizer.

◆ SetValidError()

void ROOT::Math::Minimizer::SetValidError ( bool  on)
inlineinherited

flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit)

Definition at line 467 of file Minimizer.h.

467 { fValidError = on; }

References ROOT::Math::Minimizer::fValidError.

◆ SetVariable()

virtual bool ROOT::Math::BasicMinimizer::SetVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step 
)
virtualinherited

set free variable

Implements ROOT::Math::Minimizer.

◆ SetVariableInitialRange()

virtual bool ROOT::Math::Minimizer::SetVariableInitialRange ( unsigned int  ,
double  ,
double   
)
inlinevirtualinherited

set the initial range of an existing variable

Definition at line 240 of file Minimizer.h.

240  {
241  return false;
242  }

◆ SetVariableLimits()

virtual bool ROOT::Math::BasicMinimizer::SetVariableLimits ( unsigned int  ivar,
double  lower,
double  upper 
)
virtualinherited

set the limits of an already existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ SetVariableLowerLimit()

virtual bool ROOT::Math::BasicMinimizer::SetVariableLowerLimit ( unsigned int  ivar,
double  lower 
)
virtualinherited

set the lower-limit of an already existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ SetVariables()

template<class VariableIterator >
int ROOT::Math::Minimizer::SetVariables ( const VariableIterator &  begin,
const VariableIterator &  end 
)
inlineinherited

add variables . Return number of variables successfully added

Definition at line 131 of file Minimizer.h.

131  {
132  unsigned int ivar = 0;
133  for ( VariableIterator vitr = begin; vitr != end; ++vitr) {
134  bool iret = false;
135  if (vitr->IsFixed() )
136  iret = SetFixedVariable(ivar, vitr->Name(), vitr->Value() );
137  else if (vitr->IsDoubleBound() )
138  iret = SetLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit(), vitr->UpperLimit() );
139  else if (vitr->HasLowerLimit() )
140  iret = SetLowerLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit() );
141  else if (vitr->HasUpperLimit() )
142  iret = SetUpperLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->UpperLimit() );
143  else
144  iret = SetVariable( ivar, vitr->Name(), vitr->Value(), vitr->StepSize() );
145 
146  if (iret) ivar++;
147 
148  // an error message should be eventually be reported in the virtual single SetVariable methods
149  }
150  return ivar;
151  }
virtual bool SetLowerLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower)
set a new lower limit variable (override if minimizer supports them )
Definition: Minimizer.h:155
virtual bool SetUpperLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double upper)
set a new upper limit variable (override if minimizer supports them )
Definition: Minimizer.h:159
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)=0
set a new free variable
virtual bool SetFixedVariable(unsigned int ivar, const std::string &name, double val)
set a new fixed variable (override if minimizer supports them )
Definition: Minimizer.h:170
virtual bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower, double upper)
set a new upper/lower limited variable (override if minimizer supports them ) otherwise as default se...
Definition: Minimizer.h:163

References ROOT::Math::Minimizer::SetFixedVariable(), ROOT::Math::Minimizer::SetLimitedVariable(), ROOT::Math::Minimizer::SetLowerLimitedVariable(), ROOT::Math::Minimizer::SetUpperLimitedVariable(), and ROOT::Math::Minimizer::SetVariable().

Here is the call graph for this function:

◆ SetVariableStepSize()

virtual bool ROOT::Math::BasicMinimizer::SetVariableStepSize ( unsigned int  ivar,
double  step 
)
virtualinherited

set the step size of an already existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ SetVariableUpperLimit()

virtual bool ROOT::Math::BasicMinimizer::SetVariableUpperLimit ( unsigned int  ivar,
double  upper 
)
virtualinherited

set the upper-limit of an already existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ SetVariableValue()

virtual bool ROOT::Math::BasicMinimizer::SetVariableValue ( unsigned int  ivar,
double  val 
)
virtualinherited

set the value of an existing variable

Reimplemented from ROOT::Math::Minimizer.

◆ SetVariableValues()

virtual bool ROOT::Math::BasicMinimizer::SetVariableValues ( const double *  x)
virtualinherited

set the values of all existing variables (array must be dimensioned to the size of existing parameters)

Reimplemented from ROOT::Math::Minimizer.

◆ Status()

int ROOT::Math::Minimizer::Status ( ) const
inlineinherited

status code of minimizer

Definition at line 430 of file Minimizer.h.

430 { return fStatus; }

References ROOT::Math::Minimizer::fStatus.

Referenced by GeneticMinimizer::statusToString(), and Minuit2Minimizer::statusToString().

◆ StepSizes()

virtual const double* ROOT::Math::BasicMinimizer::StepSizes ( ) const
inlinevirtualinherited

accessor methods

Definition at line 163 of file BasicMinimizer.h.

163 { return &fSteps.front(); }
std::vector< double > fSteps

References ROOT::Math::BasicMinimizer::fSteps.

◆ Strategy()

int ROOT::Math::Minimizer::Strategy ( ) const
inlineinherited

strategy

Definition at line 427 of file Minimizer.h.

427 { return fOptions.Strategy(); }
int Strategy() const
strategy

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::Strategy().

Here is the call graph for this function:

◆ Tolerance()

double ROOT::Math::Minimizer::Tolerance ( ) const
inlineinherited

absolute tolerance

Definition at line 420 of file Minimizer.h.

420 { return fOptions.Tolerance(); }
double Tolerance() const
absolute tolerance

References ROOT::Math::Minimizer::fOptions, and ROOT::Math::MinimizerOptions::Tolerance().

Here is the call graph for this function:

◆ TransformFunction()

const ROOT::Math::MinimTransformFunction* ROOT::Math::BasicMinimizer::TransformFunction ( ) const
inherited

return transformation function (NULL if not having a transformation)

◆ VariableIndex()

virtual int ROOT::Math::BasicMinimizer::VariableIndex ( const std::string &  name) const
virtualinherited

get index of variable given a variable given a name return -1 if variable is not found

Reimplemented from ROOT::Math::Minimizer.

◆ VariableName()

virtual std::string ROOT::Math::BasicMinimizer::VariableName ( unsigned int  ivar) const
virtualinherited

get name of variables (override if minimizer support storing of variable names)

Reimplemented from ROOT::Math::Minimizer.

◆ X()

virtual const double* ROOT::Math::BasicMinimizer::X ( ) const
inlinevirtualinherited

return pointer to X values at the minimum

Implements ROOT::Math::Minimizer.

Definition at line 139 of file BasicMinimizer.h.

139 { return &fValues.front(); }

References ROOT::Math::BasicMinimizer::fValues.

Member Data Documentation

◆ fBounds

std::map< unsigned int, std::pair<double, double> > ROOT::Math::BasicMinimizer::fBounds
privateinherited

Definition at line 189 of file BasicMinimizer.h.

◆ fDim

unsigned int ROOT::Math::BasicMinimizer::fDim
privateinherited

Definition at line 180 of file BasicMinimizer.h.

Referenced by ROOT::Math::BasicMinimizer::NDim().

◆ fMinVal

double ROOT::Math::BasicMinimizer::fMinVal
privateinherited

◆ fNames

std::vector<std::string> ROOT::Math::BasicMinimizer::fNames
privateinherited

Definition at line 187 of file BasicMinimizer.h.

◆ fObjFunc

const ROOT::Math::IMultiGenFunction* ROOT::Math::BasicMinimizer::fObjFunc
privateinherited

Definition at line 182 of file BasicMinimizer.h.

Referenced by ROOT::Math::BasicMinimizer::ObjFunction().

◆ fOptions

◆ fSolver

ROOT::Math::GSLSimAnnealing ROOT::Math::GSLSimAnMinimizer::fSolver
private

Definition at line 108 of file GSLSimAnMinimizer.h.

Referenced by getSolver().

◆ fStatus

int ROOT::Math::Minimizer::fStatus
protectedinherited

Definition at line 490 of file Minimizer.h.

Referenced by ROOT::Math::Minimizer::Status().

◆ fSteps

std::vector<double> ROOT::Math::BasicMinimizer::fSteps
privateinherited

Definition at line 186 of file BasicMinimizer.h.

Referenced by ROOT::Math::BasicMinimizer::StepSizes().

◆ fValidError

bool ROOT::Math::Minimizer::fValidError
protectedinherited

◆ fValues

std::vector<double> ROOT::Math::BasicMinimizer::fValues
privateinherited

◆ fVarTypes

std::vector<ROOT::Math::EMinimVariableType> ROOT::Math::BasicMinimizer::fVarTypes
privateinherited

Definition at line 188 of file BasicMinimizer.h.


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