rolling_mean_float

Function rolling_mean_float 

Source
pub fn rolling_mean_float<T: Float + Copy + Zero>(
    window: FloatAVT<'_, T>,
    subwindow: usize,
) -> FloatArray<T>
Expand description

Computes rolling arithmetic means over floating-point data with IEEE 754 compliance.

Performs moving average calculations across sliding windows while maintaining the original floating-point precision. Implements numerically stable summation strategies and proper handling of special floating-point values (NaN, infinity).

§Parameters

  • window - Float array view containing values for mean calculation
  • subwindow - Window size specifying number of values to average

§Returns

Returns a FloatArray<T> containing:

  • Rolling arithmetic means preserving input precision (f32 or f64)
  • Zero values for positions with incomplete windows
  • Comprehensive null mask for validity indication

§Examples

use minarrow::FloatArray;
use simd_kernels::kernels::window::rolling_mean_float;

let arr = FloatArray::<f32>::from_slice(&[1.5, 2.5, 3.5, 4.5]);
let result = rolling_mean_float((&arr, 0, arr.len()), 2);