44 #ifndef ROL_NONLINEARCG_U_H
45 #define ROL_NONLINEARCG_U_H
61 template<
typename Real>
81 const Ptr<NonlinearCG<Real>> &nlcg = nullPtr)
84 ParameterList& Llist = parlist.sublist(
"Step").sublist(
"Line Search");
85 if ( nlcg == nullPtr ) {
86 ncgName_ = Llist.sublist(
"Descent Method").get(
"Nonlinear CG Type",
"Oren-Luenberger");
92 ncgName_ = Llist.sublist(
"Descent Method").get(
"User Defined Nonlinear CG Name",
93 "Unspecified User Define Nonlinear CG Method");
99 nlcg_->run(s,g,x,obj);
102 if (sdotg >= static_cast<Real>(0)) {
107 s.
scale(static_cast<Real>(-1));
114 std::stringstream name;
115 name <<
ncgName_ <<
" Nonlinear CG";
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...
virtual void scale(const Real alpha)=0
Compute where .
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
std::string printName(void) const override
Contains definitions of custom data types in ROL.
Provides the interface to compute optimization steps with nonlinear CG.
Defines the linear algebra or vector space interface.
void compute(Vector< Real > &s, Real &snorm, Real &sdotg, int &iter, int &flag, const Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj) override
NonlinearCG_U(ParameterList &parlist, const Ptr< NonlinearCG< Real >> &nlcg=nullPtr)
Constructor.
ENonlinearCG
Enumeration of nonlinear CG algorithms.
ENonlinearCG StringToENonlinearCG(std::string s)
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
Provides the interface to compute unconstrained optimization steps for line search.
Ptr< NonlinearCG< Real > > nlcg_
NonlinearCG object (used for quasi-Newton)