rolling_max_int

Function rolling_max_int 

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

Computes rolling maximum values over integer data within sliding windows.

Identifies maximum values across sliding windows using efficient comparison operations. Each output position represents the largest value found within the preceding window, crucial for peak detection and trend analysis in integer data sequences.

§Parameters

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

§Returns

Returns an IntegerArray<T> containing:

  • Rolling maximum values for each complete window position
  • Zero values for positions with incomplete windows
  • Comprehensive null mask for validity tracking

§Applications

  • Peak detection: Identifying maximum peaks in time series data
  • Trend analysis: Tracking maximum value trends over sliding intervals
  • Threshold monitoring: Detecting when maximum values exceed thresholds
  • Signal analysis: Finding maximum signal amplitudes in windows

§Examples

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

let arr = IntegerArray::<i32>::from_slice(&[3, 7, 2, 9, 4]);
let result = rolling_max_int((&arr, 0, arr.len()), 3);
// Output: [0, 0, 7, 9, 9] - maximum values in each 3-element window