27 #ifndef CDPL_MATH_RANGE_HPP
28 #define CDPL_MATH_RANGE_HPP
70 start(start), stop(stop)
111 return (stop - start);
120 return (stop == start);
130 return (start ==
r.start && stop ==
r.stop);
152 std::swap(start,
r.start);
153 std::swap(stop,
r.stop);
177 inline Range<std::size_t>
178 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 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:161
bool operator!=(const Range &r) const
Inequality comparison.
Definition: Range.hpp:138
Range(SizeType start, SizeType stop)
Constructs the range .
Definition: Range.hpp:69
Range()
Constructs an empty range .
Definition: Range.hpp:60
SizeType operator()(SizeType i) const
Maps the local position i to the global index start + i.
Definition: Range.hpp:81
SizeType getStop() const
Returns the upper (exclusive) bound.
Definition: Range.hpp:100
SizeType getStart() const
Returns the lower (inclusive) bound.
Definition: Range.hpp:91
bool isEmpty() const
Tells whether the range is empty.
Definition: Range.hpp:118
void swap(Range &r)
Swaps the contents of *this and r.
Definition: Range.hpp:147
SizeType getSize() const
Returns the size of the range, .
Definition: Range.hpp:109
S SizeType
The integral size/index type.
Definition: Range.hpp:55
bool operator==(const Range &r) const
Equality comparison.
Definition: Range.hpp:128
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:1288
The namespace of the Chemical Data Processing Library.