Documentation ¶
Index ¶
- func Max[T simd.Number](src []T, filter Bitmap) (max T, hit bool)
- func Min[T simd.Number](src []T, filter Bitmap) (min T, hit bool)
- func Sum[T simd.Number](src []T, filter Bitmap) (sum T)
- type Bitmap
- func (dst *Bitmap) And(other Bitmap, extra ...Bitmap)
- func (dst *Bitmap) AndNot(other Bitmap, extra ...Bitmap)
- func (dst *Bitmap) Clear()
- func (dst Bitmap) Clone(into *Bitmap) Bitmap
- func (dst Bitmap) Contains(x uint32) bool
- func (dst Bitmap) ContainsAllInRange(from, to uint32) bool
- func (dst Bitmap) ContainsAnyInRange(from, to 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) Grow(desiredBit uint32)
- func (dst Bitmap) MarshalJSON() ([]byte, error)
- func (dst Bitmap) Max() (uint32, bool)
- func (dst Bitmap) MaxZero() (uint32, bool)
- func (dst Bitmap) Min() (uint32, bool)
- func (dst Bitmap) MinZero() (uint32, bool)
- func (dst Bitmap) Ones()
- func (dst *Bitmap) Or(other Bitmap, extra ...Bitmap)
- func (dst Bitmap) Range(fn func(x uint32))
- func (dst *Bitmap) ReadFrom(r io.Reader) (int64, error)
- func (dst *Bitmap) Remove(x uint32)
- func (dst *Bitmap) Set(x uint32)
- func (dst *Bitmap) SetRange(from, to uint32)
- func (dst *Bitmap) ToBytes() (out []byte)
- func (dst *Bitmap) UnmarshalJSON(data []byte) (err error)
- func (dst *Bitmap) WriteTo(w io.Writer) (int64, error)
- func (dst *Bitmap) Xor(other Bitmap, extra ...Bitmap)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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. Operation works as set subtract: dst - b
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) ContainsAllInRange ¶
ContainsRange checks whether all values in a range is contained in the bitmap or not.
func (Bitmap) ContainsAnyInRange ¶
ContainsAny checks whether a value in a range is contained in the bitmap or not.
func (Bitmap) CountTo ¶
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) MarshalJSON ¶
MarshalJSON returns encoded string representation for the bitmap
func (Bitmap) Max ¶
Max get the largest value stored in this bitmap, assuming the bitmap is not empty.
func (Bitmap) MaxZero ¶
MaxZero get the last zero bit and return its index, assuming bitmap is not empty
func (Bitmap) Min ¶
Min get the smallest value stored in this bitmap, assuming the bitmap is not empty.
func (Bitmap) MinZero ¶
MinZero finds the first zero bit and returns its index, 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) ReadFrom ¶
ReadFrom reads data from r until EOF or error. The return value n is the number of bytes read. Any error except EOF encountered during the read is also returned.
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.
func (*Bitmap) UnmarshalJSON ¶
UnmarshalJSON decodes the received bytes and loads it to bitmap object