Expand description
SIMD-accelerated statistical operations
This module provides high-performance statistical computations on raster data using architecture-specific SIMD intrinsics for horizontal reductions and aggregations.
§Architecture Support
- aarch64: NEON (128-bit) for parallel accumulation and comparison
- x86-64: SSE2 (baseline), AVX2 (runtime detected) for wider operations
- Other: Scalar fallback with auto-vectorization hints
§Supported Operations
- Reductions: sum, mean, variance, standard deviation
- Extrema: min, max, argmin, argmax, minmax (single-pass)
- Percentiles: median, quartiles, arbitrary percentiles
- Histograms: Fast histogram computation with SIMD bucketing
§Performance
Expected speedup over scalar: 4-8x for most operations
§Example
use oxigdal_algorithms::simd::statistics::{sum_f32, mean_f32, minmax_f32};
let data = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let sum = sum_f32(&data);
let mean = mean_f32(&data)?;
let (min, max) = minmax_f32(&data)?;
assert_eq!(sum, 15.0);
assert_eq!(mean, 3.0);
assert_eq!(min, 1.0);
assert_eq!(max, 5.0);Functions§
- argmax_
f32 - Find the index of the maximum value
- argmin_
f32 - Find the index of the minimum value
- covariance_
f32 - Compute the covariance between two slices
- histogram_
auto_ f32 - Compute histogram with automatic range detection
- histogram_
f32 - Compute histogram with specified number of bins
- max_f32
- Find the maximum value in the slice using SIMD comparison
- mean_
f32 - Compute the mean (average) of all elements
- mean_
f64 - Compute the mean (average) of all elements (f64 version)
- min_f32
- Find the minimum value in the slice using SIMD comparison
- minmax_
f32 - Find both minimum and maximum values in a single pass using SIMD
- std_
dev_ f32 - Compute standard deviation using SIMD-accelerated variance
- sum_f32
- Compute the sum of all elements using SIMD horizontal reduction
- sum_f64
- Compute the sum of all elements using SIMD (f64 version)
- variance_
f32 - Compute variance using two-pass algorithm with SIMD acceleration
- welford_
variance_ f32 - Compute Welford’s online variance (single-pass, numerically stable)