Status: Unstable
Warning: Useful and tested, but currently documented as Unstable until broader API alignment work completes.
Reservoir-like uniform sampler with merge support.
UniformSampling
fn new(sample_rate: f64) -> Self
fn with_seed(sample_rate: f64, seed: u64) -> Selffn update(&mut self, value: f64)
fn update_input(&mut self, value: &DataInput) -> Result<(), &'static str>fn sample_rate(&self) -> f64
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn total_seen(&self) -> u64
fn samples(&self) -> Vec<f64>
fn sample_at(&self, idx: usize) -> Option<f64>fn merge(&mut self, other: &UniformSampling) -> Result<(), &'static str>Derives serde; no dedicated byte API helpers.
use asap_sketchlib::UniformSampling;
let mut sk = UniformSampling::new(0.2);
sk.update(1.0);
let _ = sk.samples();- Supports numeric inputs only in
update_input. - Merge requires matching sampling rates.
Unstable.