Documentation
¶
Index ¶
- func AddMapKeysToSet[T comparable, V any](s Set[T], m map[T]V)
- func AddMapValuesToSet[T comparable, K comparable](s Set[T], m map[K]T)
- type Bitmap
- func (b *Bitmap) Add(num uint) bool
- func (b *Bitmap) Cap() int
- func (b *Bitmap) Contains(num uint) bool
- func (b *Bitmap) Grow(n uint)
- func (b *Bitmap) Iter() BitsIter
- func (b *Bitmap) Len() int
- func (b *Bitmap) Range(fn func(uint) bool)
- func (b *Bitmap) Remove(num uint) bool
- func (b *Bitmap) String() string
- type Bits
- type BitsIter
- type RoaringBitmap
- func (r *RoaringBitmap) Add(num uint32) bool
- func (r *RoaringBitmap) All() iter.Seq[uint32]
- func (r *RoaringBitmap) Contains(num uint32) bool
- func (r *RoaringBitmap) Iter() RoaringBitmapIter
- func (r *RoaringBitmap) Len() int
- func (r *RoaringBitmap) Range(fn func(num uint32) bool)
- func (r *RoaringBitmap) Remove(num uint32) bool
- type RoaringBitmapIter
- type Set
- func (s Set[T]) Add(v T) (first bool)
- func (s Set[T]) AddAll(vs ...T)
- func (s Set[T]) Clear()
- func (s Set[T]) Delete(v T) (exists bool)
- func (s Set[T]) Diff(other Set[T])
- func (s Set[T]) DiffWithSlice(other []T)
- func (s Set[T]) Filter(fn func(T) bool)
- func (s Set[T]) Has(v T) bool
- func (s Set[T]) Intersect(other Set[T])
- func (s Set[T]) IntersectWithSlice(other []T)
- func (s Set[T]) Len() int
- func (s Set[T]) Merge(other Set[T])
- func (s Set[T]) Range(fn func(T))
- func (s Set[T]) Values(dst []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMapKeysToSet ¶
func AddMapKeysToSet[T comparable, V any](s Set[T], m map[T]V)
AddMapKeysToSet adds all keys in m to s.
func AddMapValuesToSet ¶
func AddMapValuesToSet[T comparable, K comparable](s Set[T], m map[K]T)
AddMapValuesToSet adds all values in m to s.
Types ¶
type Bitmap ¶ added in v0.0.20
type Bitmap struct {
// contains filtered or unexported fields
}
type Bits ¶
type Bits struct { Bitmap // contains filtered or unexported fields }
Bits is a set of bits.
type BitsIter ¶
type BitsIter struct {
// contains filtered or unexported fields
}
BitsIter is an iterator for Bits.
type RoaringBitmap ¶ added in v0.0.20
type RoaringBitmap struct {
// contains filtered or unexported fields
}
func (*RoaringBitmap) Add ¶ added in v0.0.20
func (r *RoaringBitmap) Add(num uint32) bool
Add adds a number to the roaring bitmap.
func (*RoaringBitmap) All ¶ added in v0.0.20
func (r *RoaringBitmap) All() iter.Seq[uint32]
All returns an iterator that yields all values in the roaring bitmap.
func (*RoaringBitmap) Contains ¶ added in v0.0.20
func (r *RoaringBitmap) Contains(num uint32) bool
Contains returns true if the roaring bitmap contains the number.
func (*RoaringBitmap) Iter ¶ added in v0.0.20
func (r *RoaringBitmap) Iter() RoaringBitmapIter
Iter returns an iterator for the roaring bitmap.
func (*RoaringBitmap) Len ¶ added in v0.0.20
func (r *RoaringBitmap) Len() int
Len returns the number of numbers in the roaring bitmap.
func (*RoaringBitmap) Range ¶ added in v0.0.20
func (r *RoaringBitmap) Range(fn func(num uint32) bool)
Range calls fn for each number in the roaring bitmap.
func (*RoaringBitmap) Remove ¶ added in v0.0.20
func (r *RoaringBitmap) Remove(num uint32) bool
Remove removes a number from the roaring bitmap.
type RoaringBitmapIter ¶ added in v0.0.20
type RoaringBitmapIter struct {
// contains filtered or unexported fields
}
func (*RoaringBitmapIter) Next ¶ added in v0.0.20
func (i *RoaringBitmapIter) Next() bool
func (*RoaringBitmapIter) Value ¶ added in v0.0.20
func (i *RoaringBitmapIter) Value() uint32
type Set ¶
type Set[T comparable] map[T]struct{}
Set[T comparable] is a set of T.
func FromMapKeys ¶
func FromMapKeys[T comparable, V any](src map[T]V) Set[T]
FromMapKeys returns a new set containing all keys in src.
func FromMapValues ¶
func FromMapValues[T comparable, K comparable](m map[K]T) Set[T]
FromMapValues returns a new set containing all values in src.
func FromSlice ¶
func FromSlice[T comparable](src []T) Set[T]
FromSlice returns a new set containing all values in src.
func (Set[T]) DiffWithSlice ¶
func (s Set[T]) DiffWithSlice(other []T)
DiffWithSlice deletes all values in s that are also in other.
func (Set[T]) IntersectWithSlice ¶
func (s Set[T]) IntersectWithSlice(other []T)
IntersectWithSlice deletes all values in s that are not in other.