Class root_brent_gsl (o2scl)¶
-
template<class func_t = funct, class fp_t = double>
class root_brent_gsl : public o2scl::root_bkt<funct, funct, double>¶ One-dimensional root-finding (GSL)
This class finds the root of a user-specified function. If test_form is 0 (the default), then solve_bkt() stops when the size of the bracket is smaller than root::tol_abs. If test_form is 1, then the function stops when the residual is less than root::tol_rel. If test_form is 2, then both tests are applied.
See the One-dimensional solvers section of the User’s guide for general information about O2scl solvers. An example demonstrating the usage of this class is given in
examples/ex_fptr.cpp
and the First function object example.Todo
class root_brent_gsl
Future:
There is some duplication in the variables c x_lower, c x_upper, c a, and c b, which could be removed. Some better variable names would also be helpful.
Create a meaningful enum list for ref o2scl::root_brent_gsl::test_form.
There is code duplication between the test_interval here and in root_toms748.
Public Functions
-
inline root_brent_gsl()¶
-
inline virtual const char *type()¶
Return the type,
"root_brent_gsl"
.
-
inline int iterate(func_t &f)¶
Perform an iteration.
This function currently always returns success.
Public Members
-
int test_form¶
The type of convergence test applied: 0, 1, or 2 (default 0)
Protected Functions