rolling_product_int

Function rolling_product_int 

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

Computes rolling products over a sliding window for integer data with overflow protection.

Applies multiplicative aggregation across sliding windows using incremental computation through division operations. Maintains numerical stability through careful handling of zero values and potential overflow conditions in integer arithmetic.

§Parameters

  • window - Integer array view containing multiplicands and window specification
  • subwindow - Number of consecutive elements to multiply in each window

§Returns

Returns an IntegerArray<T> containing:

  • Rolling products computed via incremental multiplication/division
  • Identity value (1) for positions with incomplete windows
  • Null mask reflecting window completeness and null contamination

§Examples

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

let arr = IntegerArray::<i32>::from_slice(&[2, 3, 4, 5]);
let result = rolling_product_int((&arr, 0, arr.len()), 2);