Documentation
¶
Overview ¶
Package bitmap provides a simple bitmap which allows individual bits to be set and read within a slice of bytes.
The package was inspired by the book "Programming Pearls," by Jon Bentley. The first example in the book is a clever sorting solution which uses a bitmap to sort a file containing up 10 million numeric values in a single pass without loading them all into memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutOfRange = errors.New("Value out of range.")
Functions ¶
This section is empty.
Types ¶
type BitMap ¶
type BitMap struct {
// contains filtered or unexported fields
}
BitMap is a struct containing a slice of bytes, being used as a bitmap.
func FromString ¶
func New ¶
New returns a BitMap. It requires a size. A bitmap with a size of eight or less will be one byte in size, and so on.
func (BitMap) IsSet ¶
IsSet returns a boolean indicating whether the bit is set for the position in question.
Click to show internal directories.
Click to hide internal directories.