Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields | Protected Attributes
gsl_root_brent< func_t > Class Template Reference

One-dimensional root-finding (GSL) More...

#include <gsl_root_brent.h>

Inheritance diagram for gsl_root_brent< func_t >:
root_bkt< func_t > root< func_t, func_t >

Detailed Description

template<class func_t = funct>
class gsl_root_brent< func_t >

This class finds the root of a user-specified function. If test_form is 0, 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.

An example demonstrating the usage of this class is given in examples/ex_fptr.cpp and the Function object example .

Idea for Future:
There is some duplication in the variables x_lower, x_upper, a, and b, which could be removed. Some better variable names would also be helpful.
Idea for Future:
Create a meaningful enum list for gsl_root_brent::test_form.

Definition at line 85 of file gsl_root_brent.h.

Public Member Functions

virtual const char * type ()
 Return the type, "gsl_root_brent".
int iterate (func_t &f)
 Perform an iteration.
virtual int solve_bkt (double &x1, double x2, func_t &f)
 Solve func in region $ x_1<x<x_2 $ returning $ x_1 $.
double get_root ()
 Get the most recent value of the root.
double get_lower ()
 Get the lower limit.
double get_upper ()
 Get the upper limit.
int set (func_t &ff, double lower, double upper)
 Set the information for the solver.

Data Fields

int test_form
 The type of convergence test applied: 0, 1, or 2 (default 0)

Protected Attributes

double root
 The present solution estimate.
double x_lower
 The present lower limit.
double x_upper
 The present upper limit.
Storage for solver state
double a
double b
double c
double d
double e
double fa
double fb
double fc

Member Function Documentation

template<class func_t = funct>
int gsl_root_brent< func_t >::iterate ( func_t &  f) [inline]

This function currently always returns gsl_success.

Definition at line 101 of file gsl_root_brent.h.

template<class func_t = funct>
int gsl_root_brent< func_t >::set ( func_t &  ff,
double  lower,
double  upper 
) [inline]

This function currently always returns gsl_success.

Definition at line 335 of file gsl_root_brent.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.