Iterator for generating random values.
T | The type used to encapsulate the underlying data. |
random_iterator
is an iterator which represents a pointer into a range of random values. This iterator is useful for creating a range filled with random values without explicitly storing it in memory. Using random_iterator
saves both memory capacity and bandwidth.random_iterator
whose value_type
is int
and whose seed is 5
.Definition at line 81 of file random_iterator.h.
#include <random_iterator.h>
Public Methods | |
random_iterator (const size_t seed=0) | |
This constructor builds a random_iterator using a specified seed. More... | |
iterator | begin (void) const |
This method returns an iterator pointing to the beginning of this random sequence of entries. More... | |
value_type | operator[] (size_type n) const |
Subscript access to the data contained in this iterator. More... | |
|
inline |
This constructor builds a random_iterator
using a specified seed.
seed | The seed initial value used to generate the random sequence. |
Definition at line 107 of file random_iterator.h.
|
inline |
This method returns an iterator pointing to the beginning of this random sequence of entries.
Definition at line 114 of file random_iterator.h.
|
inline |
Subscript access to the data contained in this iterator.
n | The index of the element for which data should be accessed. |
This operator allows for easy, array-style, data access.
Definition at line 125 of file random_iterator.h.