22class GradientCalculator;
40 const unsigned int n =
x.size();
50 const double alpha = 1.;
51 const double beta = 0.5;
52 const double gamma = 2.;
55 const double rho1 = 1. + alpha;
58 const double rho2 = 1. + alpha * gamma;
60 std::vector<std::pair<double, MnAlgebraicVector>>
simpl;
69 for (
unsigned int i = 0; i <
n; i++) {
70 double dmin = 8. *
prec.Eps2() * (std::abs(
x(i)) +
prec.Eps2());
83 simpl.emplace_back(tmp,
x);
88 print.
Debug([&](std::ostream &os) {
89 os <<
"Initial parameters - min " <<
jl <<
" " <<
amin <<
" max " <<
jh <<
" " <<
aming <<
'\n';
90 for (
unsigned int i = 0; i < simplex.
Simplex().
size(); ++i)
91 os <<
" i = " << i <<
" x = " << simplex(i).second <<
" fval(x) = " << simplex(i).first <<
'\n';
103 print.
Debug(
"iteration: edm =", simplex.
Edm(),
'\n',
"--> Min Param is",
jl,
"pmin", simplex(
jl).second,
104 "f(pmin)",
amin,
'\n',
"--> Max param is",
jh, simplex(
jh).first);
114 simplex.
Edm(),
mfcn.NumOfCalls()));
119 for (
unsigned int i = 0; i <
n + 1; i++) {
122 pbar += (
wg * simplex(i).second);
131 if (
ystar < simplex(
jh).first) {
133 if (
jh != simplex.
Jh())
152 const double y1 = (
ystar - simplex(
jh).first) * rho2;
153 const double y2 = (
ystst - simplex(
jh).first) * rho1;
154 double rho = 0.5 * (rho2 *
y1 - rho1 *
y2) / (
y1 -
y2);
173 if (
ystst < simplex(
jl).first) {
177 if (
yrho > simplex(
jl).first) {
184 if (
ystar > simplex(
jh).first) {
185 pstst = beta * simplex(
jh).second + (1. - beta) *
pbar;
201 for (
unsigned int i = 0; i <
n + 1; i++) {
204 pbar += (
wg * simplex(i).second);
210 pbar = simplex(
jl).second;
218 print.
Debug(
"End simplex edm =", simplex.
Edm(),
"pbar =",
pbar,
"f(p) =",
ybar);
228 print.
Warn(
"Simplex did not converge, #fcn calls exhausted");
233 print.
Warn(
"Simplex did not converge, edm > minedm");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
interface class for gradient calculators
void TraceIteration(int iter, const MinimumState &state) const
const FunctionGradient & Gradient() const
const MinimumParameters & Parameters() const
const MnMachinePrecision & Precision() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Wrapper class to FCNBase interface used internally by Minuit.
Sets the relative floating point (double) arithmetic precision.
void Debug(const Ts &... args)
void Info(const Ts &... args)
void Warn(const Ts &... args)
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const override
class describing the simplex set of points (f(x), x ) which evolve during the minimization iteration ...
MnAlgebraicVector Dirin() const
void Update(double, const MnAlgebraicVector &)
const std::vector< std::pair< double, MnAlgebraicVector > > & Simplex() const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...