tweak dot
This commit is contained in:
parent
607706ee2a
commit
5cad8637cd
@ -38,7 +38,7 @@ macro_rules! impl_matrix {
|
||||
where
|
||||
T:core::ops::Mul<U,Output=V>+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()
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user