Public Types | List of all members
blaze::Indices Class Reference

Auxiliary class for the generation of random indices. More...

#include <Indices.h>

Public Types

typedef std::vector< size_t >::const_iterator ConstIterator
 Iterator over the generated indices.
 

Public Member Functions

Constructors
 Indices (size_t min, size_t max, size_t number)
 The constructor for the Indices class. More...
 
Utility functions
size_t size () const
 Returns the total number of random indices. More...
 
ConstIterator begin () const
 Returns an iterator to the beginning of the vector. More...
 
ConstIterator end () const
 Returns an iterator just past the last element of the vector. More...
 

Private Attributes

Member variables
std::vector< size_tindices_
 The generated indices.
 

Detailed Description

Auxiliary class for the generation of random indices.

This auxiliary class can be used to generate a set of random indices.

Constructor & Destructor Documentation

blaze::Indices::Indices ( size_t  min,
size_t  max,
size_t  number 
)
inline

The constructor for the Indices class.

Parameters
minThe lower limit of the random indices.
maxThe upper limit of the random indices.
numberThe number of random indices to generate.
Exceptions
std::invalid_argumentInvalid index range.
std::invalid_argumentInvalid number of indices.

This constructor initializes an Indices object by generating number random, unique indices in the range min to max. In case number is larger than the possible number of incides in the specified range, a std::invalid_argument exception is thrown.

Member Function Documentation

Indices::ConstIterator blaze::Indices::begin ( ) const
inline

Returns an iterator to the beginning of the vector.

Returns
Iterator to the beginning of the vector.
Indices::ConstIterator blaze::Indices::end ( ) const
inline

Returns an iterator just past the last element of the vector.

Returns
Iterator just past the last element of the vector.
size_t blaze::Indices::size ( ) const
inline

Returns the total number of random indices.

Returns
The total number of random indices.

The documentation for this class was generated from the following file: