|
ROOT
Reference Guide |
|
Go to the documentation of this file.
50 if (debugLevel >=1 ) std::cout <<
"Minimize using GSLSimAnMinimizer " << std::endl;
54 MATH_ERROR_MSG(
"GSLSimAnMinimizer::Minimize",
"Function has not been set");
59 unsigned int npar =
NPar();
60 std::vector<double> xvar;
73 steps.resize( trFunc->
NDim() );
76 assert (xvar.size() == steps.size() );
80 for (
unsigned int i = 0; i < npar ; ++i) {
81 std::cout <<
"x = " << xvar[i] <<
" steps " << steps[i] <<
" x " <<
X()[i] << std::endl;
83 std::cout <<
"f(x) = " << (*
ObjFunction())(&xvar.front() ) << std::endl;
84 std::cout <<
"f(x) not transf = " << (*function)(
X() ) << std::endl;
85 if (trFunc) std::cout <<
"ftrans(x) = " << (*trFunc) (&xvar.front() ) << std::endl;
89 std::vector<double>
xmin(xvar.size() );
99 if (debugLevel >=1 ) {
101 std::cout <<
"GSLSimAnMinimizer: Minimum Found" << std::endl;
103 std::cout <<
"GSLSimAnMinimizer: Error in solving" << std::endl;
105 int pr = std::cout.precision(18);
106 std::cout <<
"FVAL = " <<
MinValue() << std::endl;
107 std::cout.precision(pr);
108 for (
unsigned int i = 0; i <
NDim(); ++i)
109 std::cout <<
VariableName(i) <<
"\t = " <<
X()[i] << std::endl;
113 return ( iret == 0) ? true :
false;
124 if (
f)
return f->NCalls();
161 MATH_WARN_MSG(
"GSLSimAnMinimizer::SetOptions",
"No specific sim. annealing minimizer options are provided. No options are set");
bool GetValue(const char *name, T &t) const
GSLSimAnMinimizer(int type=0)
Default constructor.
void SetMinValue(double val)
void SetPrecision(double prec)
set the precision
virtual std::string VariableName(unsigned int ivar) const
get name of variables (override if minimizer support storing of variable names)
double k
parameters for the Boltzman distribution
void SetMinimizerType(const char *type)
set minimizer type
int PrintLevel() const
minimizer configuration parameters
virtual unsigned int NPar() const
total number of parameter defined
virtual bool Minimize()
method to perform the minimization
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
void SetPrintLevel(int level)
set print level
int Solve(const ROOT::Math::IMultiGenFunction &func, const double *x0, const double *scale, double *xmin, bool debug=false)
solve the simulated annealing given a multi-dim function, the initial vector parameters and a vector ...
void SetParameters(const GSLSimAnParams ¶ms)
set new minimizer option parameters using directly the GSLSimAnParams structure
virtual void SetOptions(const ROOT::Math::MinimizerOptions &opt)
set new minimizer options
class implementing generic options for a numerical algorithm Just store the options in a map of strin...
structure holding the simulated annealing parameters
#define MATH_ERROR_MSG(loc, str)
void SetPrintLevel(int level)
set print level
Base Minimizer class, which defines the basic funcionality of various minimizer implementations (apar...
virtual double MinValue() const
return minimum function value
#define MATH_WARN_MSG(loc, str)
void SetErrorDef(double err)
set error def
virtual ~GSLSimAnMinimizer()
Destructor (no operations)
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
void SetMinimizerAlgorithm(const char *type)
set minimizer algorithm
ROOT::Math::GSLSimAnnealing fSolver
void SetFinalValues(const double *x)
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
virtual const double * StepSizes() const
accessor methods
Generic interface for defining configuration options of a numerical algorithm.
const GSLSimAnParams & MinimizerParameters() const
Get current minimizer option parameteres.
void SetTolerance(double tol)
set the tolerance
virtual const double * X() const
return pointer to X values at the minimum
const IOptions * ExtraOptions() const
return extra options (NULL pointer if they are not present)
virtual unsigned int NDim() const
number of dimensions
void SetStrategy(int stra)
set the strategy
MultiNumGradFunction class to wrap a normal function in a gradient function using numerical gradient ...
MinimTransformFunction * CreateTransformation(std::vector< double > &startValues, const ROOT::Math::IMultiGradFunction *func=0)
Documentation for the abstract class IBaseFunctionMultiDim.
unsigned int NCalls() const
number of calls
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
void SetOwnership(bool on=true)
void SetValue(const char *name, double val)
generic methods for retrivieng options
Namespace for new Math classes and functions.
virtual ROOT::Math::MinimizerOptions Options() const
Get current minimizer options.
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
const ROOT::Math::IMultiGenFunction * ObjFunction() const
return pointer to used objective function