44 #ifndef ROL_TYPEB_NEWTONKRYLOVALGORITHM_HPP
45 #define ROL_TYPEB_NEWTONKRYLOVALGORITHM_HPP
58 template<
typename Real>
88 const Ptr<Objective<Real>>
obj_;
89 const Ptr<BoundConstraint<Real>>
bnd_;
90 const Ptr<const Vector<Real>>
x_;
91 const Ptr<const Vector<Real>>
g_;
95 const Ptr<Vector<Real>>
v_;
123 const Ptr<Objective<Real>>
obj_;
124 const Ptr<BoundConstraint<Real>>
bnd_;
125 const Ptr<const Vector<Real>>
x_;
126 const Ptr<const Vector<Real>>
g_;
130 const Ptr<Vector<Real>>
v_;
149 else obj_->precond(Hv,
v_->dual(),*
x_,tol);
165 std::ostream &outStream = std::cout);
180 std::ostream &outStream = std::cout)
override;
183 std::ostream &outStream = std::cout )
override;
192 std::ostream &outStream = std::cout )
override;
194 void writeHeader( std::ostream& os )
const override;
196 void writeName( std::ostream& os )
const override;
198 void writeOutput( std::ostream& os,
const bool write_header =
false )
const override;
Provides the interface to evaluate objective functions.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void writeHeader(std::ostream &os) const override
Print iterate header.
virtual void plus(const Vector &x)=0
Compute , where .
NewtonKrylovAlgorithm(ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr)
int maxit_
Maximum number of line search steps (default: 20)
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
void initialize(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
const Ptr< Objective< Real > > obj_
Real rhodec_
Backtracking rate (default: 0.5)
int iterKrylov_
Number of Krylov iterations (used for inexact Newton)
int flagKrylov_
Termination flag for Krylov method (used for inexact Newton)
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...
const Ptr< const Vector< Real > > g_
Defines the linear algebra or vector space interface.
EKrylov
Enumeration of Krylov methods.
Provides an interface to run the projected secant algorithm.
Real alpha0_
Initial line search step size (default: 1.0)
bool useSecantHessVec_
Whether or not to use to a secant approximation as the Hessian.
const Ptr< const Vector< Real > > x_
std::string krylovName_
Krylov name.
Provides an interface to run bound constrained optimization algorithms.
const Ptr< const Vector< Real > > g_
ESecant
Enumeration of secant update algorithms.
bool useralpha_
Flag to use user-defined initial step size (default: false)
const Ptr< Secant< Real > > secant_
void writeOutput(std::ostream &os, const bool write_header=false) const override
Print iterate status.
PrecondPNK(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Ptr< const Vector< Real >> &x, const Ptr< const Vector< Real >> &g, Real eps, const Ptr< Secant< Real >> &secant, bool useSecant, const Ptr< Vector< Real >> &pwa)
Provides interface for and implements limited-memory secant operators.
const Ptr< BoundConstraint< Real > > bnd_
std::string secantName_
Secant name.
Provides definitions for Krylov solvers.
Provides the interface to apply a linear operator.
Real c1_
Sufficient Decrease Parameter (default: 1e-4)
Provides the interface to apply upper and lower bound constraints.
HessianPNK(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Ptr< const Vector< Real >> &x, const Ptr< const Vector< Real >> &g, Real eps, const Ptr< Secant< Real >> &secant, bool useSecant, const Ptr< Vector< Real >> &pwa)
const Ptr< const Vector< Real > > x_
Ptr< Secant< Real > > secant_
Secant object (used for quasi-Newton)
void parseParameterList(ParameterList &list)
Ptr< Krylov< Real > > krylov_
Krylov solver object (used for inexact Newton)
ESecant esec_
Secant type.
bool useSecantPrecond_
Whether or not to use a secant approximation to precondition inexact Newton.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
virtual void set(const Vector &x)
Set where .
const Ptr< BoundConstraint< Real > > bnd_
const Ptr< Objective< Real > > obj_
bool usePrevAlpha_
Flag to use previous step size as next initial step size (default: false)
void writeName(std::ostream &os) const override
Print step name.
const Ptr< Vector< Real > > v_
Defines the general constraint operator interface.
const Ptr< Secant< Real > > secant_
const Ptr< Vector< Real > > v_