Skip to content

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.

readonly gamma: number

Defined in: packages/distillate/src/ddsketch/mapping.ts:17

The base the bins grow by.


readonly indexOffset: number

Defined in: packages/distillate/src/ddsketch/mapping.ts:19

Shift added to every index, carried so foreign sketches decode exactly.


readonly kind: MappingKind

Defined in: packages/distillate/src/ddsketch/mapping.ts:15

Which approximation of the logarithm the mapping uses.


readonly maxIndexableValue: number

Defined in: packages/distillate/src/ddsketch/mapping.ts:25

The largest value with a bin.


readonly minIndexableValue: number

Defined in: packages/distillate/src/ddsketch/mapping.ts:23

The smallest value with a bin; anything smaller counts as zero.


readonly relativeAccuracy: number

Defined in: packages/distillate/src/ddsketch/mapping.ts:21

The relative error any value read back from a bin is within.

index(value): number

Defined in: packages/distillate/src/ddsketch/mapping.ts:27

The bin index of a value in the indexable range.

number

number


lowerBound(index): number

Defined in: packages/distillate/src/ddsketch/mapping.ts:31

The smallest value that falls in a bin.

number

number


value(index): number

Defined in: packages/distillate/src/ddsketch/mapping.ts:29

The value a bin reads back as.

number

number