44 #ifndef ROL_PRIMALDUALINTERIORPOINTOPERATOR_H 45 #define ROL_PRIMALDUALINTERIORPOINTOPERATOR_H 78 const V &x, ROL::Ptr<V> & scratch,
80 obj_(obj), con_(con), scratch_(scratch), delta_(delta) {
82 const PV &x_pv =
dynamic_cast<const PV&
>(x);
90 const PV &x_pv =
dynamic_cast<const PV&
>(x);
95 obj_->update(*x_,flag,
true);
96 con_->update(*x_,flag,
true);
103 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
104 const PV &v_pv =
dynamic_cast<const PV&
>(v);
107 ROL::Ptr<V> Hvx = Hv_pv.
get(OPT);
108 ROL::Ptr<V> Hvl = Hv_pv.
get(EQUAL);
111 ROL::Ptr<const V> vx = v_pv.
get(OPT);
112 ROL::Ptr<const V> vl = v_pv.
get(EQUAL);
114 obj_->hessVec(*jvx,*vx,*x_,tol);
115 con_->applyAdjointHessian(*scratch_,*l_,*vx,*x_,tol);
116 jvx->plus(*scratch_);
117 con_->applyAdjointJacobian(*scratch_,*vl,*x_,tol);
118 jvx->plus(*scratch_);
122 jvx->axpy(delta_,*vx);
125 con_->applyJacobian(*jvl,*vx,*x_,tol);
130 ROL_TEST_FOR_EXCEPTION(
true , std::logic_error,
131 ">>> ERROR (ROL_PrimalDualInteriorPointBlock11, applyInverse): " 159 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
160 const PV &v_pv =
dynamic_cast<const PV&
>(v);
163 ROL::Ptr<V> Hvx = Hv_pv.
get(OPT);
164 ROL::Ptr<V> Hvl = Hv_pv.
get(EQUAL);
167 ROL::Ptr<const V> vzl = v_pv.
get(LOWER);
168 ROL::Ptr<const V> vzu = v_pv.
get(UPPER);
171 Hvx->axpy(-1.0,*vzl);
177 ROL_TEST_FOR_EXCEPTION(
true , std::logic_error,
178 ">>> ERROR (ROL_PrimalDualInteriorPointBlock12, applyInverse): " 203 const PV &z_pv =
dynamic_cast<const PV&
>(z);
204 zl_ = z_pv.
get(LOWER);
205 zu_ = z_pv.
get(UPPER);
209 const PV &z_pv =
dynamic_cast<const PV&
>(z);
210 zl_ = z_pv.
get(LOWER);
211 zu_ = z_pv.
get(UPPER);
217 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
218 const PV &v_pv =
dynamic_cast<const PV&
>(v);
221 ROL::Ptr<V> Hvzl = Hv_pv.
get(LOWER);
222 ROL::Ptr<V> Hvzu = Hv_pv.
get(UPPER);
225 ROL::Ptr<const V> vx = v_pv.
get(OPT);
226 ROL::Ptr<const V> vl = v_pv.
get(EQUAL);
229 Hvzl->applyBinary(mult_,*zl_);
232 Hvzu->applyBinary(mult_,*zu_);
237 ROL_TEST_FOR_EXCEPTION(
true , std::logic_error,
238 ">>> ERROR (ROL_PrimalDualInteriorPointBlock21, applyInverse): " 256 ROL::Ptr<const V>
x_;
268 const PV &x_pv =
dynamic_cast<const PV&
>(x);
271 xl_ = bnd.getLowerBound();
272 xu_ = bnd.getUpperBound();
278 const PV &x_pv =
dynamic_cast<const PV&
>(x);
285 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
286 const PV &v_pv =
dynamic_cast<const PV&
>(v);
289 ROL::Ptr<V> Hvzl = Hv_pv.
get(LOWER);
290 ROL::Ptr<V> Hvzu = Hv_pv.
get(UPPER);
293 ROL::Ptr<const V> vzl = v_pv.
get(LOWER);
294 ROL::Ptr<const V> vzu = v_pv.
get(UPPER);
297 Hvzl->axpy(-1.0,*xl_);
298 Hvzl->applyBinary(mult_,*vzl);
301 Hvzu->axpy(-1.0,*x_);
302 Hvzu->applyBinary(mult_,*vzu);
310 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
311 const PV &v_pv =
dynamic_cast<const PV&
>(v);
314 ROL::Ptr<V> Hvzl = Hv_pv.
get(LOWER);
315 ROL::Ptr<V> Hvzu = Hv_pv.
get(UPPER);
318 ROL::Ptr<const V> vzl = v_pv.
get(LOWER);
319 ROL::Ptr<const V> vzu = v_pv.
get(UPPER);
322 Hvzl->axpy(-1.0,*xl_);
323 Hvzl->applyBinary(divinv_,*vzl);
326 Hvzu->axpy(-1.0,*x_);
327 Hvzu->applyBinary(divinv_,*vzu);
337 #endif // ROL_PRIMALDUALINTERIORPOINTOPERATOR_H void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Provides the interface to evaluate objective functions.
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
typename PV< Real >::size_type size_type
void setInertia(Real delta)
PrimalDualInteriorPointBlock22(const ROL::Ptr< BND > &bnd, const Vector< Real > &x)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
static const size_type UPPER
static const size_type EQUAL
Defines the linear algebra of vector space on a generic partitioned vector.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
PartitionedVector< Real > PV
PartitionedVector< Real > PV
Defines the linear algebra or vector space interface.
void update(const Vector< Real > &z, bool flag=true, int iter=-1)
Update linear operator.
Elementwise::Multiply< Real > divinv_
PrimalDualInteriorPointBlock21(const V &z)
Elementwise::Multiply< Real > mult_
static const size_type OPT
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Provides the interface to apply a linear operator.
Provides the interface to apply upper and lower bound constraints.
PartitionedVector< Real > PV
BoundConstraint< Real > BND
PartitionedVector< Real > PV
static const size_type LOWER
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
PrimalDualInteriorPointBlock11(ROL::Ptr< OBJ > &obj, ROL::Ptr< CON > &con, const V &x, ROL::Ptr< V > &scratch, Real delta=0)
ROL::Ptr< const Vector< Real > > get(size_type i) const
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Defines the general constraint operator interface.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.