affine
This commit is contained in:
parent
a097e3945f
commit
047451d247
17
fixed_wide_vectors/src/affine.rs
Normal file
17
fixed_wide_vectors/src/affine.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
use std::ops::Add;
|
||||||
|
use fixed_wide_traits::wide::WideDot;
|
||||||
|
|
||||||
|
pub struct Affine<M,T>{
|
||||||
|
pub matrix:M,
|
||||||
|
pub offset:T,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<M:Copy,T:Copy> Affine<M,T>{
|
||||||
|
pub fn wide_transform<X>(&self,input:X)-><<M as WideDot<X>>::Output as Add<T>>::Output
|
||||||
|
where
|
||||||
|
M:WideDot<X>,
|
||||||
|
<M as WideDot<X>>::Output:Add<T>,
|
||||||
|
{
|
||||||
|
self.matrix.wide_dot(input)+self.offset
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
mod macros;
|
mod macros;
|
||||||
mod vector;
|
mod vector;
|
||||||
|
|
||||||
|
#[cfg(feature="fixed_wide_traits")]
|
||||||
|
pub mod affine;
|
||||||
|
|
||||||
pub use vector::Vector2;
|
pub use vector::Vector2;
|
||||||
pub use vector::Vector3;
|
pub use vector::Vector3;
|
||||||
pub use vector::Vector4;
|
pub use vector::Vector4;
|
||||||
|
Loading…
Reference in New Issue
Block a user