36 std::vector<Real> alpha(
state_->current+1,
zero);
37 for (
int i =
state_->current; i>=0; i--) {
38 alpha[i] =
state_->iterDiff[i]->apply(*tmp);
39 alpha[i] /=
state_->product[i];
40 tmp->axpy(-alpha[i],*
state_->gradDiff[i]);
47 for (
int i = 0; i <=
state_->current; i++) {
50 beta /=
state_->product[i];
51 Hv.
axpy((alpha[i]-beta),*(
state_->iterDiff[i]));
56 void applyB( Vector<Real> &Bv,
const Vector<Real> &v )
const {
62 std::vector<Ptr<Vector<Real>>> a(
state_->current+1);
63 std::vector<Ptr<Vector<Real>>> b(
state_->current+1);
64 Real bv(0), av(0), bs(0), as(0);
65 for (
int i = 0; i <=
state_->current; i++) {
67 b[i]->set(*(
state_->gradDiff[i]));
68 b[i]->scale(one/sqrt(
state_->product[i]));
76 for (
int j = 0; j < i; j++) {
82 a[i]->axpy(-as,*a[j]);
86 a[i]->scale(one/sqrt(as));
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
virtual void applyH(Vector< Real > &Hv, const Vector< Real > &v) const =0
Provides definitions for limited-memory BFGS operators.
Defines the linear algebra or vector space interface.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
virtual void applyB0(Vector< Real > &Bv, const Vector< Real > &v) const
Provides interface for and implements limited-memory secant operators.
virtual void applyB(Vector< Real > &Bv, const Vector< Real > &v) const =0
const Ptr< SecantState< Real > > state_
virtual void applyH0(Vector< Real > &Hv, const Vector< Real > &v) const