41 #ifndef ROL_COMPOSITECONSTRAINT_H 42 #define ROL_COMPOSITECONSTRAINT_H 70 Teuchos::RCP<InequalityConstraint<Real> >
incon_;
71 Teuchos::RCP<EqualityConstraint<Real> >
eqcon_;
97 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
99 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
100 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
102 incon_->update(*xo,flag,iter);
105 eqcon_->update(*xo,flag,iter);
112 PV &cpv = Teuchos::dyn_cast<
PV>(c);
113 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
115 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
116 Teuchos::RCP<const V> xs = xpv.get(
SLACK);
118 Teuchos::RCP<V> ci = cpv.
get(
INEQ);
121 incon_->value(*ci, *xo, tol);
126 eqcon_->value(*ce, *xo, tol);
138 using Teuchos::RCP;
using Teuchos::dyn_cast;
141 const PV &xpv = dyn_cast<
const PV>(x);
142 const PV &vpv = dyn_cast<
const PV>(v);
144 RCP<const V> xo = xpv.
get(
OPT);
147 RCP<const V> vo = vpv.get(
OPT);
148 RCP<const V> vs = vpv.get(
SLACK);
150 PV &jvpv = dyn_cast<
PV>(jv);
153 incon_->applyJacobian(*jvi, *vo, *xo, tol);
158 eqcon_->applyJacobian(*jve, *vo, *xo, tol);
168 using Teuchos::RCP;
using Teuchos::dyn_cast;
171 const PV &xpv = dyn_cast<
const PV>(x);
172 PV &ajvpv = dyn_cast<
PV>(ajv);
174 RCP<const V> xo = xpv.
get(
OPT);
177 RCP<V> ajvo = ajvpv.get(
OPT);
178 RCP<V> ajvs = ajvpv.get(
SLACK);
180 const PV &vpv = dyn_cast<
const PV>(v);
182 RCP<const V> vi = vpv.
get(
INEQ);
184 incon_->applyAdjointJacobian(*ajvo,*vi,*xo,tol);
192 RCP<V> temp = ajvo->clone();
193 eqcon_->applyAdjointJacobian(*temp,*ve,*xo,tol);
206 using Teuchos::RCP;
using Teuchos::dyn_cast;
208 const PV &xpv = dyn_cast<
const PV>(x);
209 const PV &vpv = dyn_cast<
const PV>(v);
210 PV &ahuvpv = dyn_cast<
PV>(ahuv);
212 RCP<const V> xo = xpv.
get(
OPT);
215 RCP<const V> vo = vpv.get(
OPT);
217 RCP<V> ahuvo = ahuvpv.get(
OPT);
218 RCP<V> ahuvs = ahuvpv.get(
SLACK);
220 RCP<V> temp = ahuvo->clone();
222 const PV &upv = dyn_cast<
const PV>(u);
224 RCP<const V> ui = upv.
get(
INEQ);
226 incon_->applyAdjointHessian(*ahuvo,*ui,*vo,*xo,tol);
231 eqcon_->applyAdjointHessian(*temp,*ue,*vo,*xo,tol);
250 incon_->setParameter(param);
252 eqcon_->setParameter(param);
Defines the linear algebra of vector space on a generic partitioned vector.
void setParameter(const std::vector< Real > ¶m)
Teuchos::RCP< const Vector< Real > > get(size_type i) const
static const size_type EQUAL
virtual void setParameter(const std::vector< Real > ¶m)
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< 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 ...
std::vector< PV >::size_type size_type
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon, const Teuchos::RCP< EqualityConstraint< Real > > &eqcon)
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_
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 i...
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon)
Teuchos::RCP< InequalityConstraint< Real > > incon_