Module aggregate

Module aggregate 

Source
Expand description

§Aggregation Kernels Module - High-Performance Statistical Reduction Operations

Null-aware aggregation kernels implementing statistical reductions with SIMD acceleration. Core building blocks for analytical workloads requiring high-throughput data summarisation.

§Core Operations

  • Sum aggregation: Optimised summation with overflow handling and numerical stability
  • Min/Max operations: Efficient extrema detection with proper null handling
  • Count operations: Fast counting with distinct value detection capabilities
  • Statistical moments: Mean, variance, and standard deviation calculations
  • Percentile calculations: Quantile computation with interpolation support
  • String aggregation: Concatenation and string-based reduction operations

Structs§

PairStats
Statistical summary for paired data analysis.

Constants§

W8
Auto-generated SIMD lane widths from build.rs SIMD lane count for 8-bit elements (u8, i8). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W16
SIMD lane count for 16-bit elements (u16, i16). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W32
SIMD lane count for 32-bit elements (u32, i32, f32). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W64
SIMD lane count for 64-bit elements (u64, i64, f64). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.

Functions§

agg_product
Returns the accumulating product of all values
average_f32
Returns the average of f32 values, or None if all-null.
average_f64
Returns the average of f64 values, or None if all-null.
average_i32
Returns the average of i32 values, or None if all-null.
average_i64
Returns the average of i64 values, or None if all-null.
average_u32
Returns the average of u32 values, or None if all-null.
average_u64
Returns the average of u64 values, or None if all-null.
count_distinct
Counts distinct values in an ordinal slice, with optional nulls.
count_distinct_f
Counts distinct values in a float slice using bitwise equality.
count_generic_raw
Returns the number of valid (non-null) elements.
geometric_mean_f
Computes geometric mean for float types.
geometric_mean_int
Computes geometric mean for integer types.
geometric_mean_uint
Computes geometric mean for unsigned integer types.
harmonic_mean_f
Computes harmonic mean for float types.
harmonic_mean_int
Computes harmonic mean for integer types.
harmonic_mean_uint
Computes harmonic mean for unsigned integers.
iqr
Computes interquartile range for ordinal types.
iqr_f
Computes interquartile range for float types.
kurtosis_f32
Calculates the kurtosis of a floating-point dataset.
kurtosis_f64
Calculates the kurtosis of a floating-point dataset.
kurtosis_i32
Calculates the kurtosis of an integer dataset.
kurtosis_i64
Calculates the kurtosis of an integer dataset.
kurtosis_u32
Calculates the kurtosis of an integer dataset.
kurtosis_u64
Calculates the kurtosis of an integer dataset.
max_f32
Returns the maximum of a f32 slice.
max_f64
Returns the maximum of a f64 slice.
max_i32
Returns the maximum of a i32 slice.
max_i64
Returns the maximum of a i64 slice.
max_u32
Returns the maximum of a u32 slice.
max_u64
Returns the maximum of a u64 slice.
median
Computes median of a sorted/unsorted slice with optional nulls.
median_f
Computes median for float types, with optional nulls and sorting.
min_f32
Returns the minimum of a f32 slice.
min_f64
Returns the minimum of a f64 slice.
min_i32
Returns the minimum of a i32 slice.
min_i64
Returns the minimum of a i64 slice.
min_u32
Returns the minimum of a u32 slice.
min_u64
Returns the minimum of a u64 slice.
mode
Computes mode (most frequent value) for ordinal types.
mode_f
Computes mode for float types via bit-level equivalence.
pair_stats_f32
Returns PairStats (n, sum_x, sum_y, sum_xy, sum_x2, sum_y2) for floating point types.
pair_stats_f64
Returns PairStats (n, sum_x, sum_y, sum_xy, sum_x2, sum_y2) for floating point types.
percentile_f
Computes percentile for float types, optionally sorted.
percentile_ord
Computes percentile for ordinal types, optionally sorted.
quantile
Computes q quantiles for ordinal types, optionally sorted.
quantile_f
Computes q quantiles for float types, optionally sorted.
range_f32
Returns the (min, max) of a f32 slice.
range_f64
Returns the (min, max) of a f64 slice.
range_i32
Returns the (min, max) of a i32 slice.
range_i64
Returns the (min, max) of a i64 slice.
range_u32
Returns the (min, max) of a u32 slice.
range_u64
Returns the (min, max) of a u64 slice.
reduce_min_max_f32
Finds the minimum and maximum values in a floating-point slice.
reduce_min_max_f64
Finds the minimum and maximum values in a floating-point slice.
reduce_min_max_i32
Finds the minimum and maximum values in a numeric slice.
reduce_min_max_i64
Finds the minimum and maximum values in a numeric slice.
reduce_min_max_u32
Finds the minimum and maximum values in a numeric slice.
reduce_min_max_u64
Finds the minimum and maximum values in a numeric slice.
skewness_f32
Calculates the skewness of a floating-point dataset.
skewness_f64
Calculates the skewness of a floating-point dataset.
skewness_i32
Calculates the skewness of an integer dataset.
skewness_i64
Calculates the skewness of an integer dataset.
skewness_u32
Calculates the skewness of an integer dataset.
skewness_u64
Calculates the skewness of an integer dataset.
stat_moments4_f32
SIMD-accelerated (∑x … ∑x⁴) for f32. Returns (s1,s2,s3,s4,n) as (f64,f64,f64,f64,usize).
stat_moments4_f64
SIMD-accelerated (∑x … ∑x⁴) for f64. Returns (s1,s2,s3,s4,n) as (f64,f64,f64,f64,usize).
stat_moments4_i32
SIMD-accelerated (∑x … ∑x⁴) for i32 (promoted to f64). Accumulator type for scalar paths: i128.
stat_moments4_i64
SIMD-accelerated (∑x … ∑x⁴) for i64 (promoted to f64). Accumulator type for scalar paths: i128.
stat_moments4_u32
SIMD-accelerated (∑x … ∑x⁴) for u32 (promoted to f64). Accumulator type for scalar paths: u128.
stat_moments4_u64
SIMD-accelerated (∑x … ∑x⁴) for u64 (promoted to f64). Accumulator type for scalar paths: u128.
stat_moments_f32
Computes sum, sum-of-squares, and count for a f32 slice. Skips nulls if present. Uses SIMD if available.
stat_moments_f64
Computes sum, sum-of-squares, and count for a f64 slice. Skips nulls if present. Uses SIMD if available.
stat_moments_i32
Computes sum, sum-of-squares, and count for i32 integers. Uses i64 for accumulation. Skips nulls if present.
stat_moments_i64
Computes sum, sum-of-squares, and count for i64 integers. Uses i64 for accumulation. Skips nulls if present.
stat_moments_u32
Computes sum, sum-of-squares, and count for u32 integers. Uses u64 for accumulation. Skips nulls if present.
stat_moments_u64
Computes sum, sum-of-squares, and count for u64 integers. Uses u64 for accumulation. Skips nulls if present.
sum2_f32_raw
Computes sum-of-squares for f32 (Σx²). Skips nulls if present. SIMD‐enabled.
sum2_f64_raw
Computes sum-of-squares for f64 (Σx²). Skips nulls if present. SIMD‐enabled.
sum_cubes
Computes the sum of cubes (Σx³). Kernel: SumP3 (L1-3)
sum_f32
Returns the sum of f32 values, or None if all-null.
sum_f64
Returns the sum of f64 values, or None if all-null.
sum_f32_raw
Returns (sum, count) for non-null f32 values. Uses SIMD where available.
sum_f64_raw
Returns (sum, count) for non-null f64 values. Uses SIMD where available.
sum_i32
Returns the sum of i32 values, or None if all-null.
sum_i64
Returns the sum of i64 values, or None if all-null.
sum_i32_raw
Returns (sum, count) for non-null i32 values. Accumulates using i64. Uses SIMD if available.
sum_i64_raw
Returns (sum, count) for non-null i64 values. Accumulates using i64. Uses SIMD if available.
sum_quartics
Computes the sum of fourth powers (Σx⁴). Kernel: SumP4 (L1-4)
sum_squares
Computes the sum of squares (Σx²). Kernel: SumP2 (L1-2)
sum_u32
Returns the sum of u32 values, or None if all-null.
sum_u64
Returns the sum of u64 values, or None if all-null.
sum_u32_raw
Returns (sum, count) for non-null u32 values. Accumulates using u64. Uses SIMD if available.
sum_u64_raw
Returns (sum, count) for non-null u64 values. Accumulates using u64. Uses SIMD if available.
variance_f32
Returns the variance for f32; if sample is true, uses Bessel’s correction (n-1).
variance_f64
Returns the variance for f64; if sample is true, uses Bessel’s correction (n-1).
variance_i32
Returns the variance for i32; if sample is true, uses Bessel’s correction (n-1).
variance_i64
Returns the variance for i64; if sample is true, uses Bessel’s correction (n-1).
variance_u32
Returns the variance for u32; if sample is true, uses Bessel’s correction (n-1).
variance_u64
Returns the variance for u64; if sample is true, uses Bessel’s correction (n-1).
weighted_sum2_f32
Returns (∑w·x, ∑w, ∑w·x², rows) for f32 slices vals, wts with optional null mask.
weighted_sum2_f64
Returns (∑w·x, ∑w, ∑w·x², rows) for f64 slices vals, wts with optional null mask.