38#include <gtest/gtest.h>
70 for (
int v : {3, 6, 9})
76 for (
size_t i = 0; i <
copy.size(); ++i)
87 for (
size_t i = 0; i < arr.
size(); ++i)
93 auto & ref = arr.
touch(10);
143 for (
size_t i = 0; i < arr.
size(); ++i)
144 arr.
access(i) =
static_cast<int>(i * 2);
145 for (
size_t i = 0; i < arr.
size(); ++i)
152 for (
int i = 0; i < 6; ++i)
161 const auto &
carr = arr;
261struct Fails_After_Budget
263 static inline long budget = -1;
269 throw std::bad_alloc();
290 for (
size_t i = 0; i <= 15; ++i)
308 Fails_After_Budget::budget =
static_cast<long>(4 *
block);
310 Fails_After_Budget::budget = -1;
314 for (
size_t i = 0; i <
block; ++i)
316 for (
size_t i = block; i <= 47; ++i)
322 for (
size_t i = 0; i <= 47; ++i)
331 Fails_After_Budget::budget = 0;
333 Fails_After_Budget::budget = -1;
337 for (
size_t i = 0; i <= 47; ++i)
348 Fails_After_Budget::budget = 0;
358 for (
int i = 0; i < 5; ++i)
Deduplicate sequential Aleph containers in-place.
size_t size_t int32_t value
Iterator on the items of array.
void reset_last() noexcept
Reset the iterator to the last item.
size_t get_block_size() const noexcept
Return the block size.
void adjust(const size_t dim)
Set a new dimension.
void cut(const size_t new_dim=0)
Cut the array to a new dimension; that is, it reduces the dimension of array and frees the remaining ...
Array< T > to_array() const
Copy contents into Aleph::Array (requires copyable elements).
void remove(T &item)
Given a valid reference to an item in the array, it removes it and decrease the dimension.
T & insert(const T &item)
T & get_last() const
Return a modifiable reference to the last item of array (as if this was a queue)
T & get_first() const
Return a modifiable reference to the first item of array (as if this was a queue)
size_t get_num_blocks() const noexcept
Return the number of blocks consumed by the array.
void set_default_initial_value(const T &value) noexcept
Set the default value.
void clear() noexcept
Empties the container.
T & touch(const size_t i)
Touch the entry i.
size_t size() const noexcept
Return the current dimension of array.
T pop()
Remove the last item of array (as if this was a stack)
T & access(const size_t i) const noexcept
Fast access without checking allocation and bound_min_clock checking.
bool exist(const size_t i) const
Return true if the i-th entry is accessible.
T & top() const
Return a modifiable reference to the last item of stack.
T & append()
Allocate a new entry to the end of array.
bool is_empty() const noexcept
Return true if the array is empty.
void empty() noexcept
Empty the array.
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
bool contains(const Type &item) const
Test if an item is present in the container using equality.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Compiler_SSA_Block & block(Compiler_SSA_Function &function, const Compiler_SSA_Block_Id id)
Main namespace for Aleph-w library functions.
void in_place_unique(Container &c, Compare cmp={})
Remove duplicates in-place preserving first occurrence order.
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
Lazy and scalable dynamic array implementation.