Skip to main content

Module lut

Module lut 

Source
Expand description

General-purpose interpolating lookup table (LUT).

A LutF64 pre-computes a function f: [0,1] → f64 at evenly spaced points and provides O(1) linear interpolation at query time. This is the building block that distribution ICD sampling, arbitrary function approximation, and any precomputed f64→f64 mapping can use.

The LUT is built at assembly time from any Fn(f64) -> f64. At runtime, querying is a single array index + lerp — no branching on distribution type, no function pointer call per sample.

Structs§

DistEmpirical
Sample from an empirical distribution defined by a list of data points. The data points become the LUT entries (sorted); linear interpolation gives continuous sampling. Input should be in [0, 1] (from unit_interval).
LutF64
A pre-computed interpolating lookup table mapping [0, 1] → f64.
LutSample
Polydat node that performs interpolating lookup in a precomputed table.