#include <minimize.h>
Definition at line 39 of file minimize.h.
Public Member Functions | |
minimize () | |
virtual | ~minimize () |
virtual int | print_iter (double x, double y, int iter, double value=0.0, double limit=0.0, std::string comment="") |
Print out iteration information. | |
virtual int | min (double &x, double &fmin, param_t &pa, func_t &func) |
Calculate the minimum min of func w.r.t 'x'. | |
virtual int | min_bkt (double &x2, double x1, double x3, double &fmin, param_t &pa, func_t &func) |
Calculate the minimum min of func with x2 bracketed between x1 and x3. | |
virtual int | min_de (double &x, double &fmin, param_t &pa, func_t &func, dfunc_t &df) |
Calculate the minimum min of func with derivative dfunc w.r.t 'x'. | |
virtual int | min_bkt_de (double &x2, double x1, double x3, double &fmin, param_t &pa, func_t &func, dfunc_t &df) |
Calculate the minimum min of func with derivative dfunc and x2 bracketed between x1 and x3. | |
virtual int | bracket (double &ax, double &bx, double &cx, double &fa, double &fb, double &fc, param_t &pa, func_t &func) |
Given ax and bx, bracket a minimum for function func . | |
virtual const char * | type () |
Return string denoting type ("minimize"). | |
Data Fields | |
int | verbose |
Output control. | |
int | ntrial |
Maximum number of iterations. | |
double | tolf |
The tolerance for the minimum function value. | |
double | tolx |
The tolerance for the location of the minimum. | |
int | last_ntrial |
The number of iterations for in the most recent minimization. |
virtual int print_iter | ( | double | x, | |
double | y, | |||
int | iter, | |||
double | value = 0.0 , |
|||
double | limit = 0.0 , |
|||
std::string | comment = "" | |||
) | [inline, virtual] |
Print out iteration information.
Depending on the value of the variable verbose, this prints out the iteration information. If verbose=0, then no information is printed, while if verbose>1, then after each iteration, the present values of x and y are output to std::cout along with the iteration number. If verbose>=2 then each iteration waits for a character.
Definition at line 78 of file minimize.h.
virtual int min | ( | double & | x, | |
double & | fmin, | |||
param_t & | pa, | |||
func_t & | func | |||
) | [inline, virtual] |
Calculate the minimum min
of func
w.r.t 'x'.
If this is not overloaded, it attempts to bracket the minimum using bracket() and then calls min_bkt() with the newly bracketed minimum.
Definition at line 109 of file minimize.h.
virtual int min_bkt | ( | double & | x2, | |
double | x1, | |||
double | x3, | |||
double & | fmin, | |||
param_t & | pa, | |||
func_t & | func | |||
) | [inline, virtual] |
Calculate the minimum min
of func
with x2 bracketed between x1 and x3.
If this is not overloaded, it ignores the bracket and calls min().
Reimplemented in cern_minimize, and gsl_min_brent.
Definition at line 122 of file minimize.h.
virtual int min_de | ( | double & | x, | |
double & | fmin, | |||
param_t & | pa, | |||
func_t & | func, | |||
dfunc_t & | df | |||
) | [inline, virtual] |
Calculate the minimum min
of func
with derivative dfunc
w.r.t 'x'.
If this is not overloaded, it attempts to bracket the minimum using bracket() and then calls min_bkt_de() with the newly bracketed minimum.
Definition at line 135 of file minimize.h.
virtual int min_bkt_de | ( | double & | x2, | |
double | x1, | |||
double | x3, | |||
double & | fmin, | |||
param_t & | pa, | |||
func_t & | func, | |||
dfunc_t & | df | |||
) | [inline, virtual] |
Calculate the minimum min
of func
with derivative dfunc
and x2 bracketed between x1 and x3.
If this is not overloaded, it ignores the bracket and calls min_de().
Definition at line 150 of file minimize.h.
virtual int bracket | ( | double & | ax, | |
double & | bx, | |||
double & | cx, | |||
double & | fa, | |||
double & | fb, | |||
double & | fc, | |||
param_t & | pa, | |||
func_t & | func | |||
) | [inline, virtual] |
Given ax and bx, bracket a minimum for function func
.
Upon success, fa=f(ax), fb=f(bx), and fc=f(cx) with fb<fa and fb<fc and ax<bx<cx.
Definition at line 167 of file minimize.h.