69 std::vector<ROL::Ptr<Vector<Real> > > a(state->current+1);
70 std::vector<ROL::Ptr<Vector<Real> > > b(state->current+1);
71 Real bv(0), av(0), bs(0), as(0);
72 for (
int i = 0; i <= state->current; i++) {
74 b[i]->set(*(state->iterDiff[i]));
75 b[i]->scale(1.0/sqrt(state->product[i]));
76 bv = b[i]->dot(v.
dual());
80 applyH0(*a[i],*(state->gradDiff[i]));
82 for (
int j = 0; j < i; j++) {
83 bs = b[j]->dot((state->gradDiff[i])->dual());
85 as = a[j]->dot((state->gradDiff[i])->dual());
86 a[i]->axpy(-as,*a[j]);
88 as = a[i]->dot((state->gradDiff[i])->dual());
89 a[i]->scale(one/sqrt(as));
90 av = a[i]->dot(v.
dual());
101 if (state->iter != 0 && state->current != -1) {
102 Real ss = state->iterDiff[state->current]->dot(*(state->iterDiff[state->current]));
103 Hv.
scale(state->product[state->current]/ss);
114 std::vector<Real> alpha(state->current+1,zero);
115 for (
int i = state->current; i>=0; i--) {
116 alpha[i] = state->gradDiff[i]->dot(Bv);
117 alpha[i] /= state->product[i];
118 Bv.
axpy(-alpha[i],(state->iterDiff[i])->dual());
122 ROL::Ptr<Vector<Real> > tmp = Bv.
clone();
127 for (
int i = 0; i <= state->current; i++) {
128 beta = state->iterDiff[i]->dot(Bv.
dual());
129 beta /= state->product[i];
130 Bv.
axpy((alpha[i]-beta),*(state->gradDiff[i]));
140 if (state->iter != 0 && state->current != -1) {
141 Real ss = state->iterDiff[state->current]->dot(*(state->iterDiff[state->current]));
142 Bv.
scale(ss/state->product[state->current]);
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 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.
Defines the linear algebra or vector space interface.
virtual void applyH0(Vector< Real > &Hv, const Vector< Real > &v) const
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
ROL::Ptr< SecantState< Real > > & get_state()
Provides interface for and implements limited-memory secant operators.
virtual void applyB0(Vector< Real > &Bv, const Vector< Real > &v) const
virtual void set(const Vector &x)
Set where .
void applyH(Vector< Real > &Hv, const Vector< Real > &v) const
void applyB(Vector< Real > &Bv, const Vector< Real > &v) const