|
Bsoft
2.0.3
Bernard's software package
|
Structure used in the downhill simplex method. More...
#include <simplex2.h>
Public Member Functions | |
| Bsimplex2 () | |
| Bsimplex2 (long nv, long np, long nc, long n, vector< double > &ax, vector< double > &ay) | |
| Initializes a Bsimplex2 structure. More... | |
| void | parameters (long n, vector< double > &p) |
| void | parameter (long i, double p) |
| double | parameter (long i) |
| void | limits (long i, double vlo, double vhi) |
| void | limits_low (long n, vector< double > &p) |
| void | limits_high (long n, vector< double > &p) |
| void | constant (long i, double p) |
| double | constant (long i) |
| void | constants (long n, vector< double > &p) |
| double | run (long maxcycles, double tolerance, double(funk)(Bsimplex2 &)) |
| double | amotry (vector< double > &mp, vector< double > &R, long ihi, double fac, double(funk)(Bsimplex2 &)) |
Public Attributes | |
| long | nvar |
| long | nparam |
| long | nconstant |
| long | npoint |
| vector< double > | param |
| vector< double > | lo |
| vector< double > | hi |
| vector< double > | c |
| vector< double > | x |
| vector< double > | fx |
Structure used in the downhill simplex method.
Nelder and Mead downhill simplex method for generalized parameter fitting Adapted from Numerical Recipes, 2nd edition, Press et al. 1992 The structure is set up to accommodate any number of variables, parameters, constants and points. The structure is very flexible in the sense that only some fields are absolutely required and with a fixed meaning for the simplex method. The required fields are: nparam, param, lo, hi The other fields may be recast and used as desired in the user function. Intended sizes: param nparam. lo nparam. hi nparam. c nconstant. x npoint*nvar. fx npoint. x or fx can be recast as a different pointer, as long as it is handled by the user before calling kill_simplex.
Definition at line 42 of file simplex2.h.
|
inline |
Definition at line 55 of file simplex2.h.
| Bsimplex2::Bsimplex2 | ( | long | nv, |
| long | np, | ||
| long | nc, | ||
| long | n, | ||
| vector< double > & | ax, | ||
| vector< double > & | ay | ||
| ) |
Initializes a Bsimplex2 structure.
| nv | number of independent variables. |
| np | number of parameters to determine. |
| nc | number of constants. |
| n | number of points or function values. |
| ax | array of independent variables (nv*n). |
| ay | array of dependent variables (n). The minimum setup of the simplex structure requires a number of parameters greater than 0Reference: Press W.H. et al (1992) Numerical Recipes in C. |
Definition at line 33 of file simplex2.cpp.
| double Bsimplex2::amotry | ( | vector< double > & | mp, |
| vector< double > & | R, | ||
| long | ihi, | ||
| double | fac, | ||
| double(funk)(Bsimplex2 &) | |||
| ) |
Definition at line 229 of file simplex2.cpp.
|
inline |
Definition at line 69 of file simplex2.h.
|
inline |
Definition at line 70 of file simplex2.h.
|
inline |
Definition at line 71 of file simplex2.h.
|
inline |
Definition at line 62 of file simplex2.h.
|
inline |
Definition at line 66 of file simplex2.h.
|
inline |
Definition at line 63 of file simplex2.h.
|
inline |
Definition at line 60 of file simplex2.h.
|
inline |
Definition at line 61 of file simplex2.h.
|
inline |
Definition at line 57 of file simplex2.h.
| double Bsimplex2::run | ( | long | maxcycles, |
| double | tolerance, | ||
| double(funk)(Bsimplex2 &) | |||
| ) |
Definition at line 76 of file simplex2.cpp.
| vector<double> Bsimplex2::c |
Definition at line 51 of file simplex2.h.
| vector<double> Bsimplex2::fx |
Definition at line 53 of file simplex2.h.
| vector<double> Bsimplex2::hi |
Definition at line 50 of file simplex2.h.
| vector<double> Bsimplex2::lo |
Definition at line 49 of file simplex2.h.
| long Bsimplex2::nconstant |
Definition at line 46 of file simplex2.h.
| long Bsimplex2::nparam |
Definition at line 45 of file simplex2.h.
| long Bsimplex2::npoint |
Definition at line 47 of file simplex2.h.
| long Bsimplex2::nvar |
Definition at line 44 of file simplex2.h.
| vector<double> Bsimplex2::param |
Definition at line 48 of file simplex2.h.
| vector<double> Bsimplex2::x |
Definition at line 52 of file simplex2.h.