Documentation ¶
Overview ¶
Package bitmap provides a []bool/bitmap implementation with standardized iteration. Bitmaps are the equivalent of []bool, with improved compression for runs of similar values, and faster operations on ranges and the like.
Index ¶
- Constants
- Variables
- type BitIndex
- type Bitmap
- func (me *Bitmap) Add(is ...BitIndex)
- func (me *Bitmap) AddRange(begin, end BitIndex)
- func (me *Bitmap) Clear()
- func (me *Bitmap) Contains(i int) bool
- func (me Bitmap) Copy() (ret Bitmap)
- func (me *Bitmap) FlipRange(begin, end BitIndex)
- func (me *Bitmap) Get(bit BitIndex) bool
- func (me Bitmap) IsEmpty() bool
- func (me Bitmap) Iter(cb iter.Callback)
- func (me Bitmap) IterTyped(f func(int) bool) bool
- func (me *Bitmap) Len() int
- func (me *Bitmap) Remove(i BitIndex) bool
- func (me *Bitmap) RemoveRange(begin, end BitIndex) *Bitmap
- func (me *Bitmap) Set(bit BitIndex, value bool)
- func (me *Bitmap) Sub(other Bitmap)
- func (me Bitmap) ToSortedSlice() (ret []int)
- func (me *Bitmap) Union(other Bitmap)
- type Interface
- type Iter
Constants ¶
View Source
const MaxInt = -1
Variables ¶
View Source
var ToEnd int = -1
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
Bitmaps store the existence of values in [0,math.MaxUint32] more efficiently than []bool. The empty value starts with no bits set.
func (*Bitmap) RemoveRange ¶
func (Bitmap) ToSortedSlice ¶
Click to show internal directories.
Click to hide internal directories.