pub fn argmin_simd<F>(x: &ArrayView1<'_, F>) -> Option<usize>where
F: Float + SimdUnifiedOps,Expand description
Find the index of the minimum element in a 1D array with SIMD acceleration.
This function uses SIMD operations when beneficial for performance, providing significant speedups for large arrays on supported platforms (AVX2, NEON).
§Arguments
x- Input 1D array
§Returns
Some(index)- Index of the minimum elementNone- If the array is empty
§Performance
- f32: ~2-3x faster than scalar for arrays > 1000 elements
- f64: ~2-3x faster than scalar for arrays > 1000 elements
- Automatically selects SIMD or scalar based on array size and platform capabilities
§Examples
use scirs2_core::ndarray::array;
use scirs2_core::ndarray_ext::reduction::argmin_simd;
let x = array![3.0f32, 1.0, 4.0, 1.0, 5.0, 9.0, 2.0];
let idx = argmin_simd(&x.view()).expect("Operation failed");
assert_eq!(idx, 1); // First occurrence of minimum value (1.0)