29 lDFP(
int M,
bool useDefaultScaling =
true, Real Bscaling = Real(1))
30 :
Secant<Real>(M,useDefaultScaling,Bscaling) {}
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));
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]));
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Provides interface for and implements limited-memory secant operators.
const Ptr< SecantState< Real > > state_
Defines the linear algebra or vector space interface.
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,...
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.
lDFP(int M, bool useDefaultScaling=true, Real Bscaling=Real(1))
virtual void applyB0(Vector< Real > &Bv, const Vector< Real > &v) const
void applyH(Vector< Real > &Hv, const Vector< Real > &v) const
void applyB(Vector< Real > &Bv, const Vector< Real > &v) const
virtual void applyH0(Vector< Real > &Hv, const Vector< Real > &v) const