41 return (*
this)(par,
gra);
55 MnPrint print(
"Numerical2PGradientCalculator");
63 double eps =
trafo.Precision().Eps();
68 double vrysml = 8. * eps * eps;
81 print.
Debug(
"Calculating gradient around function value",
fcnmin,
"\n\t at point", par.
Vec());
104 for (
int i = 0; i <
int(
n); i++) {
117 for (
unsigned int j = 0;
j <
ncycle;
j++) {
119 double step = std::max(
optstp, std::fabs(0.1 *
gstep(i)));
121 if (
trafo.Parameter(
trafo.ExtOfInt(i)).HasLimits()) {
134 if (std::fabs((step -
stepb4) / step) <
fStrategy.GradientStepTolerance()) {
161 if (i == 0 &&
j == 0) {
163 printtl.Trace([&](std::ostream &os) {
165 print.
Trace([&](std::ostream &os) {
167 os << std::setw(10) <<
"parameter" << std::setw(6) <<
"cycle" << std::setw(15) <<
"x" << std::setw(15)
168 <<
"step" << std::setw(15) <<
"f1" << std::setw(15) <<
"f2" << std::setw(15) <<
"grd"
169 << std::setw(15) <<
"g2" << std::endl;
173 printtl.Trace([&](std::ostream &os) {
175 print.
Trace([&](std::ostream &os) {
177 const int pr = os.precision(13);
179 os << std::setw(10) <<
trafo.Name(
iext) << std::setw(5) <<
j <<
" " <<
x(i) <<
" " << step <<
" "
180 <<
fs1 <<
" " <<
fs2 <<
" " <<
grd(i) <<
" " <<
g2(i) << std::endl;
206 print.
Debug([&](std::ostream &os) {
207 const int pr = os.precision(13);
209 os << std::setw(14) <<
"Parameter" << std::setw(14) <<
"Gradient" << std::setw(14) <<
"g2 " << std::setw(14)
210 <<
"step" << std::endl;
211 for (
int i = 0; i <
int(
n); i++) {
213 os << std::setw(14) <<
trafo.Name(
iext) <<
" " <<
grd(i) <<
" " <<
g2(i) <<
" " <<
gstep(i) << std::endl;
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 GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Class to calculate an initial estimate of the gradient.
const MnAlgebraicVector & Vec() const
void Debug(const Ts &... args)
void Trace(const Ts &... args)
FunctionGradient operator()(const MinimumParameters &) const override
const MnUserTransformation & fTransformation
const MnStrategy & fStrategy
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...