pub fn norm_simd<F>(a: &ArrayView1<'_, F>) -> Fwhere
F: Float + SimdUnifiedOps,Expand description
SIMD-accelerated L2 norm (Euclidean norm)
Computes ||x||₂ = sqrt(sum(x²))
§Arguments
a- Input array
§Returns
L2 (Euclidean) norm
§Examples
use scirs2_core::ndarray::array;
use scirs2_core::ndarray_ext::elementwise::norm_simd;
let x = array![3.0_f64, 4.0];
let n = norm_simd::<f64>(&x.view());
// sqrt(9 + 16) = 5
assert!((n - 5.0).abs() < 1e-14);§Use Cases
- Vector magnitude
- Normalization preprocessing
- Regularization penalty
- Gradient clipping