bitmap

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap256

type Bitmap256 [4]uint64

Bitmap256 is a bitmap of 256 elements.

func (Bitmap256) Clear

func (v Bitmap256) Clear(pos uint8) Bitmap256

Clear sets the bit at position pos to false.

func (Bitmap256) Count

func (v Bitmap256) Count() int

Count returns the total number of 1s in the bitmap.

func (Bitmap256) CountLeadingOnes

func (v Bitmap256) CountLeadingOnes() int

CountLeadingOnes returns the count of consecutive 1s starting from the beginning.

func (Bitmap256) Get

func (v Bitmap256) Get(pos uint8) bool

Get returns the bit value at position pos.

func (Bitmap256) Iterate

func (v Bitmap256) Iterate(f func(i int))

Iterate calls the given function f with the index of each set bit.

func (Bitmap256) Or

func (v Bitmap256) Or(b Bitmap256) Bitmap256

Or returns a new Bitmap256 that is the bitwise OR of the current bitmap and the given bitmap.

func (Bitmap256) Set

func (v Bitmap256) Set(pos uint8) Bitmap256

Set sets the bit at position pos to true.

func (Bitmap256) Subtract

func (v Bitmap256) Subtract(b Bitmap256) Bitmap256

Subtract returns a new Bitmap256 containing bits set in b that are not set in the current bitmap.

Jump to

Keyboard shortcuts

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