44 #ifndef ROL_CONSTRAINT_MANAGER_H
45 #define ROL_CONSTRAINT_MANAGER_H
63 ROL::Ptr<Constraint<Real> >
con_;
64 ROL::Ptr<Vector<Real> >
l_;
65 ROL::Ptr<Vector<Real> >
x_;
66 ROL::Ptr<BoundConstraint<Real> >
bnd_;
68 std::vector<ROL::Ptr<Constraint<Real> > >
cvec_;
69 std::vector<ROL::Ptr<Vector<Real> > >
lvec_;
70 std::vector<ROL::Ptr<Vector<Real> > >
svec_;
71 std::vector<ROL::Ptr<BoundConstraint<Real> > >
sbnd_;
83 Real tol = std::sqrt(ROL_EPSILON<Real>());
84 con->value(*s,*x,tol);
94 int size = static_cast<int>(cvec.size());
95 if ( size != static_cast<int>(lvec.size()) ) {
98 if ( size != static_cast<int>(bvec.size()) ) {
99 throw Exception::NotImplemented(
">>> ROL::ConstraintManager: Constraint and BoundConstraint vectors are different sizes!");
102 ROL::Ptr<BoundConstraint<Real> > bnd0;
103 if ( bnd == ROL::nullPtr ) {
104 bnd0 = ROL::makePtr<BoundConstraint<Real>>(*x);
114 int cnt = 1, cnt_con = 0;
117 for (
int i = 0; i < size; ++i) {
118 ROL::Ptr<Constraint<Real> > con = cvec[i];
119 ROL::Ptr<Vector<Real> > l = lvec[i];
120 ROL::Ptr<BoundConstraint<Real> > cbnd = bvec[i];
121 if (con != ROL::nullPtr) {
122 if ( con->isActivated() ) {
126 cvec_.push_back(con);
128 if (cbnd != ROL::nullPtr) {
129 if ( cbnd->isActivated() ) {
133 svec_.push_back(l->dual().clone());
136 sbnd_.push_back(cbnd);
151 l_ = ROL::makePtr<PartitionedVector<Real>>(
lvec_);
164 x_ = ROL::makePtr<PartitionedVector<Real>>(
svec_);
165 bnd_ = ROL::makePtr<BoundConstraint_Partitioned<Real>>(
sbnd_,
svec_);
190 std::vector<ROL::Ptr<BoundConstraint<Real> > > bvec(cvec.size(),ROL::nullPtr);
200 std::vector<ROL::Ptr<Constraint<Real> > > cvec(1,con);
201 std::vector<ROL::Ptr<Vector<Real> > > lvec(1,l);
202 std::vector<ROL::Ptr<BoundConstraint<Real> > > bvec(1,cbnd);
211 std::vector<ROL::Ptr<Constraint<Real> > > cvec(1,con);
212 std::vector<ROL::Ptr<Vector<Real> > > lvec(1,l);
213 std::vector<ROL::Ptr<BoundConstraint<Real> > > bvec(1,ROL::nullPtr);
243 int size = static_cast<int>(
cvec_.size());
245 for (
int i = 0; i < size; ++i) {