ROL
ROL::ROL::TypeU::LineSearchAlgorithm< Real > Class Template Reference

#include <ROL_Constraint_SerialSimOpt.hpp>

Inheritance diagram for ROL::ROL::TypeU::LineSearchAlgorithm< Real >:

Public Member Functions

 LineSearchAlgorithm (ParameterList &parlist, const Ptr< Secant< Real > > &secant=nullPtr, const Ptr< DescentDirection_U< Real > > &descent=nullPtr, const Ptr< LineSearch_U< Real > > &lineSearch=nullPtr)
 Constructor.
void initialize (const Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, std::ostream &outStream=std::cout)
void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, std::ostream &outStream=std::cout) override
 Run algorithm on unconstrained problems (Type-U). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method.
void writeHeader (std::ostream &os) const override
 Print iterate header.
void writeName (std::ostream &os) const override
 Print step name.
void writeOutput (std::ostream &os, bool print_header=false) const override
 Print iterate status.
Public Member Functions inherited from ROL::ROL::TypeU::Algorithm< Real >
virtual ~Algorithm ()
 Algorithm ()
 Constructor, given a step and a status test.
void setStatusTest (const Ptr< StatusTest< Real > > &status, bool combineStatus=false)
virtual void run (Problem< Real > &problem, std::ostream &outStream=std::cout)
 Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface.
virtual void run (Vector< Real > &x, Objective< Real > &obj, std::ostream &outStream=std::cout)
 Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface.
virtual void run (Vector< Real > &x, Objective< Real > &obj, Constraint< Real > &linear_con, Vector< Real > &linear_mul, std::ostream &outStream=std::cout)
 Run algorithm on unconstrained problems with explicit linear equality constraints (Type-U). This is the primary Type-U with explicit linear equality constraints interface.
virtual void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, Constraint< Real > &linear_con, Vector< Real > &linear_mul, const Vector< Real > &linear_c, std::ostream &outStream=std::cout)
 Run algorithm on unconstrained problems with explicit linear equality constraints (Type-U). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method.
virtual void writeExitStatus (std::ostream &os) const
Ptr< const AlgorithmState< Real > > getState () const
void reset ()

Private Attributes

Ptr< DescentDirection_U< Real > > desc_
 Unglobalized step object.
Ptr< LineSearch_U< Real > > lineSearch_
 Line-search object.
EDescentU edesc_
 enum determines type of descent direction
ELineSearchU els_
 enum determines type of line search
ECurvatureConditionU econd_
 enum determines type of curvature condition
bool acceptLastAlpha_
 For backwards compatibility. When max function evaluations are reached take last step.
bool usePreviousAlpha_
 If true, use the previously accepted step length (if any) as the new initial step length.
int verbosity_
bool printHeader_
int ls_nfval_
int ls_ngrad_
int SPflag_
int SPiter_
std::string lineSearchName_
std::string descentName_

Additional Inherited Members

Protected Member Functions inherited from ROL::ROL::TypeU::Algorithm< Real >
void initialize (const Vector< Real > &x, const Vector< Real > &g)
Protected Attributes inherited from ROL::ROL::TypeU::Algorithm< Real >
const Ptr< CombinedStatusTest< Real > > status_
const Ptr< AlgorithmState< Real > > state_

Detailed Description

template<class Real>
class ROL::ROL::TypeU::LineSearchAlgorithm< Real >

Definition at line 101 of file ROL_Constraint_SerialSimOpt.hpp.

Constructor & Destructor Documentation

◆ LineSearchAlgorithm()

template<typename Real>
ROL::TypeU::LineSearchAlgorithm< Real >::LineSearchAlgorithm ( ParameterList & parlist,
const Ptr< Secant< Real > > & secant = nullPtr,
const Ptr< DescentDirection_U< Real > > & descent = nullPtr,
const Ptr< LineSearch_U< Real > > & lineSearch = nullPtr )

Constructor.

Standard constructor to build a LineSearchStep object. Algorithmic specifications are passed in through a ROL::ParameterList. The line-search type, secant type, Krylov type, or nonlinear CG type can be set using user-defined objects.

Parameters
[in]parlistis a parameter list containing algorithmic specifications
[in]lineSearchis a user-defined descent direction object
[in]lineSearchis a user-defined line search object

Definition at line 54 of file ROL_TypeU_LineSearchAlgorithm_Def.hpp.

References acceptLastAlpha_, ROL::ROL::TypeU::Algorithm< Real >::Algorithm(), ROL::ROL::CURVATURECONDITION_U_WOLFE, desc_, ROL::ROL::DESCENT_U_USERDEFINED, ROL::DescentDirectionUFactory(), descentName_, econd_, edesc_, els_, lineSearch_, ROL::ROL::LINESEARCH_U_USERDEFINED, lineSearchName_, ROL::LineSearchUFactory(), printHeader_, ROL::ROL::TypeU::Algorithm< Real >::status_, ROL::StringToECurvatureConditionU(), ROL::StringToEDescentU(), ROL::StringToELineSearchU(), and verbosity_.

