5 template <
typename T,
typename Compare,
typename Alloc>
7 has(
const std::set<T, Compare, Alloc>& s,
const T& e)
9 return s.find(e) != std::end(s);
13 template <
typename T,
typename Compare,
typename Alloc>
14 std::set<T, Compare, Alloc>
16 const std::set<T, Compare, Alloc>& set2)
18 using set_t = std::set<T, Compare, Alloc>;
20 std::insert_iterator<set_t> i{res, begin(res)};
21 std::set_intersection(begin(set1), end(set1),
22 begin(set2), end(set2),
29 template <
typename T,
typename Compare,
typename Alloc>
30 std::set<std::set<T, Compare, Alloc>>
36 for (
const auto& set1: pset)
37 for (
const auto& set2: pset)
47 template <
typename T,
typename Compare,
typename Alloc>
48 std::set<T, Compare, Alloc>
50 const std::set<T, Compare, Alloc>& set2)
52 using set_t = std::set<T, Compare, Alloc>;
54 std::insert_iterator<set_t> i{res, begin(res)};
55 std::set_union(begin(set1), end(set1),
56 begin(set2), end(set2),
63 template <
typename T,
typename Compare,
typename Alloc>
65 print(
const std::set<T, Compare, Alloc>& set, std::ostream& o)
68 for (
const auto& m: set)
77 template <
typename Container>
78 bool subset(
const Container& set1,
const Container& set2)
80 return std::includes(set2.begin(), set2.end(),
81 set1.begin(), set1.end(),
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.
bool subset(const Container &set1, const Container &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
std::ostream & print(const Aut &aut, std::ostream &out, const std::string &format)
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.
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.
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.