![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Vector-expression proxy that views a strided slice of an underlying vector. More...
#include <VectorProxy.hpp>
Inheritance diagram for CDPL::Math::VectorSlice< 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 Slice< SizeType, DifferenceType > | SliceType |
| The Math::Slice type defining the (start, stride, size) selection. More... | |
Public Types inherited from CDPL::Math::VectorExpression< VectorSlice< V > > | |
| typedef VectorSlice< 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 | |
| VectorSlice (VectorType &v, const SliceType &s) | |
| Constructs the proxy viewing the slice s 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 slice within the wrapped vector. More... | |
| DifferenceType | getStride () const |
| Returns the stride of the slice (step between successive viewed elements). More... | |
| SizeType | getSize () const |
| Returns the size of the view (number of elements covered by the slice). More... | |
| bool | isEmpty () const |
| Tells whether the view is empty (zero-length slice). 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... | |
| VectorSlice & | operator= (const VectorSlice &s) |
| Copies the elements of s into this view (writing through to the wrapped vector). More... | |
| template<typename E > | |
| VectorSlice & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to this view (writing through to the wrapped vector). More... | |
| template<typename E > | |
| VectorSlice & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e componentwise to this view. More... | |
| template<typename E > | |
| VectorSlice & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e componentwise from this view. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, VectorSlice >::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, VectorSlice >::type & | operator/= (const T &t) |
| Divides every element of this view by the scalar t. More... | |
| template<typename E > | |
| VectorSlice & | 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 > | |
| VectorSlice & | plusAssign (const VectorExpression< E > &e) |
| Adds the vector expression e to this view without intermediate temporary. More... | |
| template<typename E > | |
| VectorSlice & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the vector expression e from this view without intermediate temporary. More... | |
| void | swap (VectorSlice &s) |
| Swaps the elements of this view with those of s. More... | |
Public Member Functions inherited from CDPL::Math::VectorExpression< VectorSlice< 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 (VectorSlice &s1, VectorSlice &s2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< VectorSlice< V > > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Vector-expression proxy that views a strided slice of an underlying vector.
| V | The wrapped vector type. |
| typedef V CDPL::Math::VectorSlice< V >::VectorType |
The wrapped vector type.
| typedef V::SizeType CDPL::Math::VectorSlice< V >::SizeType |
The size type used by the wrapped vector.
| typedef V::DifferenceType CDPL::Math::VectorSlice< V >::DifferenceType |
The signed difference type used by the wrapped vector.
| typedef V::ValueType CDPL::Math::VectorSlice< V >::ValueType |
The element value type of the wrapped vector.
| typedef V::ConstReference CDPL::Math::VectorSlice< 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::VectorSlice< 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::VectorSlice< V >::VectorClosureType |
Closure type used to store the wrapped vector internally (mutable or const flavor).
| typedef const SelfType CDPL::Math::VectorSlice< V >::ConstClosureType |
Constant closure type used when this proxy appears inside another expression.
| typedef SelfType CDPL::Math::VectorSlice< V >::ClosureType |
Closure type used when this proxy appears inside another expression.
| typedef Slice<SizeType, DifferenceType> CDPL::Math::VectorSlice< V >::SliceType |
The Math::Slice type defining the (start, stride, size) selection.
|
inline |
Constructs the proxy viewing the slice s of v.
| v | The wrapped vector. |
| s | The slice (start, stride, size) selecting the viewed elements. |
|
inline |
Returns a mutable reference to the element at index i of the view.
| i | The zero-based index within the view. |
v(slice(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(slice(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 slice within the wrapped vector.
|
inline |
Returns the stride of the slice (step between successive viewed elements).
|
inline |
Returns the size of the view (number of elements covered by the slice).
|
inline |
Tells whether the view is empty (zero-length slice).
true if the slice 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 s into this view (writing through to the wrapped vector).
| s | The source slice 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 s.
| s | The view to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| s1 | The first view. |
| s2 | The second view. |