![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Vector-expression proxy that views a contiguous half-open subrange of an underlying vector. More...
#include <VectorProxy.hpp>
Inheritance diagram for CDPL::Math::VectorRange< V >:Public Types | |
| typedef V | VectorType |
| The wrapped vector type. More... | |
| typedef V::SizeType | SizeType |
| The size type used by the wrapped vector. More... | |
| typedef V::DifferenceType | DifferenceType |
| The signed difference type used by the wrapped vector. More... | |
| typedef V::ValueType | ValueType |
| The element value type of the wrapped vector. More... | |
| typedef V::ConstReference | ConstReference |
| Constant reference type to an element. More... | |
| typedef std::conditional< std::is_const< V >::value, typename V::ConstReference, typename V::Reference >::type | Reference |
Mutable reference type (degrades to ConstReference when the wrapped vector is const). More... | |
| typedef std::conditional< std::is_const< V >::value, typename V::ConstClosureType, typename V::ClosureType >::type | VectorClosureType |
| Closure type used to store the wrapped vector internally (mutable or const flavor). More... | |
| typedef const SelfType | ConstClosureType |
| Constant closure type used when this proxy appears inside another expression. More... | |
| typedef SelfType | ClosureType |
| Closure type used when this proxy appears inside another expression. More... | |
| typedef Range< SizeType > | RangeType |
| The Math::Range type defining the half-open index subrange. More... | |
Public Types inherited from CDPL::Math::VectorExpression< VectorRange< V > > | |
| typedef VectorRange< V > | ExpressionType |
| The derived vector expression type. More... | |
Public Types inherited from CDPL::Math::Expression< E > | |
| typedef E | ExpressionType |
| The derived expression type (made available to expression-template machinery). More... | |
Public Member Functions | |
| VectorRange (VectorType &v, const RangeType &r) | |
| Constructs the proxy viewing the subrange r of v. More... | |
| Reference | operator() (SizeType i) |
| Returns a mutable reference to the element at index i of the view. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the element at index i of the view. More... | |
| Reference | operator[] (SizeType i) |
| Returns a mutable reference to the element at index i of the view (alias for operator()). More... | |
| ConstReference | operator[] (SizeType i) const |
Returns a const reference to the element at index i of the view (alias for operator()). More... | |
| SizeType | getStart () const |
| Returns the start index of the viewed range within the wrapped vector. More... | |
| SizeType | getSize () const |
| Returns the size of the view (number of elements covered by the range). More... | |
| bool | isEmpty () const |
| Tells whether the view is empty (zero-length range). More... | |
| VectorClosureType & | getData () |
| Returns a reference to the wrapped vector (via its stored closure). More... | |
| const VectorClosureType & | getData () const |
Returns a const reference to the wrapped vector (via its stored closure). More... | |
| VectorRange & | operator= (const VectorRange &r) |
| Copies the elements of r into this view (writing through to the wrapped vector). More... | |
| template<typename E > | |
| VectorRange & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to this view (writing through to the wrapped vector). More... | |
| template<typename E > | |
| VectorRange & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e componentwise to this view. More... | |
| template<typename E > | |
| VectorRange & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e componentwise from this view. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, VectorRange >::type & | operator*= (const T &t) |
| Multiplies every element of this view by the scalar t. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, VectorRange >::type & | operator/= (const T &t) |
| Divides every element of this view by the scalar t. More... | |
| template<typename E > | |
| VectorRange & | assign (const VectorExpression< E > &e) |
| Assigns the vector expression e to this view without intermediate temporary (use only when e does not alias the wrapped vector). More... | |
| template<typename E > | |
| VectorRange & | plusAssign (const VectorExpression< E > &e) |
| Adds the vector expression e to this view without intermediate temporary. More... | |
| template<typename E > | |
| VectorRange & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the vector expression e from this view without intermediate temporary. More... | |
| void | swap (VectorRange &r) |
| Swaps the elements of this view with those of r. More... | |
Public Member Functions inherited from CDPL::Math::VectorExpression< VectorRange< V > > | |
| const ExpressionType & | operator() () const |
Returns a const reference to the derived vector expression. More... | |
| ExpressionType & | operator() () |
| Returns a reference to the derived vector expression. More... | |
Friends | |
| void | swap (VectorRange &r1, VectorRange &r2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< VectorRange< V > > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Vector-expression proxy that views a contiguous half-open subrange of an underlying vector.
| V | The wrapped vector type. |
| typedef V CDPL::Math::VectorRange< V >::VectorType |
The wrapped vector type.
| typedef V::SizeType CDPL::Math::VectorRange< V >::SizeType |
The size type used by the wrapped vector.
| typedef V::DifferenceType CDPL::Math::VectorRange< V >::DifferenceType |
The signed difference type used by the wrapped vector.
| typedef V::ValueType CDPL::Math::VectorRange< V >::ValueType |
The element value type of the wrapped vector.
| typedef V::ConstReference CDPL::Math::VectorRange< V >::ConstReference |
Constant reference type to an element.
| typedef std::conditional<std::is_const<V>::value, typename V::ConstReference, typename V::Reference>::type CDPL::Math::VectorRange< V >::Reference |
Mutable reference type (degrades to ConstReference when the wrapped vector is const).
| typedef std::conditional<std::is_const<V>::value, typename V::ConstClosureType, typename V::ClosureType>::type CDPL::Math::VectorRange< V >::VectorClosureType |
Closure type used to store the wrapped vector internally (mutable or const flavor).
| typedef const SelfType CDPL::Math::VectorRange< V >::ConstClosureType |
Constant closure type used when this proxy appears inside another expression.
| typedef SelfType CDPL::Math::VectorRange< V >::ClosureType |
Closure type used when this proxy appears inside another expression.
| typedef Range<SizeType> CDPL::Math::VectorRange< V >::RangeType |
The Math::Range type defining the half-open index subrange.
|
inline |
Constructs the proxy viewing the subrange r of v.
| v | The wrapped vector. |
| r | The half-open index range selecting the viewed subrange. |
|
inline |
Returns a mutable reference to the element at index i of the view.
| i | The zero-based index within the view. |
v(range(i)).
|
inline |
Returns a const reference to the element at index i of the view.
| i | The zero-based index within the view. |
const reference to the underlying element v(range(i)).
|
inline |
Returns a mutable reference to the element at index i of the view (alias for operator()).
| i | The zero-based index within the view. |
|
inline |
Returns a const reference to the element at index i of the view (alias for operator()).
| i | The zero-based index within the view. |
const reference to the underlying element.
|
inline |
Returns the start index of the viewed range within the wrapped vector.
|
inline |
Returns the size of the view (number of elements covered by the range).
|
inline |
Tells whether the view is empty (zero-length range).
true if the range is empty, and false otherwise.
|
inline |
Returns a reference to the wrapped vector (via its stored closure).
|
inline |
Returns a const reference to the wrapped vector (via its stored closure).
const reference to the wrapped vector closure.
|
inline |
Copies the elements of r into this view (writing through to the wrapped vector).
| r | The source range view. |
|
inline |
Assigns the vector expression e to this view (writing through to the wrapped vector).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e componentwise to this view.
| E | The source vector expression type. |
| e | The vector expression to add. |
|
inline |
Subtracts the vector expression e componentwise from this view.
| E | The source vector expression type. |
| e | The vector expression to subtract. |
|
inline |
Multiplies every element of this view by the scalar t.
| T | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every element of this view by the scalar t.
| T | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the vector expression e to this view without intermediate temporary (use only when e does not alias the wrapped vector).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e to this view without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the vector expression e from this view without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Swaps the elements of this view with those of r.
| r | The view to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| r1 | The first view. |
| r2 | The second view. |