|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
#include <tpl_dynArray.H>
Classes | |
| class | Iterator |
| Iterator on the items of array. More... | |
| class | Proxy |
Public Types | |
| using | Item_Type = T |
| using | Key_Type = T |
| The type of element stored in the array. | |
Public Types inherited from StlAlephIterator< DynArray< T > > | |
| using | iterator = StlIterator< DynArray< T > > |
| using | const_iterator = StlConstIterator< DynArray< T > > |
Public Member Functions | |
| size_t | get_dir_size () const noexcept |
| Return the directory size. | |
| size_t | get_seg_size () const noexcept |
| Return the segment size. | |
| size_t | get_block_size () const noexcept |
| Return the block size. | |
| size_t | size () const noexcept |
| Return the current dimension of array. | |
| size_t | max_size () const noexcept |
| Return the maximum allowed dimension (or the maximum number of elements that could have the array treated as a container). | |
| 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 | set_default_initial_value (T &&value=T()) |
| DynArray (const size_t _pow_dir, const size_t _pow_seg, const size_t _pow_block) | |
| Construct a dynamic array given directory, segment and block sizes. | |
| DynArray (const size_t dim=0) | |
| Default constructor. | |
| template<template< typename > class List> | |
| DynArray (const List< T > &l) | |
| template<class It > | |
| DynArray (It b, It e) | |
| DynArray (std::initializer_list< T > l) | |
| ~DynArray () | |
| void | copy_array (const DynArray< T > &src_array) |
Copy the items of src_array to this | |
| DynArray (const DynArray< T > &array) | |
| Copy constructor. | |
| DynArray< T > & | operator= (const DynArray< T > &array) |
| Copy assignment. | |
| void | swap (DynArray< T > &array) noexcept |
Swap in constant time array with this | |
| DynArray (DynArray &&other) noexcept | |
| Move constructor. | |
| DynArray & | operator= (DynArray &&other) noexcept |
| Move assignment. | |
| T & | access (const size_t i) const noexcept |
| Fast access without checking allocation and bound_min_clock checking. | |
| T & | operator() (const size_t i) const noexcept |
| bool | exist (const size_t i) const |
Return true if the i-th entry is accessible. | |
| T * | test (const size_t i) const noexcept |
| Test if the i-th entry es writable,. | |
| T & | touch (const size_t i) |
| Touch the entry i. | |
| void | reserve (const size_t l, const size_t r) |
| Allocate a range of entries. | |
| void | reserve (const size_t dim) |
| Assure that the range between 0 and dim is allocated. | |
| void | cut_ne (const size_t new_dim=0) |
| 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 memory. | |
| void | adjust (const size_t dim) |
| Set a new dimension. | |
| void | empty () noexcept |
| Empty the array. | |
| Proxy | operator[] (const size_t i) const |
| Proxy | operator[] (const size_t i) |
| T & | append () |
| Allocate a new entry to the end of array. | |
| T & | append (const T &data) |
Copy data to the end of array, increase the dimension and return a modifiable reference to the copied data. | |
| T & | append (T &&data) |
Move data to the end of array, increase the dimension and return a modifiable reference to the copied data. | |
| T & | insert (const T &item) |
| T & | insert (T &&item) |
| void | push (const T &data) |
| T & | push (T &&data) |
| void | put (const T &data) |
| T & | put (T &&data) |
| void | remove (T &item) |
| Given a valid reference to an item in the array, it removes it and decrease the dimension. | |
| void | erase (T &item) |
| bool | is_empty () const noexcept |
Return true if the array is empty. | |
| DynArray & | reverse () |
| Reverse the order of items in array. | |
| T | pop () |
| Remove the last item of array (as if this was a stack) | |
| T & | top () const |
| Return a modifiable reference to the last item of stack. | |
| T & | get_first () const |
| Return a modifiable reference to the first item of array (as if this was a queue) | |
| T & | get_last () const |
| Return a modifiable reference to the last item of array (as if this was a queue) | |
| Iterator | get_it () |
| Iterator | get_it () const |
| Iterator | get_it (const size_t pos) |
| Iterator | get_it (const size_t pos) const |
| template<class Operation > | |
| bool | traverse (Operation &operation) const |
| Traverse all the array and execute a conditioned operation must have the signature: | |
| template<class Operation > | |
| bool | traverse (Operation &operation) |
| template<class Operation > | |
| bool | traverse (Operation &&operation) const |
| template<class Operation > | |
| bool | traverse (Operation &&operation) |
Public Member Functions inherited from LocateFunctions< DynArray< T >, T > | |
| auto | get_it () const |
| Return a properly initialized iterator positioned at the first item on the container. | |
| auto | get_it (const size_t pos) const |
Return a properly initialized iterator positioned at the pos item on the container. | |
| auto | get_itor () const |
Alias of get_it(). | |
| T & | nth_ne (const size_t n) noexcept |
| Return the n‑th element without bounds checking. | |
| const T & | nth_ne (const size_t n) const noexcept |
Const overload of nth_ne(size_t). | |
| T & | nth (const size_t n) |
| Return the n-th item of container. | |
| const T & | nth (const size_t n) const |
Const overload of nth(size_t). | |
| T * | find_ptr (Operation &operation) noexcept(operation_is_noexcept< Operation >()) |
| Find a pointer to an item in the container according to a searching criteria. | |
| const T * | find_ptr (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
Const overload of find_ptr(Operation&). | |
| const T * | find_ptr (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Overload of find_ptr(Operation&) const that accepts rvalues. | |
| T * | find_ptr (Operation &&operation) noexcept(operation_is_noexcept< Operation >()) |
Overload of find_ptr(Operation&) that accepts rvalues. | |
| size_t | find_index (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
| Find the position of an item in the container according to a searching criteria. | |
| size_t | find_index (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Overload of find_index(Operation&) that accepts rvalues. | |
| std::tuple< bool, T > | find_item (Operation &operation) noexcept(operation_is_noexcept< Operation >()) |
| Safe sequential searching of an item matching a criteria. | |
| std::tuple< bool, T > | find_item (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
| std::tuple< bool, T > | find_item (Operation &&operation) noexcept(operation_is_noexcept< Operation >()) |
| std::tuple< bool, T > | find_item (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Public Member Functions inherited from FunctionalMethods< DynArray< T >, T > | |
| void | emplace (Args &&... args) |
| Appends a new element into the container by constructing it in-place with the given args. | |
| void | emplace_end (Args &&... args) |
| void | emplace_ins (Args &&... args) |
| Insert a new element into the container by constructing it in-place with the given args. | |
| size_t | ninsert (Args ... args) |
| Insert n variadic items. | |
| size_t | nappend (Args ... args) |
| Append n variadic items. | |
| void | for_each (Operation &operation) |
| Traverse all the container and performs an operation on each element. | |
| void | for_each (Operation &operation) const |
Const overload of for_each(Operation&). | |
| void | for_each (Operation &&operation) const |
Overload of for_each(Operation&) const that accepts rvalues. | |
| void | for_each (Operation &&operation) |
Overload of for_each(Operation&) that accepts rvalues. | |
| void | each (Operation &operation) |
Alias of for_each(Operation&). | |
| void | each (Operation &operation) const |
Const alias of for_each(Operation&). | |
| void | each (Operation &&operation) const |
Const alias of for_each(Operation&) that accepts rvalues. | |
| void | each (Operation &&operation) |
Alias of for_each(Operation&) that accepts rvalues. | |
| void | each (size_t pos, const size_t slice, Operation &operation) const |
Traverse the container starting at pos taking one item every slice, performing a mutable operation on each visited element. | |
| void | each (const size_t pos, const size_t slice, Operation &&operation) const |
| void | mutable_for_each (Operation &operation) |
| void | mutable_for_each (Operation &&operation) |
| bool | all (Operation &operation) const |
| Check if all the elements of container satisfy a condition. | |
| bool | all (Operation &&operation) const |
Overload of all(Operation&) that accepts rvalues. | |
| bool | exists (Operation &op) const |
| Test for existence in the container of an element satisfying a criteria. | |
| bool | exists (Operation &&op) const |
Overload of exists(Operation&) that accepts rvalues. | |
| Aleph::DynList< __T > | maps (Operation &op) const |
| Map the elements of the container. | |
| Aleph::DynList< __T > | maps (Operation &&op) const |
Overload of maps(Operation&) that accepts rvalues. | |
| Aleph::DynList< __T > | maps_if (Prop prop, Operation &op) const |
| Conditional mapping of the elements of the container. | |
| Aleph::DynList< __T > | maps_if (Prop prop, Operation &&op) const |
Overload of maps_if(Prop, Operation&) that accepts rvalues. | |
| Aleph::DynList< T > | to_dynlist () const |
| Convert container to DynList. | |
| std::vector< T > | to_vector () const |
| Convert container to std::vector. | |
| __T | foldl (const __T &init, Op &op) const |
| Fold the elements of the container to a specific result. | |
| __T | foldl (const __T &init, Op &&op=Op()) const |
Overload of foldl(const __T&, Op&) that accepts rvalues. | |
| __T | fold_left (const __T &init, Op &op) const |
| Alias for foldl with the same accumulator type. | |
| __T | fold_left (const __T &init, Op &&op=Op()) const |
Overload of fold_left(const __T&, Op&) that accepts rvalues. | |
| T | fold (const T &init, Operation &operation) const |
| Simplified version of foldl() where the folded type is the same type of elements stored in the container. | |
| T | fold (const T &init, Operation &&operation) const |
Overload of fold(const T&, Operation&) that accepts rvalues. | |
| Aleph::DynList< T > | filter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria. | |
| Aleph::DynList< T > | filter (Operation &&operation) const |
Overload of filter(Operation&) that accepts rvalues. | |
| Aleph::DynList< const T * > | ptr_filter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria and return a pointer to the matched items in the container. | |
| Aleph::DynList< const T * > | ptr_filter (Operation &&operation) const |
Overload of ptr_filter(Operation&) that accepts rvalues. | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria and determine its positions respect to the traversal of container. | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &&operation) const |
Overload of pfilter(Operation&) that accepts rvalues. | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &op) const |
| Exclusive partition of container according to a filter criteria. | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &&op) const |
Overload of partition(Operation&) that accepts rvalues. | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (size_t n) const |
| Exclusive partition of container in the nth item. | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | split_half () const |
| Split the container into two halves by alternating elements. | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &op) const |
| Exclusive partition of container according to a filter criteria. | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &&op) const |
Overload of tpartition(Operation&) that accepts rvalues. | |
| size_t | length () const noexcept |
| Count the number of elements of a container. | |
| Aleph::DynList< T > | rev () const |
| Return a list with the elements of container in reverse order respect to its traversal order. | |
| Aleph::DynList< T > | take (const size_t n) const |
| Return a list with the first n elements seen in the container during its traversal. | |
| Aleph::DynList< T > | take (size_t i, const size_t j, const size_t step=1) const |
| Return a list with elements seen in the container between i and j position respect to its traversal. | |
| Aleph::DynList< T > | drop (const size_t n) const |
| Drop the first n elements seen in the container during its traversal. | |
| void | mutable_drop (const size_t n) |
| Drop the first n elements seen from container. | |
Public Member Functions inherited from GenericItems< Container, T > | |
| Aleph::DynList< T > | items () const |
| Return a list of all the elements of a container sorted by traversal order. | |
| Aleph::DynList< T > | keys () const |
Public Member Functions inherited from EqualToMethod< DynArray< T > > | |
| bool | equal_to (const DynArray< T > &r) const noexcept |
Test if elements of this are exactly contained in another container. | |
| bool | operator== (const DynArray< T > &r) const noexcept |
| bool | operator!= (const DynArray< T > &r) const noexcept |
| Negation of equal_to() | |
Public Member Functions inherited from StlAlephIterator< DynArray< T > > | |
| iterator | begin () noexcept |
| Return an STL-compatible iterator to the first element. | |
| const_iterator | begin () const noexcept |
| Return a const iterator to the first element. | |
| iterator | end () noexcept |
| Return an STL-compatible end iterator. | |
| const_iterator | end () const noexcept |
| Return a const end iterator. | |
| const_iterator | cbegin () const noexcept |
| Return a const iterator to the first element. | |
| const_iterator | cend () const noexcept |
| Return a const end iterator. | |
Static Public Member Functions | |
| static void | compute_sizes (const size_t n, size_t &d, size_t &s, size_t &b) noexcept |
Given a dimension n, it proposes values for the directory, segment and block sizes. | |
| static std::tuple< size_t, size_t, size_t > | compute_sizes (const size_t n) noexcept |
Given a dimension n, it proposes values for the directory, segment and block sizes. | |
Static Public Attributes | |
| static const size_t | Default_Pow_Dir = 6 |
| The type of element stored in the array. | |
| static const size_t | Default_Pow_Seg = 8 |
| Default two power for directory size. | |
| static const size_t | Default_Pow_Block = 12 |
| Default two power for segment size. | |
| static const unsigned long long | Max_Dim_Allowed |
| Maximum dimension allowed. | |
Static Private Member Functions | |
| static size_t | two_raised (const size_t n) noexcept |
| static size_t | compute_dim (size_t d, size_t s, size_t b) noexcept |
| static size_t | next2Pow (const size_t number) noexcept |
Private Attributes | |
| size_t | pow_dir = Default_Pow_Dir |
| size_t | pow_seg = Default_Pow_Seg |
| size_t | pow_block |
| size_t | seg_plus_block_pow = pow_seg + pow_block |
| size_t | mask_seg_plus_block = two_raised(seg_plus_block_pow) - 1 |
| size_t | dir_size = two_raised(pow_dir) |
| size_t | seg_size = two_raised(pow_seg) |
| size_t | block_size = two_raised(pow_block) |
| unsigned long long | max_dim = two_raised(seg_plus_block_pow + pow_dir) |
| size_t | mask_seg = seg_size - 1 |
| size_t | mask_block = block_size - 1 |
| size_t | current_dim |
| size_t | num_segs = 0 |
| size_t | num_blocks = 0 |
| T *** | dir = nullptr |
| T | default_initial_value = T() |
| T * | default_initial_value_ptr = &default_initial_value |
Static Private Attributes | |
| static const size_t | Max_Bits_Allowed = 8 * sizeof(size_t) |
| Default two power for block size. | |
| static const size_t | Max_Pow_Block |
Friends | |
| class | BitArray |
Additional Inherited Members | |
Related Symbols inherited from FunctionalMethods< DynArray< T >, T > | |
| each | |
| each | |
| each | |
This class implements a very versatile dynamic array which would represent a good trade-off between fast and constant access time and memory consumption. The array is lazy in the sense that the dimension grows dynamically and the required memory for a cell could be allocated at the first writing.
The data structure consists of three array types. A first array type is called block, and it is a contiguous chunk of block_size data entries. if an array occupies n entries then there are n/block_size + 1 blocks allocated. The blocks are indexed by segments of seg_size blocks which in turn are indexed by a directory of dir_size segment. For accessing to entry i the following calculations are done:
block_size. This gives the index in the segment.So, there are always four operations for each access what gives a constant access time.
In order to faster perform the calculations, the directory, segment and block size are adjusted to two powers. In this way, the division and modulus can be done with shifting and masking.
For lazy writing, that is to allocate the block just when it is certain that this will be used, the operator [] is used. This operator is able to determine whether the i-th entry has been o not written. If for example a reading on a non allocated block is done, some such as:
std::cout << a[i] << end;
Then a default initialization value will be returned. This value corresponds to the resulting of default constructor call.
At the contrary, if the first time that a writing is done, some such as:
a[i] = value;
Then the block, and eventually the segment will be allocated.
Eventually the array could be fragmented and to consume memory some proportional to the writes done. Suppose for example that you only perform:
a[0] = value; a[100000000] = value;
In this case, the registered dimension of array will be 100000000, but only two blocks will be allocated. If you only performs reads between \((0, 100000000)\) always it will be returned the default value and the majority of times neither the segment nor the block will be read, since they have not been written.
Access through [] operator perform bound_min_clock checks and it requires to test if the segment and/or block have been allocated and eventually to allocate them.
If you know (you are absolutely sure of) that the entry has already been written, and consequently it has already its block allocated, then you could use the operator () for direct access.
Access with () operator does not perform any check (bounds and blocks and segment existence). This way is faster but unsure.
() operator is an alias of access(i) method.
In order to assure that a range of entries is already allocated, you could use reserve(l, r) method, which test and eventually allocates the needed memory for the entries comprised in the range \([l,r]\).
From a functional perspective, an dynamic array could be treated as a list.
Initially, the array is empty.
A new item can be inserted with append(item. This method copy (or moves) the item to the next available entry (at the end). The dimension is increased in one unit.
You can also to treat the dynamic array as stack or queue.
The interface offer a default constructor which normally sets the sizes and serves for almost all situations.
However, sometimes is desirable to set oneself these parameter. The principal justification is given for situations where the memory is very limited.
Note that a memory manager could have enough memory dispersed through the total of available chunks, but it could not exist a contiguous block of a given size. The more large is the block size, the higher is the probability for failing to allocate. So, there are circumstances where you could be interested in setting a small block size, to facilitate the block's allocation.
Of course, these settings restrict the maximum dimension, which eventually could be composed with a larger directory. As example, consider a directory of 1024 segments of 512 blocks of 4096 entries. This gives a total of
\(1024 \times 512 \times 4096 = 2147483648\) entries.
Now suppose that you think that 4096 is too much for a block, then you could set the block to 128 and displace the difference to the directory. This gives sizes of 32768, 512 and 128 respectively and thus to obtain the same maximum capacity.
You could think that failure probability is displaced to the directory allocation, but the directory is allocated once at construction time.
Definition at line 200 of file tpl_dynArray.H.
Definition at line 210 of file tpl_dynArray.H.
The type of element stored in the array.
Definition at line 211 of file tpl_dynArray.H.
|
inline |
Construct a dynamic array given directory, segment and block sizes.
| [in] | _pow_dir | two power for directory size |
| [in] | _pow_seg | two power for segment size |
| [in] | _pow_block | two power for block size |
| bad_alloc | if there is no enough memory |
| length_error | if the given sizes exceed the maximum possible dimension |
| overflow_error | if it happens an arithmetic overflow with the bits operations |
Definition at line 722 of file tpl_dynArray.H.
References ah_length_error_if, Aleph::DynArray< T >::allocate_dir(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, and Aleph::DynArray< T >::Max_Dim_Allowed.
|
inline |
Default constructor.
| [in] | dim | initial dimension of array |
| bad_alloc | if there is no enough memory |
| length_error | si dim is greater than maximum allowed |
| overflow_error | if it happens an arithmetic overflow with the bits operations |
Definition at line 757 of file tpl_dynArray.H.
References ah_length_error_if, Aleph::DynArray< T >::allocate_dir(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, and Aleph::DynArray< T >::Max_Dim_Allowed.
|
inline |
Definition at line 772 of file tpl_dynArray.H.
Definition at line 772 of file tpl_dynArray.H.
|
inline |
Definition at line 772 of file tpl_dynArray.H.
|
inline |
Definition at line 774 of file tpl_dynArray.H.
References Aleph::DynArray< T >::release_dir().
|
inline |
Copy constructor.
| [in] | array | source of copy |
| bad_alloc | if there is no enough memory |
Definition at line 795 of file tpl_dynArray.H.
References Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::copy_array(), and Aleph::DynArray< T >::dir.
|
inlinenoexcept |
Move constructor.
Definition at line 868 of file tpl_dynArray.H.
References Aleph::DynArray< T >::default_initial_value, Aleph::DynArray< T >::default_initial_value_ptr, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::swap().
|
inlineprivate |
Definition at line 1436 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::traverse(), and Aleph::DynArray< T >::traverse().
Fast access without checking allocation and bound_min_clock checking.
The purpose of this method is to access the i-th entry in the fastest possible way. For that, no checks are done.
@param[in] i index of entry to be accessed @see exist
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 904 of file tpl_dynArray.H.
References Aleph::DynArray< T >::dir, Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), and FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::Abstract_Euclidian_Plane(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::Floyd_All_Shortest_Paths(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point(), Aleph::Compute_Cut_Nodes< GT, SA >::compute_blocks(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::connect(), Aleph::DynArray_Set< T, Equal >::count(), Aleph::DynArray< T >::Iterator::get_curr_ne(), Aleph::DynArray< T >::insert(), Aleph::DynArray< T >::insert(), Aleph::kosaraju_connected_components(), Aleph::DynArray< T >::operator()(), Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operator()(), Aleph::DynArray< T >::pop(), Aleph::matgraph_detail::read_matrix(), Aleph::DynArray< T >::remove(), Aleph::DynArray_Set< T, Equal >::remove_all(), Aleph::DynArray_Set< T, Equal >::search(), TEST(), and Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::write_graph().
Set a new dimension.
If dimension is greater than the current, then more memory is allocated; otherwise the remaining memory is freed. In both cases, the current dimension is adjusted.
| [in] | dim | new dimension value |
Definition at line 1179 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::cut(), dim(), and Aleph::DynArray< T >::reserve().
|
inlineprivatenoexcept |
Definition at line 490 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, Aleph::DynArray< T >::divide_by_block_size(), FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::modulus_by_block_size().
Definition at line 399 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, Aleph::DynArray< T >::default_initial_value_ptr, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::num_blocks.
Referenced by Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::Proxy::operator->(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::reserve(), and Aleph::DynArray< T >::touch().
|
inlineprivate |
Definition at line 503 of file tpl_dynArray.H.
References Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::block_size, and FunctionalMethods< DynArray< T >, T >::maps().
|
inlineprivate |
Definition at line 357 of file tpl_dynArray.H.
References ah_bad_alloc_unless, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, Aleph::DynArray< T >::fill_dir_to_null(), and FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::DynArray(), and Aleph::DynArray< T >::allocate_dir().
Definition at line 518 of file tpl_dynArray.H.
References Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, and FunctionalMethods< DynArray< T >, T >::maps().
Definition at line 387 of file tpl_dynArray.H.
References Aleph::DynArray< T >::fill_seg_to_null(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::num_segs, and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::Proxy::operator->(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::reserve(), and Aleph::DynArray< T >::touch().
|
inlineprivate |
Definition at line 510 of file tpl_dynArray.H.
References Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::allocate_segment(), FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::seg_size.
|
inline |
Allocate a new entry to the end of array.
Increase the dimension and return a modifiable reference to the last entry
Definition at line 1208 of file tpl_dynArray.H.
References Aleph::DynArray< T >::size(), and Aleph::DynArray< T >::touch().
Referenced by Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::Abstract_Euclidian_Plane(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point(), Aleph::DynArray< T >::append(), Aleph::DynArray< T >::append(), demo_dynarray(), DataGenerator::few_unique(), Aleph::DynArray< T >::insert(), Aleph::DynArray_Set< T, Equal >::insert(), Aleph::DynArray< T >::insert(), Aleph::DynArray_Set< T, Equal >::insert(), populate_dynarray(), Aleph::DynArray< T >::push(), Aleph::DynArray< T >::push(), Aleph::DynArray< T >::put(), Aleph::DynArray< T >::put(), DataGenerator::random(), Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::read_graph(), DataGenerator::sawtooth(), DataGenerator::sorted_asc(), DataGenerator::sorted_desc(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Copy data to the end of array, increase the dimension and return a modifiable reference to the copied data.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1215 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append(), and FunctionalMethods< DynArray< T >, T >::maps().
|
inline |
Move data to the end of array, increase the dimension and return a modifiable reference to the copied data.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1224 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append(), and FunctionalMethods< DynArray< T >, T >::maps().
|
inlinestaticprivatenoexcept |
Definition at line 247 of file tpl_dynArray.H.
References Aleph::DynArray< T >::two_raised().
Referenced by Aleph::DynArray< T >::compute_sizes(), and Aleph::DynArray< T >::resize_dir().
|
inlinestaticnoexcept |
Given a dimension n, it proposes values for the directory, segment and block sizes.
| [in] | n | proposed dimension |
Definition at line 289 of file tpl_dynArray.H.
References Aleph::DynArray< T >::compute_sizes().
|
inlinestaticnoexcept |
Given a dimension n, it proposes values for the directory, segment and block sizes.
| [in] | n | proposed dimension |
| [out] | d | directory size |
| [out] | s | segment size |
| [out] | b | block size |
Definition at line 261 of file tpl_dynArray.H.
References Aleph::DynArray< T >::compute_dim(), Aleph::DynArray< T >::Default_Pow_Block, Aleph::DynArray< T >::Default_Pow_Dir, and Aleph::DynArray< T >::Default_Pow_Seg.
Referenced by Aleph::DynArray< T >::compute_sizes(), and Aleph::DynMatrix< T >::set_dimension().
Copy the items of src_array to this
| [in] | src_array | source array |
Definition at line 783 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::DynArray< T >::DynArray(), and Aleph::DynArray< T >::operator=().
Cut the array to a new dimension; that is, it reduces the dimension of array and frees the remaining memory.
| [in] | new_dim | new dimension value |
| domain_error | if new_dim is greater than current dim |
Definition at line 1158 of file tpl_dynArray.H.
References ah_length_error_if, Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::cut_ne(), and FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::DynArray< T >::adjust(), Pointer_Table::allocate_above_heap(), build_tree(), Pointer_Table::cleanup_free_table(), Pointer_Table::clear(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::clear(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::compute_nodes_weights(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Map_Matrix_Graph< GT, SA >::copy_list_graph(), Aleph::Bit_Mat_Graph< GT, SA >::copy_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::copy_nodes(), Aleph::DynArray< T >::empty(), file_to_dynarrays(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::init_with_indexes(), Aleph::DynArray< T >::operator=(), Aleph::DynArray< T >::pop(), and Pointer_Table::remove_pointer().
Definition at line 1108 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::release_all_segments_and_blocks(), Aleph::DynArray< T >::release_block(), Aleph::DynArray< T >::release_segment(), and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::cut(), and Aleph::DynArray< T >::remove().
|
inlineprivatenoexcept |
Definition at line 476 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::pow_block.
Referenced by Aleph::DynArray< T >::advance_block_index().
|
inlinenoexcept |
Empty the array.
All the occupied memory is freed and the dimension is to set to zero
Definition at line 1189 of file tpl_dynArray.H.
References Aleph::DynArray< T >::cut().
Referenced by DataGenerator::few_unique(), DataGenerator::random(), DataGenerator::sawtooth(), Fixed_Relation::set_n(), DataGenerator::sorted_asc(), and DataGenerator::sorted_desc().
|
inlineprivate |
Definition at line 442 of file tpl_dynArray.H.
References ah_underflow_error_if, Aleph::DynArray< T >::is_empty(), and FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::DynArray< T >::get_first(), Aleph::DynArray< T >::get_last(), Aleph::DynArray< T >::pop(), Aleph::DynArray< T >::remove(), and Aleph::DynArray< T >::top().
Definition at line 1274 of file tpl_dynArray.H.
References Aleph::DynArray< T >::remove().
Return true if the i-th entry is accessible.
By accessible is understood that either the entry has been previously written or the block than would contain it is already allocated,
| [in] | i | index to test |
Definition at line 925 of file tpl_dynArray.H.
References Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operator()(), Aleph::matgraph_detail::read_matrix(), Aleph::sequential_search(), and HashStats< HashTbl >::update_stat_len().
|
inlineprivatenoexcept |
Definition at line 341 of file tpl_dynArray.H.
References Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, and FunctionalMethods< DynArray< T >, T >::maps().
Referenced by Aleph::DynArray< T >::allocate_dir().
Definition at line 349 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::allocate_segment().
|
inlinenoexcept |
Return the block size.
Definition at line 671 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size.
|
inlinenoexcept |
Return the directory size.
Definition at line 665 of file tpl_dynArray.H.
References Aleph::DynArray< T >::dir_size.
|
inline |
Return a modifiable reference to the first item of array (as if this was a queue)
Definition at line 1307 of file tpl_dynArray.H.
References Aleph::DynArray< T >::ensure_not_empty().
Referenced by TEST().
|
inline |
Definition at line 1410 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::get_it().
|
inline |
Definition at line 1415 of file tpl_dynArray.H.
Definition at line 1420 of file tpl_dynArray.H.
References ah_out_of_range_error_if, Aleph::DynArray< T >::Iterator::set_pos(), and Aleph::DynArray< T >::size().
Definition at line 1428 of file tpl_dynArray.H.
References Aleph::DynArray< T >::get_it().
|
inline |
Return a modifiable reference to the last item of array (as if this was a queue)
Definition at line 1315 of file tpl_dynArray.H.
References Aleph::DynArray< T >::ensure_not_empty(), and Aleph::DynArray< T >::size().
Referenced by TEST().
|
inlinenoexcept |
Return the number of blocks consumed by the array.
Definition at line 685 of file tpl_dynArray.H.
References Aleph::DynArray< T >::num_blocks.
|
inlinenoexcept |
Return the segment size.
Definition at line 668 of file tpl_dynArray.H.
References Aleph::DynArray< T >::seg_size.
|
inlineprivatenoexcept |
Definition at line 327 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::mask_block, Aleph::DynArray< T >::modulus_from_index_in_dir(), and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::access(), Aleph::DynArray< T >::test(), and Aleph::DynArray< T >::touch().
|
inlineprivatenoexcept |
Definition at line 301 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::pow_block, Aleph::DynArray< T >::pow_seg, Aleph::DynArray< T >::seg_plus_block_pow, Aleph::DynArray< T >::seg_size, and Aleph::DynArray< T >::two_raised().
Referenced by Aleph::DynArray< T >::access(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::reserve(), Aleph::DynArray< T >::test(), and Aleph::DynArray< T >::touch().
|
inlineprivatenoexcept |
Definition at line 318 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::modulus_from_index_in_dir(), Aleph::DynArray< T >::pow_block, Aleph::DynArray< T >::seg_size, and Aleph::DynArray< T >::two_raised().
Referenced by Aleph::DynArray< T >::access(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::reserve(), Aleph::DynArray< T >::test(), and Aleph::DynArray< T >::touch().
Definition at line 1231 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::append(), FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::open_gap().
Definition at line 1240 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::append(), FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::open_gap().
|
inlinenoexcept |
Return true if the array is empty.
Definition at line 1277 of file tpl_dynArray.H.
References Aleph::DynArray< T >::size().
Referenced by Aleph::DynArray< T >::ensure_not_empty(), and TEST().
|
inlinenoexcept |
Return the maximum allowed dimension (or the maximum number of elements that could have the array treated as a container).
Be careful with the fact that this bound_min_clock is not related to available memory
Definition at line 682 of file tpl_dynArray.H.
References Aleph::DynArray< T >::max_dim.
|
inlineprivatenoexcept |
Definition at line 483 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::mask_block.
Referenced by Aleph::DynArray< T >::advance_block_index().
|
inlineprivatenoexcept |
Definition at line 310 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::mask_seg_plus_block, and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::index_in_block(), and Aleph::DynArray< T >::index_in_seg().
Definition at line 471 of file tpl_dynArray.H.
|
inlinenoexcept |
Definition at line 913 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access().
|
inline |
Copy assignment.
| [in] | array | source of copy |
| bad_alloc | if there is no enough memory |
Definition at line 823 of file tpl_dynArray.H.
References Aleph::DynArray< T >::copy_array(), Aleph::DynArray< T >::current_dim, and Aleph::DynArray< T >::cut().
|
inlinenoexcept |
Move assignment.
Definition at line 890 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::swap().
|
inline |
Definition at line 1198 of file tpl_dynArray.H.
References Aleph::DynArray< T >::max_dim, and Aleph::DynArray< T >::resize_dir().
|
inline |
Definition at line 1191 of file tpl_dynArray.H.
References ah_out_of_range_error_if, and Aleph::DynArray< T >::max_dim.
|
inline |
Remove the last item of array (as if this was a stack)
Definition at line 1289 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::cut(), Aleph::DynArray< T >::ensure_not_empty(), FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::size().
Definition at line 1250 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append().
Definition at line 1253 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append().
Definition at line 1256 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append().
Definition at line 1259 of file tpl_dynArray.H.
References Aleph::DynArray< T >::append().
|
inlineprivatenoexcept |
Definition at line 447 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::release_blocks_and_segment().
Referenced by Aleph::DynArray< T >::cut_ne(), and Aleph::DynArray< T >::release_dir().
Definition at line 422 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::num_blocks.
Referenced by Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::release_blocks_and_segment(), and Aleph::DynArray< T >::reserve().
|
inlineprivatenoexcept |
Definition at line 431 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::release_block(), Aleph::DynArray< T >::release_segment(), and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::release_all_segments_and_blocks().
|
inlineprivatenoexcept |
Definition at line 458 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::release_all_segments_and_blocks().
Referenced by Aleph::DynArray< T >::~DynArray().
Definition at line 413 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::num_segs.
Referenced by Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::Proxy::operator->(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::release_blocks_and_segment(), Aleph::DynArray< T >::reserve(), and Aleph::DynArray< T >::touch().
|
inline |
Given a valid reference to an item in the array, it removes it and decrease the dimension.
| [in] | item | valid reference to the item to remove |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1266 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::ensure_not_empty(), and Aleph::DynArray< T >::size().
Referenced by Aleph::DynArray< T >::erase(), Aleph::DynArray_Set< T, Equal >::remove_all(), Aleph::DynArray_Set< T, Equal >::remove_one(), and TEST().
Assure that the range between 0 and dim is allocated.
| [in] | dim | upper index |
| bad_alloc | if there is no enough memory |
Definition at line 1102 of file tpl_dynArray.H.
References dim(), and Aleph::DynArray< T >::reserve().
Allocate a range of entries.
reserve(l, r) assures that all the entries comprised between l and r are allocated. After a successful call, any entry between l and r can be surely accessed with access().
| [in] | l | lower index |
| [in] | r | upper index |
| bad_alloc | if there is no enough memory |
| domain_error | if l is greater than r |
Definition at line 1033 of file tpl_dynArray.H.
References ah_domain_error_if, Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), l, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, Aleph::DynArray< T >::release_block(), Aleph::DynArray< T >::release_segment(), Aleph::DynArray< T >::resize_dir(), and Aleph::DynArray< T >::seg_size.
Referenced by Fixed_Relation::Fixed_Relation(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::Floyd_All_Shortest_Paths(), Aleph::DynArray< T >::adjust(), DynArraySortTest::build_array(), Aleph::Compute_Cut_Nodes< GT, SA >::compute_blocks(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::connect(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::init_with_indexes(), Aleph::DynArray< T >::reserve(), Fixed_Relation::set_n(), DynArraySortTest::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Relation::verify_if_add_new_points().
Definition at line 365 of file tpl_dynArray.H.
References ah_bad_alloc_unless, Aleph::DynArray< T >::compute_dim(), Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, Aleph::DynArray< T >::pow_block, Aleph::DynArray< T >::pow_dir, Aleph::DynArray< T >::pow_seg, and Aleph::DynArray< T >::two_raised().
Referenced by Aleph::DynArray< T >::operator[](), Aleph::DynArray< T >::reserve(), and Aleph::DynArray< T >::touch().
|
inline |
Reverse the order of items in array.
Definition at line 1280 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::swap(), and Aleph::DynArray< T >::touch().
|
inlinenoexcept |
Set the default value.
The default value of a dynamic array is the value to be returned when entries not still written are accessed.
| [in] | value | default value |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 694 of file tpl_dynArray.H.
References Aleph::DynArray< T >::default_initial_value, and Aleph::DynArray< T >::default_initial_value_ptr.
Referenced by Aleph::Matrix_Graph< GT, SA >::copy(), and Aleph::Matrix_Graph< GT, SA >::copy().
|
inline |
Definition at line 701 of file tpl_dynArray.H.
References Aleph::DynArray< T >::default_initial_value, and Aleph::DynArray< T >::default_initial_value_ptr.
|
inlinenoexcept |
Return the current dimension of array.
According to usage style, this could represent the number of items stored in the array seen as a container
Definition at line 676 of file tpl_dynArray.H.
References Aleph::DynArray< T >::current_dim.
Referenced by OhashCommon< HashTbl, Key >::Stats::Stats(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point(), Pointer_Table::allocate_above_heap(), Aleph::DynArray< T >::append(), assign_arcs(), assign_distance(), assign_parrectangle(), assign_rectangle(), assign_scratch(), assign_shadow(), assign_tag(), assign_triangle(), assign_without_arc(), assign_without_node(), assign_xoffset(), assign_yoffset(), Aleph::bubble_sort(), Aleph::build_index(), Aleph::build_index_ptr(), build_tree(), Pointer_Table::cleanup_free_table(), Aleph::DynArray_Set< T, Equal >::count(), demo_dynarray(), Aleph::dynarray_to_Array(), Aleph::dynarray_to_DynDlist(), Aleph::dynarray_to_DynList(), Aleph::DynArray_to_vector(), Aleph::DynArray< T >::Iterator::end(), file_to_dynarrays(), Pointer_Table::frees(), generate_split_lines(), Aleph::DynArray< T >::Iterator::get_curr(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_east_point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_height(), Aleph::DynArray< T >::get_it(), Aleph::DynArray< T >::get_last(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_north_point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_south_point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_west_point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_width(), Aleph::DynArray< T >::Iterator::has_curr(), Aleph::DynArrayHeap< T, Compare >::Iterator::has_curr(), Aleph::heapsort(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::index_node(), Pointer_Table::insert_in_free_table(), Aleph::introsort(), Pointer_Table::invariant(), Aleph::DynArray< T >::is_empty(), Aleph::DynArray< T >::Iterator::is_last(), load_key_option(), main(), Aleph::DynArray< T >::Iterator::next(), Aleph::DynArray< T >::pop(), print_dynarray(), OhashCommon< HashTbl, Key >::print_stats(), HashStats< HashTbl >::print_stats(), Aleph::quicksort(), Aleph::random_select(), reassign_key(), Aleph::DynArray< T >::remove(), Aleph::DynArray_Set< T, Equal >::remove_all(), Pointer_Table::remove_pointer(), Aleph::DynArray< T >::Iterator::reset_last(), Aleph::DynArray_Set< T, Equal >::search(), Aleph::selection_sort(), Aleph::shellsort(), Pointer_Table::size(), Dynamic_Event_Table< Signature >::size(), HashStats< HashTbl >::stats(), Aleph::ODhashTable< Key, Cmp >::stats(), Aleph::OLhashTable< Key, Cmp >::stats(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), to_array(), to_dyndlist(), to_dynlist(), Aleph::DynArray< T >::top(), and Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::write_graph().
Swap in constant time array with this
| [in] | array | to swap |
Definition at line 843 of file tpl_dynArray.H.
References Aleph::DynArray< T >::block_size, Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::default_initial_value, Aleph::DynArray< T >::default_initial_value_ptr, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::dir_size, Aleph::DynArray< T >::mask_block, Aleph::DynArray< T >::mask_seg, Aleph::DynArray< T >::mask_seg_plus_block, Aleph::DynArray< T >::max_dim, Aleph::DynArray< T >::num_blocks, Aleph::DynArray< T >::num_segs, Aleph::DynArray< T >::pow_block, Aleph::DynArray< T >::pow_dir, Aleph::DynArray< T >::pow_seg, Aleph::DynArray< T >::seg_plus_block_pow, and Aleph::DynArray< T >::seg_size.
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::operator=(), and Aleph::DynArray< T >::reverse().
Test if the i-th entry es writable,.
test(i) inspects if the entry i is already allocated. If affirmative, then a pointer to the entry in the array is returned. Otherwise, nullptr is returned.
| [in] | i | index to test. |
nullptr if the entry is not allocated; a valid pointer inside the array otherwise Definition at line 957 of file tpl_dynArray.H.
References Aleph::DynArray< T >::dir, Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), and Aleph::DynArray< T >::max_dim.
|
inline |
Return a modifiable reference to the last item of stack.
Definition at line 1299 of file tpl_dynArray.H.
References Aleph::DynArray< T >::ensure_not_empty(), and Aleph::DynArray< T >::size().
Referenced by Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point().
Touch the entry i.
touch(i) testes if the block that would contain to i is already allocated. If this is not the case, then the block, and eventually the segment, is allocated. If everything is ok, the method returns a valid pointer to the entry inside the array.
touch(i) is a concise and effective way to test and eventually to allocate memory for a new entry.
| [in] | i | index to touch |
| bad_alloc | if there is no enough memory |
Definition at line 988 of file tpl_dynArray.H.
References Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::current_dim, Aleph::DynArray< T >::dir, Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), FunctionalMethods< DynArray< T >, T >::maps(), Aleph::DynArray< T >::max_dim, Aleph::DynArray< T >::release_segment(), and Aleph::DynArray< T >::resize_dir().
Referenced by Aleph::DynArray< T >::append(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::init_with_indexes(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_matrix(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_matrix(), Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operator()(), Aleph::DynArray< T >::reverse(), TEST(), TEST(), and HashStats< HashTbl >::update_stat_len().
|
inline |
Definition at line 1493 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps().
|
inline |
Definition at line 1486 of file tpl_dynArray.H.
References FunctionalMethods< DynArray< T >, T >::maps().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1479 of file tpl_dynArray.H.
References Aleph::DynArray< T >::__traverse(), and FunctionalMethods< DynArray< T >, T >::maps().
|
inline |
Traverse all the array and execute a conditioned operation must have the signature:
If
returns false then the traversal is stopped; otherwise the traverse move to the next item.
| [in] | operation |
true if all items are traversed; false otherwise Definition at line 1472 of file tpl_dynArray.H.
References Aleph::DynArray< T >::__traverse(), and FunctionalMethods< DynArray< T >, T >::maps().
Definition at line 240 of file tpl_dynArray.H.
References ah_overflow_error_if, and Aleph::DynArray< T >::Max_Bits_Allowed.
Referenced by Aleph::DynArray< T >::compute_dim(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), and Aleph::DynArray< T >::resize_dir().
|
mutableprivate |
Definition at line 235 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::__traverse(), Aleph::DynArray< T >::advance_block_index(), Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::divide_by_block_size(), Aleph::DynArray< T >::get_block_size(), Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), Aleph::DynArray< T >::modulus_by_block_size(), Aleph::DynArray< T >::modulus_from_index_in_dir(), and Aleph::DynArray< T >::swap().
|
private |
Definition at line 336 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::__traverse(), Aleph::DynArray< T >::adjust(), Aleph::DynArray< T >::cut(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::Proxy::operator->(), Aleph::DynArray< T >::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::release_all_segments_and_blocks(), Aleph::DynArray< T >::release_dir(), Aleph::DynArray< T >::reserve(), Aleph::DynArray< T >::reverse(), Aleph::DynArray< T >::size(), Aleph::DynArray< T >::swap(), and Aleph::DynArray< T >::touch().
Definition at line 396 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::set_default_initial_value(), Aleph::DynArray< T >::set_default_initial_value(), and Aleph::DynArray< T >::swap().
|
private |
Definition at line 397 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::set_default_initial_value(), Aleph::DynArray< T >::set_default_initial_value(), and Aleph::DynArray< T >::swap().
Default two power for segment size.
Definition at line 215 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::compute_sizes().
The type of element stored in the array.
Definition at line 213 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::compute_sizes().
Default two power for directory size.
Definition at line 214 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::compute_sizes().
Definition at line 339 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::__traverse(), Aleph::DynArray< T >::access(), Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::fill_dir_to_null(), Aleph::DynArray< T >::Proxy::operator->(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::Proxy::operator=(), Aleph::DynArray< T >::release_all_segments_and_blocks(), Aleph::DynArray< T >::release_dir(), Aleph::DynArray< T >::reserve(), Aleph::DynArray< T >::resize_dir(), Aleph::DynArray< T >::swap(), Aleph::DynArray< T >::test(), and Aleph::DynArray< T >::touch().
|
mutableprivate |
Definition at line 233 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::allocate_dir(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::fill_dir_to_null(), Aleph::DynArray< T >::get_dir_size(), Aleph::DynArray< T >::release_all_segments_and_blocks(), Aleph::DynArray< T >::resize_dir(), and Aleph::DynArray< T >::swap().
|
private |
Definition at line 299 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::modulus_by_block_size(), and Aleph::DynArray< T >::swap().
Definition at line 298 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 232 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::modulus_from_index_in_dir(), and Aleph::DynArray< T >::swap().
Default two power for block size.
Definition at line 218 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::two_raised().
|
private |
Definition at line 238 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::DynArray(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::max_size(), Aleph::DynArray< T >::operator[](), Aleph::DynArray< T >::operator[](), Aleph::DynArray< T >::reserve(), Aleph::DynArray< T >::resize_dir(), Aleph::DynArray< T >::swap(), Aleph::DynArray< T >::test(), and Aleph::DynArray< T >::touch().
Maximum dimension allowed.
Definition at line 222 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::DynArray(), and Aleph::DynArray< T >::DynArray().
Definition at line 225 of file tpl_dynArray.H.
|
private |
Definition at line 338 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::allocate_block(), Aleph::DynArray< T >::get_num_blocks(), Aleph::DynArray< T >::release_block(), and Aleph::DynArray< T >::swap().
|
private |
Definition at line 337 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::release_segment(), and Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 229 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::divide_by_block_size(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), Aleph::DynArray< T >::resize_dir(), and Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 227 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::resize_dir(), and Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 228 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::resize_dir(), and Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 231 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::index_in_dir(), and Aleph::DynArray< T >::swap().
|
mutableprivate |
Definition at line 234 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::__traverse(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::allocate_segment(), Aleph::DynArray< T >::cut_ne(), Aleph::DynArray< T >::exist(), Aleph::DynArray< T >::fill_seg_to_null(), Aleph::DynArray< T >::get_seg_size(), Aleph::DynArray< T >::index_in_block(), Aleph::DynArray< T >::index_in_dir(), Aleph::DynArray< T >::index_in_seg(), Aleph::DynArray< T >::modulus_from_index_in_dir(), Aleph::DynArray< T >::release_blocks_and_segment(), Aleph::DynArray< T >::reserve(), and Aleph::DynArray< T >::swap().