Documentation ¶
Index ¶
- Variables
- type Bitset
- func (a *Bitset[W, V]) And(b *Bitset[W, V]) (aAndB *Bitset[W, V])
- func (s *Bitset[V, W]) Cap() int
- func (s *Bitset[W, V]) Clear()
- func (s *Bitset[W, V]) Copy() *Bitset[W, V]
- func (s *Bitset[W, V]) Get(index V) bool
- func (s *Bitset[W, V]) Iterate() (iterable.Iter[V], uint)
- func (s *Bitset[V, W]) Len() int
- func (a *Bitset[W, V]) Or(b *Bitset[W, V]) (aOrB *Bitset[W, V])
- func (s *Bitset[V, W]) Pop() uint
- func (s *Bitset[W, V]) Set(indices ...V)
- func (s *Bitset[W, V]) Unset(indices ...V)
- type Iterator
- type Uint
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type Width
Constants ¶
This section is empty.
Variables ¶
var ( NewUint = New[uint, uint] NewUint8 = New[uint8, uint] NewUint16 = New[uint16, uint] NewUint32 = New[uint32, uint] NewUint64 = New[uint64, uint] )
handy aliases for instantiation
Functions ¶
This section is empty.
Types ¶
type Bitset ¶
type Bitset[W Width, V bitset.Value] struct { logical.IterableMixin[V] // contains filtered or unexported fields }
Bitset is a threadsafe container for storing a set of bits.
func New ¶
New instantiates a new bitset with an initial size of size. This size parameter refers to the number of bitset elements, not the underlying storage.
func (*Bitset[W, V]) And ¶
And computes and returns the intersection of two bitsets. It does not modify either bitset.
func (*Bitset[V, W]) Cap ¶
Cap is the available number of bits in the underlying data store (rounded up to word size).
func (*Bitset[W, V]) Clear ¶
func (s *Bitset[W, V]) Clear()
Clear unsets all elements in the bitset, and sets the internal size to zero.
func (*Bitset[W, V]) Get ¶
Get returns whether or not a value is set in the underlying bitset. Getting a value outside of what's stored automatically returns false.
func (*Bitset[V, W]) Len ¶
Len is the used number of bits in the underlying data store (rounded up to word size).
func (*Bitset[W, V]) Or ¶
Or computes and returns the union of two bitsets. It does not modify either bitset.