Skip to main content

compute_norm_squared_scalar

Function compute_norm_squared_scalar 

Source
pub fn compute_norm_squared_scalar(v: &[f32]) -> f32
Expand description

Scalar fallback implementation of squared norm computation

Returns the sum of squares (L2 norm squared). The caller should take the square root if the actual norm is needed.

§Arguments

  • v - Vector slice

§Returns

Sum of squares (norm squared)

§Performance

  • Time Complexity: O(n) where n is vector dimension
  • Memory Usage: O(1) additional space