27 #ifndef CDPL_MATH_RANGE_HPP
28 #define CDPL_MATH_RANGE_HPP
72 start(start), stop(stop)
113 return (stop - start);
122 return (stop == start);
132 return (start ==
r.start && stop ==
r.stop);
154 std::swap(start,
r.start);
155 std::swap(stop,
r.stop);
179 inline Range<std::size_t>
180 range(std::size_t start, std::size_t stop)
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#define CDPL_MATH_CHECK(expr, msg, e)
Throws the exception e with message msg when the boolean expression expr evaluates to false.
Definition: Check.hpp:47
Thrown to indicate that an index is out of range.
Definition: Base/Exceptions.hpp:152
Thrown to indicate that a value is out of range.
Definition: Base/Exceptions.hpp:114
Half-open index range [start, stop) used for slicing vector and matrix expressions.
Definition: Range.hpp:49
friend void swap(Range &r1, Range &r2)
Free-function swap overload.
Definition: Range.hpp:163
bool operator!=(const Range &r) const
Inequality comparison.
Definition: Range.hpp:140
Range(SizeType start, SizeType stop)
Constructs the range [start, stop).
Definition: Range.hpp:71
Range()
Constructs an empty range [0, 0).
Definition: Range.hpp:62
SizeType operator()(SizeType i) const
Maps the local position i to the global index .
Definition: Range.hpp:83
SizeType getStop() const
Returns the upper (exclusive) bound.
Definition: Range.hpp:102
SizeType getStart() const
Returns the lower (inclusive) bound.
Definition: Range.hpp:93
bool isEmpty() const
Tells whether the range is empty.
Definition: Range.hpp:120
void swap(Range &r)
Swaps the contents of *this and r.
Definition: Range.hpp:149
SizeType getSize() const
Returns the size of the range.
Definition: Range.hpp:111
S SizeType
The integral size/index type.
Definition: Range.hpp:57
bool operator==(const Range &r) const
Equality comparison.
Definition: Range.hpp:130
constexpr unsigned int S
Specifies that the atom has S configuration.
Definition: AtomConfiguration.hpp:63
constexpr unsigned int r
Specifies that the stereocenter has r configuration.
Definition: CIPDescriptor.hpp:76
MatrixRange< E > range(MatrixExpression< E > &e, const typename MatrixRange< E >::RangeType &r1, const typename MatrixRange< E >::RangeType &r2)
Returns a mutable matrix range proxy viewing rows in r1 and columns in r2 of e.
Definition: MatrixProxy.hpp:1429
The namespace of the Chemical Data Processing Library.