LTL
2.0.x
|
Class to enable referencing of ltl::MArray index ranges. More...
Public Member Functions | |
Range () | |
Range (const int first, const int last, const int stride=1) | |
Construct a Range object. More... | |
Range (const Range &other) | |
int | first (int lowest=minStart) const |
Return the first index. More... | |
int | last (int highest=minEnd) const |
Return the last index. More... | |
int | length () const |
Return the number of indices in the range. More... | |
int | stride () const |
Return the stride. More... | |
Range | operator- (const int shift) const |
Return a negative shifted Range object. More... | |
Range | operator-= (const int shift) |
Shift the Range object by shift to the negative. More... | |
Range | operator+ (const int shift) const |
Return a positive shifted Range object. More... | |
Range | operator+= (const int shift) |
Shift the Range object by shift to the positive. More... | |
Range | operator= (const Range &other) |
Copy a Range object. More... | |
Static Public Member Functions | |
static Range | all () |
This static member returns a special Range object that represents the entire dimension, wherever used. More... | |
Class to enable referencing of ltl::MArray index ranges.
A ltl::Range is a utility object used in the context of ltl::MArray describing a range of integers used for creating arrays and indexing an array along one dimension. For example, the set of indices {-10, -8, ..., 6, 8, 10}
is represented by the object Range( -10, 10, 2 )
.
|
inline |
Construct a Range object.
The stride arguments defaults to 1 and may be omitted. last >= first
is required.
|
inline |
|
inline |
Return the number of indices in the range.
|
inline |
Return the stride.
|
inlinestatic |
This static member returns a special Range object that represents the entire dimension, wherever used.
This is useful to refer to an entire dimension without having to figure out the actual size.
Return a negative shifted Range object.
I.e. one whose lower and upper indices are lower by a number shift
.
Shift the Range object by shift
to the negative.
I.e. the lower and upper indices are lowered by shift
.
Return a positive shifted Range object.
I.e. one whose lower and upper indices are higher by a number shift
.
Shift the Range object by shift
to the positive.
I.e. the lower and upper indices are increased by shift
.