Expand description
Zhang Wang Fast Approximate Quantiles Algorithm in Rust
§Installation
Add this to your Cargo.toml
:
[dependencies]
zw-fast-quantile = "0.1"
§Example
use zw_fast_quantile::FixedSizeEpsilonSummary;
let epsilon = 0.1;
let n = 10;
let mut s = FixedSizeEpsilonSummary::new(n, epsilon);
for i in 1..=n {
s.update(i);
}
let ans = s.query(0.0);
let expected = 1;
assert!(expected == ans);
//! ```rust use zw_fast_quantile::UnboundEpsilonSummary;
let epsilon = 0.1; let n = 10; let mut s = UnboundEpsilonSummary::new(epsilon); for i in 1..=n { s.update(i); }
let ans = s.query(0.0); let expected = 1; assert!(expected == ans);