80 std::map<unsigned int, std::pair<double, double> >::iterator iter =
fBounds.find(
ivar);
91 if (!
ret)
return false;
92 const double upper = std::numeric_limits<double>::infinity();
100 if (!
ret)
return false;
101 const double lower = -std::numeric_limits<double>::infinity();
110 if (!
ret)
return false;
119 if (!
ret)
return false;
135 if (
x ==
nullptr)
return false;
164 if (
lower >
upper || (
lower == - std::numeric_limits<double>::infinity() &&
165 upper == std::numeric_limits<double>::infinity() ) ) {
172 if (
lower == - std::numeric_limits<double>::infinity() )
174 else if (
upper == std::numeric_limits<double>::infinity() )
196 if (
fBounds[
ivar].first == - std::numeric_limits<double>::infinity() )
198 else if (
fBounds[
ivar].second == std::numeric_limits<double>::infinity() )
215 std::map< unsigned int , std::pair< double, double> >::const_iterator
itr =
fBounds.find(
ivar);
218 double upper = (
itr->second).second;
233 std::vector<std::string>::const_iterator
itr = std::find(
fNames.begin(),
fNames.end(),
name);
258 MATH_ERROR_MSG(
"BasicMinimizer::CheckFunction",
"Function has not been set");
268 unsigned int ivar = 0;
314 int pr = std::cout.precision(18);
315 std::cout <<
"FVAL = " <<
fMinVal << std::endl;
316 std::cout.precision(
pr);
318 std::cout <<
"Niterations = " <<
NIterations() << std::endl;
320 if (
ncalls) std::cout <<
"NCalls = " <<
ncalls << std::endl;
321 for (
unsigned int i = 0; i <
fDim; ++i)
322 std::cout <<
fNames[i] <<
"\t = " <<
fValues[i] << std::endl;
333 for (
unsigned int i = 0; i <
fVarTypes.size(); ++i)
#define MATH_ERROR_MSGVAL(loc, txt, x)
#define MATH_ERROR_MSG(loc, str)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
~BasicMinimizer() override
Destructor.
bool IsFixedVariable(unsigned int ivar) const override
query if an existing variable is fixed (i.e.
void PrintResult() const
print result of minimization
BasicMinimizer()
Default constructor.
const ROOT::Math::IMultiGenFunction * fObjFunc
unsigned int NFree() const override
number of free variables (real dimension of the problem)
unsigned int NDim() const override
number of dimensions
bool SetVariableStepSize(unsigned int ivar, double step) override
set the step size of an already existing variable
std::vector< ROOT::Math::EMinimVariableType > fVarTypes
vector specifying the type of variables
bool CheckObjFunction() const
void SetFinalValues(const double *x, const MinimTransformFunction *func=nullptr)
bool SetVariable(unsigned int ivar, const std::string &name, double val, double step) override
set free variable
MinimTransformFunction * CreateTransformation(std::vector< double > &startValues, const ROOT::Math::IMultiGradFunction *func=nullptr)
int VariableIndex(const std::string &name) const override
get index of variable given a variable given a name return -1 if variable is not found
bool SetLowerLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower) override
set lower limit variable (override if minimizer supports them )
void SetFunction(const ROOT::Math::IMultiGenFunction &func) override
set the function to minimize
bool SetVariableLowerLimit(unsigned int ivar, double lower) override
set the lower-limit of an already existing variable
bool SetVariableValues(const double *x) override
set the values of all existing variables (array must be dimensioned to the size of existing parameter...
bool Minimize() override
method to perform the minimization
std::vector< double > fSteps
bool SetFixedVariable(unsigned int, const std::string &, double) override
set fixed variable (override if minimizer supports them )
bool GetVariableSettings(unsigned int ivar, ROOT::Fit::ParameterSettings &varObj) const override
get variable settings in a variable object (like ROOT::Fit::ParamsSettings)
std::map< unsigned int, std::pair< double, double > > fBounds
map specifying the bound using as key the parameter index
bool SetUpperLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double upper) override
set upper limit variable (override if minimizer supports them )
bool CheckDimension() const
bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double, double) override
set upper/lower limited variable (override if minimizer supports them )
bool ReleaseVariable(unsigned int ivar) override
release an existing variable
bool SetVariableLimits(unsigned int ivar, double lower, double upper) override
set the limits of an already existing variable
std::vector< double > fValues
bool FixVariable(unsigned int ivar) override
fix an existing variable
const ROOT::Math::IMultiGradFunction * GradObjFunction() const
return pointer to used gradient object function (NULL if gradient is not supported)
std::vector< std::string > fNames
std::string VariableName(unsigned int ivar) const override
get name of variables (override if minimizer support storing of variable names)
bool SetVariableValue(unsigned int ivar, double val) override
set the value of an existing variable
bool SetVariableUpperLimit(unsigned int ivar, double upper) override
set the upper-limit of an already existing variable
Documentation for the abstract class IBaseFunctionMultiDim.
virtual IBaseFunctionMultiDimTempl< T > * Clone() const =0
Clone a function.
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
static int DefaultPrintLevel()
static int DefaultMaxIterations()
virtual unsigned int NIterations() const
number of iterations to reach the minimum
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
void SetPrintLevel(int level)
set print level
virtual unsigned int NCalls() const
number of function calls to reach the minimum
Namespace for new Math classes and functions.
@ kUpBound
variable has an upper bounds
@ kBounds
variable has two bounds
@ kLowBound
variable has a lower bound
@ kDefault
free variable (unlimited)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...