Index

C++ Code Documentation

math::minimize2

File: BASE/math/Minimize2.H

Finds minimum of a function f:R^n-->R^1
minimize2_gradient()
Finds minimum of a function f:R^n-->R^1
Adapted from Numerical Recipes in C, 2nd ed. sec. 10.6. (Gradient Method)
function
function to minimize
dfunction
gradient of 'function'
computes the gradient of f at x
y is function(x)
report:
after each line minimization, called with value
report(y, x)
minimize2_powell()
Finds minimum of a function f:R^n-->R^1
Adapted from Numerical Recipes in C, 2nd ed. sec. 10.4. (Powell's Method)
p: starting point
xi
initial directions
an array of 'dimension' vectors of dimension 'dimension'
iteration_maximum:
maximum allowaAble iterations (e.g. 100)
return value:
0: minimum found
!=0: minimum not found


public:
  • minimize2( uint dimension );
    constructor
  • virtual ~minimize2();
    destructor
  • void set_precision_goal( double x );
  • double get_precision_goal();
  • void set_accuracy_goal( double x );
  • double get_accuracy_goal();
  • void set_iteration_limit( uint x );
  • uint get_iteration_limit();
  • uint get_iteration_count();
  • void set_gradient_dt( double x );
  • double get_gradient_dt();
  • void set_powell_dt( double x );
  • double get_powell_dt();
  • int find_minimum_gradient_auto( base::vector<double> &x, double &y );
    minimize by the gradient method with an internally-provided gradient
  • int find_minimum_gradient( base::vector<double> &x, double &y );
    minimize by the gradient method with a user-provided gradient (not implemented)
  • int find_minimum_powell( base::vector<double> &x, double &y );
    minimize by powell's method
  • int find_minimum_powell( base::vector<double> &x, base::vector<base::vector<double> > &dx, double &y );
    minimize by powell's method (with dx)
protected:
  • virtual double function( base::vector<double> const &x ) = 0;
    function to minimize
  • virtual void dfunction( base::vector<double> &, base::vector<double> const &, double);
    gradient of function to minimize
  • virtual void report( double y, base::vector<double> const &x );
private:
  • void dfunction_auto( base::vector<double> &gradient, base::vector<double> const &x, double y);
  • int line_minimize( double &y, base::vector<double> &x, base::vector<double> &dx );
  • int bracket_minimum( double &ax, double &bx, double &cx, double &fa, double &fb, double &fc );
  • static inline void shift(double &a, double &b, double &c, double d);
  • double _precision_goal;
  • double _accuracy_goal;
  • uint _iteration_limit;
  • uint _iteration_count;
  • double _gradient_dt;
  • double _powell_dt;
  • uint _dimension;
  • base::vector<double> function_1dim_x;
  • base::vector<double> function_1dim_dx;
  • base::vector<double> function_1dim_tmp;
  • class minimize1_subclass : public minimize1;
  • minimize1_subclass minimize_1dim;
  • friend class minimize1_subclass;
  • static double const smallreal_double;
  • minimize2( minimize2 const & );
    Disabled copy constructor.
  • minimize2 &operator=( minimize2 const & );
    Disabled assignment operator.


math::minimize2 GANG