mixedbag 0.0.1
|
#include <sparse_vector.hxx>
Public Member Functions | |
sparse_vector (const sparse_vector &other)=default | |
sparse_vector (sparse_vector &&other) noexcept=default | |
sparse_vector (const allocator_type &allocator) | |
sparse_vector (const sparse_vector &other, const allocator_type &allocator) | |
sparse_vector (sparse_vector &&other, allocator_type &allocator) noexcept | |
allocator_type | get_allocator () const |
size_type | size () const noexcept |
bool | empty () const noexcept |
sparse_vector & | operator= (const sparse_vector &other) |
sparse_vector & | operator= (sparse_vector &&other) noexcept |
template<typename... Args> | |
reference | emplace (size_type index, Args... args) |
reference | insert (size_type index, const value_type &val) |
void | erase (size_type index) |
void | reserve_index (size_type size) |
void | reserve_data (size_type size) |
const value_type & | operator[] (size_type index) const |
value_type & | operator[] (size_type index) |
iterator | begin () noexcept |
iterator | end () noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
auto | operator<=> (const sparse_vector &other) const noexcept -> std::compare_three_way_result_t< value_type > |
bool | operator== (const sparse_vector &other) const noexcept |
sparse_vector is a container for storing index value pairs, intended for fast unordered iteration of the values.
The power of this kind of container is that you get very fast unordered iteration over the values, since they are stored in a contiguous vector.
T | The type of elements to store in the sparse_vector |
SizeT | The size type - it defaults to std::size_t, but if you know the upper bounds on the index it might make sense to use a smaller type that fits (since you can never have more elements than you can index). |
Checked | Enable bounds checking if true. |
|
inlinenoexcept |
Iteration
|
inlinenoexcept |
Iteration
|
inlinenoexcept |
Iteration
|
inline |
Inserts an element at the specified index by constructing it in place, and returns it by reference
|
inlinenoexcept |
Check for emptiness
|
inlinenoexcept |
Iteration
|
inline |
Removes the element at the specified index
|
inline |
Returns the allocator in use
|
inline |
Inserts an element at the specified index by copy, and returns it by reference
|
inlinenoexcept |
Comparison
|
inline |
Assignment
|
inlinenoexcept |
Assignment
|
inlinenoexcept |
Comparison
|
inline |
Element access
|
inline |
Element access
|
inline |
Allows increasing the capacity of the internal storage, to prevent unnecessary allocation
|
inline |
Allows increasing the capacity of the internal storage, to prevent unnecessary allocation
|
inlinenoexcept |
Returns the number of elements