120#include <initializer_list>
149 return a.template
maps<T>([] (
const auto & item) {
return item; });
171 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
200 for (
size_t i = 0; i < a.
size(); ++i)
220 for (
auto it =
l.
get_it(); it.has_curr(); it.next_ne())
240 std::vector<typename C::Item_Type>
ret;
241 if constexpr (
requires { c.size(); })
242 ret.reserve(c.size());
243 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
244 ret.push_back(it.get_curr());
263 for (
const auto & item : v)
284 for (
const auto & item : v)
304 for (
const auto & item : v)
326 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
346 for (
size_t i = 0; i < a.
size(); ++i)
366 for (
size_t i = 0; i < a.
size(); ++i)
386 std::deque<typename C::Item_Type>
ret;
387 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
388 ret.push_back(it.get_curr());
407 for (
const auto & item : d)
428 for (
const auto & item : d)
448 for (
const auto & item : d)
527 for (
size_t i = 0; i < a.
size(); ++i)
547 for (
const auto & item : v)
570 for (
auto & item : v)
591 for (
auto & item : v)
612 for (
auto & item : v)
633 for (
auto & item : v)
653template <
class T,
class Compare,
class Alloc>
657 for (
const auto & item : s)
675template <
class T,
class Compare,
class Alloc>
680 for (
const auto & item : s)
698template <
class T,
class Compare,
class Alloc>
702 for (
const auto & item : s)
721 std::set<typename C::Item_Type>
ret;
722 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
723 ret.insert(it.get_curr());
743template <
class K,
class V,
class Compare,
class Alloc>
748 for (
const auto & [key, value] :
m)
767template <
class K,
class V,
class Compare,
class Alloc>
773 for (
const auto & [key, value] :
m)
774 ret.append(std::make_pair(key, value));
792template <
class K,
class V,
class Compare,
class Alloc>
796 for (
const auto & [key, value] :
m)
815template <
class K,
class V,
class Compare,
class Alloc>
819 for (
const auto & [key, value] :
m)
846 for (
const auto & item :
il)
871 for (
const auto & item :
il)
896 for (
const auto & item :
il)
921 for (
const auto & item :
il)
941template <
typename Key,
template <
typename,
class>
class Tree,
class Compare>
962template <
typename Key,
template <
typename,
class>
class Tree,
class Compare>
984template <
typename Key,
template <
typename,
class>
class Tree,
class Compare>
1002template <
typename Key,
template <
typename,
class>
class Tree,
class Compare>
1005 std::vector<Key>
ret;
1021template <
typename Key,
template <
typename,
class>
class Tree,
class Compare>
1044 for (
auto it = c.get_it(); it.has_curr(); it.next_ne())
1061 for (
const auto & item : v)
1078template <
typename Key,
template <
typename,
class>
class HashTable,
class Cmp>
1096template <
typename Key,
template <
typename,
class>
class HashTable,
class Cmp>
1115template <
typename Key,
template <
typename,
class>
class HashTable,
class Cmp>
1133template <
typename Key,
template <
typename,
class>
class HashTable,
class Cmp>
1136 std::vector<Key>
ret;
1137 ret.reserve(s.size());
1158template <
typename Key,
typename Data,
1159 template <
typename,
class>
class Tree,
class Compare>
1164 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p); });
1179template <
typename Key,
typename Data,
1180 template <
typename,
class>
class Tree,
class Compare>
1186 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p); });
1201template <
typename Key,
typename Data,
1202 template <
typename,
class>
class Tree,
class Compare>
1206 std::map<Key, Data>
ret;
1208 ret.emplace(p.first, p.second);
1224template <
typename Key,
typename Data,
1225 template <
typename,
class>
class Tree,
class Compare>
1230 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p.first); });
1245template <
typename Key,
typename Data,
1246 template <
typename,
class>
class Tree,
class Compare>
1251 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p.second); });
1266template <
class K,
class V,
class Compare,
class Alloc>
1271 for (
const auto & [key, value] :
m)
1289template <
typename Key,
typename Data,
class Cmp,
1290 template <
typename,
class>
class HashTable>
1295 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p); });
1310template <
typename Key,
typename Data,
class Cmp,
1311 template <
typename,
class>
class HashTable>
1317 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p); });
1332template <
typename Key,
typename Data,
class Cmp,
1333 template <
typename,
class>
class HashTable>
1337 std::map<Key, Data>
ret;
1339 ret.emplace(p.first, p.second);
1355template <
typename Key,
typename Data,
class Cmp,
1356 template <
typename,
class>
class HashTable>
1361 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p.first); });
1376template <
typename Key,
typename Data,
class Cmp,
1377 template <
typename,
class>
class HashTable>
1382 m.
for_each([&
ret](
const std::pair<Key, Data> & p) {
ret.append(p.second); });
Simple dynamic array with automatic resizing and functional operations.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
T & append(const T &data)
Append a copy of data
void reserve(size_t cap)
Reserves cap cells into the array.
size_t size() const noexcept
Return the current dimension of array.
T & append()
Allocate a new entry to the end of array.
Dynamic doubly linked list with O(1) size and bidirectional access.
T & append(const T &item)
Append a copied item at the end of the list.
Self-adjusting dynamic hash table.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Generic key-value map implemented on top of a binary search tree.
Pair * insert(const Key &key, const Data &data)
Insert a key-value pair.
Dynamic set backed by balanced binary search trees with automatic memory management.
const size_t & size() const
Returns the cardinality of the set.
Key * insert(const Key &key)
Inserts a key into the dynamic set.
void for_each(Operation &operation)
Traverse all the container and performs an operation on each element.
auto get_it() const
Return a properly initialized iterator positioned at the first item on the container.
constexpr size_t size() const noexcept
Returns the number of entries in the table.
Concept that identifies types that can be converted or used as an Aleph Array.
Main namespace for Aleph-w library functions.
Array< typename C::Item_Type > to_array(const C &c)
Convenience wrapper identical to to_Array (copy contents).
DynSetTree< T > vector_to_DynSetTree(const std::vector< T > &v)
Convert a std::vector to a DynSetTree.
std::set< Key > settree_to_stdset(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::set.
DynList< T > to_DynList(const Array< T > &a)
Convert an Array to a DynList.
DynList< K > map_keys_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract keys from a std::map to a DynList.
DynList< V > map_values_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract values from a std::map to a DynList.
DynList< std::pair< K, V > > map_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynList of pairs.
DynList< T > dyndlist_to_DynList(const DynDlist< T > &l)
Convert a DynDlist to a DynList.
DynList< T > dynarray_to_DynList(const DynArray< T > &a)
Convert a DynArray to a DynList.
DynList< Key > maptree_keys_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract keys from a DynMapTree to a DynList.
DynArray< T > dyndlist_to_DynArray(const DynDlist< T > &l)
Convert a DynDlist to a DynArray.
Array< std::pair< Key, Data > > maphash_to_Array(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to an Array of pairs.
DynList< std::pair< Key, Data > > maphash_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a DynList of pairs.
Array< std::pair< Key, Data > > maptree_to_Array(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to an Array of pairs.
DynDlist< T > vector_to_DynDlist(const std::vector< T > &v)
Convert a std::vector to a DynDlist.
Array< T > deque_to_Array(const std::deque< T > &d)
Convert a std::deque to an Array.
Array< T > init_to_Array(std::initializer_list< T > il)
Convert an initializer_list to an Array.
std::vector< Key > sethash_to_vector(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a std::vector.
DynList< std::pair< Key, Data > > maptree_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a DynList of pairs.
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 > dynarray_to_Array(const DynArray< T > &a)
Convert a DynArray to an Array.
DynList< Data > maptree_values_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract values from a DynMapTree to a DynList.
DynArray< Key > settree_to_DynArray(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynArray.
std::map< Key, Data > maphash_to_stdmap(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a std::map.
Array< T > set_to_Array(const std::set< T, Compare, Alloc > &s)
Convert a std::set to an Array.
DynList< T > vector_to_DynList(const std::vector< T > &v)
Convert a std::vector to a DynList.
DynArray< T > dynlist_to_DynArray(const DynList< T > &l)
Convert a DynList to a DynArray.
DynArray< T > array_to_DynArray(const Array< T > &a)
Convert an Array to a DynArray.
DynSetTree< typename C::Item_Type > to_DynSetTree(const C &c)
Convert a container to a DynSetTree (AVL by default).
@ Tree
Basic arc (in spanning tree).
DynArray< T > deque_to_DynArray(const std::deque< T > &d)
Convert a std::deque to a DynArray.
std::vector< Key > settree_to_vector(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::vector.
std::set< typename C::Item_Type > to_set(const C &c)
Convert a container to a std::set.
Array< T > vector_to_Array(const std::vector< T > &v)
Convert a std::vector to an Array.
DynList< Key > sethash_to_DynList(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynList.
DynDlist< T > dynlist_to_DynDlist(const DynList< T > &l)
Convert a DynList to a DynDlist.
Array< Key > sethash_to_Array(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to an Array.
DynDlist< T > init_to_DynDlist(std::initializer_list< T > il)
Convert an initializer_list to a DynDlist.
DynList< Data > maphash_values_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract values from a MapOpenHash to a DynList.
DynList< Key > settree_to_DynList(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynList.
std::map< Key, Data > maptree_to_stdmap(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a std::map.
DynArray< T > vector_to_DynArray(const std::vector< T > &v)
Convert a std::vector to a DynArray.
DynList< T > deque_to_DynList(const std::deque< T > &d)
Convert a std::deque to a DynList.
Array< std::pair< K, V > > map_to_Array(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to an Array of pairs.
DynList< Key > maphash_keys_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract keys from a MapOpenHash to a DynList.
DynList< T > set_to_DynList(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynList.
Array< typename C::Item_Type > to_Array(const C &c)
Convert a container to an Array.
DynMapTree< K, V > stdmap_to_DynMapTree(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynMapTree.
DynArray< T > set_to_DynArray(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynArray.
Array< Key > settree_to_Array(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to an Array.
std::vector< typename C::Item_Type > to_vector(const C &c)
Convert a container to a std::vector.
DynArray< Key > sethash_to_DynArray(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynArray.
std::deque< typename C::Item_Type > to_deque(const C &c)
Convert a container to a std::deque.
DynArray< typename C::Item_Type > to_DynArray(const C &c)
Convert a container to a DynArray.
DynDlist< T > dynarray_to_DynDlist(const DynArray< T > &a)
Convert a DynArray to a DynDlist.
DynList< T > init_to_DynList(std::initializer_list< T > il)
Convert an initializer_list to a DynList.
DynArray< T > init_to_DynArray(std::initializer_list< T > il)
Convert an initializer_list to a DynArray.
Open addressing hash map for key-value pairs.
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
Dynamic array container with automatic resizing.
Lazy and scalable dynamic array implementation.
Dynamic doubly linked list implementation.
Dynamic map with open hashing.
Dynamic key-value map based on balanced binary search trees.
Dynamic set implementations based on hash tables.
Dynamic set implementations based on balanced binary search trees.