(a: &[f32], b: &[f32])
| 351 | } |
| 352 | |
| 353 | fn dot_product(a: &[f32], b: &[f32]) -> f32 { |
| 354 | a.iter().zip(b.iter()).map(|(&x, &y)| x * y).sum() |
| 355 | } |
| 356 | |
| 357 | fn magnitude(vec: &[f32]) -> f32 { |
| 358 | vec.iter().map(|&x| x * x).sum::<f32>().sqrt() |
no test coverage detected