vector delta(const vector& c) const
int constrain(vector& c) constReturns 1 if constraints were applied.
double mindumb( vector& c, // parameters (initial and optimised) const int maxits = 0, // maximum iterations (0: no limit) const int verbose = 0 // 1 for diagnostic output )Returns value of the objective function at the final parameter values (overwriting initial contents of c).
int bracket_minimum( const vector& x0, // initial position const vector& dx0, // initial change vector, pointing towards minimum vector& x1, // calculated position at one size of minimum vector& x2, // calculated position at other size of minimum vector& xint, // calculated position close to minimum const double stepscale = 1.0, // scaling factor for gradient vector const double stepfac = 1.5, // factor for changing step size (>1) const double stepmin = 1.0e-8, // minimum stepsize allowed const int maxits = 0, // maximum iterations allowed (0 => no limit) const int verbose = 0 // 1 for diagnostic output )Returns 1 on success, 0 if step size underflowed or reached maximum iterations.
int minimum_bisection( const vector& xa, // position at one side of minimum const vector& xb, // position at other side of minimum const vector& xint, // intermediate position vector& xmin, // position of minimum double& fmin, // function value at minimum const double tol = 1.0e-6, // desired position accuracy of minimum const int maxits = 0, // maximum iterations allowed (0 => no limit) const int verbose = 0 // 1 for diagnostic output )Returns 0 if reached maximum iterations.
jacob
to calculate df/dci.
int minsteep( vector& c, // parameters (initial and optimised) const double tol = 1.0e-6, // acceptable gradient tolerance const double stepscale = 1.0, // scaling factor for gradient vector const double stepfac = 1.5, // factor for changing step size (>1) const double stepmin = 1.0e-8 // minimum stepsize allowed const int maxits = 0, // maximum iterations allowed (0 => no limit) const int verbose = 0 // 1 for diagnostic output )Returns 0 on failure.
int minimum_cg( vector& x, // initial and optimised position const double acc = 1.0e-6, // desired position accuracy of minimum const double stepscale = 1.0, // scaling factor for gradient vector const double stepfac = 1.5, // factor for changing step size (>1) const double stepmin = 1.0e-8, // minimum stepsize allowed const int maxits = 0, // maximum iterations allowed (0 => no limit) const int verbose = 0 // 1 for diagnostic output )Returns 0 on failure.
Each concrete subclass requires control data. These are stored as internal parameters to objects in the class, rather than being passed each time an optimisation is performed. Defaults are set when an object of each concrete subclass is created.
The base class includes input and output methods for pointers. When the input method is used, a word is read from the input stream and compared against known subclass names; if a match is found, an instance of the subclass is created and its control data read. The output method writes the subclass name and then its control data.
int maxits; // maximum iterations (0 => no limit) default: 0 int verbose; // 0/1 for diagnostics off/on default: 0
I/O name: `dumb'.
double tol; // tolerance of minimum (spatial) default: 1.0e-7 double stepscale; // scaling factor for gradient vector default: 1.0 double stepfac; // factor for changing step size (>1) default: 1.5 double stepmin; // minimum stepsize allowed default: 1.0e-7 int maxits; // maximum iterations (0 => no limit) default: 0 int verbose; // 0/1 for diagnostics off/on default: 0
I/O name: `steepest_descent'.
double tol; // tolerance of minimum (spatial) default: 1.0e-7 double stepscale; // scaling factor for gradient vector default: 1.0 double stepfac; // factor for changing step size (>1) default: 1.5 double stepmin; // minimum stepsize allowed default: 1.0e-7 int maxits; // maximum iterations (0 => no limit) default: 0 int verbose; // 0/1 for diagnostics off/on default: 0
I/O name: `conjugate_gradient'.
double pseudotemp; // pseudo-temperature int nsteps; // global steps to take int verbose; // diagnostic options (0=off)
Additional parameters:
double decay; // decay rate for memory of previous results
If 0 < decay
< 1 then the algorithm will gradually
`forget' the results of previous calculations, concentrating on the
parameters which are most effective.
(If decay
> 1 then old results will be treated as more
important than new.)
Additional parameters:
int nset; // number in random set