diff --git a/fixed_wide_vectors/src/macros/wide.rs b/fixed_wide_vectors/src/macros/wide.rs index c2c9c59..ea5f6c3 100644 --- a/fixed_wide_vectors/src/macros/wide.rs +++ b/fixed_wide_vectors/src/macros/wide.rs @@ -11,13 +11,17 @@ macro_rules! impl_wide_operations { } } } + impl,U,T:fixed_wide_traits::wide::WideMul> fixed_wide_traits::wide::WideDot<$struct> for $struct { + type Output=V; + #[inline] + fn wide_dot(self, rhs: $struct) -> Self::Output { + $crate::sum_repeating!( + $( + (self.$field.wide_mul(rhs.$field)) ) + + ) + } + } impl,T:Copy+fixed_wide_traits::wide::WideMul> $struct { #[inline] - pub fn wide_dot(self, other: Self) -> U { - $crate::sum_repeating!( - $( + (self.$field.wide_mul(other.$field)) ) + - ) - } pub fn wide_length_squared(&self) -> U { let squared = $struct { $( $field: self.$field.wide_mul(self.$field) ), + diff --git a/fixed_wide_vectors/src/tests/mod.rs b/fixed_wide_vectors/src/tests/mod.rs index 426d018..7a5deb2 100644 --- a/fixed_wide_vectors/src/tests/mod.rs +++ b/fixed_wide_vectors/src/tests/mod.rs @@ -1,4 +1,5 @@ use fixed_wide_traits::wide::WideMul; +use fixed_wide_traits::wide::WideDot; use crate::Vector3;