class ROOT::Math::Minimizer


   Abstract Minimizer class, defining  the interface for the various minimizer
   (like Minuit2, Minuit, GSL, etc..)
   Plug-in's exist in ROOT to be able to instantiate the derived classes like
   ROOT::Math::GSLMinimizer or ROOT::Math::Minuit2Minimizer via the
   plug-in manager.

   Provides interface for setting the function to be minimized.
   The function must  implemente the multi-dimensional generic interface
   ROOT::Math::IBaseFunctionMultiDim.
   If the function provides gradient calculation
   (implements the ROOT::Math::IGradientFunctionMultiDim interface) this will be
   used by the Minimizer.

   It Defines also interface for setting the initial values for the function variables (which are the parameters in
   of the model function in case of solving for fitting) and especifying their limits.

   It defines the interface to set and retrieve basic minimization parameters
   (for specific Minimizer parameters one must use the derived classes).

   Then it defines the interface to retrieve the result of minimization ( minimum X values, function value,
   gradient, error on the mimnimum, etc...)

   @ingroup MultiMin

Function Members (Methods)

 
    This is an abstract class, constructors will not be documented.
    Look at the header to check for available constructors.

public:
virtual~Minimizer()
virtual voidClear()
virtual boolContour(unsigned int, unsigned int, unsigned int&, double*, double*)
virtual doubleCorrelation(unsigned int i, unsigned int j) const
virtual doubleCovMatrix(unsigned int i, unsigned int j) const
virtual doubleEdm() const
doubleErrorDef() const
virtual const double*Errors() const
virtual boolGetMinosError(unsigned int, double& errLow, double& errUp)
virtual doubleGlobalCC(unsigned int) const
boolIsValidError() const
unsigned intMaxFunctionCalls()
unsigned intMaxIterations()
virtual const double*MinGradient() const
virtual boolMinimize()
virtual doubleMinValue() const
virtual unsigned intNCalls() const
virtual unsigned intNDim() const
virtual unsigned intNFree() const
intPrintLevel() const
virtual voidPrintResults()
virtual boolProvidesError() const
virtual boolScan(unsigned int, unsigned int&, double*, double*, double = 0, double = 0)
voidSetErrorDef(double up)
virtual boolSetFixedVariable(unsigned int ivar, const string& name, double val)
virtual voidSetFunction(const ROOT::Math::IMultiGenFunction& func)
virtual voidSetFunction(const ROOT::Math::IMultiGradFunction& func)
virtual boolSetLimitedVariable(unsigned int ivar, const string& name, double val, double step, double, double)
virtual boolSetLowerLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower)
voidSetMaxFunctionCalls(unsigned int maxfcn)
voidSetMaxIterations(unsigned int maxiter)
voidSetPrintLevel(int level)
voidSetStrategy(int strategyLevel)
voidSetTolerance(double tol)
virtual boolSetUpperLimitedVariable(unsigned int ivar, const string& name, double val, double step, double upper)
voidSetValidError(bool on)
virtual boolSetVariable(unsigned int ivar, const string& name, double val, double step)
virtual boolSetVariableValue(unsigned int, double)
virtual boolSetVariableValues(const double* x)
intStatus() const
intStrategy() const
doubleTolerance() const
virtual const double*X() const
private:
ROOT::Math::Minimizer&operator=(const ROOT::Math::Minimizer& rhs)

Data Members

protected:
intfDebugprint level
unsigned intfMaxCallsmax number of funciton calls
unsigned intfMaxItermax number or iterations used to find the minimum
intfStatusstatus of minimizer
intfStrategyminimizer strategy
doublefToltolerance (absolute)
doublefUperror scale
boolfValidErrorflag to control if errors have been validated (Hesse has been run in case of Minuit)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

virtual ~Minimizer()
      Destructor (no operations)

{}
void Clear()
 reset for consecutive minimizations - implement if needed
{}
void SetFunction(const ROOT::Math::IMultiGenFunction & func)
 set the function to minimize
void SetFunction(const ROOT::Math::IMultiGradFunction & func)
 set a function to minimize using gradient
