38# include <gtest/gtest.h>
46using namespace testing;
51 return ((x != 0) && !(x & (x - 1))) != 0;
65 for (
size_t i = 0; i < 30; ++i)
138 for (
size_t i = 0; i < n; ++i)
160 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
166 for (
size_t i = 0; i <
m.
size(); ++i)
170 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
186 for (
size_t i = 0; i <
m.
size(); ++i)
197 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
220 auto p1 = std::make_unique<int>(5);
221 auto p2 = std::make_unique<int>(7);
230 auto last =
m.remove_last();
234 auto first =
m.remove_first();
249 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
258 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
265 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
274 for (
size_t i =
m.
size(); i < 2 *
cap1; ++i, ++
k)
282 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
297 m.reserve(2 * cap + 1);
307 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
317 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
324 auto ptr =
m.get_ptr();
335 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
349 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
371 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
394 for (
size_t i = 0; i < 10; ++i)
398 for (
size_t k = 0;
k < 10; ++
k, ++
N)
406 for (
long i = 9; i >= 0; --i)
410 for (
auto it =
l.
get_it(); it.has_curr(); it.next(), ++n)
417 constexpr size_t num_items = 10;
420 for (
size_t i = 0; i < num_items; ++i)
424 for (
size_t k = 0;
k < num_items; ++
k, ++
N)
432 for (
size_t i = 0; i < num_items; ++i)
436 for (
size_t k = 0;
k < 10; ++
k, it.next(), --n)
445 for (
size_t i = 0; i < n; ++i)
452 for (
size_t i = 0; i < n; ++i)
487 EXPECT_THROW(
m.putn(std::numeric_limits<size_t>::max()), overflow_error);
496 for (
size_t i = 0; i < 100; ++i)
499 for (
size_t i = 100; i > 0; --i)
562 static_assert(
noexcept(
m.
clear()),
"clear() must be noexcept");
571 for (
size_t i = 0; i < 10; ++i)
603 for (
size_t i = 0; i < n; ++i)
T & get_curr() const
Get the current item with bounds checking.
void reset_last() noexcept
Reset the iterator to the last item.
void reset() noexcept
Reset the iterator to the first item.
void prev()
Move to the previous item with bounds checking.
void next()
Advance to the next item with bounds checking.
bool has_curr() const noexcept
Check if there is a current valid item.
Doubly-linked list (defined in tpl_dynList.H).
T & insert(const T &item)
T & append(const T &item)
constexpr bool is_empty() const noexcept
Simple, scalable and fast dynamic array.
size_t size() const noexcept
Return the number of elements.
T & append(const T &item)
T * get_ptr() const noexcept
Return the current base of array.
constexpr size_t capacity() const noexcept
The type of element of array.
bool is_empty() const noexcept
Return true is the array is empty.
void swap(ODhashTable &other) noexcept
auto get_it() const
Return a properly initialized iterator positioned at the first item on the container.
Key * append(const Key &key)
Alias for insert() (copy version).
constexpr size_t size() const noexcept
Returns the number of entries in the table.
constexpr size_t capacity() const noexcept
Returns the current capacity of the table.
void clear()
Empties the container.
constexpr bool is_empty() const noexcept
Checks if the table is empty.
Key * insert(const Key &key)
Inserts a key into the hash table (copy version).
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_dim_function > > dim(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Singly linked list implementations with head-tail access.
bool is_power_of_two(size_t x)
TEST_F(Default_MemArray, growing_in_2_powers)
Main namespace for Aleph-w library functions.
bool traverse(Node *root, Op op)
and
Check uniqueness with explicit hash + equality functors.
Simple iterator on elements of array.
bool traverse(Operation &operation) noexcept(traverse_is_noexcept< Operation >())
Traverse the container via its iterator and performs a conditioned operation on each item.
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
Simple, scalable, contiguous dynamic array.