rlepluslazy

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 0

Variables

View Source
var (
	ErrWrongVersion = errors.New("invalid RLE+ version")
	ErrDecode       = fmt.Errorf("invalid encoding for RLE+ version %d", Version)
)

Functions

func Count

func Count(ri RunIterator) (uint64, error)

func EncodeRuns

func EncodeRuns(rit RunIterator, buf []byte) ([]byte, error)

func SliceFromRuns

func SliceFromRuns(source RunIterator) ([]uint64, error)

Types

type BitIterator

type BitIterator interface {
	Next() (uint64, error)
	HasNext() bool
}

func BitsFromRuns

func BitsFromRuns(source RunIterator) (BitIterator, error)

func BitsFromSlice

func BitsFromSlice(slice []uint64) BitIterator

type RLE

type RLE struct {
	// contains filtered or unexported fields
}

func FromBuf

func FromBuf(buf []byte) (RLE, error)

func (*RLE) Count

func (rle *RLE) Count() (uint64, error)

func (*RLE) RunIterator

func (rle *RLE) RunIterator() (RunIterator, error)

type Run

type Run struct {
	Val bool
	Len uint64
}

func (Run) Valid

func (r Run) Valid() bool

type RunIterable

type RunIterable interface {
	RunIterator() (RunIterator, error)
}

type RunIterator

type RunIterator interface {
	NextRun() (Run, error)
	HasNext() bool
}

func DecodeRLE

func DecodeRLE(buf []byte) (RunIterator, error)

func RunsFromBits

func RunsFromBits(source BitIterator) (RunIterator, error)

func RunsFromSlice

func RunsFromSlice(slice []uint64) (RunIterator, error)

func Sum

func Sum(a, b RunIterator) (RunIterator, error)

Jump to

Keyboard shortcuts

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