10#ifndef ROL_NONLINEARCG_U_H
11#define ROL_NONLINEARCG_U_H
27template<
typename Real>
47 const Ptr<NonlinearCG<Real>> &nlcg = nullPtr)
50 ParameterList& Llist = parlist.sublist(
"Step").sublist(
"Line Search");
51 if ( nlcg == nullPtr ) {
52 ncgName_ = Llist.sublist(
"Descent Method").get(
"Nonlinear CG Type",
"Oren-Luenberger");
58 ncgName_ = Llist.sublist(
"Descent Method").get(
"User Defined Nonlinear CG Name",
59 "Unspecified User Define Nonlinear CG Method");
65 nlcg_->run(s,g,x,obj);
68 if (sdotg >=
static_cast<Real
>(0)) {
73 s.
scale(
static_cast<Real
>(-1));
80 std::stringstream name;
Contains definitions of custom data types in ROL.
Provides the interface to compute unconstrained optimization steps for line search.
Provides the interface to compute optimization steps with nonlinear CG.
NonlinearCG_U(ParameterList &parlist, const Ptr< NonlinearCG< Real > > &nlcg=nullPtr)
Constructor.
Ptr< NonlinearCG< Real > > nlcg_
NonlinearCG object (used for quasi-Newton)
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
std::string printName(void) const override
Provides the interface to evaluate objective functions.
Defines the linear algebra or vector space interface.
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
virtual Real norm() const =0
Returns where .
virtual void set(const Vector &x)
Set where .
virtual void scale(const Real alpha)=0
Compute where .
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
@ NONLINEARCG_USERDEFINED
ENonlinearCG StringToENonlinearCG(std::string s)