25 has(
const std::set<T>& s,
const T& e)
27 return s.find(e) != std::end(s);
30 template <
typename Key,
typename Value,
typename Comp,
typename Alloc>
32 std::set<typename std::map<Key, Value, Comp, Alloc>::mapped_type>
33 image(
const std::map<Key, Value, Comp, Alloc>& m)
35 std::set<typename std::map<Key, Value, Comp, Alloc>::mapped_type> res;
36 for (
const auto& p: m)
48 std::insert_iterator<std::set<T>> i{res, begin(res)};
49 std::set_intersection(begin(set1), end(set1),
50 begin(set2), end(set2),
64 for (
const auto& set1: pset)
65 for (
const auto& set2: pset)
79 get_union(
const std::set<T>& set1,
const std::set<T>& set2)
82 std::insert_iterator<std::set<T>> i{res, begin(res)};
83 std::set_union(begin(set1), end(set1),
84 begin(set2), end(set2),
92 print(
const std::set<T>& set, std::ostream& o)
95 for (
const auto& m: set)
103 template <
typename Container1,
typename Container2>
105 bool subset(
const Container1& set1,
const Container2& set2)
107 return std::includes(set2.begin(), set2.end(),
108 set1.begin(), set1.end());
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.
std::ostream & print(const std::set< T, Compare, Alloc > &set, std::ostream &o)
Print with a separator. Meant to help debugging.
bool subset(const Container1 &set1, const Container2 &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
Definition: set.hxx:105
bool has(const std::map< Key, Value, Compare, Alloc > &s, const Key &e)
Definition: map.hh:53
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.
Definition: set.hxx:33
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.
Main namespace of Awali.
Definition: ato.hh:22