ROL
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROL::TypeB::NewtonKrylovAlgorithm< Real > Class Template Reference

Provides an interface to run the projected secant algorithm. More...

#include <ROL_TypeB_NewtonKrylovAlgorithm.hpp>

+ Inheritance diagram for ROL::TypeB::NewtonKrylovAlgorithm< Real >:

Classes

class  HessianPNK
 
class  PrecondPNK
 

Public Member Functions

 NewtonKrylovAlgorithm (ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr)
 
 NewtonKrylovAlgorithm (ParameterList &list, const Ptr< Krylov< Real >> &krylov, 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. More...
 
void run (Problem< Real > &problem, std::ostream &outStream=std::cout) override
 Run algorithm on bound constrained problems (Type-B). This is the primary Type-B interface. More...
 
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) override
 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. More...
 
void writeHeader (std::ostream &os) const override
 Print iterate header. More...
 
void writeName (std::ostream &os) const override
 Print step name. More...
 
void writeOutput (std::ostream &os, const bool write_header=false) const override
 Print iterate status. More...
 
- Public Member Functions inherited from ROL::TypeB::Algorithm< Real >
virtual ~Algorithm ()
 
 Algorithm ()
 Constructor, given a step and a status test. More...
 
void setStatusTest (const Ptr< StatusTest< Real >> &status, const bool combineStatus=false)
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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)
 
void parseParameterList (ParameterList &list)
 

Private Attributes

Ptr< Secant< Real > > secant_
 Secant object (used for quasi-Newton) More...
 
ESecant esec_
 Secant type. More...
 
std::string secantName_
 Secant name. More...
 
Ptr< Krylov< Real > > krylov_
 Krylov solver object (used for inexact Newton) More...
 
EKrylov ekv_
 Krylov type. More...
 
std::string krylovName_
 Krylov name. More...
 
int iterKrylov_
 Number of Krylov iterations (used for inexact Newton) More...
 
int flagKrylov_
 Termination flag for Krylov method (used for inexact Newton) More...
 
bool useSecantHessVec_
 Whether or not to use to a secant approximation as the Hessian. More...
 
bool useSecantPrecond_
 Whether or not to use a secant approximation to precondition inexact Newton. More...
 
int maxit_
 Maximum number of line search steps (default: 20) More...
 
Real alpha0_
 Initial line search step size (default: 1.0) More...
 
Real rhodec_
 Backtracking rate (default: 0.5) More...
 
Real c1_
 Sufficient Decrease Parameter (default: 1e-4) More...
 
bool useralpha_
 Flag to use user-defined initial step size (default: false) More...
 
bool usePrevAlpha_
 Flag to use previous step size as next initial step size (default: false) More...
 
int ls_nfval_
 
int verbosity_
 
bool writeHeader_
 

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::NewtonKrylovAlgorithm< Real >

Provides an interface to run the projected secant algorithm.

Definition at line 59 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

Constructor & Destructor Documentation

template<typename Real >
ROL::TypeB::NewtonKrylovAlgorithm< Real >::NewtonKrylovAlgorithm ( ParameterList &  list,
const Ptr< Secant< Real >> &  secant = nullPtr 
)
template<typename Real >
ROL::TypeB::NewtonKrylovAlgorithm< Real >::NewtonKrylovAlgorithm ( ParameterList &  list,
const Ptr< Krylov< Real >> &  krylov,
const Ptr< Secant< Real >> &  secant = nullPtr 
)

Member Function Documentation

template<typename Real >
void ROL::TypeB::NewtonKrylovAlgorithm< Real >::initialize ( Vector< Real > &  x,
const Vector< Real > &  g,
Objective< Real > &  obj,
BoundConstraint< Real > &  bnd,
std::ostream &  outStream = std::cout 
)
private
template<typename Real >
void ROL::TypeB::NewtonKrylovAlgorithm< Real >::parseParameterList ( ParameterList &  list)
private
template<typename Real >
void ROL::TypeB::NewtonKrylovAlgorithm< Real >::run ( Vector< Real > &  x,
const Vector< Real > &  g,
Objective< Real > &  obj,
BoundConstraint< Real > &  bnd,
std::ostream &  outStream = std::cout 
)
overridevirtual

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.

Implements ROL::TypeB::Algorithm< Real >.

