38# include <gtest/gtest.h>
45using namespace testing;
50 return ((x != 0) && !(x & (x - 1))) != 0;
64 for (
size_t i = 0; i < 30; ++i)
137 for (
size_t i = 0; i < n; ++i)
159 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
165 for (
size_t i = 0; i <
m.
size(); ++i)
169 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
185 for (
size_t i = 0; i <
m.
size(); ++i)
196 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
219 auto p1 = std::make_unique<int>(5);
220 auto p2 = std::make_unique<int>(7);
229 auto last =
m.remove_last();
233 auto first =
m.remove_first();
248 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
257 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
264 for (
size_t i = 0; i <
m.
capacity(); ++i, ++
k)
273 for (
size_t i =
m.
size(); i < 2 *
cap1; ++i, ++
k)
281 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
296 m.reserve(2 * cap + 1);
306 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
316 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
323 auto ptr =
m.get_ptr();
334 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
348 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
370 for (
size_t i = 0; i <
m.
size(); ++i, ++
k)
393 for (
size_t i = 0; i < 10; ++i)
397 for (
size_t k = 0;
k < 10; ++
k, ++
N)
405 for (
long i = 9; i >= 0; --i)
409 for (
auto it =
l.
get_it(); it.has_curr(); it.next(), ++n)
416 constexpr size_t num_items = 10;
419 for (
size_t i = 0; i < num_items; ++i)
423 for (
size_t k = 0;
k < num_items; ++
k, ++
N)
431 for (
size_t i = 0; i < num_items; ++i)
435 for (
size_t k = 0;
k < 10; ++
k, it.next(), --n)
444 for (
size_t i = 0; i < n; ++i)
451 for (
size_t i = 0; i < n; ++i)
476 for (
size_t i = 0; i < 100; ++i)
479 for (
size_t i = 100; i > 0; --i)
542 static_assert(
noexcept(
m.
clear()),
"clear() must be noexcept");
551 for (
size_t i = 0; i < 10; ++i)
583 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.
Dynamic singly linked list with functional programming support.
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)
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.
and
Check uniqueness with explicit hash + equality functors.
bool traverse(Node *root, Op op)
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
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.