Defined in: packages/scalar-sketch/src/count-min-sketch.ts:95
A Count-Min sketch specialized for exact unsigned 64-bit bigints.
Extends
Section titled “Extends”CountMinSketchMetadataCountMinSketchOperations<bigint,Uint64CountMinSketch>
Properties
Section titled “Properties”
readonlykind:"count-min-sketch"
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:17
Inherited from
Section titled “Inherited from”
readonlywidth:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:20
Effective power-of-two column count.
Inherited from
Section titled “Inherited from”
readonlydepth:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:22
Effective prefix-stable row count, from 1 through 32.
Inherited from
Section titled “Inherited from”epsilon
Section titled “epsilon”
readonlyepsilon:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:24
Model-based additive error factor e / width.
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.epsilon
confidence
Section titled “confidence”
readonlyconfidence:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:26
Model-based per-query confidence lower bound 1 - exp(-depth).
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.confidence
counterBits
Section titled “counterBits”
readonlycounterBits:32
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:28
Counter width, fixed at 32 bits.
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.counterBits
totalWeight
Section titled “totalWeight”
readonlytotalWeight:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:30
Accepted sum of update weights, capped at 2^32 - 1.
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.totalWeight
stateByteLength
Section titled “stateByteLength”
readonlystateByteLength:number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:32
Bytes occupied by row-major counters, excluding object and hash-instance overhead.
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.stateByteLength
readonlyseed:bigint
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:34
XXH64 base seed that participates in merge compatibility.
Inherited from
Section titled “Inherited from”seedSchedule
Section titled “seedSchedule”
readonlyseedSchedule:SeedScheduleIdentity
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:36
Prefix-stable row-seed schedule that participates in merge compatibility.
Inherited from
Section titled “Inherited from”CountMinSketchMetadata.seedSchedule
update
Section titled “update”update: (
value,weight?) =>void
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:48
Add a non-negative unsigned 32-bit weight. Weight zero is a hash-free no-op.
All destination counters and the accepted total are checked before mutation.
Parameters
Section titled “Parameters”bigint
weight?
Section titled “weight?”number
Returns
Section titled “Returns”void
Throws
Section titled “Throws”From knotkit/hash for an invalid scalar value.
Throws
Section titled “Throws”With INVALID_WEIGHT,
CAPACITY_EXCEEDED, or COUNTER_OVERFLOW.
Inherited from
Section titled “Inherited from”CountMinSketchOperations.update
estimate
Section titled “estimate”estimate: (
value) =>number
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:58
Return the minimum counter selected across all rows. Does not mutate the sketch.
For accepted non-negative streams the result never underestimates the exact
frequency. The epsilon and confidence metadata are the classical model
bounds, assuming the domain-separated seeded XXH64 rows behave independently.
Parameters
Section titled “Parameters”bigint
Returns
Section titled “Returns”number
An improved data stream summary: the Count-Min sketch
Throws
Section titled “Throws”From knotkit/hash for an invalid scalar value.
Inherited from
Section titled “Inherited from”CountMinSketchOperations.estimate
merge: (
other) =>void
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:66
Add every counter and total from a compatible sketch into this sketch.
Self-merge uses the same additive semantics. Every overflow is rejected before mutation.
Parameters
Section titled “Parameters”Uint64CountMinSketch
Returns
Section titled “Returns”void
Throws
Section titled “Throws”With FOREIGN_STRUCTURE,
WRONG_FAMILY, INCOMPATIBLE_SKETCH, CAPACITY_EXCEEDED, or COUNTER_OVERFLOW.
Inherited from
Section titled “Inherited from”CountMinSketchOperations.merge
reduce
Section titled “reduce”reduce: (
targetWidth,targetDepth) =>Uint64CountMinSketch
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:73
Return a new sketch with congruent columns summed and a deterministic row prefix retained.
The target width must divide the current width and both dimensions may only decrease.
Parameters
Section titled “Parameters”targetWidth
Section titled “targetWidth”number
targetDepth
Section titled “targetDepth”number
Returns
Section titled “Returns”Uint64CountMinSketch
Throws
Section titled “Throws”With INVALID_REDUCTION for an unsound target.
Inherited from
Section titled “Inherited from”CountMinSketchOperations.reduce
scalarKind
Section titled “scalarKind”
readonlyscalarKind:"uint64"
Defined in: packages/scalar-sketch/src/count-min-sketch.ts:97