An executor-aware contiguous container for numerical data with vector-style arithmetic semantics.
More...
|
| | Vector (const Executor &exec, sizeType size) |
| | Creates an uninitialized Vector with the given size on an executor.
|
| | Vector (const Executor &exec, const ValueType *in, sizeType size, Executor hostExec=SerialExecutor()) |
| | Creates a Vector with the given size from existing data on an executor.
|
| | Vector (const Executor &exec, sizeType size, ValueType value) |
| | Creates a Vector with the given size and initializes all elements to a value.
|
| | Vector (const Executor &exec, std::vector< ValueType > in) |
| | Creates a Vector from a std::vector on the given executor.
|
| | Vector (const Executor &exec, const Vector< ValueType > &in) |
| | Creates a copy of another Vector on the specified executor.
|
| | Vector (const Vector< ValueType > &rhs) |
| | Copy constructor.
|
| | Vector (Vector< ValueType > &&rhs) noexcept |
| | Move constructor.
|
| | ~Vector () |
| | Destroys the Vector object.
|
| template<typename func> |
| void | apply (func f) |
| | Applies a function to the elements of the Vector.
|
| Vector< ValueType > | copyToExecutor (Executor dstExec) const |
| | Creates a copy of the Vector on the specified executor.
|
| Vector< ValueType > | copyToHost () const |
| | Creates a host-resident copy of the Vector.
|
| void | copyToHost (Vector< ValueType > &result) |
| | Copies the Vector data to a host-resident Vector.
|
| ValueType & | operator[] (const localIdx i)=delete |
| | Host-side element access is intentionally disabled.
|
| const ValueType & | operator[] (const localIdx i) const =delete |
| void | operator= (const ValueType &rhs) |
| | Assigns a value to every element of the Vector.
|
| void | operator= (const Vector< ValueType > &rhs) |
| | Assigns the contents of another Vector.
|
| Vector< ValueType > & | operator= (Vector< ValueType > &&rhs) noexcept |
| | Move-assignment operator — transfers ownership of the data buffer.
|
| Vector< ValueType > & | operator+= (const Vector< ValueType > &rhs) |
| | Adds another Vector element-wise.
|
| Vector< ValueType > & | operator-= (const Vector< ValueType > &rhs) |
| | Subtracts another Vector element-wise.
|
| Vector< ValueType > | operator* (const Vector< ValueType > &rhs) |
| | Multiplies two Vectors element-wise.
|
| Vector< ValueType > | operator* (const scalar rhs) |
| | Multiplies every element of the Vector by a scalar.
|
| Vector< ValueType > & | operator*= (const Vector< ValueType > &rhs) |
| | Multiplies this Vector element-wise by another Vector.
|
| Vector< ValueType > & | operator*= (const scalar rhs) |
| | Multiplies every element of the Vector by a scalar.
|
| void | resize (const sizeType size) |
| | Resizes the Vector.
|
| ValueType * | data () |
| | Returns a pointer to the underlying Vector data.
|
| const ValueType * | data () const |
| | Returns a pointer to the underlying Vector data.
|
| ValueType * | begin () |
| | Returns a pointer to the first element of the Vector.
|
| const ValueType * | begin () const |
| | Returns a const pointer to the first element of the Vector.
|
| ValueType * | end () |
| | Returns a pointer one past the last element of the Vector.
|
| const ValueType * | end () const |
| | Returns a const pointer one past the last element of the Vector.
|
| const Executor & | exec () const |
| | Returns the executor associated with the Vector.
|
| sizeType | size () const |
| | Returns the number of elements in the Vector.
|
| label | ssize () const |
| | Returns the number of elements as a label.
|
| bool | empty () const |
| | Checks whether the Vector contains no elements.
|
| View< ValueType > | view () &&=delete |
| | Prevents creating a View from a temporary Vector.
|
| View< const ValueType > | view () const &&=delete |
| View< ValueType > | view () & |
| | Returns a non-owning view of the Vector data.
|
| View< const ValueType > | view () const & |
| | Returns a read-only, non-owning view of the Vector data.
|
| View< ValueType > | view (std::pair< localIdx, localIdx > range) &&=delete |
| | Prevents creating a view of a temporary Vector.
|
| View< const ValueType > | view (std::pair< localIdx, localIdx > range) const &&=delete |
| View< ValueType > | view (std::pair< localIdx, localIdx > range) & |
| | Returns a non-owning view of a range of the Vector.
|
| View< const ValueType > | view (std::pair< localIdx, localIdx > range) const & |
| | Returns a read-only, non-owning view of a range of the Vector.
|
| std::pair< localIdx, localIdx > | range () const |
| | Returns the index range of the Vector.
|
template<typename ValueType>
class NeoN::Vector< ValueType >
An executor-aware contiguous container for numerical data with vector-style arithmetic semantics.
Vector is intended for numerical quantities for which arithmetic operations on the elements or on the vector as a whole are meaningful.
Vector provides operations for performing arithmetic on its stored values. Use Vector when the numerical meaning of the data and its arithmetic operations are an important part of its interface.
For structural, indexing, or other non-arithmetic data, use Array instead.
- Template Parameters
-
| ValueType | The type of the elements stored in the vector. |
Definition at line 39 of file vector.hpp.