diff --git a/fixed_wide_vectors/src/macros/wide.rs b/fixed_wide_vectors/src/macros/wide.rs index d6a9eec..e35d51b 100644 --- a/fixed_wide_vectors/src/macros/wide.rs +++ b/fixed_wide_vectors/src/macros/wide.rs @@ -31,6 +31,43 @@ macro_rules! impl_wide_vector_operations { }; } +/* +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! impl_wide_matrix_operations { + ( + ($struct_outer: ident { $($field_outer: ident), + }, $size_outer: expr), + ($struct_inner: ident, $size_inner: expr), $fields_inner:tt + ) => { + impl> fixed_wide_traits::wide::WideMul for $struct { + type Output=$struct; + #[inline] + fn wide_mul(self, rhs: Self) -> Self::Output { + $struct{ + $( $field: self.$field.wide_mul(rhs.$field) ), + + } + } + } + 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_length_squared(&self) -> U { + $crate::sum_repeating!( + $( + self.$field.wide_mul(self.$field) ) + + ) + } + } + }; +} +*/ // HACK: Allows us to sum repeating tokens in macros. // See: https://stackoverflow.com/a/60187870/17452730