kumulant

LinearCountingResult

@Serializable
@SerialName(value = "LinearCountingResult")
data class LinearCountingResult(val estimate: Double, val bits: Int, val unsetBits: Long, val words: LongArray, val totalSeen: Long, val hasher: HasherRef = HasherRef.SplitMix64) : HasObservationCount(source)

Linear-counting bitset snapshot. estimate = -bits * ln(unsetBits / bits); saturates to Double.POSITIVE_INFINITY when every bit is set. words is the raw bitset for lossless merging.

Constructors

LinearCountingResult

constructor(estimate: Double, bits: Int, unsetBits: Long, words: LongArray, totalSeen: Long, hasher: HasherRef = HasherRef.SplitMix64)(source)

Properties

bits

Total bitset size in bits.

estimate

Estimated cardinality -bits * ln(unsetBits / bits).

hasher

Reference to the com.eignex.kumulant.math.LongHasher that produced this sketch.

The mixer decides which bit a key touches, so combining sketches built with different mixers is meaningless. Carried on the wire so LinearCountingStat.merge can refuse it, matching com.eignex.kumulant.stat.sketch.BloomFilterResult. Defaults to the library default so a payload encoded before the field existed still decodes.

totalSeen

Total observations the sketch has absorbed.

totalWeights

open override val totalWeights: Double(source)

Cumulative weight of observations folded into this result.

unsetBits

Number of bits still cleared; saturates the estimator as it shrinks to zero.

words

Packed bitset (bits / 64 longs); mergeable via word-wise OR.

Link copied to clipboard
open val isEmpty: Boolean

True when no observation has been folded in, so every other field is a placeholder.

Functions

equals

open operator override fun equals(other: Any?): Boolean(source)

hashCode

open override fun hashCode(): Int(source)

toString

open override fun toString(): String(source)