41 #ifndef ROL_CONSTRAINT_PARTITIONED_H
42 #define ROL_CONSTRAINT_PARTITIONED_H
58 std::vector<ROL::Ptr<Constraint<Real> > >
cvec_;
68 catch (std::exception &e) {
77 catch (std::exception &e) {
93 bool isInequality =
false)
100 const std::vector<bool> &isInequality)
108 Ptr<Constraint<Real>>
get(
const int ind = 0)
const {
109 if (ind < 0 || ind > static_cast<int>(
cvec_.size())) {
116 const int ncon =
static_cast<int>(
cvec_.size());
117 for (
int i = 0; i < ncon; ++i) {
126 const int ncon =
static_cast<int>(
cvec_.size());
128 for (
int i = 0; i < ncon; ++i) {
131 cpv.
get(i)->axpy(static_cast<Real>(-1),
getSlack(x,cnt));
145 const int ncon =
static_cast<int>(
cvec_.size());
147 for (
int i = 0; i < ncon; ++i) {
150 jvpv.
get(i)->axpy(static_cast<Real>(-1),
getSlack(v,cnt));
169 const int ncon =
static_cast<int>(
cvec_.size());
172 for (
int i = 0; i < ncon; ++i) {
178 getSlack(ajv,cnt).scale(static_cast<Real>(-1));
197 const int ncon =
static_cast<int>(
cvec_.size());
200 for (
int i = 0; i < ncon; ++i) {
201 ROL::Ptr<const Vector<Real> > ui = upv.
get(i);
222 const int ncon =
static_cast<int>(
cvec_.size());
223 for (
int i = 0; i < ncon; ++i) {
232 const int ncon =
static_cast<int>(
cvec_.size());
233 for (
int i = 0; i < ncon; ++i) {
234 cvec_[i]->setParameter(param);
ROL::Ptr< const Vector< Real > > get(size_type i) const
Vector< Real > & getSlack(Vector< Real > &xs, const int ind)
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 ...
Defines the linear algebra of vector space on a generic partitioned vector.
Defines the linear algebra or vector space interface.
Constraint_Partitioned(const std::vector< ROL::Ptr< Constraint< Real > > > &cvec, const std::vector< bool > &isInequality)
const Vector< Real > & getSlack(const Vector< Real > &xs, const int ind)
Has both inequality and equality constraints. Treat inequality constraint as equality with slack vari...
virtual void setParameter(const std::vector< Real > ¶m)
ROL::Ptr< Vector< Real > > scratch_
int getNumberConstraintEvaluations(void) const
virtual void applyPreconditioner(Vector< Real > &pv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g, Real &tol)
Apply a constraint preconditioner at , , to vector . Ideally, this preconditioner satisfies the follo...
Vector< Real > & getOpt(Vector< Real > &xs)
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 .
const Vector< Real > & getOpt(const Vector< Real > &xs)
std::vector< bool > isInequality_
Constraint_Partitioned(const std::vector< ROL::Ptr< Constraint< Real > > > &cvec, bool isInequality=false)
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< ROL::Ptr< Constraint< Real > > > cvec_
void setParameter(const std::vector< Real > ¶m)
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
Defines the general constraint operator interface.