sketches

package
v0.0.0-...-7501a2d Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DOUBLES_SER_VER     int32 = 3
	MAX_K               int32 = 32768
	MIN_K               int32 = 2
	MIN_PRELONGS        int32 = 1
	MAX_PRELONGS        int32 = 2
	QUANTILES_FAMILY_ID int32 = 8
)
View Source
const (
	PREAMBLE_LONGS_BYTE = 0
	SER_VER_BYTE        = 1
	FAMILY_BYTE         = 2
	FLAGS_BYTE          = 3
	K_SHORT             = 4 //to 5
	N_LONG              = 8 //to 15

	//After Preamble:
	MIN_DOUBLE      = 16 //to 23 (Only for DoublesSketch)
	MAX_DOUBLE      = 24 //to 31 (Only for DoublesSketch)
	COMBINED_BUFFER = 32 //to 39 (Only for DoublesSketch)

	// flag bit masks
	BIG_ENDIAN_FLAG_MASK = 1
	READ_ONLY_FLAG_MASK  = 2
	EMPTY_FLAG_MASK      = 4
	COMPACT_FLAG_MASK    = 8
	ORDERED_FLAG_MASK    = 16
)

Byte addresses and bit masks

View Source
const BB_LVL_IDX = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractDoublesSketchAccessor

type AbstractDoublesSketchAccessor struct {
	DoublesSketchAccessor
	// contains filtered or unexported fields
}

func (*AbstractDoublesSketchAccessor) NumItems

func (acc *AbstractDoublesSketchAccessor) NumItems() int32

func (*AbstractDoublesSketchAccessor) SetLevel

func (acc *AbstractDoublesSketchAccessor) SetLevel(level int32)

type DirectDoublesSketchAccessor

type DirectDoublesSketchAccessor struct{}

func NewDirectDoublesSketchAccessor

func NewDirectDoublesSketchAccessor() *DirectDoublesSketchAccessor

type DoublesSketch

type DoublesSketch interface {
	Serialize() ([]byte, error)
	SerializeCustom(bool) ([]byte, error)

	IsDirect() bool
	IsCompact() bool
	IsEmpty() bool

	GetK() int32
	GetN() int64
	GetCombinedBuffer() []float64
	GetBaseBufferCount() int32
	GetBitPattern() int64
	GetMinValue() float64
	GetMaxValue() float64

	PutK(int32)
	PutN(int64)
	PutCombinedBuffer([]float64)
	PutBaseBufferCount(int32)
	PutBitPattern(int64)
	PutMinValue(float64)
	PutMaxValue(float64)
}

type DoublesSketchAccessor

type DoublesSketchAccessor interface {
	SetLevel(level int32)
	NumItems() int32
	GetArray(fromIdx int32, numItems int32) []float64
	PutArray(srcArray []float64, srcIndex, dstIndex, numItems int32)
	Get(index int32) float64
	Set(index int32, value float64) float64
	Sort()
	CopyAndSetLevel(level int32) DoublesSketchAccessor
}

func NewDoublesSketchAccessor

func NewDoublesSketchAccessor(sketch DoublesSketch, forceSize bool) DoublesSketchAccessor

type DoublesSketchImpl

type DoublesSketchImpl struct {
	DoublesSketch
}

func (*DoublesSketchImpl) Serialize

func (s *DoublesSketchImpl) Serialize() ([]byte, error)

func (*DoublesSketchImpl) SerializeCustom

func (s *DoublesSketchImpl) SerializeCustom(compact bool) ([]byte, error)

type HeapCompactDoublesSketch

type HeapCompactDoublesSketch struct {
	*DoublesSketchImpl
	// contains filtered or unexported fields
}

func FromUpdatableDoublesSketch

func FromUpdatableDoublesSketch(s *HeapDoublesSketch) *HeapCompactDoublesSketch

func (*HeapCompactDoublesSketch) GetBaseBufferCount

func (s *HeapCompactDoublesSketch) GetBaseBufferCount() int32

func (*HeapCompactDoublesSketch) GetBitPattern

func (s *HeapCompactDoublesSketch) GetBitPattern() int64

func (*HeapCompactDoublesSketch) GetCombinedBuffer

func (s *HeapCompactDoublesSketch) GetCombinedBuffer() []float64

func (*HeapCompactDoublesSketch) GetK

func (s *HeapCompactDoublesSketch) GetK() int32

func (*HeapCompactDoublesSketch) GetMaxValue

func (s *HeapCompactDoublesSketch) GetMaxValue() float64

func (*HeapCompactDoublesSketch) GetMinValue

func (s *HeapCompactDoublesSketch) GetMinValue() float64

func (*HeapCompactDoublesSketch) GetN

func (s *HeapCompactDoublesSketch) GetN() int64

func (*HeapCompactDoublesSketch) IsCompact

func (s *HeapCompactDoublesSketch) IsCompact() bool

