![]() |
Object-oriented Scientific Computing Library: Version 0.910
|
Multi-dimensional mroot-finding routine (CERNLIB) More...
#include <cern_mroot.h>
If denotes the current iteration, and
denotes the previous iteration, then the calculation is terminated if either of the following tests is successful
This routine treats the functions specified as a mm_funct object slightly differently than gsl_mroot_hybrids. First the equations should be numbered (as much as is possible) in order of increasing nonlinearity. Also, instead of calculating all of the equations on each function call, only the equation specified by the size_t
parameter needs to be calculated. If the equations are specified as
then when the size_t
argument is given as i
, then only the function needs to be calculated.
There is an example for the usage of the multidimensional solver classes given in examples/ex_mroot.cpp
, see Multi-dimensional solver .
Based on the CERNLIB routines RSNLEQ and DSNLEQ, which was based on More79 and More80 and is documented at http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/c201/top.html
Definition at line 92 of file cern_mroot.h.
Public Member Functions | |
int | get_info () |
Get the value of INFO from the last call to msolve() | |
std::string | get_info_string () |
Get the a string corresponding to the integer returned by cern_mroot::get_info(). | |
virtual const char * | type () |
Return the type, "cern_mroot" . | |
virtual int | msolve (size_t nvar, vec_t &x, func_t &func) |
Solve func using x as an initial guess, returning x . | |
Data Fields | |
int | maxf |
Maximum number of function evaluations. | |
double | scale |
The original scale parameter from CERNLIB (default 10.0) | |
double | eps |
The smallest floating point number (default ![]() | |
Protected Attributes | |
alloc_t | ao |
Memory allocator for objects of type alloc_vec_t . | |
umatrix | w |
Desc. | |
int | info |
Internal storage for the value of info . | |
int | mpt [289] |
Store the number of function evaluations. |
int cern_mroot< func_t, vec_t, alloc_vec_t, alloc_t, jfunc_t >::get_info | ( | ) | [inline] |
The value of info is assigned according to the following list. The values 1-8 are the standard behavior from CERNLIB. 0 - The function solve() has not been called. 1 - Test 1 was successful.
2 - Test 2 was successful.
3 - Both tests were successful.
4 - Number of iterations is greater than cern_mroot_root::maxf.
5 - Approximate (finite difference) Jacobian matrix is singular.
6 - Iterations are not making good progress.
7 - Iterations are diverging.
8 - Iterations are converging, but either cern_mroot_root::tol_abs is too small or the Jacobian is nearly singular or the variables are badly scaled.
9 - Either root::tol_rel or root::tol_abs is not greater than zero or the specified number of variables is .
The return values returned by msolve() corresponding to the values of INFO
above are 1 - gsl_success 2 - gsl_success 3 - gsl_success 4 - gsl_emaxiter 5 - gsl_esing 6 - gsl_enoprog 7 - gsl_erunaway 8 - gsl_efailed 9 - gsl_einval
Definition at line 165 of file cern_mroot.h.
int cern_mroot< func_t, vec_t, alloc_vec_t, alloc_t, jfunc_t >::maxf |
If , then
(which is the CERNLIB default) is used. The default value of
maxf
is zero which then implies the default from CERNLIB.
Definition at line 200 of file cern_mroot.h.
double cern_mroot< func_t, vec_t, alloc_vec_t, alloc_t, jfunc_t >::eps |
The original prescription from CERNLIB for eps
is given below:
#if !defined(CERNLIB_DOUBLE) PARAMETER (EPS = 0.84293 69702 17878 97282 52636 392E-07) #endif #if defined(CERNLIB_IBM) PARAMETER (EPS = 0.14901 16119 38476 562D-07) #endif #if defined(CERNLIB_VAX) PARAMETER (EPS = 0.37252 90298 46191 40625D-08) #endif #if (defined(CERNLIB_UNIX))&&(defined(CERNLIB_DOUBLE)) PARAMETER (EPS = 0.14901 16119 38476 600D-07) #endif
Definition at line 229 of file cern_mroot.h.
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).