rolling_min_int

Function rolling_min_int 

Source
pub fn rolling_min_int<T: Ord + Copy + Zero>(
    window: IntegerAVT<'_, T>,
    subwindow: usize,
) -> IntegerArray<T>
Expand description

For min, we skip that very first window slot so that the first non-zero result appears one step later. Computes rolling minimum values over integer data within sliding windows.

Identifies minimum values across sliding windows using efficient comparison strategies. Each output position represents the smallest value found within the preceding window, essential for trend analysis and outlier detection in integer sequences.

§Parameters

  • window - Integer array view containing values for minimum detection
  • subwindow - Window size determining scope of minimum search

§Returns

Returns an IntegerArray<T> containing:

  • Rolling minimum values for each complete window position
  • Zero values for positions with incomplete windows
  • Null mask indicating window completeness and validity

§Use Cases

  • Trend analysis: Identifying minimum trends in time series data
  • Outlier detection: Finding exceptionally low values within windows
  • Signal processing: Detecting minimum signal levels over time intervals
  • Statistical analysis: Computing rolling minimum statistics

§Examples

use minarrow::IntegerArray;
use simd_kernels::kernels::window::rolling_min_int;

let arr = IntegerArray::<i32>::from_slice(&[5, 2, 8, 1, 9]);
let result = rolling_min_int((&arr, 0, arr.len()), 3);
// Output: [0, 0, 2, 1, 1] - minimum values in each 3-element window