46#include <gtest/gtest.h>
77 auto [it, inserted] = s.
insert(1);
94 const std::vector<int> v = {9, 7, 7, 8, 1};
191 moved.insert(
"delta");
219 for (
int i = 0; i < 1000; ++i)
228 const int *p = s.
data();
251 std::mt19937
rng(20260702);
252 std::uniform_int_distribution<int>
key_dist(0, 200);
253 std::uniform_int_distribution<int>
op_dist(0, 2);
258 for (
int step = 0; step < 4000; ++step)
277 for (
const int k : ref)
Ordered set stored as a sorted contiguous array.
size_t capacity() const noexcept
Return the capacity of the backing array. O(1).
const Key & min() const
Smallest key (checked). Alias of get_first().
const_iterator upper_bound(const Key &k) const
First element greater than k.
size_t erase(const Key &k)
Remove the key equivalent to k, if present.
const_iterator end() const noexcept
Iterator past the greatest key. O(1).
const_iterator find(const Key &k) const
Find a key.
void empty() noexcept
Remove all keys (Aleph convention).
size_t count(const Key &k) const
Count occurrences of a key (0 or 1).
std::pair< const_iterator, const_iterator > equal_range(const Key &k) const
Range of elements equivalent to k.
void clear() noexcept
Remove all keys. Alias of empty(). Capacity is kept.
const Key & max() const
Greatest key (checked). Alias of get_last().
bool traverse(Operation operation) const
Traverse keys in sorted order while operation returns true.
const Key * data() const noexcept
Pointer to the underlying sorted, contiguous storage. O(1).
void reserve(size_t cap)
Reserve capacity for at least cap keys.
const_iterator lower_bound(const Key &k) const
First element not less than k.
bool contains(const Key &k) const
Test membership.
size_t size() const noexcept
Return the number of stored keys. O(1).
bool is_empty() const noexcept
Return true if the set holds no keys. O(1).
const Key & get_first() const
Smallest key (checked).
const Key & nth(size_t i) const
Positional access to the i-th smallest key (checked).
std::pair< const_iterator, bool > insert(const Key &k)
Insert a copy of k if no equivalent key exists.
const Key & get_last() const
Greatest key (checked).
void swap(FlatSet &s) noexcept(std::is_nothrow_swappable_v< Compare >)
Swap contents with s in O(1).
const_iterator begin() const noexcept
Iterator to the smallest key. O(1).
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
and
Check uniqueness with explicit hash + equality functors.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
Sorted-array set (Aleph::FlatSet), a cache-friendly ordered set.