Skip to main content

Module agg_kernels

Module agg_kernels 

Source
Expand description

Specialized aggregate kernels for grouped operations.

These functions operate on gathered data slices with segment boundaries, or on arbitrary row-index groups. All f64 reductions use Kahan summation for deterministic, numerically stable results.

Functions§

agg_count
Count per segment.
agg_first_f64
First f64 per segment.
agg_last_f64
Last f64 per segment.
agg_max_f64
Maximum f64 per segment. Returns NAN for empty segments.
agg_max_i64
Maximum i64 per segment.
agg_mean_f64
Kahan-stable mean over contiguous segments.
agg_median_f64
Median via sort per segment. Returns NAN for empty segments.
agg_min_f64
Minimum f64 per segment. Returns NAN for empty segments.
agg_min_i64
Minimum i64 per segment.
agg_n_distinct_i64
Count distinct i64 values per segment using BTreeSet (deterministic).
agg_n_distinct_str
Count distinct strings per segment using BTreeSet (deterministic).
agg_quantile_f64
Quantile via sort + linear interpolation. Returns NAN for empty segments.
agg_sd_f64
Standard deviation via Welford’s algorithm.
agg_sum_f64
Kahan-stable sum over contiguous segments.
agg_sum_i64
Sum for i64 (wrapping on overflow).
agg_var_f64
Variance via Welford’s online algorithm (numerically stable). Returns population variance (divide by N, not N-1).
gather_agg_mean_f64
Kahan-stable mean over gathered f64 rows.
gather_agg_n_distinct_str
Count distinct strings over gathered rows.
gather_agg_sum_f64
Kahan-stable sum over gathered f64 rows.
gather_agg_var_f64
Welford variance over gathered f64 rows.