40 return (*
this)(par,
gra);
54 MnPrint print(
"Numerical2PGradientCalculator");
62 double eps =
trafo.Precision().Eps();
67 double vrysml = 8. * eps * eps;
80 print.
Debug(
"Calculating gradient around function value",
fcnmin,
"\n\t at point", par.
Vec());
99#pragma omp parallel for if (fDoParallelOMP)
102 for (
unsigned int i = 0; i <
n; i++) {
115 for (
unsigned int j = 0;
j <
ncycle;
j++) {
117 double step = std::max(
optstp, std::fabs(0.1 *
gstep(i)));
119 if (
trafo.Parameter(
trafo.ExtOfInt(i)).HasLimits()) {
132 if (std::fabs((step -
stepb4) / step) <
fStrategy.GradientStepTolerance()) {
159 if (i == 0 &&
j == 0) {
161 printtl.Trace([&](std::ostream &os) {
163 print.
Trace([&](std::ostream &os) {
165 os << std::setw(10) <<
"parameter" << std::setw(6) <<
"cycle" << std::setw(15) <<
"x" << std::setw(15)
166 <<
"step" << std::setw(15) <<
"f1" << std::setw(15) <<
"f2" << std::setw(15) <<
"grd"
167 << std::setw(15) <<
"g2" << std::endl;
171 printtl.Trace([&](std::ostream &os) {
173 print.
Trace([&](std::ostream &os) {
175 const int pr = os.precision(13);
177 os << std::setw(10) <<
trafo.Name(
iext) << std::setw(5) <<
j <<
" " <<
x(i) <<
" " << step <<
" "
178 <<
fs1 <<
" " <<
fs2 <<
" " <<
grd(i) <<
" " <<
g2(i) << std::endl;
204 print.
Debug([&](std::ostream &os) {
205 const int pr = os.precision(13);
207 os << std::setw(14) <<
"Parameter" << std::setw(14) <<
"Gradient" << std::setw(14) <<
"g2 " << std::setw(14)
208 <<
"step" << std::endl;
209 for (
int i = 0; i <
int(
n); i++) {
211 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.
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
FunctionGradient calculateInitialGradient(const MinimumParameters &, const MnUserTransformation &, double errorDef)
Initial rough estimate of the gradient using the parameter step size.
Namespace for new ROOT classes and functions.