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
- type Bitmap
- func (me *Bitmap) Add(is ...int)
- func (me *Bitmap) AddRange(begin, end int)
- func (me *Bitmap) Clear()
- func (me *Bitmap) Contains(i int) bool
- func (me Bitmap) Copy() (ret Bitmap)
- func (me *Bitmap) FlipRange(begin, end int)
- func (me *Bitmap) Get(bit int) bool
- func (me *Bitmap) Iter(f func(interface{}) bool)
- func (me Bitmap) IterTyped(f func(int) bool) bool
- func (me *Bitmap) Len() int
- func (me *Bitmap) Remove(i int)
- func (me *Bitmap) RemoveRange(begin, end int) *Bitmap
- func (me *Bitmap) Set(bit int, value bool)
- func (me *Bitmap) Sub(other *Bitmap)
- func (me Bitmap) ToSortedSlice() (ret []int)
- func (me *Bitmap) Union(other *Bitmap)
- type Iter
Constants ¶
View Source
const MaxInt = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
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.