39 std::vector<Ptr<Vector<Real>>> a(
state_->current+1);
40 std::vector<Ptr<Vector<Real>>> b(
state_->current+1);
41 Real bv(0), av(0), bs(0), as(0);
42 for (
int i = 0; i <=
state_->current; i++) {
44 b[i]->set(*(
state_->iterDiff[i]));
45 b[i]->scale(1.0/sqrt(
state_->product[i]));
53 for (
int j = 0; j < i; j++) {
55 bs = b[j]->apply(*(
state_->gradDiff[i]));
58 as = a[j]->apply(*(
state_->gradDiff[i]));
59 a[i]->axpy(-as,*a[j]);
62 as = a[i]->apply(*(
state_->gradDiff[i]));
63 a[i]->scale(one/sqrt(as));
71 virtual void applyH0( Vector<Real> &Hv,
const Vector<Real> &v )
const {
85 void applyB( Vector<Real> &Bv,
const Vector<Real> &v )
const {
89 std::vector<Real> alpha(
state_->current+1,
zero);
90 for (
int i =
state_->current; i>=0; i--) {
91 alpha[i] =
state_->gradDiff[i]->dot(Bv);
92 alpha[i] /=
state_->product[i];
93 Bv.axpy(-alpha[i],(
state_->iterDiff[i])->dual());
97 Ptr<Vector<Real>> tmp = Bv.clone();
102 for (
int i = 0; i <=
state_->current; i++) {
104 beta =
state_->iterDiff[i]->apply(Bv);
105 beta /=
state_->product[i];
106 Bv.axpy((alpha[i]-beta),*(
state_->gradDiff[i]));
111 virtual void applyB0( Vector<Real> &Bv,
const Vector<Real> &v )
const {
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Provides definitions for limited-memory DFP operators.
virtual void applyH(Vector< Real > &Hv, const Vector< Real > &v) const =0
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