15 #ifndef _OCRABASE_CONSTRAINT_SET_H_ 16 #define _OCRABASE_CONSTRAINT_SET_H_ 72 typedef boost::is_base_of<Function, T> T_must_derived_from_Function;
73 BOOST_STATIC_ASSERT(T_must_derived_from_Function ::value);
107 std::vector<GenericConstraint*> _equalityConstraints;
108 std::vector<GenericConstraint*> _inequalityConstraints;
135 return _equalityConstraints[i];
148 return _inequalityConstraints[i];
164 _dime += constraint->getDimension();
165 _equalityConstraints.push_back(constraint);
169 _dimi += constraint->getDimension();
170 _inequalityConstraints.push_back(constraint);
186 for (
size_t i=0; i<constraintSet._equalityConstraints.size(); ++i)
187 add(constraintSet._equalityConstraints[i]);
188 for (
size_t i=0; i<constraintSet._inequalityConstraints.size(); ++i)
189 add(constraintSet._inequalityConstraints[i]);
203 std::vector<GenericConstraint*>::iterator it;
206 it = std::find(_equalityConstraints.begin(), _equalityConstraints.end(), constraint);
207 if (it != _equalityConstraints.end())
209 _dime -= constraint->getDimension();
210 _equalityConstraints.erase(it);
215 it = std::find(_inequalityConstraints.begin(), _inequalityConstraints.end(), constraint);
216 if (it != _inequalityConstraints.end())
218 _dimi -= constraint->getDimension();
219 _inequalityConstraints.erase(it);
234 for (
size_t i=0; i<constraintSet._equalityConstraints.size(); ++i)
235 remove(constraintSet._equalityConstraints[i]);
236 for (
size_t i=0; i<constraintSet._inequalityConstraints.size(); ++i)
237 remove(constraintSet._inequalityConstraints[i]);
251 return _equalityConstraints.size();
264 return _inequalityConstraints.size();
295 #endif //_OCRABASE_CONSTRAINT_SET_H_ Constraint< T > * getIthInequalityConstraint(size_t i)
ConstraintSet< T > & add(Constraint< T > *constraint)
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
size_t getEqualityDimension() const
size_t getNumberOfEqualityConstraints() const
Declaration file of the Constraint class.
Constraint< T > * getIthEqualityConstraint(size_t i)
size_t getNumberOfInequalityConstraints() const
size_t getInequalityDimension() const
ConstraintSet< T > & remove(Constraint< T > *constraint)