27 #ifndef CDPL_MATH_VECTORITERATOR_HPP
28 #define CDPL_MATH_VECTORITERATOR_HPP
51 typedef typename E::SizeType SizeType;
52 typedef typename E::Reference Reference;
79 return (&vec.get() == &accessor.vec.get());
83 std::reference_wrapper<VectorType> vec;
95 typedef typename E::SizeType SizeType;
96 typedef typename E::ConstReference Reference;
130 return (&vec.get() == &accessor.vec.get());
140 vec = std::reference_wrapper<const VectorType>(accessor.vec);
145 std::reference_wrapper<const VectorType> vec;
152 template <
typename E>
183 template <
typename E>
216 template <
typename E>
228 template <
typename E>
240 template <
typename E>
252 template <
typename E>
Definition of basic expression types.
Definition of class CDPL::Util::IndexedElementIterator.
Specialization of Math::VectorElementAccessor for const vector references (read-only iteration).
Definition: VectorIterator.hpp:92
VectorElementAccessor(const VectorElementAccessor< E > &accessor)
Constructs the accessor from a mutable-vector accessor (relaxing it to read-only access).
Definition: VectorIterator.hpp:103
bool operator==(const VectorElementAccessor &accessor) const
Tells whether this accessor references the same vector as accessor.
Definition: VectorIterator.hpp:128
VectorElementAccessor(const VectorType &e)
Constructs the accessor referencing the constant vector e.
Definition: VectorIterator.hpp:110
VectorElementAccessor & operator=(const VectorElementAccessor< E > &accessor)
Rebinds this accessor to the vector referenced by accessor.
Definition: VectorIterator.hpp:138
Reference operator()(SizeType i) const
Returns a const reference to the element at index i of the referenced vector.
Definition: VectorIterator.hpp:118
Access functor used by Math::VectorIteratorTraits to read mutable vector elements via Util::IndexedEl...
Definition: VectorIterator.hpp:48
bool operator==(const VectorElementAccessor &accessor) const
Tells whether this accessor references the same vector as accessor.
Definition: VectorIterator.hpp:77
VectorElementAccessor(VectorType &e)
Constructs the accessor referencing the (mutable) vector e.
Definition: VectorIterator.hpp:59
Reference operator()(SizeType i) const
Returns a mutable reference to the element at index i of the referenced vector.
Definition: VectorIterator.hpp:67
CRTP base class for all vector expression types.
Definition: Expression.hpp:66
STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
constexpr unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
VectorIteratorTraits< E >::IteratorType vectorBegin(VectorExpression< E > &e)
Returns a mutable iterator pointing to the first element of the vector expression e.
Definition: VectorIterator.hpp:217
VectorIteratorTraits< E >::IteratorType vectorEnd(VectorExpression< E > &e)
Returns a mutable iterator pointing one past the last element of the vector expression e.
Definition: VectorIterator.hpp:229
The namespace of the Chemical Data Processing Library.
E VectorType
The constant vector expression type being iterated.
Definition: VectorIterator.hpp:188
static IteratorType makeIterator(const VectorType &e, SizeType idx)
Creates a constant iterator pointing to the element at index idx of e.
Definition: VectorIterator.hpp:204
E::SizeType SizeType
The size type used by the iterated vector.
Definition: VectorIterator.hpp:190
E::ValueType ValueType
The element value type of the iterated vector.
Definition: VectorIterator.hpp:192
VectorElementAccessor< const E > AccessorType
The element-access functor type used to materialize iterator references (const-qualified).
Definition: VectorIterator.hpp:194
Util::IndexedElementIterator< const ValueType, AccessorType, SizeType > IteratorType
The constructed constant iterator type (a Util::IndexedElementIterator specialization).
Definition: VectorIterator.hpp:196
Traits selecting the element accessor and Util::IndexedElementIterator specialization for mutable ite...
Definition: VectorIterator.hpp:154
E VectorType
The (mutable) vector expression type being iterated.
Definition: VectorIterator.hpp:157
E::ValueType ValueType
The element value type of the iterated vector.
Definition: VectorIterator.hpp:161
Util::IndexedElementIterator< ValueType, AccessorType, SizeType > IteratorType
The constructed iterator type (a Util::IndexedElementIterator specialization).
Definition: VectorIterator.hpp:165
VectorElementAccessor< E > AccessorType
The element-access functor type used to materialize iterator references.
Definition: VectorIterator.hpp:163
static IteratorType makeIterator(VectorType &e, SizeType idx)
Creates an iterator pointing to the element at index idx of e.
Definition: VectorIterator.hpp:173
E::SizeType SizeType
The size type used by the iterated vector.
Definition: VectorIterator.hpp:159