Documentation ¶
Index ¶
- type Bitmap
- func (dst *Bitmap) And(b Bitmap)
- func (dst *Bitmap) AndNot(b Bitmap)
- func (dst *Bitmap) Clear()
- func (dst Bitmap) Clone(into *Bitmap) Bitmap
- func (dst Bitmap) Contains(x uint32) bool
- func (dst Bitmap) Count() int
- func (dst Bitmap) CountTo(until uint32) int
- func (dst *Bitmap) Filter(f func(x uint32) bool)
- func (dst Bitmap) FirstZero() (uint32, bool)
- func (dst *Bitmap) Grow(desiredBit uint32)
- func (dst Bitmap) Max() (uint32, bool)
- func (dst Bitmap) Min() (uint32, bool)
- func (dst Bitmap) Ones()
- func (dst *Bitmap) Or(b Bitmap)
- func (dst Bitmap) Range(f func(x uint32) bool)
- func (dst *Bitmap) Remove(x uint32)
- func (dst *Bitmap) Set(x uint32)
- func (dst *Bitmap) ToBytes() (out []byte)
- func (dst *Bitmap) WriteTo(w io.Writer) (int64, error)
- func (dst *Bitmap) Xor(b Bitmap)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap []uint64
Bitmap represents a scalar-backed bitmap index
func (*Bitmap) And ¶
And computes the intersection between two bitmaps and stores the result in the current bitmap
func (*Bitmap) AndNot ¶
AndNot computes the difference between two bitmaps and stores the result in the current bitmap
func (Bitmap) Clone ¶
Clone clones the bitmap. If a destination bitmap is provided, the bitmap will be cloned inside, otherwise a new Bitmap will be allocated and returned
func (Bitmap) CountTo ¶ added in v1.0.4
CountTo counts the number of elements in the bitmap up until the specified index. If until is math.MaxUint32, it will return the count. The count is non-inclusive of the index.
func (*Bitmap) Filter ¶
Filter iterates over the bitmap elements and calls a predicate provided for each containing element. If the predicate returns false, the bitmap at the element's position is set to zero.
func (Bitmap) FirstZero ¶
FirstZero finds the first zero bit and returns its index, assuming the bitmap is not empty.
func (Bitmap) Max ¶
Max get the largest value stored in this bitmap, assuming the bitmap is not empty.
func (Bitmap) Min ¶
Min get the smallest value stored in this bitmap, assuming the bitmap is not empty.
func (*Bitmap) Or ¶
Or computes the union between two bitmaps and stores the result in the current bitmap
func (Bitmap) Range ¶
Range iterates over the bitmap elements. If the callback returns false it halts the iteration.
func (*Bitmap) ToBytes ¶
ToBytes converts the bitmap to binary representation without copying the underlying data. The output buffer should not be modified, since it would also change the bitmap.