45 #ifndef ROL_FLETCHER_H
46 #define ROL_FLETCHER_H
53 #include "ROL_Ptr.hpp"
97 Ptr<Vector<Real> >
Tv_;
98 Ptr<Vector<Real> >
w_;
99 Ptr<Vector<Real> >
v_;
122 const Ptr<Constraint<Real> >
con_;
123 const Ptr<const Vector<Real> >
x_;
134 con_->applyAdjointJacobian(*(Hvp.
get(0)), *(vp.
get(1)), *
x_, tol);
135 Hvp.
get(0)->plus(*(vp.
get(0)));
137 con_->applyJacobian(*(Hvp.
get(1)), *(vp.
get(0)), *
x_, tol);
144 const Ptr<Constraint<Real> >
con_;
145 const Ptr<const Vector<Real> >
x_;
160 con_->applyPreconditioner(*(Hvp.
get(1)),*(vp.
get(1)),*
x_,*
x_, zero);
169 ROL::ParameterList &parlist)
173 y_ = conVec.
dual().clone();
174 g_ = optVec.
dual().clone();
180 w_ = optVec.
dual().clone();
181 v_ = conVec.
dual().clone();
190 vv_ = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>> >({
v1_,
v2_}));
194 bb_ = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>> >({
b1_,
b2_}));
196 ROL::ParameterList& sublist = parlist.sublist(
"Step").sublist(
"Fletcher");
197 HessianApprox_ = sublist.get(
"Level of Hessian Approximation", 0);
200 delta_ = sublist.get(
"Regularization Parameter", 0.0);
202 useInexact_ = sublist.get(
"Inexact Solves",
false);
204 ROL::ParameterList krylovList;
205 Real atol =
static_cast<Real
>(1e-12);
206 Real rtol =
static_cast<Real
>(1e-2);
207 krylovList.sublist(
"General").sublist(
"Krylov").set(
"Type",
"GMRES");
208 krylovList.sublist(
"General").sublist(
"Krylov").set(
"Absolute Tolerance", atol);
209 krylovList.sublist(
"General").sublist(
"Krylov").set(
"Relative Tolerance", rtol);
210 krylovList.sublist(
"General").sublist(
"Krylov").set(
"Iteration Limit", 200);
211 krylov_ = KrylovFactory<Real>(krylovList);
215 obj_->update(x,flag,iter);
216 con_->update(x,flag,iter);
263 con_->applyAdjointHessian( *
gPhi_, *
y_, *
w_, x, tol2 ); tol2 = origTol;
266 obj_->hessVec( *
Tv_, *
w_, x, tol2 ); tol2 = origTol;
267 gPhi_->axpy( static_cast<Real>(-1), *
Tv_ );
269 con_->applyAdjointHessian( *
Tv_, *
v_, *
gL_, x, tol2 ); tol2 = origTol;
286 obj_->hessVec( hv, v, x, tol2 ); tol2 = origTol;
287 con_->applyAdjointHessian( *
Tv_, *
y_, v, x, tol2 ); tol2 = origTol;
288 hv.
axpy(static_cast<Real>(-1), *
Tv_ );
292 hv.
scale( static_cast<Real>(-1) );
300 obj_->hessVec( *
Tv_, *
w_, x, tol2 ); tol2 = origTol;
302 con_->applyAdjointHessian( *
Tv_, *
y_, *
w_, x, tol2 ); tol2 = origTol;
303 hv.
axpy( static_cast<Real>(-1), *
Tv_ );
315 ROL::Ptr<LinearOperator<Real> > K
316 = ROL::makePtr<AugSystem>(
con_, makePtrFromRef(x),
delta_);
317 ROL::Ptr<LinearOperator<Real> > P
318 = ROL::makePtr<AugSystemPrecond>(
con_, makePtrFromRef(x));
328 krylov_->resetAbsoluteTolerance(tol);
Provides the interface to evaluate objective functions.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Ptr< Vector< Real > > gPhi_
virtual void scale(const Real alpha)=0
Compute where .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
const Ptr< Constraint< Real > > con_
ROL::Ptr< const Vector< Real > > get(size_type i) const
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Defines the linear algebra of vector space on a generic partitioned vector.
void objValue(const Vector< Real > &x, Real &tol)
const Ptr< Objective< Real > > obj_
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
Contains definitions of custom data types in ROL.
Fletcher(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< Constraint< Real > > &con, const Vector< Real > &optVec, const Vector< Real > &conVec, ROL::ParameterList &parlist)
const Ptr< const Vector< Real > > x_
const Ptr< const Vector< Real > > x_
AugSystemPrecond(const Ptr< Constraint< Real > > con, const Ptr< const Vector< Real > > x)
Ptr< Vector< Real > > czeros_
Ptr< Vector< Real > > Tv_
Defines the linear algebra or vector space interface.
Ptr< Krylov< Real > > krylov_
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Ptr< Vector< Real > > gL_
Ptr< Vector< Real > > v1_
Ptr< Vector< Real > > b1_
AugSystem(const Ptr< Constraint< Real > > &con, const Ptr< const Vector< Real > > &x, const Real delta)
bool isMultiplierComputed_
Ptr< Vector< Real > > scaledc_
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
void conValue(const Vector< Real > &x, Real &tol)
void set(const V &x)
Set where .
void computeMultipliers(const Vector< Real > &x, const Real tol)
Ptr< Vector< Real > > xzeros_
Ptr< PartitionedVector< Real > > vv_
Provides the interface to apply a linear operator.
const Ptr< Constraint< Real > > con_
void solveAugmentedSystem(Vector< Real > &v1, Vector< Real > &v2, const Vector< Real > &b1, const Vector< Real > &b2, const Vector< Real > &x, Real &tol)
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual void set(const Vector &x)
Set where .
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
Ptr< Vector< Real > > v2_
Ptr< Vector< Real > > b2_
Ptr< PartitionedVector< Real > > bb_
const Ptr< Constraint< Real > > con_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
void objGrad(const Vector< Real > &x, Real &tol)
Defines the general constraint operator interface.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.