template<eve::product_type Type, eve::simd_allocator Allocator = eve::aligned_allocator<unsigned char, eve::fixed<64>>>
class eve::algo::soa_vector< Type, Allocator >
SIMD-aware container for product types.
Required header: #include <eve/memory/soa_vector.hpp>
soa_vector is a container similar to std::vector but optimized to store [product types](eve::product_type) using a Structure Of Array layout compatible with SIMD processing.
- Template Parameters
-
| Type | Value type stored inside eve::soa_vector |
|
|
| soa_vector (Allocator a) |
| | Constructs an empty container with a custom Allocator.
|
|
| soa_vector () |
| | Constructs an empty container.
|
|
| soa_vector (size_type n, Allocator a) |
| | Constructs the container with n default-inserted instances of Type and a custom Allocator.
|
|
| soa_vector (size_type n) |
| | Constructs the container with n default-inserted instances of Type.
|
|
| soa_vector (no_init_t, size_type n, Allocator a) |
| | Constructs the container with n default-inserted instances of Type and a custom Allocator.
|
|
| soa_vector (no_init_t, size_type n) |
| | Constructs the container with n default-inserted instances of Type.
|
|
| soa_vector (size_type n, value_type v, Allocator a) |
| | Constructs the container with n copies of elements with value value and a custom Allocator.
|
|
| soa_vector (size_type n, value_type v) |
| | Constructs the container with n copies of elements with value value.
|
|
| soa_vector (std::initializer_list< Type > l, Allocator a) |
| | Constructs the container with the contents of the initializer list l.
|
|
| soa_vector (std::initializer_list< Type > l) |
| | Constructs the container with the contents of the initializer list l.
|
|
size_type | size () const noexcept |
| | Returns the number of elements in the container.
|
|
size_type | capacity () const noexcept |
| | Returns the number of elements that the container has currently allocated space for.
|
|
void | shrink_to_fit () |
| | Requests the removal of unused capacity.
|
|
bool | empty () const noexcept |
| | Checks if the container has no elements.
|
| void | reserve (size_type n) |
| | Increase the capacity of the vector to a value that's greater or equal to n.
|
|
auto | data_aligned () |
| | Returns a zipped aligned pointer to the beginning.
|
|
auto | data_aligned () const |
| | Returns a zipped aligned pointer to the beginning.
|
|
auto | data () |
| | Returns a zipped pointer to the beginning.
|
|
auto | data () const |
| | Returns a constant zipped pointer to the beginning.
|
| value_type | get (size_type i) const |
| | Returns the value of the ith element of the container.
|
| void | set (size_type i, value_type const &v) |
| | Modify the value of the ith element of the container.
|
|
void | fill (value_type v) |
| | Fill the soa_vector with a given value.
|
|
auto | begin_aligned () -> iterator_aligned |
| | Returns an aligned iterator to the beginning.
|
|
auto | begin_aligned () const -> const_iterator_aligned |
| | Returns an aligned iterator to the beginning.
|
|
auto | cbegin_aligned () const -> const_iterator_aligned |
| | Returns a constant aligned iterator to the beginning.
|
|
auto | begin () -> iterator |
| | Returns an iterator to the beginning.
|
|
auto | begin () const -> const_iterator |
| | Returns an iterator to the beginning.
|
|
auto | cbegin () const -> const_iterator |
| | Returns a constant iterator to the beginning.
|
|
auto | end () -> iterator |
| | Returns an iterator to the end.
|
|
auto | end () const -> const_iterator |
| | Returns an iterator to the end.
|
|
auto | cend () const -> const_iterator |
| | Returns a constant iterator to the end.
|
|
|
void | clear () |
| | Clear the contents of the container.
|
| iterator | erase (const_iterator pos) |
| | Removes an element from the container.
|
|
iterator | erase (const_iterator f, const_iterator l) |
| | Removes the elements in the range [first, last).
|
| void | push_back (value_type const &value) noexcept |
| | Appends the given element value to the end of the container.
|
| void | pop_back () noexcept |
| | Removes the last element of the container.
|
| void | resize (size_type n, value_type value) |
| | Resizes the container to contain count elements.
|
|
void | resize (size_type n) |
| | Resizes the current eve::soa_vector to a new size.
|
| void | swap (soa_vector &other) noexcept |
| | Exchanges the contents of the container with those of other.
|
|
Allocator | get_allocator () |
| | Retrieves an instance of the current allocator.
|
|
void | swap (soa_vector &lhs, soa_vector &rhs) noexcept |
| | Swaps the contents of lhs and rhs by calling lhs.swap(rhs).
|
template<eve::product_type Type, eve::simd_allocator Allocator = eve::aligned_allocator<unsigned char, eve::fixed<64>>>
Increase the capacity of the vector to a value that's greater or equal to n.
If n is greater than the current capacity(), new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, the method does nothing.
- Warning
- reserve() does not change the size of the vector.
- Parameters
-
| n | New capacity of the eve::soa_vector |