func (*HeapCompactDoublesSketch) IsDirect

func (s *HeapCompactDoublesSketch) IsDirect() bool

func (*HeapCompactDoublesSketch) IsEmpty

func (s *HeapCompactDoublesSketch) IsEmpty() bool

func (*HeapCompactDoublesSketch) PutBaseBufferCount

func (s *HeapCompactDoublesSketch) PutBaseBufferCount(v int32)

func (*HeapCompactDoublesSketch) PutBitPattern

func (s *HeapCompactDoublesSketch) PutBitPattern(v int64)

func (*HeapCompactDoublesSketch) PutCombinedBuffer

func (s *HeapCompactDoublesSketch) PutCombinedBuffer(v []float64)

func (*HeapCompactDoublesSketch) PutK

func (s *HeapCompactDoublesSketch) PutK(v int32)

func (*HeapCompactDoublesSketch) PutMaxValue

func (s *HeapCompactDoublesSketch) PutMaxValue(v float64)

func (*HeapCompactDoublesSketch) PutMinValue

func (s *HeapCompactDoublesSketch) PutMinValue(v float64)

func (*HeapCompactDoublesSketch) PutN

func (s *HeapCompactDoublesSketch) PutN(v int64)

type HeapDoublesSketch

type HeapDoublesSketch struct {
	*DoublesSketchImpl
	// contains filtered or unexported fields
}

func NewDoublesSketch

func NewDoublesSketch(k int) (*HeapDoublesSketch, error)

func (*HeapDoublesSketch) Compact

func (*HeapDoublesSketch) GetBaseBufferCount

func (s *HeapDoublesSketch) GetBaseBufferCount() int32

func (*HeapDoublesSketch) GetBitPattern

func (s *HeapDoublesSketch) GetBitPattern() int64

func (*HeapDoublesSketch) GetCombinedBuffer

func (s *HeapDoublesSketch) GetCombinedBuffer() []float64

func (*HeapDoublesSketch) GetK

func (s *HeapDoublesSketch) GetK() int32

func (*HeapDoublesSketch) GetMaxValue

func (s *HeapDoublesSketch) GetMaxValue() float64

func (*HeapDoublesSketch) GetMinValue

func (s *HeapDoublesSketch) GetMinValue() float64

func (*HeapDoublesSketch) GetN

func (s *HeapDoublesSketch) GetN() int64

func (*HeapDoublesSketch) IsCompact

func (s *HeapDoublesSketch) IsCompact() bool

func (*HeapDoublesSketch) IsDirect

func (s *HeapDoublesSketch) IsDirect() bool

func (*HeapDoublesSketch) IsEmpty

func (s *HeapDoublesSketch) IsEmpty() bool

func (*HeapDoublesSketch) PutBaseBufferCount

func (s *HeapDoublesSketch) PutBaseBufferCount(v int32)

func (*HeapDoublesSketch) PutBitPattern

func (s *HeapDoublesSketch) PutBitPattern(v int64)

func (*HeapDoublesSketch) PutCombinedBuffer

func (s *HeapDoublesSketch) PutCombinedBuffer(v []float64)

func (*HeapDoublesSketch) PutK

func (s *HeapDoublesSketch) PutK(v int32)

func (*HeapDoublesSketch) PutMaxValue

func (s *HeapDoublesSketch) PutMaxValue(v float64)

func (*HeapDoublesSketch) PutMinValue

func (s *HeapDoublesSketch) PutMinValue(v float64)

func (*HeapDoublesSketch) PutN

func (s *HeapDoublesSketch) PutN(v int64)

func (*HeapDoublesSketch) Update

func (s *HeapDoublesSketch) Update(dataItem float64) error

type HeapDoublesSketchAccessor

type HeapDoublesSketchAccessor struct {
	*AbstractDoublesSketchAccessor
}

func NewHeapDoublesSketchAccessor

func NewHeapDoublesSketchAccessor(sketch DoublesSketch, forceSize bool, level int32) *HeapDoublesSketchAccessor

func (*HeapDoublesSketchAccessor) CopyAndSetLevel

func (acc *HeapDoublesSketchAccessor) CopyAndSetLevel(level int32) DoublesSketchAccessor

func (*HeapDoublesSketchAccessor) Get

func (acc *HeapDoublesSketchAccessor) Get(index int32) float64

func (*HeapDoublesSketchAccessor) GetArray

func (acc *HeapDoublesSketchAccessor) GetArray(fromIdx int32, numItems int32) []float64

func (*HeapDoublesSketchAccessor) PutArray

func (acc *HeapDoublesSketchAccessor) PutArray(srcArray []float64, srcIndex, dstIndex, numItems int32)

func (*HeapDoublesSketchAccessor) Set

func (acc *HeapDoublesSketchAccessor) Set(index int32, value float64) float64

func (*HeapDoublesSketchAccessor) Sort

func (acc *HeapDoublesSketchAccessor) Sort()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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