ALP User Documentation
0.8.preview
Algebraic Programming User Documentation
|
A (dense) vector of a given size that holds the same constant value at each entry. More...
Public Types | |
typedef iterator | const_iterator |
The const-iterator type. | |
typedef grb::utils::iterators::Repeater< T >::RealType | iterator |
The iterator type. More... | |
Public Member Functions | |
ConstantVector (const T val, const size_t n) | |
Constructs a container with \( \Theta(1) \) memory usage that represents some vector of length n with contents \( ( c, c, \ldots, c ) \). More... | |
iterator | begin (const size_t s=0, const size_t P=1) const |
Returns a const-iterator at start position to this container. More... | |
const_iterator | cbegin (const size_t s=0, const size_t P=1) const |
Returns a const-iterator at start position to this container. More... | |
const_iterator | cend (const size_t s=0, const size_t P=1) const |
Returns a const-iterator at end position to this container. More... | |
iterator | end (const size_t s=0, const size_t P=1) const |
Returns a const-iterator at end position to this container. More... | |
A (dense) vector of a given size that holds the same constant value at each entry.
Instances of this container are immutable in terms of both value and size.
T | The type of the value. |
The storage requirement of this container is \( \Theta(1) \).
typedef grb::utils::iterators::Repeater< T >::RealType iterator |
The iterator type.
|
inline |
Constructs a container with \( \Theta(1) \) memory usage that represents some vector of length n with contents \( ( c, c, \ldots, c ) \).
[in] | val | The value of the constants \( c \) in this vector. |
[in] | n | The size of the vector. |
|
inline |
Returns a const-iterator at start position to this container.
By default, it creates a sequential I/O iterator, meaning, an iterator that iterators over all elements in the container. Optionally, however, the callee may request an iterator over a chunk of this container instead:
[in] | s | The chunk ID of the requested chunk. |
[in] | P | How many chunks the underlying container should be cut into. |
The defaults for s and P are 0 and 1, respectively. The value s must always be strictly smaller than P, and P must always be strictly larger than zero.
For \( P > 1 \), the iterator may be used to effect parallel I/O. With parallel I/O, multiple threads and/or processes may concurrently deal with different chunks of this container.
An iterator pair retrieved in this mode only has knowledge about the elements in its chunk of the container; the size of the container as visible by the iterator pair thus reflects the size of the chunk, not that of the container.
Thus as an addition to standard STL semenatics, iterator pairs when jointly passed to some STL (or ALP) call must not only be derived from the same container, but must be derived from the same chunk as well.
|
inline |
Returns a const-iterator at start position to this container.
Since this container is immutable, there is no difference between this function (cbegin) and begin. Please see the latter for full documentation.
|
inline |
Returns a const-iterator at end position to this container.
Since this container is immutable, there is no difference between this function (cend) and end. Please see the latter for full documentation.
|
inline |
Returns a const-iterator at end position to this container.
By default, it creates a sequential I/O iterator, meaning, an iterator that iterators over all elements in the container. Optionally, however, the callee may request an iterator over a chunk of this container instead:
[in] | s | The chunk ID of the requested chunk. |
[in] | P | How many chunks the underlying container should be cut into. |
The defaults for s and P are 0 and 1, respectively. The value s must always be strictly smaller than P, and P must always be strictly larger than zero.
For \( P > 1 \), the iterator may be used to effect parallel I/O. With parallel I/O, multiple threads and/or processes may concurrently deal with different chunks of this container.
An iterator pair retrieved in this mode only has knowledge about the elements in its chunk of the container; the size of the container as visible by the iterator pair thus reflects the size of the chunk, not that of the container.
Thus as an addition to standard STL semenatics, iterator pairs when jointly passed to some STL (or ALP) call must not only be derived from the same container, but must be derived from the same chunk as well.