![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Dynamically-sized dense vector with configurable underlying storage. More...
#include <Vector.hpp>
Inheritance diagram for CDPL::Math::Vector< T, A >:Public Types | |
| typedef T | ValueType |
| The scalar value type stored in the vector. More... | |
| typedef T & | Reference |
| Mutable reference type to an element. More... | |
| typedef const T & | ConstReference |
| Constant reference type to an element. More... | |
| typedef A::size_type | SizeType |
| The unsigned size type used by the underlying storage container. More... | |
| typedef A::difference_type | DifferenceType |
| The signed difference type used by the underlying storage container. More... | |
| typedef A | ArrayType |
| The underlying storage container type. More... | |
| typedef T * | Pointer |
| Pointer type for raw element access. More... | |
| typedef const T * | ConstPointer |
| Constant pointer type for raw element access. More... | |
| typedef VectorReference< SelfType > | ClosureType |
| Closure type used when this vector appears inside another expression. More... | |
| typedef const VectorReference< const SelfType > | ConstClosureType |
| Constant closure type used when this vector appears inside another expression. More... | |
| typedef SelfType | VectorTemporaryType |
| Concrete temporary vector type used by expression-template machinery. More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Vector instances. More... | |
| typedef std::initializer_list< T > | InitializerListType |
| Type of the brace-initializer list accepted by the corresponding constructor. More... | |
Public Types inherited from CDPL::Math::VectorContainer< Vector< T, std::vector< T > > > | |
| typedef Vector< T, std::vector< T > > | ContainerType |
| The derived vector container type. More... | |
Public Types inherited from CDPL::Math::VectorExpression< E > | |
| typedef E | 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 | |
| Vector () | |
| Constructs an empty vector (size zero). More... | |
| Vector (SizeType n) | |
| Constructs a vector of size n with default-initialized elements. More... | |
| Vector (SizeType n, const ValueType &v) | |
| Constructs a vector of size n with every element initialized to v. More... | |
| Vector (const ArrayType &data) | |
| Constructs a vector that copies its data directly from the underlying-array container data. More... | |
| Vector (const Vector &v) | |
| Constructs a copy of the vector v. More... | |
| Vector (Vector &&v) | |
| Move-constructs a vector from v (v is left in a valid empty state). More... | |
| Vector (InitializerListType l) | |
| Constructs the vector from a brace-initializer list l. More... | |
| template<typename E > | |
| Vector (const VectorExpression< E > &e) | |
| Constructs the vector from the vector expression e (materializing the expression result). 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... | |
| bool | isEmpty () const |
| Tells whether the vector is empty. More... | |
| SizeType | getSize () const |
| Returns the current element count. More... | |
| SizeType | getMaxSize () const |
| Returns the maximum number of elements the underlying storage container can hold. More... | |
| ArrayType & | getData () |
| Returns a mutable reference to the underlying storage container. More... | |
| const ArrayType & | getData () const |
Returns a const reference to the underlying storage container. More... | |
| Vector & | operator= (const Vector &v) |
| Copy-assigns the elements of v to this vector. More... | |
| Vector & | operator= (Vector &&v) |
| Move-assigns the elements of v to this vector. More... | |
| Vector & | operator= (InitializerListType l) |
| Assigns the contents of the initializer list l to this vector (resizes to fit). More... | |
| template<typename C > | |
| Vector & | operator= (const VectorContainer< C > &c) |
| Assigns the contents of the vector container c to this vector (no alias check needed). More... | |
| template<typename E > | |
| Vector & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to this vector (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Vector & | operator+= (const VectorContainer< C > &c) |
| Adds the contents of the vector container c element-wise to this vector (no alias check needed). More... | |
| Vector & | operator+= (InitializerListType l) |
| Adds the contents of the initializer list l element-wise to this vector. More... | |
| template<typename E > | |
| Vector & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e element-wise to this vector (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Vector & | operator-= (const VectorContainer< C > &c) |
| Subtracts the contents of the vector container c element-wise from this vector (no alias check needed). More... | |
| Vector & | operator-= (InitializerListType l) |
| Subtracts the contents of the initializer list l element-wise from this vector. More... | |
| template<typename E > | |
| Vector & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e element-wise from this vector (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Vector >::type & | operator*= (const T1 &t) |
| Multiplies every element by the scalar t. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Vector >::type & | operator/= (const T1 &t) |
| Divides every element by the scalar t. More... | |
| template<typename E > | |
| Vector & | assign (const VectorExpression< E > &e) |
| Resizes this vector to match e and assigns the elements of e without intermediate temporary. More... | |
| Vector & | assign (InitializerListType l) |
| Assigns the contents of the initializer list l to this vector. More... | |
| template<typename E > | |
| Vector & | plusAssign (const VectorExpression< E > &e) |
| Adds the elements of the vector expression e to this vector without intermediate temporary. More... | |
| Vector & | plusAssign (InitializerListType l) |
| Adds the contents of the initializer list l element-wise to this vector without intermediate temporary. More... | |
| template<typename E > | |
| Vector & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the elements of the vector expression e from this vector without intermediate temporary. More... | |
| Vector & | minusAssign (InitializerListType l) |
| Subtracts the contents of the initializer list l element-wise from this vector without intermediate temporary. More... | |
| void | swap (Vector &v) |
| Swaps the contents of this vector with those of v. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every element of the vector to the value v. More... | |
| void | resize (SizeType n, const ValueType &v=ValueType()) |
| Resizes the vector to n elements. More... | |
Public Member Functions inherited from CDPL::Math::VectorContainer< Vector< T, std::vector< T > > > | |
| const ContainerType & | operator() () const |
Returns a const reference to the derived vector container. More... | |
| ContainerType & | operator() () |
| Returns a reference to the derived vector container. More... | |
Public Member Functions inherited from CDPL::Math::VectorExpression< E > | |
| 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 (Vector &v1, Vector &v2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorContainer< Vector< T, std::vector< T > > > | |
| VectorContainer () | |
| ~VectorContainer () | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< E > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Dynamically-sized dense vector with configurable underlying storage.
| T | The scalar value type. |
| A | The underlying storage container type (default: std::vector). |
| typedef T CDPL::Math::Vector< T, A >::ValueType |
The scalar value type stored in the vector.
| typedef T& CDPL::Math::Vector< T, A >::Reference |
Mutable reference type to an element.
| typedef const T& CDPL::Math::Vector< T, A >::ConstReference |
Constant reference type to an element.
| typedef A::size_type CDPL::Math::Vector< T, A >::SizeType |
The unsigned size type used by the underlying storage container.
| typedef A::difference_type CDPL::Math::Vector< T, A >::DifferenceType |
The signed difference type used by the underlying storage container.
| typedef A CDPL::Math::Vector< T, A >::ArrayType |
The underlying storage container type.
| typedef T* CDPL::Math::Vector< T, A >::Pointer |
Pointer type for raw element access.
| typedef const T* CDPL::Math::Vector< T, A >::ConstPointer |
Constant pointer type for raw element access.
| typedef VectorReference<SelfType> CDPL::Math::Vector< T, A >::ClosureType |
Closure type used when this vector appears inside another expression.
| typedef const VectorReference<const SelfType> CDPL::Math::Vector< T, A >::ConstClosureType |
Constant closure type used when this vector appears inside another expression.
| typedef SelfType CDPL::Math::Vector< T, A >::VectorTemporaryType |
Concrete temporary vector type used by expression-template machinery.
| typedef std::shared_ptr<SelfType> CDPL::Math::Vector< T, A >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Vector instances.
| typedef std::initializer_list<T> CDPL::Math::Vector< T, A >::InitializerListType |
Type of the brace-initializer list accepted by the corresponding constructor.
|
inline |
Constructs an empty vector (size zero).
|
inlineexplicit |
Constructs a vector of size n with default-initialized elements.
| n | The desired vector size. |
|
inline |
Constructs a vector of size n with every element initialized to v.
| n | The desired vector size. |
| v | The element value used to initialize every entry. |
|
inline |
Constructs a vector that copies its data directly from the underlying-array container data.
| data | The source storage container. |
|
inline |
Constructs a copy of the vector v.
| v | The vector to copy. |
|
inline |
Move-constructs a vector from v (v is left in a valid empty state).
| v | The vector to move from. |
|
inline |
Constructs the vector from a brace-initializer list l.
| l | The initializer list (one element per vector entry). |
|
inline |
Constructs the vector from the vector expression e (materializing the expression result).
| E | The vector expression type. |
| e | The vector expression to materialize. |
|
inline |
Returns a mutable reference to the element at index i (alias for operator()).
| i | The zero-based element index. |
| Base::IndexError | if i is out of range. |
|
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. | Base::IndexError | if i is out of range. |
|
inline |
Returns a mutable reference to the element at index i.
| i | The zero-based element index. |
| Base::IndexError | if i is out of range. |
|
inline |
Returns a const reference to the element at index i.
| i | The zero-based element index. |
const reference to the element. | Base::IndexError | if i is out of range. |
|
inline |
Tells whether the vector is empty.
true if the vector contains no elements, and false otherwise.
|
inline |
Returns the current element count.
|
inline |
Returns the maximum number of elements the underlying storage container can hold.
|
inline |
Returns a mutable reference to the underlying storage container.
|
inline |
Returns a const reference to the underlying storage container.
const reference to the storage container.
|
inline |
Copy-assigns the elements of v to this vector.
| v | The source vector. |
|
inline |
Move-assigns the elements of v to this vector.
| v | The source vector (left in a valid but unspecified state). |
|
inline |
Assigns the contents of the initializer list l to this vector (resizes to fit).
| l | The initializer list providing the new elements. |
|
inline |
Assigns the contents of the vector container c to this vector (no alias check needed).
| C | The source vector container type. |
| c | The source vector container. |
|
inline |
Assigns the vector expression e to this vector (via a temporary to handle aliasing).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the contents of the vector container c element-wise to this vector (no alias check needed).
| C | The source vector container type. |
| c | The source vector container. |
|
inline |
Adds the contents of the initializer list l element-wise to this vector.
| l | The initializer list providing the addends. |
|
inline |
Adds the vector expression e element-wise to this vector (via a temporary to handle aliasing).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the contents of the vector container c element-wise from this vector (no alias check needed).
| C | The source vector container type. |
| c | The source vector container. |
|
inline |
Subtracts the contents of the initializer list l element-wise from this vector.
| l | The initializer list providing the subtrahends. |
|
inline |
Subtracts the vector expression e element-wise from this vector (via a temporary to handle aliasing).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Multiplies every element by the scalar t.
| T1 | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every element by the scalar t.
| T1 | The scalar type. |
| t | The scalar divisor. |
|
inline |
Resizes this vector to match e and assigns the elements of e without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Assigns the contents of the initializer list l to this vector.
| l | The initializer list providing the new elements. |
|
inline |
Adds the elements of the vector expression e to this vector without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the contents of the initializer list l element-wise to this vector without intermediate temporary.
| l | The initializer list providing the addends. |
|
inline |
Subtracts the elements of the vector expression e from this vector without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the contents of the initializer list l element-wise from this vector without intermediate temporary.
| l | The initializer list providing the subtrahends. |
|
inline |
Swaps the contents of this vector with those of v.
| v | The vector to swap with. |
|
inline |
Sets every element of the vector to the value v.
| v | The fill value. |
|
inline |
Resizes the vector to n elements.
| n | The new element count. |
| v | The fill value for newly added elements. |
|
friend |
ADL-enabled free-function form of swap().
| v1 | The first vector. |
| v2 | The second vector. |