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)
109 const int ncon =
static_cast<int>(
cvec_.size());
110 for (
int i = 0; i < ncon; ++i) {
119 const int ncon =
static_cast<int>(
cvec_.size());
121 for (
int i = 0; i < ncon; ++i) {
124 cpv.
get(i)->axpy(static_cast<Real>(-1),
getSlack(x,cnt));
138 const int ncon =
static_cast<int>(
cvec_.size());
140 for (
int i = 0; i < ncon; ++i) {
143 jvpv.
get(i)->axpy(static_cast<Real>(-1),
getSlack(v,cnt));
161 const int ncon =
static_cast<int>(
cvec_.size());
164 for (
int i = 0; i < ncon; ++i) {
170 getSlack(ajv,cnt).scale(static_cast<Real>(-1));
189 const int ncon =
static_cast<int>(
cvec_.size());
192 for (
int i = 0; i < ncon; ++i) {
193 ROL::Ptr<const Vector<Real> > ui = upv.
get(i);
214 const int ncon =
static_cast<int>(
cvec_.size());
215 for (
int i = 0; i < ncon; ++i) {
224 const int ncon =
static_cast<int>(
cvec_.size());
225 for (
int i = 0; i < ncon; ++i) {
226 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.