Skip to content

Latest commit

 

History

History
116 lines (62 loc) · 2.65 KB

hyperloglog.md

File metadata and controls

116 lines (62 loc) · 2.65 KB

hyperloglog

import "github.com/andy2046/gopie/pkg/hyperloglog"

Package hyperloglog implements HyperLogLog cardinality estimation.

hyperloglog.go

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

HyperLogLog probabilistic data struct for cardinality estimation.

func New(m uint) (*HyperLogLog, error)

New creates a new HyperLogLog with m registers bucket. m should be a power of two.

func NewGuess(stdErr float64) (*HyperLogLog, error)

NewGuess creates a new HyperLogLog within the given standard error.

func (*HyperLogLog) Add

func (h *HyperLogLog) Add(data []byte)

Add adds the data to the set.

func (*HyperLogLog) Count

func (h *HyperLogLog) Count() uint64

Count returns the estimated cardinality of the set.

func (*HyperLogLog) Merge

func (h *HyperLogLog) Merge(other *HyperLogLog) error

Merge combines the HyperLogLog with the other.

func (*HyperLogLog) Reset

func (h *HyperLogLog) Reset()

Reset restores the HyperLogLog to its original state.

func (*HyperLogLog) SetHash

func (h *HyperLogLog) SetHash(hasher hash.Hash32)

SetHash sets the hashing function.


Generated by godoc2md