41 #ifndef ROL_COMPOSITECONSTRAINT_H
42 #define ROL_COMPOSITECONSTRAINT_H
70 Teuchos::RCP<InequalityConstraint<Real> >
incon_;
71 Teuchos::RCP<EqualityConstraint<Real> >
eqcon_;
87 if( x != Teuchos::null ) {
97 if( x != Teuchos::null ) {
109 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
111 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
112 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
114 incon_->update(*xo,flag,iter);
117 eqcon_->update(*xo,flag,iter);
124 PV &cpv = Teuchos::dyn_cast<
PV>(c);
125 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
127 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
128 Teuchos::RCP<const V> xs = xpv.get(
SLACK);
130 Teuchos::RCP<V> ci = cpv.
get(
INEQ);
133 incon_->value(*ci, *xo, tol);
138 eqcon_->value(*ce, *xo, tol);
150 using Teuchos::RCP;
using Teuchos::dyn_cast;
153 const PV &xpv = dyn_cast<
const PV>(x);
154 const PV &vpv = dyn_cast<
const PV>(v);
156 RCP<const V> xo = xpv.
get(
OPT);
159 RCP<const V> vo = vpv.get(
OPT);
160 RCP<const V> vs = vpv.get(
SLACK);
162 PV &jvpv = dyn_cast<
PV>(jv);
165 incon_->applyJacobian(*jvi, *vo, *xo, tol);
170 eqcon_->applyJacobian(*jve, *vo, *xo, tol);
180 using Teuchos::RCP;
using Teuchos::dyn_cast;
183 const PV &xpv = dyn_cast<
const PV>(x);
184 PV &ajvpv = dyn_cast<
PV>(ajv);
186 RCP<const V> xo = xpv.
get(
OPT);
189 RCP<V> ajvo = ajvpv.get(
OPT);
190 RCP<V> ajvs = ajvpv.get(
SLACK);
192 const PV &vpv = dyn_cast<
const PV>(v);
194 RCP<const V> vi = vpv.
get(
INEQ);
196 incon_->applyAdjointJacobian(*ajvo,*vi,*xo,tol);
221 using Teuchos::RCP;
using Teuchos::dyn_cast;
223 const PV &xpv = dyn_cast<
const PV>(x);
224 const PV &vpv = dyn_cast<
const PV>(v);
225 PV &ahuvpv = dyn_cast<
PV>(ahuv);
227 RCP<const V> xo = xpv.
get(
OPT);
230 RCP<const V> vo = vpv.get(
OPT);
232 RCP<V> ahuvo = ahuvpv.get(
OPT);
233 RCP<V> ahuvs = ahuvpv.get(
SLACK);
239 const PV &upv = dyn_cast<
const PV>(u);
241 RCP<const V> ui = upv.
get(
INEQ);
243 incon_->applyAdjointHessian(*ahuvo,*ui,*vo,*xo,tol);
267 incon_->setParameter(param);
269 eqcon_->setParameter(param);
Defines the linear algebra of vector space on a generic partitioned vector.
void setParameter(const std::vector< Real > ¶m)
static const size_type EQUAL
virtual void setParameter(const std::vector< Real > ¶m)
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon, const Teuchos::RCP< Vector< Real > > &x=Teuchos::null)
Defines the linear algebra or vector space interface.
Teuchos::RCP< EqualityConstraint< Real > > getEqualityConstraint(void)
Defines the equality constraint operator interface.
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
Teuchos::RCP< const Vector< Real > > get(size_type i) const
Teuchos::RCP< InequalityConstraint< Real > > getInequalityConstraint(void)
static const size_type OPT
Has both inequality and equality constraints. Treat inequality constraint as equality with slack vari...
static const size_type INEQ
static const size_type SLACK
int getNumberConstraintEvaluations(void)
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
Teuchos::RCP< Vector< Real > > scratch_
std::vector< PV >::size_type size_type
PartitionedVector< Real > PV
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
Provides a unique argument for inequality constraints, which otherwise behave exactly as equality con...
Teuchos::RCP< EqualityConstraint< Real > > eqcon_
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon, const Teuchos::RCP< EqualityConstraint< Real > > &eqcon, const Teuchos::RCP< Vector< Real > > &x=Teuchos::null)
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::RCP< InequalityConstraint< Real > > incon_