Member Function Documentation

◆ initialize()

◆ run()

template<typename Real>
void ROL::TypeU::LineSearchAlgorithm< Real >::run ( Vector< Real > & x,
const Vector< Real > & g,
Objective< Real > & obj,
std::ostream & outStream = std::cout )
overridevirtual

◆ writeHeader()

template<typename Real>
void ROL::TypeU::LineSearchAlgorithm< Real >::writeHeader ( std::ostream & os) const
overridevirtual

Print iterate header.

Reimplemented from ROL::ROL::TypeU::Algorithm< Real >.

Definition at line 172 of file ROL_TypeU_LineSearchAlgorithm_Def.hpp.

References ROL::ROL::DESCENT_U_NEWTONKRYLOV, descentName_, edesc_, and verbosity_.

Referenced by writeOutput().

◆ writeName()

template<typename Real>
void ROL::TypeU::LineSearchAlgorithm< Real >::writeName ( std::ostream & os) const
overridevirtual

Print step name.

Reimplemented from ROL::ROL::TypeU::Algorithm< Real >.

Definition at line 213 of file ROL_TypeU_LineSearchAlgorithm_Def.hpp.

References desc_, econd_, ROL::ECurvatureConditionUToString(), and lineSearchName_.

Referenced by writeOutput().

◆ writeOutput()

template<typename Real>
void ROL::TypeU::LineSearchAlgorithm< Real >::writeOutput ( std::ostream & os,
bool write_header = false ) const
overridevirtual

Member Data Documentation

◆ desc_

template<class Real>
Ptr<DescentDirection_U<Real> > ROL::ROL::TypeU::LineSearchAlgorithm< Real >::desc_
private

Unglobalized step object.

Definition at line 104 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by initialize(), LineSearchAlgorithm(), run(), and writeName().

◆ lineSearch_

template<class Real>
Ptr<LineSearch_U<Real> > ROL::ROL::TypeU::LineSearchAlgorithm< Real >::lineSearch_
private

Line-search object.

Definition at line 105 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by initialize(), LineSearchAlgorithm(), and run().

◆ edesc_

template<class Real>
EDescentU ROL::ROL::TypeU::LineSearchAlgorithm< Real >::edesc_
private

enum determines type of descent direction

Definition at line 107 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), writeHeader(), and writeOutput().

◆ els_

template<class Real>
ELineSearchU ROL::ROL::TypeU::LineSearchAlgorithm< Real >::els_
private

enum determines type of line search

Definition at line 108 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm().

◆ econd_

template<class Real>
ECurvatureConditionU ROL::ROL::TypeU::LineSearchAlgorithm< Real >::econd_
private

enum determines type of curvature condition

Definition at line 109 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), and writeName().

◆ acceptLastAlpha_

template<class Real>
bool ROL::ROL::TypeU::LineSearchAlgorithm< Real >::acceptLastAlpha_
private

For backwards compatibility. When max function evaluations are reached take last step.

Definition at line 111 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), and run().

◆ usePreviousAlpha_

template<class Real>
bool ROL::ROL::TypeU::LineSearchAlgorithm< Real >::usePreviousAlpha_
private

If true, use the previously accepted step length (if any) as the new initial step length.

Definition at line 113 of file ROL_Constraint_SerialSimOpt.hpp.

◆ verbosity_

template<class Real>
int ROL::ROL::TypeU::LineSearchAlgorithm< Real >::verbosity_
private

Definition at line 115 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), run(), and writeHeader().

◆ printHeader_

template<class Real>
bool ROL::ROL::TypeU::LineSearchAlgorithm< Real >::printHeader_
private

Definition at line 116 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), and run().

◆ ls_nfval_

template<class Real>
int ROL::ROL::TypeU::LineSearchAlgorithm< Real >::ls_nfval_
private

Definition at line 117 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by run(), and writeOutput().

◆ ls_ngrad_

template<class Real>
int ROL::ROL::TypeU::LineSearchAlgorithm< Real >::ls_ngrad_
private

Definition at line 117 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by run(), and writeOutput().

◆ SPflag_

template<class Real>
int ROL::ROL::TypeU::LineSearchAlgorithm< Real >::SPflag_
private

Definition at line 118 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by run(), and writeOutput().

◆ SPiter_

template<class Real>
int ROL::ROL::TypeU::LineSearchAlgorithm< Real >::SPiter_
private

Definition at line 118 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by run(), and writeOutput().

◆ lineSearchName_

template<class Real>
std::string ROL::ROL::TypeU::LineSearchAlgorithm< Real >::lineSearchName_
private

Definition at line 120 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), and writeName().

◆ descentName_

template<class Real>
std::string ROL::ROL::TypeU::LineSearchAlgorithm< Real >::descentName_
private

Definition at line 120 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by LineSearchAlgorithm(), and writeHeader().


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