ROL
ROL::TypeB::LSecantBAlgorithm< Real > Class Template Reference

Provides an interface to run the line-search algorithm of Byrd, Lu, Nocedal and Zhu (similar to L-BFGS-B). More...

#include <ROL_TypeB_LSecantBAlgorithm.hpp>

Inheritance diagram for ROL::TypeB::LSecantBAlgorithm< Real >:

Public Member Functions

 LSecantBAlgorithm (ParameterList &list, const Ptr< Secant< Real > > &secant=nullPtr)
void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout) override
 Run algorithm on bound constrained problems (Type-B). 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, const bool write_header=false) const override
 Print iterate status.
Public Member Functions inherited from ROL::TypeB::Algorithm< Real >
virtual ~Algorithm ()
 Algorithm ()
 Constructor, given a step and a status test.
void setStatusTest (const Ptr< StatusTest< Real > > &status, const bool combineStatus=false)
virtual void run (Problem< Real > &problem, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems (Type-B). This is the primary Type-B interface.
virtual void run (Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems (Type-B). This is the primary Type-B interface.
virtual void run (Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_econ, Vector< Real > &linear_emul, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). This is the primary Type-B with explicit linear constraints interface.
virtual void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_econ, Vector< Real > &linear_emul, const Vector< Real > &linear_eres, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method.
virtual void run (Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_icon, Vector< Real > &linear_imul, BoundConstraint< Real > &linear_ibnd, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). This is the primary Type-B with explicit linear constraints interface.
virtual void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_icon, Vector< Real > &linear_imul, BoundConstraint< Real > &linear_ibnd, const Vector< Real > &linear_ires, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method.
virtual void run (Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_econ, Vector< Real > &linear_emul, Constraint< Real > &linear_icon, Vector< Real > &linear_imul, BoundConstraint< Real > &linear_ibnd, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). This is the primary Type-B with explicit linear constraints interface.
virtual void run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, Constraint< Real > &linear_econ, Vector< Real > &linear_emul, const Vector< Real > &linear_eres, Constraint< Real > &linear_icon, Vector< Real > &linear_imul, BoundConstraint< Real > &linear_ibnd, const Vector< Real > &linear_ires, std::ostream &outStream=std::cout)
 Run algorithm on bound constrained problems with explicit linear constraints (Type-B). 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 Member Functions

void initialize (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
Real dgpstep (Vector< Real > &s, const Vector< Real > &w, const Vector< Real > &x, const Real alpha, std::ostream &outStream=std::cout) const
Real dcauchy (Vector< Real > &s, Real &alpha, Real &q, const Vector< Real > &x, const Vector< Real > &g, Secant< Real > &secant, Vector< Real > &dwa, Vector< Real > &dwa1, std::ostream &outStream=std::cout)
Real dsrch (Vector< Real > &x, Vector< Real > &s, Real &fnew, Real &beta, Real fold, Real gs, Objective< Real > &obj, Vector< Real > &pwa, std::ostream &outStream=std::cout)
Real dpcg (Vector< Real > &w, int &iflag, int &iter, const Vector< Real > &g, const Vector< Real > &x, Secant< Real > &secant, BoundConstraint< Real > &bnd, const Real tol, const Real stol, const int itermax, Vector< Real > &p, Vector< Real > &q, Vector< Real > &r, Vector< Real > &t, Vector< Real > &pwa, Vector< Real > &dwa, std::ostream &outStream=std::cout) const
void applyFreeHessian (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Secant< Real > &secant, BoundConstraint< Real > &bnd, Real &tol, Vector< Real > &pwa) const
void applyFreePrecond (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Secant< Real > &secant, BoundConstraint< Real > &bnd, Real &tol, Vector< Real > &dwa, Vector< Real > &pwa) const

Private Attributes

int SPflag_
 Subproblem solver termination flag.
int SPiter_
 Subproblem solver iteration count.
ESecant esec_
 Secant type (default: Limited-Memory BFGS).
bool useSecantPrecond_
 Flag to use secant as a preconditioner (default: false).
bool useSecantHessVec_
 Flag to use secant as Hessian (default: false).
Ptr< Secant< Real > > secant_
 Secant object.
Real tol1_
 Absolute tolerance for truncated CG (default: 1e-4).
Real tol2_
 Relative tolerance for truncated CG (default: 1e-2).
int maxit_
 Maximum number of CG iterations (default: 20).
Real mu0_
 Sufficient decrease parameter (default: 1e-2).
Real spexp_
 Relative tolerance exponent for subproblem solve (default: 1, range: [1,2]).
int redlim_
 Maximum number of Cauchy point reduction steps (default: 10).
int explim_
 Maximum number of Cauchy point expansion steps (default: 10).
Real alpha_
 Initial Cauchy point step length (default: 1.0).
bool normAlpha_
 Normalize initial Cauchy point step length (default: false).
Real interpf_
 Backtracking rate for Cauchy point computation (default: 1e-1).
Real extrapf_
 Extrapolation rate for Cauchy point computation (default: 1e1).
Real qtol_
 Relative tolerance for computed decrease in Cauchy point computation (default: 1-8).
Real interpfPS_
 Backtracking rate for projected search (default: 0.5).
unsigned verbosity_
 Output level (default: 0).
bool writeHeader_
 Flag to write header at every iteration.
bool hasEcon_
 Flag signifies if equality constraints exist.
Ptr< ReducedLinearConstraint< Real > > rcon_
 Equality constraint restricted to current active variables.
Ptr< NullSpaceOperator< Real > > ns_
 Null space projection onto reduced equality constraint Jacobian.

Additional Inherited Members

Protected Member Functions inherited from ROL::TypeB::Algorithm< Real >
void initialize (const Vector< Real > &x, const Vector< Real > &g)
Real optimalityCriterion (const Vector< Real > &x, const Vector< Real > &g, Vector< Real > &primal, std::ostream &outStream=std::cout) const
Protected Attributes inherited from ROL::TypeB::Algorithm< Real >
const Ptr< CombinedStatusTest< Real > > status_
const Ptr< AlgorithmState< Real > > state_
Ptr< PolyhedralProjection< Real > > proj_

Detailed Description

template<typename Real>
class ROL::TypeB::LSecantBAlgorithm< Real >

Provides an interface to run the line-search algorithm of Byrd, Lu, Nocedal and Zhu (similar to L-BFGS-B).

Definition at line 27 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Constructor & Destructor Documentation

◆ LSecantBAlgorithm()

Member Function Documentation

◆ run()

◆ writeHeader()

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

Print iterate header.

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

Definition at line 453 of file ROL_TypeB_LSecantBAlgorithm_Def.hpp.

References verbosity_.

Referenced by writeOutput().

◆ writeName()

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

Print step name.

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

Definition at line 489 of file ROL_TypeB_LSecantBAlgorithm_Def.hpp.

Referenced by writeOutput().

◆ writeOutput()

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

Print iterate status.

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

Definition at line 496 of file ROL_TypeB_LSecantBAlgorithm_Def.hpp.

References SPflag_, SPiter_, ROL::TypeB::Algorithm< Real >::state_, writeHeader(), and writeName().

Referenced by run().

◆ initialize()

◆ dgpstep()

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::dgpstep ( Vector< Real > & s,
const Vector< Real > & w,
const Vector< Real > & x,
const Real alpha,
std::ostream & outStream = std::cout ) const
private

◆ dcauchy()

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::dcauchy ( Vector< Real > & s,
Real & alpha,
Real & q,
const Vector< Real > & x,
const Vector< Real > & g,
Secant< Real > & secant,
Vector< Real > & dwa,
Vector< Real > & dwa1,
std::ostream & outStream = std::cout )
private

◆ dsrch()

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::dsrch ( Vector< Real > & x,
Vector< Real > & s,
Real & fnew,
Real & beta,
Real fold,
Real gs,
Objective< Real > & obj,
Vector< Real > & pwa,
std::ostream & outStream = std::cout )
private

◆ dpcg()

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::dpcg ( Vector< Real > & w,
int & iflag,
int & iter,
const Vector< Real > & g,
const Vector< Real > & x,
Secant< Real > & secant,
BoundConstraint< Real > & bnd,
const Real tol,
const Real stol,
const int itermax,
Vector< Real > & p,
Vector< Real > & q,
Vector< Real > & r,
Vector< Real > & t,
Vector< Real > & pwa,
Vector< Real > & dwa,
std::ostream & outStream = std::cout ) const
private

◆ applyFreeHessian()

template<typename Real>
void ROL::TypeB::LSecantBAlgorithm< Real >::applyFreeHessian ( Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & x,
Secant< Real > & secant,
BoundConstraint< Real > & bnd,
Real & tol,
Vector< Real > & pwa ) const
private

◆ applyFreePrecond()

template<typename Real>
void ROL::TypeB::LSecantBAlgorithm< Real >::applyFreePrecond ( Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & x,
Secant< Real > & secant,
BoundConstraint< Real > & bnd,
Real & tol,
Vector< Real > & dwa,
Vector< Real > & pwa ) const
private

Member Data Documentation

◆ SPflag_

template<typename Real>
int ROL::TypeB::LSecantBAlgorithm< Real >::SPflag_
private

Subproblem solver termination flag.

Definition at line 30 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by run(), and writeOutput().

◆ SPiter_

template<typename Real>
int ROL::TypeB::LSecantBAlgorithm< Real >::SPiter_
private

Subproblem solver iteration count.

Definition at line 31 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by run(), and writeOutput().

◆ esec_

template<typename Real>
ESecant ROL::TypeB::LSecantBAlgorithm< Real >::esec_
private

Secant type (default: Limited-Memory BFGS).

Definition at line 34 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm().

◆ useSecantPrecond_

template<typename Real>
bool ROL::TypeB::LSecantBAlgorithm< Real >::useSecantPrecond_
private

Flag to use secant as a preconditioner (default: false).

Definition at line 35 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm().

◆ useSecantHessVec_

template<typename Real>
bool ROL::TypeB::LSecantBAlgorithm< Real >::useSecantHessVec_
private

Flag to use secant as Hessian (default: false).

Definition at line 36 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm().

◆ secant_

template<typename Real>
Ptr<Secant<Real> > ROL::TypeB::LSecantBAlgorithm< Real >::secant_
private

Secant object.

Definition at line 37 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ tol1_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::tol1_
private

Absolute tolerance for truncated CG (default: 1e-4).

Definition at line 40 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ tol2_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::tol2_
private

Relative tolerance for truncated CG (default: 1e-2).

Definition at line 41 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ maxit_

template<typename Real>
int ROL::TypeB::LSecantBAlgorithm< Real >::maxit_
private

Maximum number of CG iterations (default: 20).

Definition at line 42 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ mu0_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::mu0_
private

Sufficient decrease parameter (default: 1e-2).

Definition at line 45 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), dsrch(), and LSecantBAlgorithm().

◆ spexp_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::spexp_
private

Relative tolerance exponent for subproblem solve (default: 1, range: [1,2]).

Definition at line 46 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ redlim_

template<typename Real>
int ROL::TypeB::LSecantBAlgorithm< Real >::redlim_
private

Maximum number of Cauchy point reduction steps (default: 10).

Definition at line 47 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), and LSecantBAlgorithm().

