42 Double_t absTolerance )
43 : fRootMin( rootMin ),
45 fMaxIter( maxIterations ),
46 fAbsTol ( absTolerance ),
47 fLogger ( new MsgLogger("RootFinder") )
49 fGetRootVal = rootVal;
66 Double_t fa = (*fGetRootVal)(
a ) - refValue;
67 Double_t fb = (*fGetRootVal)( b ) - refValue;
69 Log() <<
kWARNING <<
"<Root> initial interval w/o root: "
70 <<
"(a=" << a <<
", b=" << b <<
"),"
71 <<
" (Eff_a=" << (*fGetRootVal)(
a )
72 <<
", Eff_b=" << (*fGetRootVal)( b ) <<
"), "
73 <<
"(fa=" << fa <<
", fb=" << fb <<
"), "
74 <<
"refValue = " << refValue <<
Endl;
82 if ((fb < 0 && fc < 0) || (fb > 0 && fc > 0)) {
93 fa = fb; fb =
fc; fc = fa;
107 if (ac_equal) { p = 2 * m * s; q = 1 - s; }
109 q = fa /
fc; r = fb /
fc;
110 p = s * (2 * m * q * (q -
r) - (b - a) * (r - 1));
111 q = (q - 1) * (r - 1) * (s - 1);
119 if (2 * p < (min1 < min2 ? min1 : min2)) {
123 else { d =
m; e =
m; }
129 else b += (m > 0 ? +tol : -
tol);
131 fb = (*fGetRootVal)( b ) - refValue;
136 Log() <<
kWARNING <<
"<Root> maximum iterations (" << fMaxIter
137 <<
") reached before convergence" <<
Endl;
MsgLogger & Endl(MsgLogger &ml)
static struct mg_connection * fc(struct mg_context *ctx)
std::map< std::string, std::string >::const_iterator iter
Double_t Root(Double_t refValue)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
ClassImp(TMVA::RootFinder) TMVA
constructor
virtual ~RootFinder(void)
destructor
Abstract ClassifierFactory template that handles arbitrary types.