163 requires (std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T>)
166 for (
size_t i = 0; i < n; ++i)
203 requires (std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T>)
216 requires (std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T>)
246 requires std::is_copy_assignable_v<T>
248 return array.put(data);
259 return array.put(std::forward<T>(data));
283 return array.push(data);
295 return array.push(std::forward<T>(data));
324 return *
array.get_ptr();
330 return *
array.get_ptr();
414 for (
size_t i = 0; i < n; ++i)
430 template<
class Operation>
437 template<
class Operation>
444 template<
class Operation>
451 template<
class Operation>
480template<
typename T,
typename ...
Args>
486template <
class Container>
487inline std::vector<typename Container::Item_Type>
490 std::vector<typename Container::Item_Type>
ret(c.size());
491 for (
size_t i = 0; i < c.size(); ++i)
Variadic constructor macros for containers.
#define Args_Ctor(Name, Type)
Container traversal and functional operation mixins.
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
#define Special_Ctors(Set_Type, Type)
Generates special constructors for containers.
Core header for the Aleph-w library.
Simple dynamic array with automatic resizing and functional operations.
constexpr const T & operator()(const size_t i) const noexcept
Return a constant reference to the ith element. It does not perform bound_statics checks.
Array & operator=(Array &&s) noexcept
Assign by moving s to this
static Array create(size_t n)
Create an array with n logical elements.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
void empty() noexcept
Empties the container.
void clear() noexcept
Empties the container.
T & append(T &&data)
Append data
constexpr bool is_empty() const noexcept
Checks if the container is empty.
Array(size_t dim=32)
The type of key.
bool traverse(Operation &&operation=Operation()) const
bool traverse(Operation &operation) const
T & base()
Return a reference to the first element of array.
Array & operator=(const Array &s)
Assign by copy s to this
T Key_Type
The type of element.
T & insert(const T &data)
insert a copy of data at the beginning of the array.
bool traverse(Operation &&operation=Operation())
Array(Array &&s) noexcept
Move constructor.
void swap(Array &s) noexcept
Swap this with s
Array append(const Array &a) const
bool traverse(Operation &operation)
Traverse all the items of the stack from the youngest to the oldest and conditionally performs an ope...
Array & append(const Array &a)
const T & get_first() const noexcept
return a constant reference to the first element.
T & insert(T &&data)
insert a copy of data at the beginning of the array.
T & operator[](size_t i)
Return a reference to the ith element.
Array(size_t n, const T &value)
Construct an array with n copies of value.
T & get_first() noexcept
return a modifiable reference to the first element.
const T & operator[](size_t i) const
Return a constant reference to the ith element.
constexpr T & operator()(const size_t i) noexcept
Return a reference to the ith element. It does not perform bound_statics checks.
Array & reverse()
Reverse the order of items in array.
bool is_valid() const noexcept
const T & get_last() const noexcept
return a constant reference to the last element.
T & append(const T &data)
Append a copy of data
T & get_last() noexcept
return a modifiable reference to the last element.
constexpr size_t capacity() const noexcept
Return the internal capacity.
Array reverse() const
Return a copy of this with its items reversed.
Array(const Array &s)
Copy constructor.
void reserve(size_t cap)
Reserves cap cells into the array.
void putn(const size_t n)
Reserve n additional logical slots in the array without value-initializing them.
Array to_array() const
Copy to Aleph::Array (requires copyable elements).
Simple, scalable and fast dynamic array.
Mixin providing equality comparison for sequence containers.
Common methods to the Aleph-w ( ) containers.
Common sequential searching methods on containers.
Mixin that adds STL begin()/end() and cbegin()/cend() to Aleph containers.
__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.
Main namespace for Aleph-w library functions.
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.
std::decay_t< typename HeadC::Item_Type > T
Array< T > build_array(Args ... args)
std::vector< typename Container::Item_Type > to_stdvector(const Container &c)
Iterator on the items of an array.
Iterator(const Array< T > &s) noexcept
Initialize an iterator on array s
typename MemArray< T >::Iterator Base
Simple iterator on elements of array.
Generic list of items stored in a container.
Dynamic doubly linked list implementation.
Simple, scalable, contiguous dynamic array.