◆ explim_

template<typename Real>
int ROL::TypeB::LSecantBAlgorithm< Real >::explim_
private

Maximum number of Cauchy point expansion steps (default: 10).

Definition at line 48 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), and LSecantBAlgorithm().

◆ alpha_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::alpha_
private

Initial Cauchy point step length (default: 1.0).

Definition at line 49 of file ROL_TypeB_LSecantBAlgorithm.hpp.

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

◆ normAlpha_

template<typename Real>
bool ROL::TypeB::LSecantBAlgorithm< Real >::normAlpha_
private

Normalize initial Cauchy point step length (default: false).

Definition at line 50 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by initialize(), and LSecantBAlgorithm().

◆ interpf_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::interpf_
private

Backtracking rate for Cauchy point computation (default: 1e-1).

Definition at line 51 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), and LSecantBAlgorithm().

◆ extrapf_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::extrapf_
private

Extrapolation rate for Cauchy point computation (default: 1e1).

Definition at line 52 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), and LSecantBAlgorithm().

◆ qtol_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::qtol_
private

Relative tolerance for computed decrease in Cauchy point computation (default: 1-8).

Definition at line 53 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), and LSecantBAlgorithm().

◆ interpfPS_

template<typename Real>
Real ROL::TypeB::LSecantBAlgorithm< Real >::interpfPS_
private

