#include <lnsrch.hh>
Inheritance diagram for RVLUmin::LineSearchAlg< Scalar >:
Public Member Functions | |
LineSearchAlg (Scalar _firststep=numeric_limits< Scalar >::max(), Scalar _minsteptol=numeric_limits< Scalar >::epsilon()) | |
constructor: | |
LineSearchAlg (LineSearchAlg< Scalar > const &lsh) | |
~LineSearchAlg () | |
void | initialize (FunctionalEvaluation< Scalar > &fx, Vector< Scalar > const &dx) |
this method makes this class an abstract factory | |
void | run () |
run whatever you've got, then record step actually taken | |
bool | query () |
query functions | |
Scalar | getStep () const |
Scalar | getBaseValue () const |
Vector< Scalar > const & | getBasePoint () const |
Vector< Scalar > const & | getBaseGradient () const |
Vector< Scalar > & | getTrialPoint () const |
Vector< Scalar > const & | getSearchDirection () const |
FunctionalEvaluation< Scalar > & | getFunctionalEvaluation () const |
Scalar | getMinStep () const |
Checks that the step is not senselessly small. | |
Protected Member Functions | |
virtual LineSearchAlgBase< Scalar > * | build (FunctionalEvaluation< Scalar > &fx, Vector< Scalar > const &dx, Scalar firststep)=0 |
Protected initialization - to be supplied by subclass. |
Instantiates its captive LineSearchAlgBase data member via protected pure virtual constructor (build(...)), and implements run() by delegation to this internal Alg. Also manages two key items:
Definition at line 160 of file lnsrch.hh.
RVLUmin::LineSearchAlg< Scalar >::LineSearchAlg | ( | Scalar | _firststep = numeric_limits<Scalar>::max() , |
|
Scalar | _minsteptol = numeric_limits<Scalar>::epsilon() | |||
) |
RVLUmin::LineSearchAlg< Scalar >::LineSearchAlg | ( | LineSearchAlg< Scalar > const & | lsh | ) |
RVLUmin::LineSearchAlg< Scalar >::~LineSearchAlg | ( | ) |
virtual LineSearchAlgBase<Scalar>* RVLUmin::LineSearchAlg< Scalar >::build | ( | FunctionalEvaluation< Scalar > & | fx, | |
Vector< Scalar > const & | dx, | |||
Scalar | firststep | |||
) | [protected, pure virtual] |
Protected initialization - to be supplied by subclass.
Note that LSAlgBase class is responsible for sensibly extracting an initial step from the firststep arg, which is initially the max Scalar, then the step actually taken in the last successful line search.
Implemented in RVLUmin::BacktrackingLineSearchAlg< Scalar >.
Referenced by RVLUmin::LineSearchAlg< Scalar >::initialize().
void RVLUmin::LineSearchAlg< Scalar >::initialize | ( | FunctionalEvaluation< Scalar > & | fx, | |
Vector< Scalar > const & | dx | |||
) |
this method makes this class an abstract factory
Definition at line 197 of file lnsrch.hh.
References RVLUmin::LineSearchAlg< Scalar >::build().
void RVLUmin::LineSearchAlg< Scalar >::run | ( | ) | [virtual] |
bool RVLUmin::LineSearchAlg< Scalar >::query | ( | ) | [virtual] |
Scalar RVLUmin::LineSearchAlg< Scalar >::getStep | ( | ) | const |
Scalar RVLUmin::LineSearchAlg< Scalar >::getBaseValue | ( | ) | const |
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getBasePoint | ( | ) | const |
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getBaseGradient | ( | ) | const |
Vector<Scalar>& RVLUmin::LineSearchAlg< Scalar >::getTrialPoint | ( | ) | const |
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getSearchDirection | ( | ) | const |
FunctionalEvaluation<Scalar>& RVLUmin::LineSearchAlg< Scalar >::getFunctionalEvaluation | ( | ) | const |
Scalar RVLUmin::LineSearchAlg< Scalar >::getMinStep | ( | ) | const |
Checks that the step is not senselessly small.
Size of step times direction vector is measured either relative to the length of the current iterate, if the latter is nonzero, or absolutely if the current iterate happens to be the zero vector. In either case returns true if stepsize is greater than this measure, else false.