Class root_bkt (o2scl)¶
-
template<class func_t = funct, class dfunc_t = func_t, class fp_t = double>
class root_bkt : public o2scl::root<funct, funct, double>¶ One-dimensional bracketing solver [abstract base].
Subclassed by o2scl::root_bkt_cern< o2scl::nstar_rot::polytrope_solve >, o2scl::root_brent_gsl< std::function< double(double)>, double >, o2scl::root_brent_gsl< funct, double >, o2scl::root_brent_gsl< std::function< cpp_dec_float_25(cpp_dec_float_25)>, cpp_dec_float_25 >, o2scl::root_brent_gsl< funct_cdf25, cpp_dec_float_25 >, o2scl::root_brent_gsl< std::function< long double(long double)>, long double >, o2scl::root_brent_gsl< funct_ld, long double >, o2scl::root_brent_gsl< std::function< cpp_dec_float_35(cpp_dec_float_35)>, cpp_dec_float_35 >, o2scl::root_brent_gsl< std::function< cpp_dec_float_50(cpp_dec_float_50)>, cpp_dec_float_50 >, o2scl::root_brent_gsl< std::function< cpp_dec_float_100(cpp_dec_float_100)>, cpp_dec_float_100 >, o2scl::root_bkt_cern< func_t >, o2scl::root_brent_gsl< func_t, fp_t >, o2scl::root_toms748< func_t, fp_t >
Public Functions
-
inline root_bkt()¶
-
inline virtual ~root_bkt()¶
-
inline virtual const char *type()¶
Return the type,
"root_bkt"
.
-
virtual int solve_bkt(fp_t &x1, fp_t x2, func_t &func) = 0¶
Solve
func
in region \( x_1<x<x_2 \) returning \( x_1 \) .
-
inline virtual int solve(fp_t &x, func_t &func)¶
Solve
func
usingx
as an initial guess.This has been updated to automatically bracket functions which are undefined away from the initial guess, but there are still various ways in which the bracketing algorithm can fail.
Todo
class root
Future: Return early if the bracketing procedure finds a root early?
-
inline root_bkt()¶