root Class Template Reference

#include <root.h>

Inheritance diagram for root:

gsl_root_brent

Detailed Description

template<class param_t, class func_t, class dfunc_t = func_t>
class root< param_t, func_t, dfunc_t >

1-dimensional solver base class

Note:
This class does not actually do any solving, it is present to provide member data and various functions common to all the 1 dimensional solvers.
Idea for future:
This does not have pure virtual functions, but I'd still like to prevent the user from directly instantiating a root object.

Definition at line 48 of file root.h.


Public Member Functions

virtual const char * type ()
 Return the type, "root".
virtual int print_iter (double x, double y, int iter, double value=0.0, double limit=0.0, std::string comment="")
 Print out iteration information.
virtual int solve (double &x, param_t &pa, func_t &func)
 Solve func using x as an initial guess.
virtual int solve_bkt (double &x1, double x2, param_t &pa, func_t &func)
 Solve func in region $ x_1<x<x_2 $ returning $ x_1 $ .
virtual int solve_de (double &x, param_t &pa, func_t &func, dfunc_t &df)
 Solve func using x as an initial guess using derivatives df.

Data Fields

double tolf
 The maximum value of the functions for success (default $ 10^{-8} $ ).
double tolx
 The minimum allowable stepsize (default $ 10^{-12} $ ).
int verbose
 Output control (default 0).
int ntrial
 Maximum number of iterations (default 100).
bool over_bkt
 Should be true if root_bkt() is overloaded.
bool over_de
 Should be true if root_de() is overloaded.
double bracket_step
 The stepsize for automatic bracketing (default $ 10^{-4} $).
int last_ntrial
 The number of iterations for in the most recent minimization.

Member Function Documentation

virtual int print_iter ( double  x,
double  y,
int  iter,
double  value = 0.0,
double  limit = 0.0,
std::string  comment = "" 
) [inline, virtual]

Print out iteration information.

Depending on the value of the variable verbose, this prints out the iteration information. If verbose=0, then no information is printed, while if verbose>1, then after each iteration, the present values of x and y are output to std::cout along with the iteration number. If verbose>=2 then each iteration waits for a character before continuing

Definition at line 112 of file root.h.


Field Documentation

double bracket_step

The stepsize for automatic bracketing (default $ 10^{-4} $).

If this is exactly zero, it will be reset to $ 10^{-4} $ by solve().

Definition at line 92 of file root.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page