2024-09-05 13:36:38 -07:00
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export(local_inner_macros)]
|
|
|
|
macro_rules! impl_matrix {
|
|
|
|
() => {
|
|
|
|
//$crate::impl_common!();
|
|
|
|
}
|
|
|
|
}
|
2024-08-30 12:06:33 -07:00
|
|
|
|
2024-09-05 13:36:38 -07:00
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export(local_inner_macros)]
|
|
|
|
macro_rules! impl_matrix_named_fields_shape {
|
|
|
|
(
|
|
|
|
($struct_outer:ident, $size_outer: expr),
|
|
|
|
($struct_inner:ident, $size_inner: expr)
|
|
|
|
) => {
|
|
|
|
impl<T> core::ops::Deref for Matrix<$size_outer,$size_inner,T>{
|
|
|
|
type Target=$struct_outer<$struct_inner<T>>;
|
|
|
|
fn deref(&self)->&Self::Target{
|
|
|
|
unsafe{core::mem::transmute(&self.array)}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<T> core::ops::DerefMut for Matrix<$size_outer,$size_inner,T>{
|
|
|
|
fn deref_mut(&mut self)->&mut Self::Target{
|
|
|
|
unsafe{core::mem::transmute(&mut self.array)}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export(local_inner_macros)]
|
|
|
|
macro_rules! impl_matrix_named_fields_shape_shim {
|
|
|
|
(
|
|
|
|
($($vector_info:tt),+),
|
|
|
|
$matrix_info:tt
|
|
|
|
) => {
|
|
|
|
$crate::macro_repeated!(impl_matrix_named_fields_shape,$matrix_info,$($vector_info),+);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export(local_inner_macros)]
|
|
|
|
macro_rules! impl_matrix_named_fields {
|
|
|
|
(
|
|
|
|
($($matrix_info:tt),+),
|
|
|
|
$vector_infos:tt
|
|
|
|
) => {
|
|
|
|
$crate::macro_repeated!(impl_matrix_named_fields_shape_shim,$vector_infos,$($matrix_info),+);
|
|
|
|
}
|
|
|
|
}
|