| 130 |
return fSolver->SetFunction( f, xstart); |
return fSolver->SetFunction( f, xstart); |
| 131 |
} |
} |
| 132 |
|
|
| 133 |
|
template<class Function, class Derivative> |
| 134 |
|
int Solve(Function f, Derivative d, double start, |
| 135 |
|
int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6); |
| 136 |
|
|
| 137 |
|
template<class Function> |
| 138 |
|
int Solve(Function f, double min, double max, |
| 139 |
|
int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6); |
| 140 |
|
|
| 141 |
/** |
/** |
| 142 |
Compute the roots iterating until the estimate of the Root is within the required tolerance returning |
Compute the roots iterating until the estimate of the Root is within the required tolerance returning |
| 143 |
the iteration Status |
the iteration Status |
| 227 |
} // namespace ROOT |
} // namespace ROOT |
| 228 |
|
|
| 229 |
|
|
| 230 |
|
#include "Math/WrappedFunction.h" |
| 231 |
|
#include "Math/Functor.h" |
| 232 |
|
|
| 233 |
|
template<class Function, class Derivative> |
| 234 |
|
int ROOT::Math::RootFinder::Solve(Function f, Derivative d, double start, |
| 235 |
|
int maxIter, double absTol, double relTol) |
| 236 |
|
{ |
| 237 |
|
ROOT::Math::GradFunctor1D wf(f, d); |
| 238 |
|
if (fSolver) fSolver->SetFunction(wf, start); |
| 239 |
|
return Solve(maxIter, absTol, relTol); |
| 240 |
|
} |
| 241 |
|
|
| 242 |
|
template<class Function> |
| 243 |
|
int ROOT::Math::RootFinder::Solve(Function f, double min, double max, |
| 244 |
|
int maxIter, double absTol, double relTol) |
| 245 |
|
{ |
| 246 |
|
ROOT::Math::WrappedFunction<Function> wf(f); |
| 247 |
|
if (fSolver) fSolver->SetFunction(wf, min, max); |
| 248 |
|
return Solve(maxIter, absTol, relTol); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
#endif /* ROOT_Math_RootFinder */ |
#endif /* ROOT_Math_RootFinder */ |