diff --git a/fixed_wide_vectors/src/macros/fixed_wide.rs b/fixed_wide_vectors/src/macros/fixed_wide.rs index ca03e6c..feaa800 100644 --- a/fixed_wide_vectors/src/macros/fixed_wide.rs +++ b/fixed_wide_vectors/src/macros/fixed_wide.rs @@ -104,26 +104,48 @@ macro_rules! impl_wide_matrix_mul { $struct_inner:fixed_wide_traits::wide::WideDot<$rhs_struct_inner>, { type Output=$struct_outer<<$struct_inner as fixed_wide_traits::wide::WideDot<$rhs_struct_inner>::Output>; + paste::item!{ #[inline] - fn wide_dot(self,rhs:$matrix_inner<$rhs_struct_inner>)->Self::Output{ + fn [](self,rhs:$matrix_inner<$rhs_struct_inner>)->Self::Output{ //just made this up, don't trust it let tr=rhs.transpose(); //TODO: use a macro expansion instead of transpose and map self.map(|axis| tr.map(|trax| - axis.wide_dot(trax) + axis.[](trax) ).to_vector() ) } + } } } } #[doc(hidden)] #[macro_export(local_inner_macros)] -macro_rules! impl_wide_matrix_operations { +macro_rules! impl_wide_matrix_operations_2arg_not_const_generic { ( + $lhs: expr, $rhs: expr, ($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident { $($vector_field_outer: ident), + }, $size_outer: expr), ($struct_inner: ident { $($field_inner: ident), + }, $matrix_inner: ident { $($matrix_field_inner: ident), + }, $size_inner: expr) + ) => { + /* TODO: nasty determinant macro + impl,T:Copy+fixed_wide_traits::wide::WideMul> $struct { + #[inline] + pub fn wide_dot(&self) -> U { + $crate::sum_repeating!( + $( + self.$field.wide_mul(self.$field) ) + + ) + } + } + */ + }; +} +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! impl_wide_matrix_operations_1arg_not_const_generic { + ( + $n: expr, + ($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident { $($vector_field_outer: ident), + }, $size_outer: expr), ) => { /* TODO: nasty determinant macro impl,T:Copy+fixed_wide_traits::wide::WideMul> $struct {