bitset

package
v0.0.0-...-8beb243 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const BitsetUnitSize = 64

BitsetUnitSize is the size of a bitset unit.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitset

type Bitset struct {
	// contains filtered or unexported fields
}

func New

func New(size uint64) *Bitset

New returns a new Bitset instance.

func (*Bitset) Bits

func (b *Bitset) Bits() []uint64

Bits returns the underlying bitset.

func (*Bitset) Clear

func (b *Bitset) Clear()

Clear clears the bitset.

func (*Bitset) Copy

func (b *Bitset) Copy() *Bitset

Copy returns a copy of the bitset.

func (*Bitset) Count

func (b *Bitset) Count() int

Count returns the number of 1s in the bitset.

func (*Bitset) Difference

func (b *Bitset) Difference(other *Bitset) *Bitset

Difference returns the difference of the bitset with the given bitset.

func (*Bitset) Get

func (b *Bitset) Get(index uint64) bool

Get returns the bit at the given index.

func (*Bitset) Intersect

func (b *Bitset) Intersect(other *Bitset) *Bitset

Intersect returns the intersection of the bitset with the given bitset.

func (*Bitset) Set

func (b *Bitset) Set(index uint64)

Set sets the bit at the given index.

func (*Bitset) Size

func (b *Bitset) Size() uint64

Size returns the size of the bitset.

func (*Bitset) Union

func (b *Bitset) Union(other *Bitset) *Bitset

Union returns the union of the bitset with the given bitset.

func (*Bitset) Unset

func (b *Bitset) Unset(index uint64)

Unset unsets the bit at the given index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL