44 #ifndef ROL_PRIMALDUALINTERIORPOINTREDUCEDRESIDUAL_H 45 #define ROL_PRIMALDUALINTERIORPOINTREDUCEDRESIDUAL_H 113 typedef Teuchos::ParameterList
PL;
129 static const size_type
OPT = 0;
134 Teuchos::RCP<const V>
x_;
135 Teuchos::RCP<const V>
l_;
136 Teuchos::RCP<const V>
zl_;
137 Teuchos::RCP<const V>
zu_;
139 Teuchos::RCP<const V>
xl_;
140 Teuchos::RCP<const V>
xu_;
155 const Teuchos::RCP<CON> &con,
157 Teuchos::RCP<V> &scratch ) :
158 penalty_(penalty), con_(con), scratch_(scratch) {
160 obj_ = penalty_->getObjective();
161 maskL_ = penalty_->getLowerMask();
162 maskU_ = penalty_->getUpperMask();
164 Teuchos::RCP<BND> bnd = penalty_->getBoundConstraint();
165 xl_ = bnd->getLowerVectorRCP();
166 xu_ = bnd->getUpperVectorRCP();
170 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
173 l_ = x_pv.
get(EQUAL);
174 zl_ = x_pv.
get(LOWER);
175 zu_ = x_pv.
get(UPPER);
183 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
186 l_ = x_pv.
get(EQUAL);
187 zl_ = x_pv.
get(LOWER);
188 zu_ = x_pv.
get(UPPER);
190 obj_->update(*x_,flag,iter);
191 con_->update(*x_,flag,iter);
196 void value( V &c,
const V &x, Real &tol ) {
199 PV &c_pv = Teuchos::dyn_cast<PV>(c);
200 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
203 l_ = x_pv.get(EQUAL);
204 zl_ = x_pv.get(LOWER);
205 zu_ = x_pv.get(UPPER);
207 RCP<V> cx = c_pv.
get(OPT);
208 RCP<V> cl = c_pv.
get(EQUAL);
211 penalty_->gradient(*cx,*x_,tol);
212 con_->applyAdjointJacobian(*scratch_,*l_,*x_,tol);
215 cx_->plus(*scratch_);
217 con_->value(*cl_,*x_,tol);
225 PV &jv_pv = Teuchos::dyn_cast<PV>(jv);
226 const PV &v_pv = Teuchos::dyn_cast<
const PV>(v);
227 const PV &x_pv = Teuchos::dyn_cast<
const PV>(x);
230 RCP<V> jvx = jv_pv.
get(OPT);
231 RCP<V> jvl = jv_pv.
get(EQUAL);
234 RCP<const V> vx = v_pv.get(OPT);
235 RCP<const V> vl = v_pv.get(EQUAL);
238 l_ = x_pv.get(EQUAL);
241 obj_->hessVec(*jvx,*vx,*x_,tol);
242 con_->applyAdjointHessian(*scratch_,*l_,*vx,*x_,tol);
243 jvx->plus(*scratch_);
246 con_->applyAdjointJacobian(*scratch_,*vl,*x_,tol);
247 jvx->plus(*scratch_);
250 Elementwise::DivideAndInvert<Real> divinv;
251 Elementwise::Multiply<Real> mult;
256 scratch_->axpy(-1.0,*xl_);
257 scratch_->applyBinary(divinv,*zl_);
258 scratch_->applyBinary(mult,*vx);
263 scratch_->axpy(-1.0,*x_);
264 scratch_->applyBinary(divinv,*zu_);
265 scratch_->applyBinary(mult,*vx);
267 jvx->plus(*scratch_);
299 #endif // ROL_PRIMALDUALKKTOPERATOR_H
Provides the interface to evaluate objective functions.
void value(V &c, const V &x, Real &tol)
Evaluate the constraint operator at .
int getNumberConstraintEvaluations(void) const
Teuchos::RCP< const V > x_
EqualityConstraint< Real > CON
Teuchos::RCP< const V > zl_
Teuchos::ParameterList PL
static const size_type OPT
Teuchos::RCP< const V > zu_
Teuchos::RCP< const V > xl_
Defines the linear algebra of vector space on a generic partitioned vector.
Teuchos::RCP< const Vector< Real > > get(size_type i) const
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
Teuchos::RPC< V > scratch_
static const size_type UPPER
int getNumberFunctionEvaluations(void) const
Symmetrized form of the KKT operator for the Type-EB problem with equality and bound multipliers...
const Teuchos::RCP< const V > maskU_
Defines the linear algebra or vector space interface.
PartitionedVector< Real > PV
Teuchos::RCP< const V > xu_
static const size_type LOWER
Elementwise::ValueSet< Real > ValueSet
Provides the interface to evaluate the Interior Pointy log barrier penalty function with upper and lo...
Defines the equality constraint operator interface.
PrimalDualInteriorPointResidual(const Teuchos::RCP< PENALTY > &penalty, const Teuchos::RCP< CON > &con, const V &x, Teuchos::RCP< V > &scratch)
static const size_type EQUAL
const Teuchos::RCP< OBJ > obj_
BoundConstraint< Real > BND
const Teuchos::RCP< const V > maskL_
int getNumberGradientEvaluations(void) const
void applyJacobian(V &jv, const V &v, const V &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
Provides the interface to apply a linear operator.
Provides the interface to apply upper and lower bound constraints.
Teuchos::RCP< const V > l_
const Teuchos::RCP< CON > con_
std::vector< PV >::size_type size_type
LinearOperator< Real > LOP
const Teuchos::RCP< PENALTY > penalty_
InteriorPointPenalty< Real > PENALTY