bool SetVariable(unsigned int ivar, const string& name, double val, double step)
 set free variable
bool SetLowerLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower)
return SetLimitedVariable(unsigned int ivar, const string& name, double val, double step, double , double )
bool SetUpperLimitedVariable(unsigned int ivar, const string& name, double val, double step, double upper)
 set upper limit variable (override if minimizer supports them )
bool SetFixedVariable(unsigned int ivar, const string& name, double val)
 set fixed variable (override if minimizer supports them )
bool SetVariableValue(unsigned int , double )
 set the value of an existing variable
{ return false; }
bool SetVariableValues(const double* x)
bool Minimize()
 method to perform the minimization
double MinValue() const
 return minimum function value
double Edm() const
 return expected distance reached from the minimum
const double * X() const
 return  pointer to X values at the minimum
const double * MinGradient() const
 return pointer to gradient values at the minimum
unsigned int NCalls() const
 number of function calls to reach the minimum
unsigned int NDim() const
 this is <= Function().NDim() which is the total
 number of variables (free+ constrained ones)
unsigned int NFree() const
 number of free variables (real dimension of the problem)
 this is <= Function().NDim() which is the total
bool ProvidesError() const
 minimizer provides error and error matrix
const double * Errors() const
 return errors at the minimum
double CovMatrix(unsigned int i, unsigned int j) const
 return covariance matrices elements
       if the variable is fixed the matrix is zero
       The ordering of the variables is the same as in errors

double Correlation(unsigned int i, unsigned int j) const
      return correlation coefficient between variable i and j.
      If the variable is fixed or const the return value is zero

double GlobalCC(unsigned int ) const
      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

{ return -1; }
bool GetMinosError(unsigned int , double& errLow, double& errUp)
      minos error for variable i, return false if Minos failed or not supported

bool Scan(unsigned int , unsigned int& , double* , double* , double = 0, double = 0)
      scan function minimum for variable i. Variable and funciton must be set before using Scan
      Return false if an error or if minimizer does not support this funcitonality

bool Contour(unsigned int , unsigned int , unsigned int& , double* , double* )
      find the contour points (xi,xj) of the function for parameter i and j around the minimum
      The contour will be find for value of the function = Min + ErrorUp();

void PrintResults()
 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)
{}
int PrintLevel() const
 get name of variables (override if minimizer support storing of variable names)
virtual std::string VariableName(unsigned int ivar) const { return "x_" + ROOT::Math::Util::ToString(ivar); }
 minimizer configuration parameters 
 set print level
{ return fDebug; }
unsigned int MaxFunctionCalls()
  max number of function calls
{ return fMaxCalls; }
unsigned int MaxIterations()
 max iterations
{ return fMaxIter; }
double Tolerance() const
 absolute tolerance
{ return fTol; }
int Strategy() const
 strategy
{ return fStrategy; }
int Status() const
 status code of minimizer
{ return fStatus; }
double ErrorDef() const
 return the statistical scale used for calculate the error
 is typically 1 for Chi2 and 0.5 for likelihood minimization
{ return fUp; }
bool IsValidError() const
return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit)
{ return fValidError; }
void SetPrintLevel(int level)
 set print level
{ fDebug = level; }
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
{ if (maxfcn > 0) fMaxCalls = maxfcn; }
void SetMaxIterations(unsigned int maxiter)
 set maximum iterations (one iteration can have many function calls)
{ if (maxiter > 0) fMaxIter = maxiter; }
void SetTolerance(double tol)
 set the tolerance
{ fTol = tol; }
void SetStrategy(int strategyLevel)
set the strategy
{ fStrategy = strategyLevel; }
void SetErrorDef(double up)
 set scale for calculating the errors
{ fUp = up; }
void SetValidError(bool on)
 flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit)
{ fValidError = on; }

Author: L. Moneta Fri Sep 22 15:06:47 2006
Last change: root/mathcore:$Id: Minimizer.h 26866 2008-12-12 10:50:07Z moneta $
Last generated: 2008-12-12 12:11
Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.