pub fn dot<T: Num + Copy + Sum>(slice1: &[T], slice2: &[T]) -> T
calculate the dot product of two slices