IndexMapping
Defined in: packages/distillate/src/ddsketch/mapping.ts:13
Maps a positive value to the integer index of the bin holding it, and an
index back to a value within relativeAccuracy of everything in that bin.
Built by this module’s factories only: a sketch serializes its mapping by
kind, so a custom implementation would be written, and read back, as the
built-in one of that kind.
Properties
Section titled “Properties”
readonlygamma:number
Defined in: packages/distillate/src/ddsketch/mapping.ts:17
The base the bins grow by.
indexOffset
Section titled “indexOffset”
readonlyindexOffset:number
Defined in: packages/distillate/src/ddsketch/mapping.ts:19
Shift added to every index, carried so foreign sketches decode exactly.
readonlykind:MappingKind
Defined in: packages/distillate/src/ddsketch/mapping.ts:15
Which approximation of the logarithm the mapping uses.
maxIndexableValue
Section titled “maxIndexableValue”
readonlymaxIndexableValue:number
Defined in: packages/distillate/src/ddsketch/mapping.ts:25
The largest value with a bin.
minIndexableValue
Section titled “minIndexableValue”
readonlyminIndexableValue:number
Defined in: packages/distillate/src/ddsketch/mapping.ts:23
The smallest value with a bin; anything smaller counts as zero.
relativeAccuracy
Section titled “relativeAccuracy”
readonlyrelativeAccuracy:number
Defined in: packages/distillate/src/ddsketch/mapping.ts:21
The relative error any value read back from a bin is within.
Methods
Section titled “Methods”index()
Section titled “index()”index(
value):number
Defined in: packages/distillate/src/ddsketch/mapping.ts:27
The bin index of a value in the indexable range.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number
lowerBound()
Section titled “lowerBound()”lowerBound(
index):number
Defined in: packages/distillate/src/ddsketch/mapping.ts:31
The smallest value that falls in a bin.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number
value()
Section titled “value()”value(
index):number
Defined in: packages/distillate/src/ddsketch/mapping.ts:29
The value a bin reads back as.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number