23 #pragma warning(disable : 4267)
24 #include <Math/GSLNLSMinimizer.h>
27 #pragma GCC diagnostic push
28 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29 #include <Math/GSLNLSMinimizer.h>
30 #pragma GCC diagnostic pop
38 std::map<int, std::string> result;
39 result[0] =
"Covariance matrix was not computed";
40 result[1] =
"Covariance matrix approximate because minimum is not valid";
41 result[3] =
"Covariance matrix OK";
49 m_gsl_minimizer(new
ROOT::Math::GSLNLSMinimizer(2))
51 addOption(
"Tolerance", 0.01,
"Tolerance on the function value at the minimum");
52 addOption(
"PrintLevel", 0,
"Minimizer internal print level");
53 addOption(
"MaxIterations", 0,
"Maximum number of iterations");
65 return optionValue<double>(
"Tolerance");
75 return optionValue<int>(
"PrintLevel");
85 return optionValue<int>(
"MaxIterations");
98 result[
"functionCalls"] = std::to_string(
rootMinimizer()->NCalls());
116 auto limits = par.
limits();
117 if (!limits.isLimitless() && !limits.isFixed())
118 throw std::runtime_error(
"GSLLMA minimizer can't handle limited parameters."
119 "Please make them free");
Declares class GSLLevenbergMarquardtMinimizer.
Declares class GSLMultiMinimizer.
Declares namespace MinimizerUtils.
Defines a few helper functions.
A fittable parameter with value, error, step, and limits.
void setMaxIterations(int value)
Sets maximum number of iterations.
~GSLLevenbergMarquardtMinimizer() override
void setTolerance(double value)
Sets tolerance on the function value at the minimum.
std::unique_ptr< ROOT::Math::GSLNLSMinimizer > m_gsl_minimizer
void setParameter(unsigned int index, const Fit::Parameter &par) override
std::string statusToString() const override
Returns string representation of current minimizer status.
const root_minimizer_t * rootMinimizer() const override
void propagateOptions() override
void setPrintLevel(int value)
Sets minimizer internal print level.
std::map< std::string, std::string > statusMap() const override
Returns map of string representing different minimizer statuses.
int maxIterations() const
GSLLevenbergMarquardtMinimizer()
Info about a minimizer, including list of defined minimization algorithms.
Pure virtual interface that adapts the CERN ROOT minimizer to our IMinimizer.
OptionContainer::option_t addOption(const std::string &optionName, T value, const std::string &description="")
void setOptionValue(const std::string &optionName, T value)
ROOT::Math::Minimizer root_minimizer_t
virtual void setParameter(unsigned int index, const Fit::Parameter &par)
virtual std::map< std::string, std::string > statusMap() const
Returns map of string representing different minimizer statuses.
std::string gslErrorDescription(int errorCode)
std::string scientific(const T value, int n=10)
Returns scientific string representing given value of any numeric type.
std::map< int, std::string > covmatrixStatusDescription()