Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields | Protected Attributes
simple_jacobian< func_t, vec_t, mat_t, alloc_vec_t, alloc_t > Class Template Reference

Simple automatic Jacobian. More...

#include <jacobian.h>

Inheritance diagram for simple_jacobian< func_t, vec_t, mat_t, alloc_vec_t, alloc_t >:
jacobian< func_t, vec_t, mat_t > jac_funct< vec_t, mat_t >

Detailed Description

template<class func_t = mm_funct<>, class vec_t = ovector_base, class mat_t = omatrix_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
class simple_jacobian< func_t, vec_t, mat_t, alloc_vec_t, alloc_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}~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 gsl_mroot_hybrids class sets epsrel to GSL_SQRT_DBL_EPSILON in its constructor, but does not set epsmin to zero.

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

Definition at line 273 of file jacobian.h.

Public Member Functions

virtual int operator() (size_t nv, vec_t &x, vec_t &y, mat_t &jac)
 The operator()

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

alloc_t ao
 For memory allocation.
alloc_vec_t f
 Function values.
alloc_vec_t xx
 Function arguments.
size_t mem_size
 Size of allocated memory.

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.