ug4
ug::StandardLineSearch< TVector > Class Template Reference

standard implementation of the line search based on the "sufficient descent" More...

#include <line_search.h>

+ Inheritance diagram for ug::StandardLineSearch< TVector >:

Public Types

typedef TVector vector_type
 

Public Member Functions

virtual std::string config_string () const
 returns information about configuration parameters More...
 
virtual bool search (SmartPtr< IOperator< vector_type > > spOp, vector_type &u, vector_type &p, vector_type &d, number defect)
 
void set_accept_best (bool bAcceptBest)
 sets iff after max_steps the best try is used More...
 
void set_check_all (bool bCheckAll)
 sets iff all the max_steps line search steps must be tested even if the sufficient descent is achieved More...
 
void set_lambda_start (number start)
 sets start factor More...
 
void set_maximum_defect (number maxDef)
 sets maximum allowed norm of the defect (an exception is thrown if this value if exceeded) More...
 
void set_maximum_steps (int steps)
 sets maximum number of line search steps More...
 
virtual void set_offset (std::string offset)
 set string to be printed before each output of line search More...
 
void set_reduce_factor (number factor)
 sets factor by which line search factor is multiplied in each step More...
 
void set_suff_descent_factor (number factor)
 sets the factor controlling the sufficient descent More...
 
void set_verbose (bool level)
 sets if info should be printed More...
 
 StandardLineSearch ()
 default constructor (setting default values) More...
 
 StandardLineSearch (int maxSteps, number lambdaStart, number lambdaReduce, bool bAcceptBest)
 constructor More...
 
 StandardLineSearch (int maxSteps, number lambdaStart, number lambdaReduce, bool bAcceptBest, bool bCheckAll)
 constructor More...
 

Protected Attributes

number m_alpha
 sufficient descent factor More...
 
bool m_bAcceptBest
 accept best More...
 
bool m_bCheckAll
 check all More...
 
number m_lambdaReduce
 reduction factor for the step length More...
 
number m_lambdaStart
 initial step length scaling More...
 
number m_maxDefect
 maximum allowed defect More...
 
int m_maxSteps
 maximum number of steps to be performed More...
 
std::string m_offset
 number of spaces inserted before output More...
 
bool m_verbose
 verbosity level More...
 
vector_type s
 solution in line direction More...
 

Detailed Description

template<typename TVector>
class ug::StandardLineSearch< TVector >

standard implementation of the line search based on the "sufficient descent"

Member Typedef Documentation

◆ vector_type

template<typename TVector >
typedef TVector ug::StandardLineSearch< TVector >::vector_type

Constructor & Destructor Documentation

◆ StandardLineSearch() [1/3]

template<typename TVector >
ug::StandardLineSearch< TVector >::StandardLineSearch ( )
inline

default constructor (setting default values)

References new().

◆ StandardLineSearch() [2/3]

template<typename TVector >
ug::StandardLineSearch< TVector >::StandardLineSearch ( int  maxSteps,
number  lambdaStart,
number  lambdaReduce,
bool  bAcceptBest 
)
inline

constructor

References new().

◆ StandardLineSearch() [3/3]

template<typename TVector >
ug::StandardLineSearch< TVector >::StandardLineSearch ( int  maxSteps,
number  lambdaStart,
number  lambdaReduce,
bool  bAcceptBest,
bool  bCheckAll 
)
inline

constructor

References new().

Member Function Documentation

◆ config_string()

◆ search()

template<typename TVector >
virtual bool ug::StandardLineSearch< TVector >::search ( SmartPtr< IOperator< vector_type > >  spOp,
vector_type u,
vector_type p,
vector_type d,
number  defect 
)
inlinevirtual

◆ set_accept_best()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_accept_best ( bool  bAcceptBest)
inline

sets iff after max_steps the best try is used

References ug::StandardLineSearch< TVector >::m_bAcceptBest.

◆ set_check_all()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_check_all ( bool  bCheckAll)
inline

sets iff all the max_steps line search steps must be tested even if the sufficient descent is achieved

References ug::StandardLineSearch< TVector >::m_bCheckAll.

◆ set_lambda_start()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_lambda_start ( number  start)
inline

sets start factor

References ug::StandardLineSearch< TVector >::m_lambdaStart.

◆ set_maximum_defect()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_maximum_defect ( number  maxDef)
inline

sets maximum allowed norm of the defect (an exception is thrown if this value if exceeded)

References ug::StandardLineSearch< TVector >::m_maxDefect.

◆ set_maximum_steps()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_maximum_steps ( int  steps)
inline

sets maximum number of line search steps

References ug::StandardLineSearch< TVector >::m_maxSteps.

◆ set_offset()

template<typename TVector >
virtual void ug::StandardLineSearch< TVector >::set_offset ( std::string  offset)
inlinevirtual

set string to be printed before each output of line search

Implements ug::ILineSearch< TVector >.

References ug::StandardLineSearch< TVector >::m_offset.

◆ set_reduce_factor()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_reduce_factor ( number  factor)
inline

sets factor by which line search factor is multiplied in each step

References ug::StandardLineSearch< TVector >::m_lambdaReduce.

◆ set_suff_descent_factor()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_suff_descent_factor ( number  factor)
inline

sets the factor controlling the sufficient descent

References ug::StandardLineSearch< TVector >::m_alpha.

◆ set_verbose()

template<typename TVector >
void ug::StandardLineSearch< TVector >::set_verbose ( bool  level)
inline

sets if info should be printed

References ug::StandardLineSearch< TVector >::m_verbose.

Member Data Documentation

◆ m_alpha

template<typename TVector >
number ug::StandardLineSearch< TVector >::m_alpha
protected

◆ m_bAcceptBest

◆ m_bCheckAll

◆ m_lambdaReduce

template<typename TVector >
number ug::StandardLineSearch< TVector >::m_lambdaReduce
protected

◆ m_lambdaStart

template<typename TVector >
number ug::StandardLineSearch< TVector >::m_lambdaStart
protected

◆ m_maxDefect

template<typename TVector >
number ug::StandardLineSearch< TVector >::m_maxDefect
protected

◆ m_maxSteps

template<typename TVector >
int ug::StandardLineSearch< TVector >::m_maxSteps
protected

◆ m_offset

template<typename TVector >
std::string ug::StandardLineSearch< TVector >::m_offset
protected

number of spaces inserted before output

Referenced by ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_offset().

◆ m_verbose

template<typename TVector >
bool ug::StandardLineSearch< TVector >::m_verbose
protected

◆ s

template<typename TVector >
vector_type ug::StandardLineSearch< TVector >::s
protected

solution in line direction

Referenced by ug::StandardLineSearch< TVector >::search().


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