import "github.com/andy2046/gopie/pkg/countminsketch"
Package countminsketch implements Count-Min Sketch.
- type CountMinSketch
- func New(width, depth uint) (*CountMinSketch, error)
- func NewGuess(epsilon, delta float64) (*CountMinSketch, error)
- func (c *CountMinSketch) Add(data []byte, count ...uint64)
- func (c *CountMinSketch) AddString(data string, count ...uint64)
- func (c *CountMinSketch) Count() uint64
- func (c *CountMinSketch) Depth() uint
- func (c *CountMinSketch) Estimate(data []byte) uint64
- func (c *CountMinSketch) EstimateString(data string) uint64
- func (c *CountMinSketch) Merge(other *CountMinSketch) error
- func (c *CountMinSketch) Reset()
- func (c *CountMinSketch) Width() uint
type CountMinSketch struct {
// contains filtered or unexported fields
}CountMinSketch struct.
func New(width, depth uint) (*CountMinSketch, error)New returns new Count-Min Sketch with the given width and depth.
func NewGuess(epsilon, delta float64) (*CountMinSketch, error)NewGuess returns new Count-Min Sketch with the given error rate epsilon and confidence delta.
func (c *CountMinSketch) Add(data []byte, count ...uint64)Add add the data to the sketch. count default to 1.
func (c *CountMinSketch) AddString(data string, count ...uint64)AddString add the data string to the sketch. count default to 1.
func (c *CountMinSketch) Count() uint64Count returns the number of items added to the sketch.
func (c *CountMinSketch) Depth() uintDepth returns the matrix depth.
func (c *CountMinSketch) Estimate(data []byte) uint64Estimate estimate the frequency of the data.
func (*CountMinSketch) EstimateString
func (c *CountMinSketch) EstimateString(data string) uint64EstimateString estimate the frequency of the data string.
func (c *CountMinSketch) Merge(other *CountMinSketch) errorMerge combines the sketch with another.
func (c *CountMinSketch) Reset()Reset reset the sketch to its original state.
func (c *CountMinSketch) Width() uintWidth returns the matrix width.
Generated by godoc2md