1 2 3 4 5 6 7
pub fn dot_product(a: Vec<f64>, b: Vec<f64>) -> f64 { let mut sum = 0.0; for i in 0..a.len() { sum += a[i] * b[i]; } sum }