bitset

package
v0.0.0-...-3100227 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bitset is sample code illustrating possible implementations of a Bitset in Go, with benchmarks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitset

type Bitset interface {
	GetBit(i int) bool
	SetBit(i int, value bool)

	// Len is the length of the bitset, in bits.
	// Its semantics may vary slightly depending on the implementation.
	Len() int
}

Bitset is the minimum set of features common to my Bitset implementations.

type BitsetBigInt

type BitsetBigInt struct {
	*big.Int
}

func NewBigInt

func NewBigInt() BitsetBigInt

func (BitsetBigInt) GetBit

func (b BitsetBigInt) GetBit(i int) bool

func (BitsetBigInt) Len

func (b BitsetBigInt) Len() int

func (BitsetBigInt) SetBit

func (b BitsetBigInt) SetBit(i int, value bool)

type BitsetBool

type BitsetBool []bool

func (BitsetBool) GetBit

func (b BitsetBool) GetBit(i int) bool

func (BitsetBool) Len

func (b BitsetBool) Len() int

func (BitsetBool) SetBit

func (b BitsetBool) SetBit(i int, value bool)

type BitsetBoolDyn

type BitsetBoolDyn []bool

func (*BitsetBoolDyn) GetBit

func (b *BitsetBoolDyn) GetBit(i int) bool

func (*BitsetBoolDyn) Len

func (b *BitsetBoolDyn) Len() int

func (*BitsetBoolDyn) SetBit

func (b *BitsetBoolDyn) SetBit(i int, value bool)

type BitsetMap

type BitsetMap map[int]bool

func (BitsetMap) GetBit

func (b BitsetMap) GetBit(i int) bool

func (BitsetMap) Len

func (b BitsetMap) Len() int

func (BitsetMap) SetBit

func (b BitsetMap) SetBit(i int, value bool)

type BitsetUint64

type BitsetUint64 []uint64

func NewUint64

func NewUint64(n int) BitsetUint64

func (BitsetUint64) GetBit

func (b BitsetUint64) GetBit(index int) bool

func (BitsetUint64) Len

func (b BitsetUint64) Len() int

func (BitsetUint64) SetBit

func (b BitsetUint64) SetBit(index int, value bool)

type BitsetUint8

type BitsetUint8 []uint8

func NewUint8

func NewUint8(n int) BitsetUint8

func (BitsetUint8) GetBit

func (b BitsetUint8) GetBit(index int) bool

func (BitsetUint8) Len

func (b BitsetUint8) Len() int

func (BitsetUint8) SetBit

func (b BitsetUint8) SetBit(index int, value bool)

type BitsetWillf

type BitsetWillf struct {
	wb.BitSet
}

func (*BitsetWillf) GetBit

func (b *BitsetWillf) GetBit(i int) bool

func (*BitsetWillf) Len

func (b *BitsetWillf) Len() int

func (*BitsetWillf) SetBit

func (b *BitsetWillf) SetBit(i int, value bool)

Jump to

Keyboard shortcuts

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