Documentation ¶
Index ¶
- type Bitmap256
- func (v *Bitmap256) Clear(pos uint8)
- func (v *Bitmap256) Count() int
- func (v *Bitmap256) CountLess(pos uint8) int
- func (v *Bitmap256) Empty() bool
- func (v *Bitmap256) FindFirstClear() int
- func (v *Bitmap256) FindFirstSet() int
- func (v *Bitmap256) FindNextClear(pos uint8) int
- func (v *Bitmap256) FindNextSet(pos uint8) int
- func (v *Bitmap256) FindNthSet(n uint8) int
- func (v *Bitmap256) Full() bool
- func (v *Bitmap256) Get(pos uint8) bool
- func (v *Bitmap256) Set(pos uint8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap256 ¶
type Bitmap256 [4]uint64
A Bitmap256 is a bitmap of 256 elements.
Using a fixed-size structure avoids the overhead of using a slice (both the 3-word slice structure, and the associated cache-miss due to the slice indirection), at the cost of flexibility.
func (*Bitmap256) CountLess ¶
Return the number of true bits up to, but not including, position pos.
func (*Bitmap256) FindFirstClear ¶
Return the position of the first false bit in the bitmap, and 256 if there are no false bits.
func (*Bitmap256) FindFirstSet ¶
Return the position of the first true bit in the bitmap, and 256 if there are no true bits.
func (*Bitmap256) FindNextClear ¶
Return the position of the first false bit starting at position pos, and 256 if there are no further false bits.
func (*Bitmap256) FindNextSet ¶
Return the position of the first true bit starting at position pos, and 256 if there are no further true bits.
func (*Bitmap256) FindNthSet ¶
Return the position of the n-th (zero-indexed) true bit in the bitmap, and 256 if there are not true bits. The first true bit is n == 0.