8 has(
const std::set<T>& s,
const T& e)
10 return s.find(e) != std::end(s);
13 template <
typename Key,
typename Value,
typename Comp,
typename Alloc>
15 std::set<typename std::map<Key, Value, Comp, Alloc>::mapped_type>
16 image(
const std::map<Key, Value, Comp, Alloc>& m)
18 std::set<typename std::map<Key, Value, Comp, Alloc>::mapped_type> res;
19 for (
const auto& p: m)
31 std::insert_iterator<std::set<T>> i{res, begin(res)};
32 std::set_intersection(begin(set1), end(set1),
33 begin(set2), end(set2),
47 for (
const auto& set1: pset)
48 for (
const auto& set2: pset)
62 get_union(
const std::set<T>& set1,
const std::set<T>& set2)
65 std::insert_iterator<std::set<T>> i{res, begin(res)};
66 std::set_union(begin(set1), end(set1),
67 begin(set2), end(set2),
75 print(
const std::set<T>& set, std::ostream& o)
78 for (
const auto& m: set)
86 template <
typename Container1,
typename Container2>
88 bool subset(
const Container1& set1,
const Container2& set2)
90 return std::includes(set2.begin(), set2.end(),
91 set1.begin(), set1.end());
bool subset(const Container1 &set1, const Container2 &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
std::set< T, Compare, Alloc > get_union(const std::set< T, Compare, Alloc > &set1, const std::set< T, Compare, Alloc > &set2)
The union of two sets.
std::set< std::set< T, Compare, Alloc > > intersection_closure(std::set< std::set< T, Compare, Alloc >> pset)
The set of all the intersections of the sets in pset.
std::ostream & print(const ValueSet &vs, const typename ValueSet::value_t &v, std::ostream &o, const std::string &format)
Applies to (ValueSet, Value, ostream, string): for expansionset, polynomialset, ratexpset, and weightset.
std::set< typename std::map< Key, Value, Comp, Alloc >::mapped_type > image(const std::map< Key, Value, Comp, Alloc > &m)
The set of values of a map.
std::set< T, Compare, Alloc > intersection(const std::set< T, Compare, Alloc > &set1, const std::set< T, Compare, Alloc > &set2)
The intersection of two sets.
bool has(const std::map< Key, Value, Compare, Alloc > &s, const Key &e)