27 #ifndef CDPL_MATH_SLICE_HPP
28 #define CDPL_MATH_SLICE_HPP
43 template <
typename S,
typename D>
54 start(0), stride(0), size(0) {}
57 start(start), stride(stride), size(size)
65 return (start + i * stride);
90 return (start ==
s.start && stride ==
s.stride && size ==
s.size);
103 std::swap(start,
s.start);
104 std::swap(stride,
s.stride);
105 std::swap(size,
s.size);
119 inline Slice<std::size_t, std::ptrdiff_t>
120 slice(std::size_t start, std::ptrdiff_t stride, std::size_t size)
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#define CDPL_MATH_CHECK(expr, msg, e)
Definition: Check.hpp:36
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
SizeType operator()(SizeType i) const
Definition: Slice.hpp:62
friend void swap(Slice &s1, Slice &s2)
Definition: Slice.hpp:108
S SizeType
Definition: Slice.hpp:50
bool operator!=(const Slice &s) const
Definition: Slice.hpp:93
Slice()
Definition: Slice.hpp:53
SizeType getStart() const
Definition: Slice.hpp:68
bool operator==(const Slice &s) const
Definition: Slice.hpp:88
SizeType getSize() const
Definition: Slice.hpp:78
DifferenceType getStride() const
Definition: Slice.hpp:73
Slice(SizeType start, DifferenceType stride, SizeType size)
Definition: Slice.hpp:56
D DifferenceType
Definition: Slice.hpp:51
void swap(Slice &s)
Definition: Slice.hpp:98
bool isEmpty() const
Definition: Slice.hpp:83
constexpr unsigned int S
Specifies that the atom has S configuration.
Definition: AtomConfiguration.hpp:63
constexpr unsigned int D
Specifies Hydrogen (Deuterium).
Definition: AtomType.hpp:62
constexpr unsigned int s
Specifies that the stereocenter has s configuration.
Definition: CIPDescriptor.hpp:81
MatrixSlice< E > slice(MatrixExpression< E > &e, const typename MatrixSlice< E >::SliceType &s1, const typename MatrixSlice< E >::SliceType &s2)
Definition: MatrixProxy.hpp:788
The namespace of the Chemical Data Processing Library.