Definition at line 144 of file ROL_TypeB_NewtonKrylovAlgorithm_Def.hpp.

References ROL::Accept, ROL::Vector< Real >::axpy(), ROL::Vector< Real >::clone(), ROL::Objective< Real >::gradient(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), ROL::Objective< Real >::value(), and ROL::TypeB::Algorithm< Real >::writeExitStatus().

template<typename Real >
void ROL::TypeB::NewtonKrylovAlgorithm< Real >::run ( Problem< Real > &  problem,
std::ostream &  outStream = std::cout 
)
overridevirtual

Run algorithm on bound constrained problems (Type-B). This is the primary Type-B interface.

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

Definition at line 247 of file ROL_TypeB_NewtonKrylovAlgorithm_Def.hpp.

References ROL::Problem< Real >::getPolyhedralProjection(), and ROL::TypeB::Algorithm< Real >::run().

template<typename Real >
void ROL::TypeB::NewtonKrylovAlgorithm< Real >::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 
)
overridevirtual

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.

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

Definition at line 258 of file ROL_TypeB_NewtonKrylovAlgorithm_Def.hpp.

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

Print step name.

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

Definition at line 314 of file ROL_TypeB_NewtonKrylovAlgorithm_Def.hpp.

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

Print iterate status.

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

Definition at line 327 of file ROL_TypeB_NewtonKrylovAlgorithm_Def.hpp.

Member Data Documentation

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

Secant object (used for quasi-Newton)

Definition at line 61 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

Referenced by ROL::TypeB::NewtonKrylovAlgorithm< Real >::NewtonKrylovAlgorithm().

template<typename Real >
ESecant ROL::TypeB::NewtonKrylovAlgorithm< Real >::esec_
private
template<typename Real >
std::string ROL::TypeB::NewtonKrylovAlgorithm< Real >::secantName_
private
template<typename Real >
Ptr<Krylov<Real> > ROL::TypeB::NewtonKrylovAlgorithm< Real >::krylov_
private

Krylov solver object (used for inexact Newton)

Definition at line 65 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

Referenced by ROL::TypeB::NewtonKrylovAlgorithm< Real >::NewtonKrylovAlgorithm().

template<typename Real >
EKrylov ROL::TypeB::NewtonKrylovAlgorithm< Real >::ekv_
private
template<typename Real >
std::string ROL::TypeB::NewtonKrylovAlgorithm< Real >::krylovName_
private
template<typename Real >
int ROL::TypeB::NewtonKrylovAlgorithm< Real >::iterKrylov_
private

Number of Krylov iterations (used for inexact Newton)

Definition at line 69 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
int ROL::TypeB::NewtonKrylovAlgorithm< Real >::flagKrylov_
private

Termination flag for Krylov method (used for inexact Newton)

Definition at line 70 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

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

Whether or not to use to a secant approximation as the Hessian.

Definition at line 72 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

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

Whether or not to use a secant approximation to precondition inexact Newton.

Definition at line 73 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

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

Maximum number of line search steps (default: 20)

Definition at line 75 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
Real ROL::TypeB::NewtonKrylovAlgorithm< Real >::alpha0_
private

Initial line search step size (default: 1.0)

Definition at line 76 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
Real ROL::TypeB::NewtonKrylovAlgorithm< Real >::rhodec_
private

Backtracking rate (default: 0.5)

Definition at line 77 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
Real ROL::TypeB::NewtonKrylovAlgorithm< Real >::c1_
private

Sufficient Decrease Parameter (default: 1e-4)

Definition at line 78 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
bool ROL::TypeB::NewtonKrylovAlgorithm< Real >::useralpha_
private

Flag to use user-defined initial step size (default: false)

Definition at line 79 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
bool ROL::TypeB::NewtonKrylovAlgorithm< Real >::usePrevAlpha_
private

Flag to use previous step size as next initial step size (default: false)

Definition at line 80 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
int ROL::TypeB::NewtonKrylovAlgorithm< Real >::ls_nfval_
private

Definition at line 82 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

template<typename Real >
int ROL::TypeB::NewtonKrylovAlgorithm< Real >::verbosity_
private

Definition at line 83 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.

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

Definition at line 84 of file ROL_TypeB_NewtonKrylovAlgorithm.hpp.


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