primatologist-gpl
5.1.2
|
Newton's Method for optimization. More...
#include <primatologist/optimization/newton_decl.h>
Public Types | |
typedef O | Objective |
typedef L< O > | LineSearch |
typedef math::Matrix | Matrix |
typedef math::Vector | Vector |
Public Member Functions | |
Newton (const Objective &f=Objective(), const Vector &x=Vector()) | |
Newton (const Newton< O, L > &other) | |
~Newton () | |
Newton< O, L > & | operator= (const Newton< O, L > &other) |
void | setGamma (float gamma=0.1) |
void | setStopCriterion (const std::string &crit="absdiff") |
Can take values: More... | |
void | setStopValue (float epsilon=1E-5) |
void | setLineSearch (const LineSearch &l=LineSearch()) |
void | setMaximize (bool maximize=false) |
void | setMaxIterations (int n=- 1) |
void | setVerbose (int v=carto::verbose) |
void | setObjectiveFunction (const Objective &f) |
void | setPosition (const Vector &x=Vector()) |
float | gamma () const |
const std::string & | stopCriterion () const |
float | stopValue () const |
LineSearch & | lineSearch () |
bool | maximize () const |
int | maxIterations () const |
int | verbose () const |
const Vector & | position () const |
const Objective & | objectiveFunction () const |
Vector | execute () |
Protected Attributes | |
float | _gamma |
Fixed Gamma or initial gamma for line search. More... | |
Vector | _x |
position More... | |
Objective | _f |
objectiveFunction More... | |
LineSearch | _ls |
lineSearch More... | |
int | _verbose |
verbosity level More... | |
bool | _maximize |
maximize or minimize More... | |
int | _max_it |
maximum number of iterations More... | |
std::string | _crit |
stop criterion More... | |
float | _epsilon |
stop value More... | |
Newton's Method for optimization.
O | Objective function type. It should implement functions value(Vector), derivative(Vector) and hessian(Vector) |
L | [optional] Line search type. A line search method can be used to select the next position each time a search is found. This can be useful to avoid too small or too large steps. |
Definition at line 31 of file newton_decl.h.
typedef L<O> aims::Newton< O, L >::LineSearch |
Definition at line 38 of file newton_decl.h.
typedef math::Matrix aims::Newton< O, L >::Matrix |
Definition at line 39 of file newton_decl.h.
typedef O aims::Newton< O, L >::Objective |
Definition at line 37 of file newton_decl.h.
typedef math::Vector aims::Newton< O, L >::Vector |
Definition at line 40 of file newton_decl.h.
aims::Newton< O, L >::Newton | ( | const Objective & | f = Objective() , |
const Vector & | x = Vector() |
||
) |
Definition at line 23 of file newton_d.h.
References aims::Newton< O, L >::setGamma(), aims::Newton< O, L >::setLineSearch(), aims::Newton< O, L >::setMaximize(), aims::Newton< O, L >::setMaxIterations(), aims::Newton< O, L >::setStopCriterion(), aims::Newton< O, L >::setStopValue(), and aims::Newton< O, L >::setVerbose().
aims::Newton< O, L >::Newton | ( | const Newton< O, L > & | other | ) |
Definition at line 36 of file newton_d.h.
aims::Newton< O, L >::~Newton |
Definition at line 47 of file newton_d.h.
Newton< O, L >::Vector aims::Newton< O, L >::execute |
Definition at line 197 of file newton_d.h.
References aims::math::invert().
float aims::Newton< O, L >::gamma |
Definition at line 136 of file newton_d.h.
References aims::_gamma.
Newton< O, L >::LineSearch & aims::Newton< O, L >::lineSearch |
Definition at line 155 of file newton_d.h.
bool aims::Newton< O, L >::maximize |
Definition at line 161 of file newton_d.h.
int aims::Newton< O, L >::maxIterations |
Definition at line 167 of file newton_d.h.
const Newton< O, L >::Objective & aims::Newton< O, L >::objectiveFunction |
Definition at line 187 of file newton_d.h.
Newton< O, L > & aims::Newton< O, L >::operator= | ( | const Newton< O, L > & | other | ) |
Definition at line 52 of file newton_d.h.
References aims::Newton< O, L >::_f, aims::Newton< O, L >::_gamma, aims::_gamma, aims::Newton< O, L >::_ls, aims::Newton< O, L >::_max_it, aims::Newton< O, L >::_maximize, aims::Newton< O, L >::_verbose, and aims::Newton< O, L >::_x.
const Newton< O, L >::Vector & aims::Newton< O, L >::position |
Definition at line 180 of file newton_d.h.
void aims::Newton< O, L >::setGamma | ( | float | gamma = 0.1 | ) |
Definition at line 72 of file newton_d.h.
References aims::_gamma.
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setLineSearch | ( | const LineSearch & | l = LineSearch() | ) |
Definition at line 90 of file newton_d.h.
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setMaximize | ( | bool | maximize = false | ) |
Definition at line 99 of file newton_d.h.
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setMaxIterations | ( | int | n = - 1 | ) |
Definition at line 106 of file newton_d.h.
References max().
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setObjectiveFunction | ( | const Objective & | f | ) |
Definition at line 119 of file newton_d.h.
void aims::Newton< O, L >::setPosition | ( | const Vector & | x = Vector() | ) |
Definition at line 126 of file newton_d.h.
void aims::Newton< O, L >::setStopCriterion | ( | const std::string & | crit = "absdiff" | ) |
Can take values:
Definition at line 78 of file newton_d.h.
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setStopValue | ( | float | epsilon = 1E-5 | ) |
Definition at line 84 of file newton_d.h.
References epsilon().
Referenced by aims::Newton< O, L >::Newton().
void aims::Newton< O, L >::setVerbose | ( | int | v = carto::verbose | ) |
Definition at line 112 of file newton_d.h.
Referenced by aims::Newton< O, L >::Newton().
const std::string & aims::Newton< O, L >::stopCriterion |
Definition at line 142 of file newton_d.h.
float aims::Newton< O, L >::stopValue |
Definition at line 148 of file newton_d.h.
int aims::Newton< O, L >::verbose |
Definition at line 173 of file newton_d.h.
|
protected |
stop criterion
Definition at line 106 of file newton_decl.h.
|
protected |
stop value
Definition at line 107 of file newton_decl.h.
|
protected |
objectiveFunction
Definition at line 101 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
Fixed Gamma or initial gamma for line search.
Definition at line 99 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
lineSearch
Definition at line 102 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
maximum number of iterations
Definition at line 105 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
maximize or minimize
Definition at line 104 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
verbosity level
Definition at line 103 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().
|
protected |
position
Definition at line 100 of file newton_decl.h.
Referenced by aims::Newton< O, L >::operator=().