From 56b781fcb87ee8401b34dc18dd0a04de5b86fd86 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 5 Sep 2024 13:52:54 -0700 Subject: [PATCH] we build --- fixed_wide_vectors/src/macros/matrix.rs | 6 +++++- fixed_wide_vectors/src/macros/vector.rs | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/fixed_wide_vectors/src/macros/matrix.rs b/fixed_wide_vectors/src/macros/matrix.rs index 518315b..71ec8e7 100644 --- a/fixed_wide_vectors/src/macros/matrix.rs +++ b/fixed_wide_vectors/src/macros/matrix.rs @@ -2,7 +2,11 @@ #[macro_export(local_inner_macros)] macro_rules! impl_matrix { () => { - //$crate::impl_common!(); + impl Matrix{ + pub const fn new(array:[[T;Y];X])->Self{ + Self{array} + } + } } } diff --git a/fixed_wide_vectors/src/macros/vector.rs b/fixed_wide_vectors/src/macros/vector.rs index fc28750..8a0fe4e 100644 --- a/fixed_wide_vectors/src/macros/vector.rs +++ b/fixed_wide_vectors/src/macros/vector.rs @@ -2,7 +2,18 @@ #[macro_export(local_inner_macros)] macro_rules! impl_vector { () => { - //$crate::impl_common!(); + impl Vector{ + pub const fn new(array:[T;N])->Self{ + Self{array} + } + } + impl Vector{ + pub const fn from_value(value:T)->Self{ + Self{ + array:[value;N] + } + } + } } }