38#include <gtest/gtest.h>
67 for (
int v : {3, 6, 9})
73 for (
size_t i = 0; i <
copy.size(); ++i)
84 for (
size_t i = 0; i < arr.
size(); ++i)
140 for (
size_t i = 0; i < arr.
size(); ++i)
141 arr.
access(i) =
static_cast<int>(i * 2);
142 for (
size_t i = 0; i < arr.
size(); ++i)
149 for (
int i = 0; i < 6; ++i)
158 const auto &
carr = arr;
208 for (
int i = 0; i < 5; ++i)
Deduplicate sequential Aleph containers in-place.
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)
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.
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.
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.
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.
Lazy and scalable dynamic array implementation.