OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
QuantLib::LineSearch Class Referenceabstract

Base class for line search. More...

#include <LineSearch.hpp>

+ Inheritance diagram for QuantLib::LineSearch:

Public Member Functions

 LineSearch (RealType=0.0)
 Default constructor.
 
virtual ~LineSearch ()
 Destructor.
 
const DynamicVector< RealType > & lastX ()
 return last x value
 
RealType lastFunctionValue ()
 return last objective function value
 
const DynamicVector< RealType > & lastGradient ()
 return last gradient
 
RealType lastGradientNorm2 ()
 return square norm of last gradient
 
bool succeed ()
 
virtual RealType operator() (Problem &P, EndCriteria::Type &ecType, const EndCriteria &, const RealType t_ini)=0
 Perform line search.
 
RealType update (DynamicVector< RealType > &params, const DynamicVector< RealType > &direction, RealType beta, const Constraint &constraint)
 
const DynamicVector< RealType > & searchDirection () const
 current value of the search direction
 
DynamicVector< RealType > & searchDirection ()
 

Protected Attributes

DynamicVector< RealType > searchDirection_
 current values of the search direction
 
DynamicVector< RealType > xtd_
 new x and its gradient
 
DynamicVector< RealType > gradient_
 
RealType qt_
 objective function value and gradient norm corresponding to xtd_
 
RealType qpt_
 
bool succeed_
 flag to know if linesearch succeed
 

Detailed Description

Base class for line search.

Definition at line 39 of file LineSearch.hpp.

Constructor & Destructor Documentation

◆ LineSearch()

QuantLib::LineSearch::LineSearch ( RealType = 0.0)
inlineexplicit

Default constructor.

Definition at line 42 of file LineSearch.hpp.

◆ ~LineSearch()

virtual QuantLib::LineSearch::~LineSearch ( )
inlinevirtual

Destructor.

Definition at line 44 of file LineSearch.hpp.

Member Function Documentation

◆ lastFunctionValue()

RealType QuantLib::LineSearch::lastFunctionValue ( )
inline

return last objective function value

Definition at line 49 of file LineSearch.hpp.

References qt_.

◆ lastGradient()

const DynamicVector< RealType > & QuantLib::LineSearch::lastGradient ( )
inline

return last gradient

Definition at line 51 of file LineSearch.hpp.

◆ lastGradientNorm2()

RealType QuantLib::LineSearch::lastGradientNorm2 ( )
inline

return square norm of last gradient

Definition at line 53 of file LineSearch.hpp.

◆ lastX()

const DynamicVector< RealType > & QuantLib::LineSearch::lastX ( )
inline

return last x value

Definition at line 47 of file LineSearch.hpp.

References xtd_.

◆ operator()()

virtual RealType QuantLib::LineSearch::operator() ( Problem & P,
EndCriteria::Type & ecType,
const EndCriteria & ,
const RealType t_ini )
pure virtual

Perform line search.

Implemented in QuantLib::ArmijoLineSearch.

◆ searchDirection() [1/2]

DynamicVector< RealType > & QuantLib::LineSearch::searchDirection ( )
inline

Definition at line 70 of file LineSearch.hpp.

◆ searchDirection() [2/2]

const DynamicVector< RealType > & QuantLib::LineSearch::searchDirection ( ) const
inline

current value of the search direction

Definition at line 67 of file LineSearch.hpp.

References searchDirection_.

◆ succeed()

bool QuantLib::LineSearch::succeed ( )
inline

Definition at line 55 of file LineSearch.hpp.

◆ update()

RealType QuantLib::LineSearch::update ( DynamicVector< RealType > & params,
const DynamicVector< RealType > & direction,
RealType beta,
const Constraint & constraint )

Definition at line 30 of file LineSearch.cpp.

Member Data Documentation

◆ gradient_

DynamicVector<RealType> QuantLib::LineSearch::gradient_
protected

Definition at line 76 of file LineSearch.hpp.

◆ qpt_

RealType QuantLib::LineSearch::qpt_
protected

Definition at line 78 of file LineSearch.hpp.

◆ qt_

RealType QuantLib::LineSearch::qt_
protected

objective function value and gradient norm corresponding to xtd_

Definition at line 78 of file LineSearch.hpp.

Referenced by lastFunctionValue(), and QuantLib::ArmijoLineSearch::operator()().

◆ searchDirection_

DynamicVector<RealType> QuantLib::LineSearch::searchDirection_
protected

current values of the search direction

Definition at line 74 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()(), and searchDirection().

◆ succeed_

bool QuantLib::LineSearch::succeed_
protected

flag to know if linesearch succeed

Definition at line 80 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ xtd_

DynamicVector<RealType> QuantLib::LineSearch::xtd_
protected

new x and its gradient

Definition at line 76 of file LineSearch.hpp.

Referenced by lastX(), and QuantLib::ArmijoLineSearch::operator()().


The documentation for this class was generated from the following files: