ug4
|
standard implementation of the line search based on the "sufficient descent" More...
#include <line_search.h>
Public Types | |
typedef TVector | vector_type |
Public Types inherited from ug::ILineSearch< TVector > | |
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... | |
Public Member Functions inherited from ug::ILineSearch< TVector > | |
virtual | ~ILineSearch () |
virtual destructor 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... | |
standard implementation of the line search based on the "sufficient descent"
typedef TVector ug::StandardLineSearch< TVector >::vector_type |
|
inline |
default constructor (setting default values)
|
inline |
constructor
|
inline |
constructor
|
inlinevirtual |
returns information about configuration parameters
Implements ug::ILineSearch< TVector >.
References ug::StandardLineSearch< TVector >::m_bAcceptBest, ug::StandardLineSearch< TVector >::m_bCheckAll, ug::StandardLineSearch< TVector >::m_lambdaReduce, ug::StandardLineSearch< TVector >::m_lambdaStart, and ug::StandardLineSearch< TVector >::m_maxSteps.
|
inlinevirtual |
Performs a line search to a given direction.
[in] | Op | Non-linear operator |
[in] | u | current solution |
[in] | p | search direction |
[in,out] | d | defect |
[in] | defect | norm of current defect |
Implements ug::ILineSearch< TVector >.
References ug::StandardLineSearch< TVector >::m_alpha, ug::StandardLineSearch< TVector >::m_bAcceptBest, ug::StandardLineSearch< TVector >::m_bCheckAll, ug::StandardLineSearch< TVector >::m_lambdaReduce, ug::StandardLineSearch< TVector >::m_lambdaStart, ug::StandardLineSearch< TVector >::m_maxDefect, ug::StandardLineSearch< TVector >::m_maxSteps, ug::StandardLineSearch< TVector >::m_offset, ug::StandardLineSearch< TVector >::m_verbose, p, PROFILE_BEGIN_GROUP, ug::StandardLineSearch< TVector >::s, UG_LOG, and ug::VecScaleAdd().
|
inline |
sets iff after max_steps the best try is used
References ug::StandardLineSearch< TVector >::m_bAcceptBest.
|
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.
|
inline |
sets start factor
References ug::StandardLineSearch< TVector >::m_lambdaStart.
|
inline |
sets maximum allowed norm of the defect (an exception is thrown if this value if exceeded)
References ug::StandardLineSearch< TVector >::m_maxDefect.
|
inline |
sets maximum number of line search steps
References ug::StandardLineSearch< TVector >::m_maxSteps.
|
inlinevirtual |
set string to be printed before each output of line search
Implements ug::ILineSearch< TVector >.
References ug::StandardLineSearch< TVector >::m_offset.
|
inline |
sets factor by which line search factor is multiplied in each step
References ug::StandardLineSearch< TVector >::m_lambdaReduce.
|
inline |
sets the factor controlling the sufficient descent
References ug::StandardLineSearch< TVector >::m_alpha.
|
inline |
sets if info should be printed
References ug::StandardLineSearch< TVector >::m_verbose.
|
protected |
sufficient descent factor
Referenced by ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_suff_descent_factor().
|
protected |
|
protected |
|
protected |
reduction factor for the step length
Referenced by ug::StandardLineSearch< TVector >::config_string(), ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_reduce_factor().
|
protected |
initial step length scaling
Referenced by ug::StandardLineSearch< TVector >::config_string(), ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_lambda_start().
|
protected |
maximum allowed defect
Referenced by ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_maximum_defect().
|
protected |
maximum number of steps to be performed
Referenced by ug::StandardLineSearch< TVector >::config_string(), ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_maximum_steps().
|
protected |
number of spaces inserted before output
Referenced by ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_offset().
|
protected |
verbosity level
Referenced by ug::StandardLineSearch< TVector >::search(), and ug::StandardLineSearch< TVector >::set_verbose().
|
protected |
solution in line direction
Referenced by ug::StandardLineSearch< TVector >::search().