pub fn normalize_vector(vector: &mut [f32])Expand description
Normalizes a vector to unit length (L2 normalization).
This scales the vector so that its magnitude (Euclidean norm) is 1.0. Normalized vectors are useful for efficient similarity comparisons.
§Arguments
vector- The vector to normalize (will be modified in place)
§Example
use ceylon_next::memory::vector::normalize_vector;
let mut v = vec![3.0, 4.0];
normalize_vector(&mut v);
assert!((v[0] - 0.6).abs() < 0.001);
assert!((v[1] - 0.8).abs() < 0.001);