KrisLibrary
1.0.0
|
A regular range of indices ik = start+k*stride, for k=0 to size-1. More...
#include <indexing.h>
Classes | |
struct | iterator |
Public Member Functions | |
RangeIndices (const RangeIndices &rhs) | |
RangeIndices (int max) | |
RangeIndices (int min, int max) | |
RangeIndices (int min, int max, int stride) | |
void | enumerate (std::vector< int > &indices) |
int | operator[] (int i) const |
bool | contains (int index) const |
int | indexToElement (int index) const |
bool | operator== (const RangeIndices &range) const |
bool | operator!= (const RangeIndices &range) const |
iterator | begin () const |
iterator | end () const |
Public Attributes | |
int | start |
int | size |
int | stride |
A regular range of indices ik = start+k*stride, for k=0 to size-1.
Element k (domain) is given by the index start+k*stride (range). Indices be enumerated into a vector, or with an iterator interface similar to STL. With the iterator class, the index can be retrieved efficiently with the * operator. The element can be randomly accessed.