![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Half-open index range \( [start, stop) \) used for slicing vector and matrix expressions. More...
#include <Range.hpp>
Inheritance diagram for CDPL::Math::Range< S >:Public Types | |
| typedef S | SizeType |
| The integral size/index type. More... | |
Public Member Functions | |
| Range () | |
| Constructs an empty range \( [0, 0) \). More... | |
| Range (SizeType start, SizeType stop) | |
| Constructs the range \( [start, stop) \). More... | |
| SizeType | operator() (SizeType i) const |
| Maps the local position i to the global index start + i. More... | |
| SizeType | getStart () const |
| Returns the lower (inclusive) bound. More... | |
| SizeType | getStop () const |
| Returns the upper (exclusive) bound. More... | |
| SizeType | getSize () const |
| Returns the size of the range, \( stop - start \). More... | |
| bool | isEmpty () const |
| Tells whether the range is empty. More... | |
| bool | operator== (const Range &r) const |
| Equality comparison. More... | |
| bool | operator!= (const Range &r) const |
| Inequality comparison. More... | |
| void | swap (Range &r) |
Swaps the contents of *this and r. More... | |
Friends | |
| void | swap (Range &r1, Range &r2) |
| Free-function swap overload. More... | |
Half-open index range \( [start, stop) \) used for slicing vector and matrix expressions.
| S | The integral size/index type. |
| typedef S CDPL::Math::Range< S >::SizeType |
The integral size/index type.
|
inline |
Constructs an empty range \( [0, 0) \).
|
inline |
Constructs the range \( [start, stop) \).
| start | The lower (inclusive) bound. |
| stop | The upper (exclusive) bound. |
| Base::RangeError | if start > stop. |
|
inline |
Maps the local position i to the global index start + i.
| i | The zero-based local position. |
| Base::IndexError | if i is not in the range \( [0, size) \). |
|
inline |
Returns the lower (inclusive) bound.
|
inline |
Returns the upper (exclusive) bound.
|
inline |
Returns the size of the range, \( stop - start \).
|
inline |
Tells whether the range is empty.
true if the range is empty, and false otherwise.
|
inline |
Equality comparison.
| r | The other range. |
true if both ranges have the same start and stop, and false otherwise.
|
inline |
Inequality comparison.
| r | The other range. |
true if the ranges differ in start or stop, and false otherwise.
|
inline |
Swaps the contents of *this and r.
| r | The other range. |
Free-function swap overload.
| r1 | The first range. |
| r2 | The second range. |