53 bool ret = r->Solve();
54 int returnCode = !ret;
61 std::cout <<
"\nTest " << r->Name() <<
" algorithm " << std::endl;
63 double root = r->Root();
65 std::cout <<
"Return code: " << returnCode << std::endl;
66 std::cout <<
"Result: " << root <<
" n iters = " << r->Iterations() << std::endl;
67 std::cout <<
"Exact result: " <<
sqrt(5.0) <<
" difference: " << root -
sqrt(5.0) << std::endl;
72 std::cerr <<
"Test Root finder with " << r->Name() <<
" failed " << std::endl;
86 std::vector<double> p(3);
User Class to find the Root of one dimensional functions.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
GradFunctor1D class for one-dimensional gradient functions.
double myfunc_deriv_gsl(double x, void *)
double myfunc_gsl(double x, void *)
a Newton algorithm, which computes the derivative at each iteration See the GSL manual for more infor...
bool SetFunction(const IGradFunction &f, double xstart)
Sets the function for algorithms using derivatives.
void myfunc_fdf(double x, void *, double *y, double *dy)
double(* FP)(double, void *)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual void SetParameters(const double *p)
Set the parameter values.
double myfunc_deriv(double x)
Parametric Function class describing polynomials of order n.
bool SetFunction(const IGenFunction &f, double xlow, double xup)
Provide to the solver the function and the initial search interval [xlow, xup] for algorithms not usi...
double func(double *x, double *p)
Brent-Dekker algorithm which combines an interpolation strategy with the bisection algorithm See the ...
int printStats(RF *r, int returnCode, TStopwatch &timer)
Functor1D class for one-dimensional functions.
bool SetFunction(const IGenFunction &f, double xlow, double xup)
Sets the function for the rest of the algorithms.
double(* GSLFuncPointer)(double, void *)