Skip to main content

nrm2_c64_ndarray

Function nrm2_c64_ndarray 

Source
pub fn nrm2_c64_ndarray(x: &Array1<Complex64>) -> f64
Expand description

Computes the Euclidean norm of a Complex64 vector.

||x||_2 = sqrt(Σ |x[i]|²) = sqrt(Σ (x[i].re² + x[i].im²))

This is equivalent to sqrt(x^H · x).

The real and imaginary components are treated as a flat real vector and passed to the numerically stable, scaled (LASSQ-style) nrm2 used by the BLAS Level-1 norm routines, so this never overflows to infinity for vectors whose true norm is representable but whose naive sum of squares would overflow (e.g. entries with magnitude around 1e200).