Documentation
¶
Index ¶
Constants ¶
const MaxBitsetWords = 16
MaxBitsetWords specifies the number of 64-bit words in the bitset.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitsTraverser ¶
type BitsTraverser struct {
// contains filtered or unexported fields
}
BitsTraverser is an iterator that allows to iterate over all bits set in the given 64-bit unsigned integer.
Iteration is performed from the least significant bit to the most significant one.
func NewBitsTraverser ¶
func NewBitsTraverser(word uint64) BitsTraverser
NewBitsTraverser constructs a new bits traverser over given 64-bit word.
type TinyBitset ¶
type TinyBitset struct {
// contains filtered or unexported fields
}
TinyBitset implements constant-length bitset.
This structure is designed to be used as a comparable key in maps.
func (*TinyBitset) AsSlice ¶
func (m *TinyBitset) AsSlice() []uint32
AsSlice returns the bitset as a slice of indices, where each index is a position of the bit set.
func (*TinyBitset) Count ¶
func (m *TinyBitset) Count() uint
Count returns the number of bits set in the bitset.
func (*TinyBitset) Insert ¶
func (m *TinyBitset) Insert(idx uint32)
Insert inserts the given index into the bitset.
func (*TinyBitset) Traverse ¶
func (m *TinyBitset) Traverse(fn func(uint32) bool)
Traverse traverses the bitset and calls the given function for each bit set.
Iteration is performed from the least significant bit to the most significant one.