|
Stratax
Scientific computing containers and operations
|
#include <Vector.hpp>
Public Types | |
| using | value_type = T |
| template<typename U> | |
| using | rebind = Vector<U> |
Public Member Functions | |
| Vector () noexcept=default | |
| Creates a default vector with no logical dimensions. | |
| Vector (std::size_t size) | |
| Creates a vector with the given number of elements. | |
| Vector (const core::Shape &shape) | |
| Creates a vector from a validated rank-1 shape. | |
| Vector (std::size_t size, const T &value) | |
| Creates a vector and fills it with a value. | |
| Vector (std::initializer_list< T > list) | |
| Creates a vector from an initializer list. | |
| Vector (const Vector &)=default | |
| Creates a copy of another vector. | |
| Vector (Vector &&) noexcept=default | |
| Transfers ownership from another vector. | |
| Vector & | operator= (const Vector &)=default |
| Replaces this vector with a copy of another vector. | |
| Vector & | operator= (Vector &&) noexcept=default |
| Replaces this vector by taking ownership from another vector. | |
| ~Vector ()=default | |
| Destroys the vector. | |
| T & | operator() (std::size_t index) noexcept |
| Returns a flat element without bounds checking. | |
| const T & | operator() (std::size_t index) const noexcept |
| Returns a flat element without bounds checking. | |
| T & | operator[] (std::size_t index) noexcept |
| Returns a flat element without bounds checking. | |
| const T & | operator[] (std::size_t index) const noexcept |
| Returns a flat element without bounds checking. | |
| T & | at (std::size_t index) |
| Returns a flat element with bounds checking. | |
| const T & | at (std::size_t index) const |
| Returns a flat element with bounds checking. | |
| T & | front () |
| Returns the first element. | |
| const T & | front () const |
| Returns the first element as a const reference. | |
| T & | back () |
| Returns the last element. | |
| const T & | back () const |
| Returns the last element as a const reference. | |
| std::size_t | size () const noexcept |
| Returns the number of stored elements. | |
| std::size_t | rank () const noexcept |
| Returns the vector rank. | |
| bool | empty () const noexcept |
| Returns whether the vector has no elements. | |
| const stratax::core::Shape & | shape () const noexcept |
| Returns the vector shape. | |
| const stratax::core::Strides & | strides () const noexcept |
| Returns the vector strides. | |
| T * | data () noexcept |
| Returns the raw data pointer. | |
| const T * | data () const noexcept |
| Returns the raw data pointer as a const pointer. | |
| T * | begin () noexcept |
| Returns an iterator to the first element. | |
| const T * | begin () const noexcept |
| Returns a const iterator to the first element. | |
| const T * | cbegin () const noexcept |
| Returns a const iterator to the first element. | |
| T * | end () noexcept |
| Returns an iterator one past the last element. | |
| const T * | end () const noexcept |
| Returns a const iterator one past the last element. | |
| const T * | cend () const noexcept |
| Returns a const iterator one past the last element. | |
| std::reverse_iterator< T * > | rbegin () noexcept |
| Returns a reverse iterator to the last element. | |
| std::reverse_iterator< const T * > | rbegin () const noexcept |
| Returns a const reverse iterator to the last element. | |
| std::reverse_iterator< const T * > | crbegin () const noexcept |
| Returns a const reverse iterator to the last element. | |
| std::reverse_iterator< T * > | rend () noexcept |
| Returns a reverse iterator before the first element. | |
| std::reverse_iterator< const T * > | rend () const noexcept |
| Returns a const reverse iterator before the first element. | |
| std::reverse_iterator< const T * > | crend () const noexcept |
| Returns a const reverse iterator before the first element. | |
| void | fill (const T &value) |
| Fills every element with the same value. | |
| void | swap (Vector &other) noexcept |
| Swaps the contents of two vectors. | |
Definition at line 26 of file Vector.hpp.
Definition at line 37 of file Vector.hpp.
| using stratax::container::Vector< T >::value_type = T |
Definition at line 34 of file Vector.hpp.
|
defaultnoexcept |
Creates a default vector with no logical dimensions.
The default vector has rank 0 and owns no element storage. Use Vector(0) when a rank-1 empty vector is required.
|
inlineexplicit |
Creates a vector with the given number of elements.
| size | Number of elements to allocate. |
Definition at line 54 of file Vector.hpp.
|
inlineexplicit |
Creates a vector from a validated rank-1 shape.
| shape | Source shape. |
| Exceptions::DimensionError | If the shape is not rank 1. |
Definition at line 68 of file Vector.hpp.
|
inline |
Creates a vector and fills it with a value.
| size | Number of elements to allocate. |
| value | Value to copy into each element. |
Definition at line 82 of file Vector.hpp.
|
inline |
Creates a vector from an initializer list.
| list | Source values in element order. |
Definition at line 95 of file Vector.hpp.
|
default |
Creates a copy of another vector.
|
defaultnoexcept |
Transfers ownership from another vector.
|
default |
Destroys the vector.
|
inline |
Returns a flat element with bounds checking.
| index | Flat element index. |
| Exceptions::IndexError | If the index is out of bounds. |
Definition at line 195 of file Vector.hpp.
|
inline |
Returns a flat element with bounds checking.
| index | Flat element index. |
| Exceptions::IndexError | If the index is out of bounds. |
Definition at line 210 of file Vector.hpp.
|
inline |
Returns the last element.
Definition at line 241 of file Vector.hpp.
|
inline |
Returns the last element as a const reference.
Definition at line 251 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const iterator to the first element.
Definition at line 341 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns an iterator to the first element.
Definition at line 331 of file Vector.hpp.
Referenced by stratax::container::operator<<().
|
inlinenodiscardnoexcept |
Returns a const iterator to the first element.
Definition at line 351 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const iterator one past the last element.
Definition at line 381 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const reverse iterator to the last element.
Definition at line 411 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const reverse iterator before the first element.
Definition at line 441 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns the raw data pointer as a const pointer.
Definition at line 321 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns the raw data pointer.
Definition at line 311 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns whether the vector has no elements.
Definition at line 281 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const iterator one past the last element.
Definition at line 371 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns an iterator one past the last element.
Definition at line 361 of file Vector.hpp.
Referenced by stratax::container::operator<<().
|
inline |
Fills every element with the same value.
| value | Value to assign to each element. |
Definition at line 451 of file Vector.hpp.
|
inline |
Returns the first element.
Definition at line 221 of file Vector.hpp.
|
inline |
Returns the first element as a const reference.
Definition at line 231 of file Vector.hpp.
|
inlinenoexcept |
Returns a flat element without bounds checking.
| index | Flat element index. |
Definition at line 155 of file Vector.hpp.
|
inlinenoexcept |
Returns a flat element without bounds checking.
| index | Flat element index. |
Definition at line 142 of file Vector.hpp.
|
default |
Replaces this vector with a copy of another vector.
|
defaultnoexcept |
Replaces this vector by taking ownership from another vector.
|
inlinenoexcept |
Returns a flat element without bounds checking.
| index | Flat element index. |
Definition at line 181 of file Vector.hpp.
|
inlinenoexcept |
Returns a flat element without bounds checking.
| index | Flat element index. |
Definition at line 168 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns the vector rank.
Definition at line 271 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const reverse iterator to the last element.
Definition at line 401 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a reverse iterator to the last element.
Definition at line 391 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a const reverse iterator before the first element.
Definition at line 431 of file Vector.hpp.
|
inlinenodiscardnoexcept |
Returns a reverse iterator before the first element.
Definition at line 421 of file Vector.hpp.
|
inlinenoexcept |
Returns the vector shape.
Definition at line 291 of file Vector.hpp.
Referenced by astype().
|
inlinenodiscardnoexcept |
Returns the number of stored elements.
Definition at line 261 of file Vector.hpp.
Referenced by astype(), stratax::container::Vector< U >::at(), stratax::container::Vector< U >::at(), and slice().
|
inlinenoexcept |
Returns the vector strides.
Definition at line 301 of file Vector.hpp.
|
inlinenoexcept |
Swaps the contents of two vectors.
| other | Vector to exchange state with. |
Definition at line 461 of file Vector.hpp.
Referenced by stratax::container::Vector< U >::swap().