44 #ifndef ROL_PRIMALDUALINTERIORPOINTOPERATOR_H 45 #define ROL_PRIMALDUALINTERIORPOINTOPERATOR_H 62 static const size_type
OPT = 0;
63 static const size_type
EQUAL = 1;
64 static const size_type
LOWER = 0;
65 static const size_type
UPPER = 1;
67 Teuchos::RCP<const V>
x_;
68 Teuchos::RCP<const V>
l_;
78 const V &x, Teuchos::RCP<V> & scratch,
80 obj_(obj), con_(con), scratch_(scratch), delta_(delta) {
82 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
90 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
95 obj_->update(*x_,flag,
true);
96 con_->update(*x_,flag,
true);
103 PV &Hv_pv = Teuchos::dyn_cast<PV>(Hv);
104 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
107 RCP<V> Hvx = Hv_pv.
get(OPT);
108 RCP<V> Hvl = Hv_pv.
get(EQUAL);
111 RCP<const V> vx = v_pv.get(OPT);
112 RCP<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 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::logic_error,
131 ">>> ERROR (ROL_PrimalDualInteriorPointBlock11, applyInverse): " 149 static const size_type
OPT = 0;
159 PV &Hv_pv = Teuchos::dyn_cast<PV>(Hv);
160 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
163 RCP<V> Hvx = Hv_pv.
get(OPT);
164 RCP<V> Hvl = Hv_pv.
get(EQUAL);
167 RCP<const V> vzl = v_pv.get(LOWER);
168 RCP<const V> vzu = v_pv.get(UPPER);
171 Hvx->axpy(-1.0,*vzl);
177 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::logic_error,
178 ">>> ERROR (ROL_PrimalDualInteriorPointBlock12, applyInverse): " 192 static const size_type
OPT = 0;
197 Teuchos::RCP<const V>
zl_;
198 Teuchos::RPC<const V>
zu_;
203 const PV &z_pv = Teuchos::dyn_cast<
const PV>(z);
204 zl_ = z_pv.
get(LOWER);
205 zu_ = z_pv.
get(UPPER);
209 const PV &z_pv = Teuchos::dyn_cast<
const PV>(z);
210 zl_ = z_pv.
get(LOWER);
211 zu_ = z_pv.
get(UPPER);
217 PV &Hv_pv = Teuchos::dyn_cast<PV>(Hv);
218 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
221 RCP<V> Hvzl = Hv_pv.
get(LOWER);
222 RCP<V> Hvzu = Hv_pv.
get(UPPER);
225 RCP<const V> vx = v_pv.get(OPT);
226 RCP<const V> vl = v_pv.get(EQUAL);
229 Hvzl->applyBinary(mult_,*zl_);
232 Hvzu->applyBinary(mult_,*zu_);
237 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::logic_error,
238 ">>> ERROR (ROL_PrimalDualInteriorPointBlock21, applyInverse): " 252 static const size_type
OPT = 0;
256 Teuchos::RCP<const V>
x_;
257 Teuchos::RCP<const V>
xl_;
258 Teuchos::RCP<const V>
xu_;
268 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
271 xl_ = bnd.getLowerVectorRCP();
272 xu_ = bnd.getUpperVectorRCP();
278 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
285 PV &Hv_pv = Teuchos::dyn_cast<PV>(Hv);
286 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
289 RCP<V> Hvzl = Hv_pv.
get(LOWER);
290 RCP<V> Hvzu = Hv_pv.
get(UPPER);
293 RCP<const V> vzl = v_pv.get(LOWER);
294 RCP<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 = Teuchos::dyn_cast<PV>(Hv);
311 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
314 RCP<V> Hvzl = Hv_pv.
get(LOWER);
315 RCP<V> Hvzu = Hv_pv.
get(UPPER);
318 RCP<const V> vzl = v_pv.get(LOWER);
319 RCP<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.
Teuchos::RCP< const V > l_
void setInertia(Real delta)
Teuchos::RCP< const V > zl_
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
static const size_type UPPER
EqualityConstraint< Real > CON
static const size_type EQUAL
Defines the linear algebra of vector space on a generic partitioned vector.
Teuchos::RCP< const Vector< Real > > get(size_type i) const
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
PartitionedVector< Real > PV
Teuchos::RCP< const V > x_
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.
Defines the equality constraint operator interface.
Elementwise::Multiply< Real > divinv_
Teuchos::RCP< const V > xu_
PrimalDualInteriorPointBlock21(const V &z)
Elementwise::Multiply< Real > mult_
static const size_type OPT
Teuchos::RCP< const V > x_
Teuchos::RCP< V > scratch_
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.
Teuchos::RCP< const V > xl_
PartitionedVector< Real > PV
PrimalDualInteriorPointBlock22(const Teuchos::RCP< BND > &bnd, const Vector< Real > &x)
Teuchos::RPC< const V > zu_
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.
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.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
PrimalDualInteriorPointBlock11(Teuchos::RCP< OBJ > &obj, Teuchos::RCP< CON > &con, const V &x, Teuchos::RCP< V > &scratch, Real delta=0)