diff --git a/fixed_wide_vectors/src/macros/matrix.rs b/fixed_wide_vectors/src/macros/matrix.rs index 0c1c371..cde4330 100644 --- a/fixed_wide_vectors/src/macros/matrix.rs +++ b/fixed_wide_vectors/src/macros/matrix.rs @@ -38,7 +38,7 @@ macro_rules! impl_matrix { where T:core::ops::Mul+Copy, V:core::iter::Sum, - U:Clone, + U:Copy, { let mut array_of_iterators=rhs.array.map(|axis|axis.into_iter().cycle()); Matrix{ @@ -46,11 +46,9 @@ macro_rules! impl_matrix { core::array::from_fn(|_| // axis dot product with transposed rhs array axis.iter().zip( - array_of_iterators.each_mut().map(|iter| - iter.next().unwrap() - ) - ).map(|(&a,b)| - a*b + array_of_iterators.iter_mut() + ).map(|(&lhs_value,rhs_iter)| + lhs_value*rhs_iter.next().unwrap() ).sum() ) )