#include <gsl_root_stef.h>
This class finds a root of a function a derivative. If the derivative is not analytically specified, it is most likely preferable to use of the alternatives, gsl_root_brent, cern_root, or cern_mroot_root. The function solve_de() performs the solution automatically, and a lower-level GSL-like interface with set() and iterate() is also provided.
By default, this solver compares the present value of the root () to the previous value (
), and returns success if
, where
.
If test_residual is set to true, then the solver additionally requires that the absolute value of the function is less than root::tolf.
The original variable x_2
has been removed as it was unused in the original GSL code.
Definition at line 57 of file gsl_root_stef.h.
Public Member Functions | |
gsl_root_stef () | |
virtual const char * | type () |
Return the type, "gsl_root_stef" . | |
int | iterate () |
Perform an iteration. | |
virtual int | solve_de (double &xx, param_t &pa, func_t &fun, dfunc_t &dfun) |
Solve func using x as an initial guess using derivatives df . | |
int | set (func_t &fun, dfunc_t &dfun, double guess, param_t &pa) |
Set the information for the solver. | |
Data Fields | |
double | root |
The present solution estimate. | |
double | tolf2 |
The relative tolerance for subsequent solutions (default ![]() | |
bool | test_residual |
True if we should test the residual also (default false). | |
Protected Attributes | |
double | f |
Desc. | |
double | df |
Desc. | |
double | x_1 |
Desc. | |
double | x |
Desc. | |
int | count |
Desc. | |
func_t * | fp |
The function to solve. | |
dfunc_t * | dfp |
The derivative. | |
param_t * | params |
The function parameters. |
int iterate | ( | ) | [inline] |
Perform an iteration.
After a successful iteration, root contains the most recent value of the root.
Definition at line 111 of file gsl_root_stef.h.
int set | ( | func_t & | fun, | |
dfunc_t & | dfun, | |||
double | guess, | |||
param_t & | pa | |||
) | [inline] |
Set the information for the solver.
Set the function, the derivative, the initial guess and the parameters.
Definition at line 222 of file gsl_root_stef.h.
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page