All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Data Fields | Protected Attributes
o2scl::jacobian_gsl< func_t, vec_t, mat_t > Class Template Reference

Simple automatic Jacobian. More...

Detailed Description

template<class func_t = mm_funct11, class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
class o2scl::jacobian_gsl< func_t, vec_t, mat_t >

This class computes a numerical Jacobian by finite differencing. The stepsize is chosen to be $ h_j = \mathrm{epsrel}~x_j $ or $ h_j = \mathrm{epsmin} $ if $ \mathrm{epsrel}\times x_j < \mathrm{epsmin} $.

This is nearly equivalent to the GSL method for computing Jacobians as in multiroots/fdjac.c. To obtain the GSL behavior, set epsrel to GSL_SQRT_DBL_EPSILON and set epsmin to zero. The mroot_hybrids and chi_fit_funct classes set epsrel to GSL_SQRT_DBL_EPSILON in their constructor in order to partially mimic the GSL behavior, but do not set epsmin to zero.

This class does not separately check the vector and matrix sizes to ensure they are commensurate.

Default template arguments

Definition at line 126 of file jacobian.h.

#include <jacobian.h>

Inheritance diagram for o2scl::jacobian_gsl< func_t, vec_t, mat_t >:
o2scl::jacobian< func_t, vec_t, mat_t >

Public Member Functions

virtual int operator() (size_t nx, vec_t &x, size_t ny, vec_t &y, mat_t &jac)
 The operator()
 
- Public Member Functions inherited from o2scl::jacobian< func_t, vec_t, mat_t >
virtual int set_function (func_t &f)
 Set the function to compute the Jacobian of.
 

Data Fields

double epsrel
 The relative stepsize for finite-differencing (default $ 10^{-4} $ )
 
double epsmin
 The minimum stepsize (default $ 10^{-15} $)
 
bool err_nonconv
 If true, call the error handler if the routine does not "converge".
 

Protected Attributes

vec_t f
 Function values.
 
vec_t xx
 Function arguments.
 
size_t mem_size_x
 Size of allocated memory in x.
 
size_t mem_size_y
 Size of allocated memory in y.
 
- Protected Attributes inherited from o2scl::jacobian< func_t, vec_t, mat_t >
func_t func
 A pointer to the user-specified function.
 

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

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..