References
Operations on the main vector
DynamicSparseArrays.find
— Functionfind(array::Vector{Union{Nothing, T}}, key, from::Int, to::Int) where {T}
Look for the element indexed by key
in the subarray of array
starting at position from
and ending at position to
.
If the element is in the subarray, the method returns the position and the the element.
If the element is not in the subarray, the method returns the position and the element that has the nearest inferior key (predecessor) in the subarray.
If the element has no predecessor in the subarray, the method returns the position and the last element located in the left outside.
find(array::Vector{Union{Nothing, T}}, key) where {T}
Look for the element indexed by key
in array
.
If the element is in the array
, the method returns the position and the the element.
If the element is not in the array
, the method returns the position and the element that has the nearest inferior key (predecessor).
If the element has no predecessor, the method returns (0, nothing)
.
DynamicSparseArrays.pack!
— Functionpack!(array::Elements{K,T}, window_start, window_end, m)
Given a subarray of array
delimited by window_start
included and window_end
included, this method packs the m
non-empty cells on the left side of the subarray.
DynamicSparseArrays.spread!
— Functionspread!(array::Elements{K,T}, windows_start, window_end, m)
Given a subarray of array
delimited by window_start
included and window_end
included, this method spreads evenly the m
non-empty cells that have been packed on the left side of the subarray.
DynamicSparseArrays.insert!
— Functioninsert!(array::Elements{K,T}, key::K, value::T, from, to, semaphores)
Insert the element (key, value)
in the subarray of array
starting at position from
and ending at position to
included.
Return the position where the element is located and a boolean equal to true
if it is a new key
.
insert!(array::Elements{K,T}, key::K, value::T, semaphores)
Insert the element (key, value)
in array
.
DynamicSparseArrays.delete!
— Functiondelete!(array, key, from, to, semaphores)
Delete from array
the element having key key
and located in the subarray starting at position from
and ending at position to
.
Return true
if the element has been deleted; false
otherwise.
DynamicSparseArrays.purge!
— Functionpurge!(array, from, to)
Delete from array
all elements between positions from
and to
included. Return middle and the number of elements deleted
DynamicSparseArrays._movecellstoright!
— FunctionMove cells of array
to the right from position from
to position to
(from
< to
). After the move, the cell at position from
is empty, the content of the cell at position to
is replaced by the content of the cell at position to - 1
.
DynamicSparseArrays._movecellstoleft!
— FunctionMove cells of array
to the left from position from
to position to
(from
> to
). After the move, the cell at position from
is empty, the content of the cell at position to
is replaced by the content of the cell at position to + 1
.