18 #ifndef HPP_CONSTRAINTS_COMOARISON_TYPES_HH 19 #define HPP_CONSTRAINTS_COMOARISON_TYPES_HH 26 namespace constraints {
29 struct ReplicateCompType {
35 for (std::size_t i = 0; i < n; ++i) v.push_back(type);
45 inline internal::ReplicateCompType
operator*(
const int& n,
48 internal::ReplicateCompType cts;
50 cts.n = (std::size_t)n;
74 const internal::ReplicateCompType& b)
91 const internal::ReplicateCompType& c)
93 for (std::size_t i = 0; i < c.n; ++i) v.push_back(c.type);
101 vv.reserve(v.size()+1);
102 vv.insert(vv.end(), v.begin(), v.end());
108 const internal::ReplicateCompType& c)
111 vv.reserve(v.size()+c.n);
112 vv.insert(vv.end(), v.begin(), v.end());
113 for (std::size_t i = 0; i < c.n; ++i) vv.push_back(c.type);
118 const internal::ReplicateCompType& r)
120 if (v.size() != r.n)
return false;
121 for (std::size_t i=0; i<v.size(); ++i)
123 if (v[i] != r.type)
return false;
132 for (ComparisonTypes_t::const_iterator it=comp.begin();
133 it!=comp.end(); ++it)
144 assert(
"false && ComparisonType out of range.");
146 if(it+1 != comp.end())
156 (hpp::constraints::internal::ReplicateCompType c1,
157 hpp::constraints::internal::ReplicateCompType c2)
160 for (std::size_t i = 0; i < c2.n; ++i) vv.push_back(c2.type);
165 #endif // HPP_CONSTRAINTS_COMOARISON_TYPES_HH ComparisonType
Definition: fwd.hh:170
Definition: active-set-differentiable-function.hh:24
bool operator==(const ComparisonTypes_t &v, const internal::ReplicateCompType &r)
Definition: comparison-types.hh:117
std::vector< ComparisonType > ComparisonTypes_t
Definition: fwd.hh:176
assert(d.lhs()._blocks()==d.rhs()._blocks())
ComparisonTypes_t operator<<(const ComparisonType &a, const ComparisonType &b)
Definition: comparison-types.hh:54
internal::ReplicateCompType operator*(const int &n, const ComparisonType &c)
Definition: comparison-types.hh:45