Defined in File SparseVector.hpp
A vector that imitates a map with unsigned integer keys. This class has faster access than a map, but needs space linear in the maximum key value.
Public Functions
Construct an empty vector. Empty values are created using the default constructor.
size – upper bound for the maximum usable index
Construct an empty vector.
size – upper bound for the maximum usable index
emptyValue – value used for empty entries
Insert a value at a given position.
i – index where the value is inserted
value –
Access operator. Before accessing an element, insert it by using the insert() method.
Const access operator. Before accessing an element, insert it by using the insert() method.
Returns true iff an element was previously inserted at the given index.
idx –
Inserts value at position i, or replaces the value if previously inserted
i –
value –
Remove all indexes for which the value is set to the emptyValue.
Reset all values to the default value, so it is “empty”. The upper bound is not changed.
Clear the vector, setting the upper bound of usable indexes to 0.
Reallocate the datastructure if size exceeds current upper bound This is different from setUpperBound() since we want to make sure both usedIndexes and data are allocated on the socket of the calling thread
size –
emptyValue – new emptyValue
Applies the given lambda to each inserted index and associated value
ElementHandler –
lambda –