![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Fixed-size vector of dimension N backed by a C-array (no dynamic allocation). More...
#include <Vector.hpp>
Inheritance diagram for CDPL::Math::CVector< T, N >:Public Types | |
| typedef T | ValueType |
| The scalar value type. More... | |
| typedef T & | Reference |
| Mutable reference type to an element. More... | |
| typedef const T & | ConstReference |
| Constant reference type to an element. More... | |
| typedef std::size_t | SizeType |
| The unsigned size type. More... | |
| typedef std::ptrdiff_t | DifferenceType |
| The signed difference type. More... | |
| typedef ValueType | ArrayType[N] |
| The fixed-size C-array type used for in-memory storage of N elements. More... | |
| typedef T * | Pointer |
| Pointer type for raw access to the element array. More... | |
| typedef const T * | ConstPointer |
| Constant pointer type for raw access to the element array. 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 BoundedVector< T, N+1 > | VectorTemporaryType |
| Concrete temporary vector type used by expression-template machinery (a Math::BoundedVector of N + 1 capacity). More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CVector instances. More... | |
| typedef std::initializer_list< T > | InitializerListType |
| The initializer-list type accepted by constructors and assignment. More... | |
Public Types inherited from CDPL::Math::VectorContainer< CVector< T, N > > | |
| typedef CVector< T, N > | 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 | |
| CVector () | |
| Constructs a zero-initialized N-element vector. More... | |
| CVector (const ValueType &v) | |
| Constructs an N-element vector with every element initialized to v. More... | |
| CVector (const CVector &v) | |
| Constructs a copy of the fixed-size vector v. More... | |
| CVector (InitializerListType l) | |
| Constructs a fixed-size vector with the contents of the initializer list l. More... | |
| template<typename E > | |
| CVector (const VectorExpression< E > &e) | |
| Constructs a fixed-size vector from the vector expression e. 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 (N is zero). More... | |
| SizeType | getSize () const |
| Returns the fixed element count N. More... | |
| SizeType | getMaxSize () const |
| Returns the fixed element count N (capacity equals size for Math::CVector). More... | |
| Pointer | getData () |
| Returns a mutable pointer to the contiguous element array. More... | |
| ConstPointer | getData () const |
Returns a const pointer to the contiguous element array. More... | |
| CVector & | operator= (const CVector &v) |
| Copy-assigns the elements of v to this fixed-size vector. More... | |
| CVector & | operator= (InitializerListType l) |
| Assigns the contents of the initializer list l to this fixed-size vector. More... | |
| template<typename C > | |
| CVector & | operator= (const VectorContainer< C > &c) |
| Assigns the contents of the vector container c to this fixed-size vector (no alias check needed). More... | |
| template<typename E > | |
| CVector & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to this fixed-size vector (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| CVector & | operator+= (const VectorContainer< C > &c) |
| Adds the contents of the vector container c element-wise to this fixed-size vector (no alias check needed). More... | |
| CVector & | operator+= (InitializerListType l) |
| Adds the contents of the initializer list l element-wise to this fixed-size vector. More... | |
| template<typename E > | |
| CVector & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e element-wise to this fixed-size vector (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| CVector & | operator-= (const VectorContainer< C > &c) |
| Subtracts the contents of the vector container c element-wise from this fixed-size vector (no alias check needed). More... | |
| CVector & | operator-= (InitializerListType l) |
| Subtracts the contents of the initializer list l element-wise from this fixed-size vector. More... | |
| template<typename E > | |
| CVector & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e element-wise from this fixed-size vector (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, CVector >::type & | operator*= (const T1 &t) |
| Multiplies every element by the scalar t. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, CVector >::type & | operator/= (const T1 &t) |
| Divides every element by the scalar t. More... | |
| template<typename E > | |
| CVector & | assign (const VectorExpression< E > &e) |
| Assigns the elements of the vector expression e to this fixed-size vector without intermediate temporary. More... | |
| CVector & | assign (InitializerListType l) |
| Assigns the contents of the initializer list l to this fixed-size vector (truncated to N if longer; zero-padded if shorter). More... | |
| template<typename E > | |
| CVector & | plusAssign (const VectorExpression< E > &e) |
| Adds the elements of the vector expression e to this vector without intermediate temporary. More... | |
| CVector & | plusAssign (InitializerListType l) |
| Adds the contents of the initializer list l element-wise to this vector without intermediate temporary. More... | |
| template<typename E > | |
| CVector & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the elements of the vector expression e from this vector without intermediate temporary. More... | |
| CVector & | minusAssign (InitializerListType l) |
| Subtracts the contents of the initializer list l element-wise from this vector without intermediate temporary. More... | |
| void | swap (CVector &v) |
| Swaps the contents of this fixed-size vector with those of v. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every element of the vector to the value v. More... | |
Public Member Functions inherited from CDPL::Math::VectorContainer< CVector< T, N > > | |
| 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... | |
Static Public Attributes | |
| static const SizeType | Size = N |
| The compile-time fixed size N. More... | |
Friends | |
| void | swap (CVector &v1, CVector &v2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorContainer< CVector< T, N > > | |
| VectorContainer () | |
| ~VectorContainer () | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< E > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Fixed-size vector of dimension N backed by a C-array (no dynamic allocation).
| T | The scalar value type. |
| N | The vector dimension. |
| typedef T CDPL::Math::CVector< T, N >::ValueType |
The scalar value type.
| typedef T& CDPL::Math::CVector< T, N >::Reference |
Mutable reference type to an element.
| typedef const T& CDPL::Math::CVector< T, N >::ConstReference |
Constant reference type to an element.
| typedef std::size_t CDPL::Math::CVector< T, N >::SizeType |
The unsigned size type.
| typedef std::ptrdiff_t CDPL::Math::CVector< T, N >::DifferenceType |
The signed difference type.
| typedef ValueType CDPL::Math::CVector< T, N >::ArrayType[N] |
The fixed-size C-array type used for in-memory storage of N elements.
| typedef T* CDPL::Math::CVector< T, N >::Pointer |
Pointer type for raw access to the element array.
| typedef const T* CDPL::Math::CVector< T, N >::ConstPointer |
Constant pointer type for raw access to the element array.
| typedef VectorReference<SelfType> CDPL::Math::CVector< T, N >::ClosureType |
Closure type used when this vector appears inside another expression.
| typedef const VectorReference<const SelfType> CDPL::Math::CVector< T, N >::ConstClosureType |
Constant closure type used when this vector appears inside another expression.
| typedef BoundedVector<T, N + 1> CDPL::Math::CVector< T, N >::VectorTemporaryType |
Concrete temporary vector type used by expression-template machinery (a Math::BoundedVector of N + 1 capacity).
| typedef std::shared_ptr<SelfType> CDPL::Math::CVector< T, N >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CVector instances.
| typedef std::initializer_list<T> CDPL::Math::CVector< T, N >::InitializerListType |
The initializer-list type accepted by constructors and assignment.
|
inline |
Constructs a zero-initialized N-element vector.
|
inlineexplicit |
Constructs an N-element vector with every element initialized to v.
| v | The initial element value. |
|
inline |
Constructs a copy of the fixed-size vector v.
| v | The fixed-size vector to copy. |
|
inline |
Constructs a fixed-size vector with the contents of the initializer list l.
| l | The initializer list providing the initial elements (truncated to N if longer; zero-padded if shorter). |
|
inline |
Constructs a fixed-size vector from the vector expression e.
| E | The source vector expression type. |
| e | The source vector expression. |
|
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 (N is zero).
true if N is zero, and false otherwise.
|
inline |
Returns the fixed element count N.
|
inline |
Returns the fixed element count N (capacity equals size for Math::CVector).
|
inline |
Returns a mutable pointer to the contiguous element array.
|
inline |
Returns a const pointer to the contiguous element array.
const pointer to the element array.
|
inline |
Copy-assigns the elements of v to this fixed-size vector.
| v | The source fixed-size vector. |
|
inline |
Assigns the contents of the initializer list l to this fixed-size vector.
| l | The initializer list providing the new elements (truncated to N if longer; zero-padded if shorter). |
|
inline |
Assigns the contents of the vector container c to this fixed-size vector (no alias check needed).
| C | The source vector container type. |
| c | The source vector container. |
|
inline |
Assigns the vector expression e to this fixed-size 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 fixed-size 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 fixed-size vector.
| l | The initializer list providing the addends. |
|
inline |
Adds the vector expression e element-wise to this fixed-size 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 fixed-size 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 fixed-size vector.
| l | The initializer list providing the subtrahends. |
|
inline |
Subtracts the vector expression e element-wise from this fixed-size 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 |
Assigns the elements of the vector expression e to this fixed-size vector 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 fixed-size vector (truncated to N if longer; zero-padded if shorter).
| l | The initializer list providing the new elements. |
| Base::SizeError | if l.size() exceeds N. |
|
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 fixed-size vector with those of v.
| v | The fixed-size vector to swap with. |
|
inline |
Sets every element of the vector to the value v.
| v | The fill value. |
|
friend |
ADL-enabled free-function form of swap().
| v1 | The first fixed-size vector. |
| v2 | The second fixed-size vector. |
|
static |
The compile-time fixed size N.