Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
size_limits_test.cc
Go to the documentation of this file.
1
2/*
3 Aleph_w
4
5 Data structures & Algorithms
6 version 2.0.0b
7 https://github.com/lrleon/Aleph-w
8
9 This file is part of Aleph-w library
10
11 Copyright (c) 2002-2026 Leandro Rabindranath Leon
12
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 SOFTWARE.
30*/
31
32
38// BitArray::set_size() computed its bytes as (size + 7) / 8, which wraps for
39// the last seven sizes of size_t, and ArrayHeap allocated an array of
40// capacity + 1 entries, which wraps for the last one: each took a size that
41// it could not hold, with less memory than it said. DynArray, whose
42// constructor refuses a dimension past Max_Dim_Allowed, took it in reserve(),
43// touch(), operator[] and adjust(). MemArray, ArrayHeap, FixedStack and
44// FixedQueue left to new[] a count whose bytes do not fit in a size_t, for
45// which Clang, and GCC with items that have a destructor, ask the allocator
46// for SIZE_MAX bytes; and FixedQueue shifted 1 by 64 bits or more past 2^63.
47// These tests give each container that takes a size the sizes that it cannot
48// hold, those whose bytes do not fit in a size_t and, for the arrays of
49// DynArray, those past its limit. Static_Event_Table, Simplex and the hash
50// tables left such a count to new[] too, the tables after a search for the
51// next prime, which past the table of primes is by trial division. Each one must refuse them before it
52// allocates: with an exception that is not a failed allocation, since a
53// request of that size never gets memory, and under ASan the attempt itself
54// ends the program. And the container must be as it was.
55
56#include <gtest/gtest.h>
57
58#include <Simplex.H>
59#include <bitArray.H>
60#include <bloom-filter.H>
62#include <cuckoo-filter.H>
63#include <driven_table.H>
64#include <tpl_array.H>
65#include <tpl_arrayHeap.H>
66#include <tpl_arrayQueue.H>
67#include <tpl_arrayStack.H>
68#include <tpl_dynArray.H>
69#include <tpl_dynArrayHeap.H>
70#include <tpl_dynLhash.H>
71#include <tpl_dynMapOhash.H>
72#include <tpl_dynSetHash.H>
73#include <tpl_flat_map.H>
74#include <tpl_flat_set.H>
75#include <tpl_lhash.H>
76#include <tpl_memArray.H>
77#include <tpl_odhash.H>
78#include <tpl_olhash.H>
79#include <tpl_small_vector.H>
80
81#include <cstddef>
82#include <exception>
83#include <limits>
84#include <new>
85#include <stdexcept>
86#include <string>
87#include <typeinfo>
88
89using namespace Aleph;
90
91namespace
92{
93 constexpr size_t max_size = std::numeric_limits<size_t>::max();
94
95 // The counts of items of `item_size` bytes, of two or more, that no
96 // container can hold: their bytes do not fit in a size_t, near the
97 // maximum and from the least count that wraps
98 Array<size_t> sizes_beyond_bytes(const size_t item_size)
99 {
100 return {max_size, max_size - 1, max_size - 6, max_size - 7, max_size - 8,
101 max_size / item_size + 1, max_size / 2 + 1};
102 }
103
104 // And those that a DynArray of items of `item_size` bytes cannot hold
105 // either: past its limit, Max_Dim_Allowed entries
106 Array<size_t> sizes_beyond_dynarray(const size_t item_size)
107 {
108 Array<size_t> sizes = sizes_beyond_bytes(item_size);
109 const size_t limit = DynArray<int>::Max_Dim_Allowed;
110 for (const size_t s : {limit + 1, limit * 2, size_t(1) << 61, size_t(1) << 62})
111 sizes.append(s);
112 return sizes;
113 }
114
115 // The numbers of bits that a BitArray cannot hold: those whose bytes are
116 // more than a DynArray holds. It is not a test of 2^38 to 2^41 bits,
117 // which a BitArray holds with up to 256 GiB
118 Array<size_t> bits_beyond_bitarray()
119 {
120 const size_t limit = DynArray<int>::Max_Dim_Allowed;
121 return {max_size, max_size - 1, max_size - 6, max_size - 7, max_size - 8, max_size / 2 + 1,
122 limit * 8 + 1, limit * 8 + 8, limit * 16, size_t(1) << 61, size_t(1) << 62};
123 }
124
125 // What `request` did with a size that it cannot hold: "" if it threw an
126 // exception that is not a failed allocation; otherwise what happened
127 template <class Request>
128 std::string refusal_of(Request request)
129 {
130 try
131 {
132 request();
133 }
134 catch (const std::bad_array_new_length &)
135 {
136 return ""; // new[] refuses the count before it allocates
137 }
138 catch (const std::bad_alloc &)
139 {
140 return "it tried to allocate";
141 }
142 catch (const std::exception &)
143 {
144 return "";
145 }
146 return "it took the size";
147 }
148
149 // MemArray and Array of `item`, refusing the counts of items that do not
150 // fit: those of a class with a destructor too, whose new[] keeps the count
151 // before the items
152 template <class T>
153 void expect_memarray_and_array_refuse(const T & item)
154 {
155 for (const size_t n : sizes_beyond_bytes(sizeof(T)))
156 {
157 SCOPED_TRACE(n);
159 m.append(item);
160 const size_t m_cap = m.capacity();
161 EXPECT_EQ(refusal_of([&] { m.reserve(n); }), "");
162 ASSERT_EQ(m.size(), 1u);
163 EXPECT_EQ(m.first(), item);
164 EXPECT_EQ(m.capacity(), m_cap);
165 EXPECT_EQ(refusal_of([&] { MemArray<T> b(n); }), "");
166
167 Array<T> a;
168 a.append(item);
169 const size_t a_cap = a.capacity();
170 EXPECT_EQ(refusal_of([&] { a.reserve(n); }), "");
171 ASSERT_EQ(a.size(), 1u);
172 EXPECT_EQ(a[0], item);
173 EXPECT_EQ(a.capacity(), a_cap);
174 EXPECT_EQ(refusal_of([&] { Array<T> b(n, item); }), "");
175 }
176 }
177
178 // The queues and the stacks of arrays of `item`, refusing the counts of
179 // items that do not fit
180 template <class T>
181 void expect_queues_and_stacks_refuse(const T & item)
182 {
183 for (const size_t n : sizes_beyond_bytes(sizeof(T)))
184 {
185 SCOPED_TRACE(n);
187 q.put(item);
188 EXPECT_EQ(refusal_of([&] { q.reserve(n); }), "");
189 ASSERT_EQ(q.size(), 1u);
190 EXPECT_EQ(q.front(), item);
191 EXPECT_EQ(refusal_of([&] { ArrayQueue<T> b(n); }), "");
192 EXPECT_EQ(refusal_of([&] { ArrayStack<T> s(n); }), "");
193 EXPECT_EQ(refusal_of([&] { FixedQueue<T> f(n); }), "");
194 EXPECT_EQ(refusal_of([&] { FixedStack<T> s(n); }), "");
195 }
196 }
197}
198
199TEST(SizeLimits, BitArray)
200{
201 for (const size_t bits : bits_beyond_bitarray())
202 {
203 SCOPED_TRACE(bits);
204 BitArray a;
205 a.set_bit_str("101");
206 EXPECT_EQ(refusal_of([&] { a.set_size(bits); }), "");
207 EXPECT_EQ(refusal_of([&] { a.reserve(bits); }), "");
208 ASSERT_EQ(a.size(), 3u); // before the bits of an array that took the size
209 EXPECT_EQ(a.get_bit_str(), "101");
210 EXPECT_EQ(refusal_of([&] { BitArray b(bits); }), "");
211 }
212}
213
214TEST(SizeLimits, DynArray)
215{
216 for (const size_t n : sizes_beyond_dynarray(sizeof(int)))
217 {
218 SCOPED_TRACE(n);
220 a.append(5);
221 EXPECT_EQ(refusal_of([&] { a.reserve(n); }), "");
222 EXPECT_EQ(refusal_of([&] { a.adjust(n); }), "");
223 EXPECT_EQ(refusal_of([&] { (void) a.touch(n - 1); }), "");
224 EXPECT_EQ(refusal_of([&] { a[n - 1] = 6; }), "");
225 ASSERT_EQ(a.size(), 1u);
226 EXPECT_EQ(a(0), 5);
227 EXPECT_EQ(refusal_of([&] { DynArray<int> b(n); }), "");
228 }
229}
230
231TEST(SizeLimits, DynArrayHeap)
232{
233 for (const size_t n : sizes_beyond_dynarray(sizeof(int)))
234 {
235 SCOPED_TRACE(n);
237 h.insert(5);
238 EXPECT_EQ(refusal_of([&] { h.reserve(n); }), "");
239 ASSERT_EQ(h.size(), 1u);
240 EXPECT_EQ(h.top(), 5);
241 }
242}
243
244TEST(SizeLimits, ArrayHeap)
245{
246 // Its array has an entry more, the entry 0, so the least capacity that it
247 // cannot hold is one less than for the others
248 Array<size_t> sizes = sizes_beyond_bytes(sizeof(int));
249 sizes.append(max_size / sizeof(int));
250 for (const size_t n : sizes)
251 {
252 SCOPED_TRACE(n);
253 EXPECT_EQ(refusal_of([&] { ArrayHeap<int> h(n); }), "");
254 ArrayHeap<int> h(4);
255 h.insert(5);
256 EXPECT_EQ(refusal_of([&] { h.allocate_storage(n); }), "");
257 ASSERT_EQ(h.size(), 1u);
258 EXPECT_EQ(h.top(), 5);
259 }
260}
261
262TEST(SizeLimits, MemArrayAndArray)
263{
264 expect_memarray_and_array_refuse(5);
265 expect_memarray_and_array_refuse(std::string("five"));
266}
267
268TEST(SizeLimits, QueuesAndStacks)
269{
270 expect_queues_and_stacks_refuse(5);
271 expect_queues_and_stacks_refuse(std::string("five"));
272}
273
274TEST(SizeLimits, FlatSetAndFlatMap)
275{
276 for (const size_t n : sizes_beyond_bytes(sizeof(std::string)))
277 {
278 SCOPED_TRACE(n);
280 s.insert("five");
281 EXPECT_EQ(refusal_of([&] { s.reserve(n); }), "");
282 EXPECT_EQ(s.size(), 1u);
283 EXPECT_TRUE(s.contains("five"));
284 EXPECT_EQ(refusal_of([&] { FlatSet<std::string> b(n); }), "");
285
287 m.insert("five", 5);
288 EXPECT_EQ(refusal_of([&] { m.reserve(n); }), "");
289 EXPECT_EQ(m.size(), 1u);
290 EXPECT_TRUE(m.contains("five"));
291 EXPECT_EQ(refusal_of([&] { FlatMap<std::string, int> b(n); }), "");
292 }
293}
294
295TEST(SizeLimits, SmallVector)
296{
297 for (const size_t n : sizes_beyond_bytes(sizeof(std::string)))
298 {
299 SCOPED_TRACE(n);
301 v.push_back("five");
302 EXPECT_EQ(refusal_of([&] { v.reserve(n); }), "");
303 ASSERT_EQ(v.size(), 1u);
304 EXPECT_EQ(v[0], "five");
305 EXPECT_EQ(refusal_of([&] { SmallVector<std::string, 4> b(n, "x"); }), "");
306 }
307}
308
309TEST(SizeLimits, StaticEventTable)
310{
311 using Table = Static_Event_Table<int(int)>;
312 for (const size_t n : sizes_beyond_bytes(sizeof(Table::Event_Handler)))
313 {
314 SCOPED_TRACE(n);
315 EXPECT_EQ(refusal_of([&] { Table t(n); }), "");
316 }
317 EXPECT_EQ(Table(3).size(), 3u);
318 EXPECT_EQ(Table().size(), 0u);
319}
320
321TEST(SizeLimits, Simplex)
322{
323 for (const size_t n : sizes_beyond_bytes(sizeof(double)))
324 {
325 SCOPED_TRACE(n);
326 EXPECT_EQ(refusal_of([&] { Simplex<double> s(n); }), "");
327 }
328 // a restriction has one coefficient more than the variables: the largest
329 // count of variables whose bytes fit leaves no room for it
330 EXPECT_EQ(refusal_of([&] { Simplex<double> s(max_size / sizeof(double)); }), "");
331
332 Simplex<double> s(2);
333 const double row[] = {1.0, 1.0, 4.0};
334 EXPECT_NE(s.put_restriction(row), nullptr);
335}
336
337// The hash tables take the count of buckets asked for to the next prime:
338// they refuse before that search a count whose bytes do not fit, in their
339// constructors and in resize(), which leaves the table as it was. Each
340// table is given the counts past its own buckets, which have from 8 to 48
341// bytes, and must say overflow_error: a count that passed the check would
342// reach new[] after the search, which says another thing
343TEST(SizeLimits, HashTables)
344{
345 const auto refuses = [] (const char * name, const size_t bucket_size, const auto & build)
346 {
347 for (const size_t n : sizes_beyond_bytes(bucket_size))
348 {
349 SCOPED_TRACE(testing::Message() << name << " of " << n << " buckets of " << bucket_size << " bytes");
350 EXPECT_THROW(build(n), std::overflow_error);
351 }
352 };
353 refuses("ODhashTable", sizeof(ODhashTable<int>::Bucket), [] (const size_t n) { ODhashTable<int> t(n); });
354 refuses("OLhashTable", sizeof(OLhashTable<int>::Bucket), [] (const size_t n) { OLhashTable<int> t(n); });
355 refuses("LhashTable", sizeof(Dlink), [] (const size_t n) { LhashTable<int> t(n); });
356 refuses("DynSetLhash", sizeof(Dlink), [] (const size_t n) { DynSetLhash<int> t(n); });
357 refuses("DynMapHash", sizeof(Dlink), [] (const size_t n) { DynMapHash<int, int> t(n); });
358 refuses("DynLhashTable", sizeof(Dlink), [] (const size_t n) { DynLhashTable<int, int> t(n); });
359 refuses("MapODhash", sizeof(MapODhash<int, std::string>::Bucket),
360 [] (const size_t n) { MapODhash<int, std::string> t(n); });
361 refuses("MapOLhash", sizeof(MapOLhash<int, std::string>::Bucket),
362 [] (const size_t n) { MapOLhash<int, std::string> t(n); });
363 // the sizes of the buckets are not all the same: the counts differ
364 static_assert(sizeof(ODhashTable<int>::Bucket) > sizeof(OLhashTable<int>::Bucket));
365 static_assert(sizeof(MapODhash<int, std::string>::Bucket) > sizeof(Dlink));
366
368 ASSERT_NE(d.insert(5), nullptr);
369 const size_t d_cap = d.capacity();
370 refuses("ODhashTable::resize()", sizeof(ODhashTable<int>::Bucket), [&d] (const size_t n) { d.resize(n); });
371 EXPECT_EQ(d.size(), 1u);
372 EXPECT_EQ(d.capacity(), d_cap);
373 EXPECT_TRUE(d.has(5));
374
376 ASSERT_NE(l.insert(5), nullptr);
377 const size_t l_cap = l.capacity();
378 refuses("OLhashTable::resize()", sizeof(OLhashTable<int>::Bucket), [&l] (const size_t n) { l.resize(n); });
379 EXPECT_EQ(l.size(), 1u);
380 EXPECT_EQ(l.capacity(), l_cap);
381 EXPECT_TRUE(l.has(5));
382
383 DynSetLhash<int> lists;
384 lists.insert(5);
385 const size_t lists_cap = lists.capacity();
386 refuses("DynSetLhash::resize()", sizeof(Dlink), [&lists] (const size_t n) { lists.resize(n); });
387 EXPECT_EQ(lists.size(), 1u);
388 EXPECT_EQ(lists.capacity(), lists_cap);
389 EXPECT_TRUE(lists.has(5));
390}
391
392// The cuckoo filters compute their buckets, and the estimate of a Bloom
393// filter its bits, as a double: for a count next to the largest size_t
394// they are more than a size_t counts, and the conversion of such a double
395// is undefined. A cuckoo filter of one entry per bucket was built there
396// with one bucket
397TEST(SizeLimits, CuckooFiltersAndTheEstimateOfABloomFilter)
398{
399 for (const size_t n : {max_size, max_size - 1, max_size / 2 + 1, max_size / 2, max_size / 4})
400 {
401 SCOPED_TRACE(n);
402 EXPECT_THROW((Cuckoo_Filter<int, 8, 1>(n, 42)), std::overflow_error);
403 EXPECT_THROW((Cuckoo_Filter<int, 8, 4>(n, 42)), std::overflow_error);
404 EXPECT_THROW((Compact_Cuckoo_Filter<int, 8, 1>(n, 42)), std::overflow_error);
405 EXPECT_THROW((Compact_Cuckoo_Filter<int, 8, 4>(n, 42)), std::overflow_error);
406 EXPECT_THROW((void) Bloom_Filter<int>::estimate(n, 0.01), std::overflow_error);
407 }
408
409 // those that fit are built as before
410 const Cuckoo_Filter<int, 8, 1> one(1000, 42);
411 EXPECT_GE(one.capacity(), 1000u);
412 const Compact_Cuckoo_Filter<int, 8, 4> four(1000, 42);
413 EXPECT_GE(four.capacity(), 1000u);
414 const auto [m, k] = Bloom_Filter<int>::estimate(1000, 0.01);
415 EXPECT_EQ(m, 9586u);
416 EXPECT_EQ(k, 7u);
417 // and the most bits that a size_t counts, at a probability of 1/2
418 EXPECT_NO_THROW((void) Bloom_Filter<int>::estimate(max_size / 4, 0.5));
419 // and bits past half of what a size_t counts, where fewer than twice
420 // what it counts are refused: the limit is its width
421 EXPECT_NO_THROW((void) Bloom_Filter<int>::estimate(max_size / 2, 0.5));
422 EXPECT_THROW((void) Bloom_Filter<int>::estimate(max_size / 8, 0.01), std::overflow_error);
423
424 // a probability that is not a number is not in (0, 1): its bits were
425 // not a number either, which no limit refuses, and their conversion
426 // gave 2^63 with GCC 14
427 const double not_a_number = std::numeric_limits<double>::quiet_NaN();
428 EXPECT_THROW((void) Bloom_Filter<int>::estimate(1000, not_a_number), std::invalid_argument);
429 EXPECT_THROW((Bloom_Filter<int>(1000, not_a_number)), std::invalid_argument);
430 for (const double p : {0.0, 1.0, -0.5, 2.0, std::numeric_limits<double>::infinity()})
431 EXPECT_THROW((void) Bloom_Filter<int>::estimate(1000, p), std::invalid_argument) << p;
432}
Simplex algorithm for linear programming.
Space-efficient bit array implementation.
Probabilistic set membership with Bloom filters.
long double h
Definition btreepic.C:154
size_t row
Definition ca-c-api.h:115
Fixed-capacity binary heap backed by a raw array.
Queue implemented with a single dynamic array.
T & front(const size_t i=0)
Return the i-th oldest item of the queue.
T & put(const T &item)
Copy and put an item in the queue.
void reserve(const size_t cap)
Reserve capacity for at least cap items, keeping the queue order.
Stack implemented with simple dynamic array and with bounds verification.
Simple dynamic array with automatic resizing and functional operations.
Definition tpl_array.H:141
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
Definition tpl_array.H:450
T & append(const T &data)
Append a copy of data
Definition tpl_array.H:331
constexpr size_t capacity() const noexcept
Return the internal capacity.
Definition tpl_array.H:456
void reserve(size_t cap)
Reserves cap cells into the array.
Definition tpl_array.H:402
Contiguous array of bits.
Definition bitArray.H:201
std::string get_bit_str() const
Definition bitArray.H:981
void set_bit_str(const std::string &str)
Definition bitArray.H:966
void reserve(const size_t dim)
Reserve memory in advance for the bit array dim dimension.
Definition bitArray.H:344
constexpr size_t size() const noexcept
Returns the dimension of the bit array.
Definition bitArray.H:350
void set_size(const size_t sz)
Resets the dimension of the array.
Definition bitArray.H:362
Bloom filter implementation.
static std::tuple< size_t, size_t > estimate(const size_t n, const double p)
Estimate the parameters of a Bloom filter.
Memory-optimized Cuckoo Filter with bit-packed fingerprints.
size_t capacity() const noexcept
Return the total number of fingerprint slots (including stash).
Industrial-grade Cuckoo Filter implementation.
size_t capacity() const noexcept
Return the total number of fingerprint slots (including stash).
Dynamic heap (priority queue) backed by DynArray.
T & insert(const T &key)
Insert a copy of key into the heap.
void adjust(const size_t dim)
Set a new dimension.
T & touch(const size_t i)
Touch the entry i.
size_t size() const noexcept
Return the current dimension of array.
T & append()
Allocate a new entry to the end of array.
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
Key * insert(const Key &key)
Inserts key into the hash set.
bool has(const Key &key) const noexcept
Checks if a key exists in the hash table.
Dynamic hash table mapping keys to records with separate chaining.
T & insert(const T &item)
Definition htlist.H:1308
size_t size() const noexcept
Return the number of items of the list, in constant time.
Definition htlist.H:1264
Very simple queue implemented with a contiguous array.
Fixed length stack.
Ordered map stored as two parallel sorted contiguous arrays.
Ordered set stored as a sorted contiguous array.
void reserve(size_t cap)
Reserve capacity for at least cap keys.
bool contains(const Key &k) const
Test membership.
size_t size() const noexcept
Return the number of stored keys. O(1).
std::pair< const_iterator, bool > insert(const Key &k)
Insert a copy of k if no equivalent key exists.
Generic linear hash table.
Simple, scalable and fast dynamic array.
size_t size() const noexcept
Return the number of elements.
Open addressing hash table with double hashing collision resolution.
Definition tpl_odhash.H:193
constexpr bool contains(const Key &key) const noexcept
Alias for has().
Definition hashDry.H:769
Open addressing hash table with linear probing collision resolution.
Definition tpl_olhash.H:175
Linear program solver using the Simplex method.
Definition Simplex.H:279
T * put_restriction(const T *coefs=nullptr, ConstraintType type=ConstraintType::LE)
Adds a constraint to the linear program.
Definition Simplex.H:1132
Contiguous dynamic array with N elements of inline storage.
T & push_back(const T &item)
STL-style alias of append(const T &).
size_t size() const noexcept
Return the number of stored elements. O(1).
void reserve(const size_t cap)
Reserve capacity for at least cap elements.
Key * append(const Key &key)
Alias for insert() (copy version).
Definition hashDry.H:733
constexpr size_t size() const noexcept
Returns the number of entries in the table.
Definition hashDry.H:954
constexpr size_t capacity() const noexcept
Returns the current capacity of the table.
Definition hashDry.H:964
Key * insert(const Key &key)
Inserts a key into the hash table (copy version).
Definition hashDry.H:507
Fixed-size event table implementation.
Memory-optimized Cuckoo filter with bit-packed fingerprints.
Probabilistic set membership with Cuckoo filters.
#define TEST(name)
Event-driven table abstraction for event-driven simulations.
LinearHashTable< int > Table
Definition lin-hash.cc:56
Main namespace for Aleph-w library functions.
size_t size(Node *root) noexcept
See compute_cardinality_rec(Node * root).
constexpr Bit_Column bits(const unsigned n)
Column of n bits without sign: the integers of [0, 2^n - 1].
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:152
Hash-based dynamic set (defined in tpl_dynSetHash.H).
Generic hash table with collision resolution by separate chaining and buckets without virtual destruc...
Definition tpl_lhash.H:1008
Open addressing hash map using double hashing.
Open addressing hash map using linear probing.
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
static int * k
Fixed-capacity binary heap and heapsort algorithms.
Circular queue implementations backed by arrays.
Stack implementations backed by dynamic or fixed arrays.
Dynamic array container with automatic resizing.
Array-based dynamic binary heap.
Lazy and scalable dynamic array implementation.
Dynamic hash table mapping keys to records with separate chaining.
Dynamic map with open hashing.
Dynamic set implementations based on hash tables.
Sorted-array map (Aleph::FlatMap), a cache-friendly ordered map.
Sorted-array set (Aleph::FlatSet), a cache-friendly ordered set.
Hash tables with collision resolution by separate chaining.
Simple, scalable, contiguous dynamic array.
Open addressing hash table with double hashing.
Open addressing hash table with linear probing.
Dynamic array with inline storage (Aleph::SmallVector).
DynList< int > l