Bsimplex(3)

NAME
Bsimplex - Structure used in the downhill simplex method.

SYNOPSIS

#include <simplex.h>

  Public Member Functions
Bsimplex ()
Bsimplex (long nv, long np, long nc, long n, vector< double > &ax, vector< double > &ay)
Initializes a Bsimplex structure.
long variables ()
long constants ()
double constant (long i)
void constant (long i, double p)
void constants (long n, vector< double > &p)
long points ()
long parameters ()
void parameters (long n, vector< double > &p)
void parameter (long i, double p)
double parameter (long i)
void limit_low (long i, double v)
double limit_low (long i)
void limit_high (long i, double v)
double limit_high (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)
vector< double > & independent_values ()
vector< double > & dependent_values ()
double run (long maxcycles, double tolerance, double(funk)(Bsimplex &))
double amotry (vector< double > &mp, vector< double > &R, long ihi, double fac, double(funk)(Bsimplex &))

Detailed Description

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 simplex.h.

Constructor & Destructor Documentation

  Bsimplex::Bsimplex () [inline]

Definition at line 55 of file simplex.h.

  Bsimplex::Bsimplex (long nv, long np, long nc, long n, vector< double > & ax, vector< double > & ay)

Initializes a Bsimplex structure.

Parameters:
    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 0

     Reference: Press W.H. et al (1992) Numerical Recipes in C.

Definition at line 33 of file simplex.cpp.

Member Function Documentation

  double Bsimplex::amotry (vector< double > & mp, vector< double > & R, long ihi, double fac, double(funk)(Bsimplex &))

Definition at line 226 of file simplex.cpp.

  double Bsimplex::constant (long i) [inline]

Definition at line 59 of file simplex.h.

  void Bsimplex::constant (long i, double p) [inline]

Definition at line 60 of file simplex.h.

  long Bsimplex::constants () [inline]

Definition at line 58 of file simplex.h.

  void Bsimplex::constants (long n, vector< double > & p) [inline]

Definition at line 61 of file simplex.h.

  vector<double>& Bsimplex::dependent_values () [inline]

Definition at line 83 of file simplex.h.

  vector<double>& Bsimplex::independent_values () [inline]

Definition at line 82 of file simplex.h.

  void Bsimplex::limit_high (long i, double v) [inline]

Definition at line 73 of file simplex.h.

  double Bsimplex::limit_high (long i) [inline]

Definition at line 74 of file simplex.h.

  void Bsimplex::limit_low (long i, double v) [inline]

Definition at line 71 of file simplex.h.

  double Bsimplex::limit_low (long i) [inline]

Definition at line 72 of file simplex.h.

  void Bsimplex::limits (long i, double vlo, double vhi) [inline]

Definition at line 75 of file simplex.h.

  void Bsimplex::limits_high (long n, vector< double > & p) [inline]

Definition at line 79 of file simplex.h.

  void Bsimplex::limits_low (long n, vector< double > & p) [inline]

Definition at line 76 of file simplex.h.

  void Bsimplex::parameter (long i, double p) [inline]

Definition at line 69 of file simplex.h.

  double Bsimplex::parameter (long i) [inline]

Definition at line 70 of file simplex.h.

  long Bsimplex::parameters () [inline]

Definition at line 65 of file simplex.h.

  void Bsimplex::parameters (long n, vector< double > & p) [inline]

Definition at line 66 of file simplex.h.

  long Bsimplex::points () [inline]

Definition at line 64 of file simplex.h.

  double Bsimplex::run (long maxcycles, double tolerance, double(funk)(Bsimplex &))

Definition at line 76 of file simplex.cpp.

  long Bsimplex::variables () [inline]

Definition at line 57 of file simplex.h.

Author

Generated automatically by Doxygen for Bsoft from the source code.