![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Lightweight vector expression that proxies a reference to an underlying vector container. More...
#include <Vector.hpp>
Inheritance diagram for CDPL::Math::VectorReference< V >:Public Types | |
| typedef V | VectorType |
| The wrapped vector type. More... | |
| typedef V::ValueType | ValueType |
| The element value type of the wrapped vector. 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 V::ConstReference | ConstReference |
| Constant reference type to an element. More... | |
| typedef V::SizeType | SizeType |
| The unsigned size type of the wrapped vector. More... | |
| typedef V::DifferenceType | DifferenceType |
| The signed difference type of the wrapped vector. More... | |
| typedef SelfType | ClosureType |
| Closure type used when this proxy appears inside another expression. More... | |
| typedef const SelfType | ConstClosureType |
| Constant closure type used when this proxy appears inside another expression. More... | |
Public Types inherited from CDPL::Math::VectorExpression< VectorReference< V > > | |
| typedef VectorReference< 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 | |
| VectorReference (VectorType &v) | |
| Constructs the reference proxy referring to v. More... | |
| Reference | operator[] (SizeType i) |
| Returns a mutable reference to the element at index i (alias for operator()). More... | |
| ConstReference | operator[] (SizeType i) const |
Returns a const reference to the element at index i (alias for operator()). More... | |
| Reference | operator() (SizeType i) |
| Returns a mutable reference to the element at index i. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the element at index i. More... | |
| SizeType | getSize () const |
| Returns the wrapped vector's element count. More... | |
| SizeType | getMaxSize () const |
| Returns the wrapped vector's capacity (maximum element count without reallocation). More... | |
| bool | isEmpty () const |
| Tells whether the wrapped vector is empty. More... | |
| const VectorType & | getData () const |
Returns a const reference to the wrapped vector. More... | |
| VectorType & | getData () |
| Returns a reference to the wrapped vector. More... | |
| VectorReference & | operator= (const VectorReference &r) |
| Copy-assigns the wrapped vector from the vector referenced by r. More... | |
| template<typename E > | |
| VectorReference & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to the wrapped vector. More... | |
| template<typename E > | |
| VectorReference & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e element-wise to the wrapped vector. More... | |
| template<typename E > | |
| VectorReference & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e element-wise from the wrapped vector. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, VectorReference >::type & | operator*= (const T &t) |
| Multiplies every element of the wrapped vector by the scalar t. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, VectorReference >::type & | operator/= (const T &t) |
| Divides every element of the wrapped vector by the scalar t. More... | |
| template<typename E > | |
| VectorReference & | assign (const VectorExpression< E > &e) |
| Assigns the vector expression e to the wrapped vector without intermediate temporary. More... | |
| template<typename E > | |
| VectorReference & | plusAssign (const VectorExpression< E > &e) |
| Adds the vector expression e to the wrapped vector without intermediate temporary. More... | |
| template<typename E > | |
| VectorReference & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the vector expression e from the wrapped vector without intermediate temporary. More... | |
| void | swap (VectorReference &r) |
| Swaps the contents of the two wrapped vectors. More... | |
Public Member Functions inherited from CDPL::Math::VectorExpression< VectorReference< 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 (VectorReference &r1, VectorReference &r2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< VectorReference< V > > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Lightweight vector expression that proxies a reference to an underlying vector container.
| V | The wrapped vector type. |
| typedef V CDPL::Math::VectorReference< V >::VectorType |
The wrapped vector type.
| typedef V::ValueType CDPL::Math::VectorReference< V >::ValueType |
The element value type of the wrapped vector.
| typedef std::conditional<std::is_const<V>::value, typename V::ConstReference, typename V::Reference>::type CDPL::Math::VectorReference< V >::Reference |
Mutable reference type (degrades to ConstReference when the wrapped vector is const).
| typedef V::ConstReference CDPL::Math::VectorReference< V >::ConstReference |
Constant reference type to an element.
| typedef V::SizeType CDPL::Math::VectorReference< V >::SizeType |
The unsigned size type of the wrapped vector.
| typedef V::DifferenceType CDPL::Math::VectorReference< V >::DifferenceType |
The signed difference type of the wrapped vector.
| typedef SelfType CDPL::Math::VectorReference< V >::ClosureType |
Closure type used when this proxy appears inside another expression.
| typedef const SelfType CDPL::Math::VectorReference< V >::ConstClosureType |
Constant closure type used when this proxy appears inside another expression.
|
inlineexplicit |
Constructs the reference proxy referring to v.
| v | The wrapped vector to proxy. |
|
inline |
Returns a mutable reference to the element at index i (alias for operator()).
| i | The zero-based element index. |
|
inline |
Returns a const reference to the element at index i (alias for operator()).
| i | The zero-based element index. |
const reference to the element.
|
inline |
Returns a mutable reference to the element at index i.
| i | The zero-based element index. |
|
inline |
Returns a const reference to the element at index i.
| i | The zero-based element index. |
const reference to the element.
|
inline |
Returns the wrapped vector's element count.
|
inline |
Returns the wrapped vector's capacity (maximum element count without reallocation).
|
inline |
Tells whether the wrapped vector is empty.
true if the wrapped vector has zero elements, and false otherwise.
|
inline |
Returns a const reference to the wrapped vector.
const reference to the wrapped vector.
|
inline |
Returns a reference to the wrapped vector.
|
inline |
Copy-assigns the wrapped vector from the vector referenced by r.
| r | The source reference proxy. |
|
inline |
Assigns the vector expression e to the wrapped vector.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e element-wise to the wrapped vector.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the vector expression e element-wise from the wrapped vector.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Multiplies every element of the wrapped vector by the scalar t.
| T | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every element of the wrapped vector by the scalar t.
| T | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the vector expression e to the wrapped vector without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e to the wrapped vector without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the vector expression e from the wrapped vector without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Swaps the contents of the two wrapped vectors.
| r | The reference proxy to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| r1 | The first reference proxy. |
| r2 | The second reference proxy. |