Function norm_l2_sq

Source
pub fn norm_l2_sq(a: &[f32]) -> f32
Expand description

Computes the squared L2 norm of a vector a.

§Arguments

  • a - The vector.

§Returns

The squared L2 norm of a.

§Examples

let a = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
let norm_sq = intspan::norm_l2_sq(&a);
assert_eq!(norm_sq, 385.0);