44#ifndef ROL_QUASINEWTON_U_H
45#define ROL_QUASINEWTON_U_H
60template<
typename Real>
81 : secant_(secant), esec_(SECANT_USERDEFINED) {
83 if ( secant == nullPtr ) {
84 secantName_ = parlist.sublist(
"General").sublist(
"Secant").get(
"Type",
"Limited-Memory BFGS");
85 esec_ = StringToESecant(secantName_);
86 secant_ = SecantFactory<Real>(parlist);
89 secantName_ = parlist.sublist(
"General").sublist(
"Secant").get(
"User Defined Secant Name",
90 "Unspecified User Defined Secant Method");
95 const Vector<Real> &x,
const Vector<Real> &g, Objective<Real> &obj)
override {
99 if (sdotg >=
static_cast<Real
>(0)) {
104 s.scale(
static_cast<Real
>(-1));
110 void update(
const Vector<Real> &x,
const Vector<Real> &s,
111 const Vector<Real> &gold,
const Vector<Real> &gnew,
112 const Real
snorm,
const int iter)
override {
114 secant_->updateStorage(x,gnew,gold,s,
snorm,
iter+1);
118 std::stringstream name;
119 name <<
"Quasi-Newton Method with " << secantName_;
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 a secant method.
void update(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &gold, const Vector< Real > &gnew, const Real snorm, const int iter) override
Ptr< Secant< Real > > secant_
Secant object (used for quasi-Newton)
std::string printName(void) const override
ESecant esec_
Secant type.
QuasiNewton_U(ParameterList &parlist, const Ptr< Secant< Real > > &secant=nullPtr)
Constructor.
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 secantName_
Secant name.
Provides interface for and implements limited-memory secant operators.