Documentation
¶
Overview ¶
package sparse implements a generic sparse array with popcount compression.
Index ¶
- type Array
- func (s *Array[T]) DeleteAt(i uint) (T, bool)
- func (s *Array[T]) Get(i uint) (val T, ok bool)
- func (s *Array[T]) InsertAt(i uint, val T) (exists bool)
- func (s *Array[T]) Len() int
- func (s *Array[T]) MustGet(i uint) T
- func (s *Array[T]) UpdateAt(i uint, cb func(T, bool) T) (newVal T, wasPresent bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
Array, a generic implementation of a sparse array with popcount compression and payload T.
func (*Array[T]) InsertAt ¶
InsertAt a value at i into the sparse array. If the value already exists, overwrite it with val and return true.
Click to show internal directories.
Click to hide internal directories.