From 047451d247dd8d2615326064e17bbc050402cddf Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 27 Aug 2024 14:23:20 -0700 Subject: [PATCH] affine --- fixed_wide_vectors/src/affine.rs | 17 +++++++++++++++++ fixed_wide_vectors/src/lib.rs | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 fixed_wide_vectors/src/affine.rs diff --git a/fixed_wide_vectors/src/affine.rs b/fixed_wide_vectors/src/affine.rs new file mode 100644 index 0000000..74ba207 --- /dev/null +++ b/fixed_wide_vectors/src/affine.rs @@ -0,0 +1,17 @@ +use std::ops::Add; +use fixed_wide_traits::wide::WideDot; + +pub struct Affine{ + pub matrix:M, + pub offset:T, +} + +impl Affine{ + pub fn wide_transform(&self,input:X)-><>::Output as Add>::Output + where + M:WideDot, + >::Output:Add, + { + self.matrix.wide_dot(input)+self.offset + } +} diff --git a/fixed_wide_vectors/src/lib.rs b/fixed_wide_vectors/src/lib.rs index 775c4e6..2dc585f 100644 --- a/fixed_wide_vectors/src/lib.rs +++ b/fixed_wide_vectors/src/lib.rs @@ -1,6 +1,9 @@ mod macros; mod vector; +#[cfg(feature="fixed_wide_traits")] +pub mod affine; + pub use vector::Vector2; pub use vector::Vector3; pub use vector::Vector4;