54 fMaxIter( maxIterations ),
55 fAbsTol ( absTolerance ),
75 Double_t fa = fMethod->GetValueForRoot(
a ) - refValue;
76 Double_t fb = fMethod->GetValueForRoot(
b ) - refValue;
78 Log() << kWARNING <<
"<Root> initial interval w/o root: "
79 <<
"(a=" <<
a <<
", b=" <<
b <<
"),"
80 <<
" (Eff_a=" << fMethod->GetValueForRoot(
a )
81 <<
", Eff_b=" << fMethod->GetValueForRoot(
b ) <<
"), "
82 <<
"(fa=" << fa <<
", fb=" << fb <<
"), "
83 <<
"refValue = " << refValue <<
Endl;
90 for (
Int_t iter= 0; iter <= fMaxIter; iter++) {
91 if ((fb < 0 &&
fc < 0) || (fb > 0 &&
fc > 0)) {
102 fa = fb; fb =
fc;
fc = fa;
116 if (ac_equal) { p = 2 *
m *
s;
q = 1 -
s; }
119 p =
s * (2 *
m *
q * (
q -
r) - (
b -
a) * (
r - 1));
120 q = (
q - 1) * (
r - 1) * (
s - 1);
128 if (2 * p < (min1 < min2 ? min1 : min2)) {
132 else {
d =
m;
e =
m; }
138 else b += (
m > 0 ? +tol : -tol);
140 fb = fMethod->GetValueForRoot(
b ) - refValue;
145 Log() << kWARNING <<
"<Root> maximum iterations (" << fMaxIter
146 <<
") reached before convergence" <<
Endl;
static struct mg_connection * fc(struct mg_context *ctx)
Virtual base Class for all MVA method.
ostringstream derivative to redirect and format output
Root finding using Brents algorithm (translated from CERNLIB function RZERO)
virtual ~RootFinder(void)
destructor
Double_t Root(Double_t refValue)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
RootFinder(MethodBase *method, Double_t rootMin, Double_t rootMax, Int_t maxIterations=100, Double_t absTolerance=0.0)
constructor
static constexpr double s
MsgLogger & Endl(MsgLogger &ml)