15 #include "RConfigure.h"
17 #ifndef MATH_NO_PLUGIN_MANAGER
22 #else // case no plugin manager is available
23 #ifdef R__HAS_MATHMORE
37 RootFinder::RootFinder(RootFinder::EType type) :
44 bool RootFinder::SetMethod(RootFinder::EType type)
47 if ( type == RootFinder::kBRENT )
49 fSolver =
new BrentRootFinder();
53 #ifdef MATH_NO_PLUGIN_MANAGER // no PM available
54 #ifdef R__HAS_MATHMORE
59 fSolver =
new ROOT::Math::Roots::Bisection();
62 fSolver =
new ROOT::Math::Roots::FalsePos();
65 fSolver =
new ROOT::Math::Roots::Brent();
68 fSolver =
new ROOT::Math::Roots::Newton();
71 fSolver =
new ROOT::Math::Roots::Secant();
74 fSolver =
new ROOT::Math::Roots::Steffenson();
77 MATH_ERROR_MSG(
"RootFinder::SetMethod",
"RootFinderMethod type is not available in MathCore");
84 MATH_ERROR_MSG(
"RootFinder::SetMethod",
"RootFinderMethod type is not available in MathCore");
88 #else // case of using Plugin Manager
109 case kGSL_STEFFENSON:
110 stype =
"Steffenson";
113 MATH_ERROR_MSG(
"RootFinder::SetMethod",
"RootFinderMethod type is not available in MathCore");
119 if ((h = gROOT->GetPluginManager()->FindHandler(
"ROOT::Math::IRootFinderMethod", stype.c_str() ))) {
120 if (h->LoadPlugin() == -1) {
121 MATH_ERROR_MSG(
"RootFinder::SetMethod",
"Error loading RootFinderMethod");
125 fSolver =
reinterpret_cast<ROOT::Math::IRootFinderMethod *
>( h->ExecPlugin(0) );
126 assert(fSolver != 0);
129 MATH_ERROR_MSG(
"RootFinder::SetMethod",
"Error loading RootFinderMethod");
139 RootFinder::~RootFinder()