Skip to main content

vector_norm

Function vector_norm 

Source
pub fn vector_norm(
    n: i32,
    x: &[f64],
    incx: i32,
    null_mask: Option<&Bitmask>,
    null_count: Option<usize>,
) -> Result<f64, KernelError>
Expand description

Computes the Euclidean (ℓ₂) norm of a vector: ‖x‖₂ = sqrt(Σ xᵢ²)

Returns the magnitude (Euclidean norm) of the vector x. For an input vector x, computes sqrt(sum(x_i^2)).