Go to the documentation of this file.
26 #ifndef O2SCL_ROOT_TOMS748_H
27 #define O2SCL_ROOT_TOMS748_H
31 #include <boost/math/tools/roots.hpp>
33 #include <o2scl/root.h>
49 bool operator()(
const T &a,
const T &b) {
53 if ((a > 0.0 && b > 0.0) || (a < 0.0 && b < 0.0)) {
54 if (abs_a<abs_b) min_abs=abs_a;
60 double tolerance = epsabs+epsrel*min_abs;
62 if (fabs(b-a) < tolerance) {
92 virtual const char *
type() {
return "root_toms748"; }
96 std::pair<double,double> res;
98 if (this->
tol_rel>1.0) digits=1;
99 else if (this->
tol_rel<=0.0) digits=18;
100 else digits=((size_t)(-log10(this->
tol_rel)));
103 size_t niter=((size_t)this->
ntrial);
104 res=boost::math::tools::toms748_solve(func,
x1,
x2,tol,niter);
double tol_rel
The maximum value of the functions for success (default )
int last_ntrial
The number of iterations used in the most recent solve.
double tol_abs
The minimum allowable stepsize (default )
One-dimensional bracketing solver [abstract base].
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
static const double x2[5]
static const double x1[5]
Bracketing solver based the Boost implementation of TOMS 748.
virtual const char * type()
Return the type, "root_toms748".
virtual int solve_bkt(double &x1, double x2, func_t &func)
Solve func using x as an initial guess, returning x.
Convergence test similar to gsl_root_test_interval() for root_toms748.
int ntrial
Maximum number of iterations (default 100)
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).