Class to enable referencing of ltl::MArray index ranges. More...
shift
to the negative. shift
to the positive. 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 )
.
ltl::Range::Range | ( | ) | [inline] |
Referenced by all(), operator+(), and operator-().
Construct a Range object.
The stride arguments defaults to 1 and may be omitted. last >= first
is required.
References ltl::minStart.
ltl::Range::Range | ( | const Range & | other | ) | [inline] |
Return the first index.
References ltl::minStart.
Return the last index.
References ltl::minEnd.
int ltl::Range::length | ( | ) | const [inline] |
Return the number of indices in the range.
int ltl::Range::stride | ( | ) | const [inline] |
Return the stride.
static Range ltl::Range::all | ( | ) | [inline, static] |
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.
References ltl::minEnd, ltl::minStart, and Range().
Shift the Range object by shift
to the negative.
I.e. the lower and upper indices are lowered by shift
.
Shift the Range object by shift
to the positive.
I.e. the lower and upper indices are increased by shift
.