Documentation ¶
Index ¶
- Constants
- func MakeHashes(depth uint32) []uint64
- func MakeTable(dx, dy uint32) [][]uint32
- func MultiplyShift(m uint, a uint64, x uint64) uint64
- func RandomOddInt() uint64
- func SerializeUint64(n uint64) []byte
- type GroupSketch
- type Interface
- type Item
- type Items
- type MultiSketch
- type Sketch
- func (self *Sketch) DHash(key string, hf uint64) uint64
- func (self *Sketch) Estimate(key string) uint32
- func (self *Sketch) Hash(key string) uint64
- func (s *Sketch) StartAutoRotation()
- func (s *Sketch) StopAutoRotation()
- func (sk *Sketch) Top(n int) []Item
- func (self *Sketch) Update(key string)
- func (self *Sketch) UpdateHeap(key string, est uint32)
- type SketchWithChildren
Constants ¶
View Source
const IntMask = (1 << IntSize) - 1
View Source
const IntSize = 64
Variables ¶
This section is empty.
Functions ¶
func MakeHashes ¶
func RandomOddInt ¶
func RandomOddInt() uint64
func SerializeUint64 ¶
Types ¶
type GroupSketch ¶
type GroupSketch struct { SketchWithChildren Default string Parent Interface }
func MakeGroupSketch ¶
func MakeGroupSketch(def string, sketches map[string]Interface) *GroupSketch
func (*GroupSketch) Top ¶
func (gs *GroupSketch) Top(n int) []Item
func (*GroupSketch) Update ¶
func (ms *GroupSketch) Update(term string)
type MultiSketch ¶
type MultiSketch struct { Len int Period int Sketches []*Sketch K int Depth uint32 Width uint32 // contains filtered or unexported fields }
func MakeMultiSketch ¶
func (*MultiSketch) Rotate ¶
func (ms *MultiSketch) Rotate()
func (*MultiSketch) StartAutoRotation ¶
func (ms *MultiSketch) StartAutoRotation()
func (*MultiSketch) StopAutoRotation ¶
func (ms *MultiSketch) StopAutoRotation()
func (*MultiSketch) Top ¶
func (ms *MultiSketch) Top(n int) []Item
func (*MultiSketch) Update ¶
func (ms *MultiSketch) Update(term string)
type Sketch ¶
type Sketch struct { K int LgWidth uint Count [][]uint32 HashFunctions []uint64 Depth uint32 Heap *pqueue.Queue Map map[string]Item // contains filtered or unexported fields }
func (*Sketch) StartAutoRotation ¶
func (s *Sketch) StartAutoRotation()
func (*Sketch) StopAutoRotation ¶
func (s *Sketch) StopAutoRotation()
func (*Sketch) UpdateHeap ¶
type SketchWithChildren ¶
func (*SketchWithChildren) StartAutoRotation ¶
func (s *SketchWithChildren) StartAutoRotation()
func (*SketchWithChildren) StopAutoRotation ¶
func (s *SketchWithChildren) StopAutoRotation()
Click to show internal directories.
Click to hide internal directories.