Backtracking rate for projected search (default: 0.5).

Definition at line 54 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dsrch(), and LSecantBAlgorithm().

◆ verbosity_

template<typename Real>
unsigned ROL::TypeB::LSecantBAlgorithm< Real >::verbosity_
private

Output level (default: 0).

Definition at line 56 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by dcauchy(), dsrch(), LSecantBAlgorithm(), run(), and writeHeader().

◆ writeHeader_

template<typename Real>
bool ROL::TypeB::LSecantBAlgorithm< Real >::writeHeader_
private

Flag to write header at every iteration.

Definition at line 57 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by LSecantBAlgorithm(), and run().

◆ hasEcon_

template<typename Real>
bool ROL::TypeB::LSecantBAlgorithm< Real >::hasEcon_
private

Flag signifies if equality constraints exist.

Definition at line 59 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by applyFreePrecond(), dpcg(), initialize(), and run().

◆ rcon_

template<typename Real>
Ptr<ReducedLinearConstraint<Real> > ROL::TypeB::LSecantBAlgorithm< Real >::rcon_
private

Equality constraint restricted to current active variables.

Definition at line 60 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by applyFreePrecond(), and initialize().

◆ ns_

template<typename Real>
Ptr<NullSpaceOperator<Real> > ROL::TypeB::LSecantBAlgorithm< Real >::ns_
private

Null space projection onto reduced equality constraint Jacobian.

Definition at line 61 of file ROL_TypeB_LSecantBAlgorithm.hpp.

Referenced by applyFreePrecond(), and initialize().


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