From 263f0d35d4a86aee23a475c73a16b759be285d24 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 30 Aug 2024 12:52:54 -0700 Subject: [PATCH] test reason why matrix needs its own type --- .../src/tests/fixed_wide_traits.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fixed_wide_vectors/src/tests/fixed_wide_traits.rs b/fixed_wide_vectors/src/tests/fixed_wide_traits.rs index 04925e6..a409d5e 100644 --- a/fixed_wide_vectors/src/tests/fixed_wide_traits.rs +++ b/fixed_wide_vectors/src/tests/fixed_wide_traits.rs @@ -4,7 +4,7 @@ use fixed_wide_traits::wide::WideDot; use crate::Vector3; type Planar64=fixed_wide::types::I32F32; -//type Planar64Wide1=fixed::types::I64F64; +type Planar64Wide1=fixed_wide::types::I64F64; //type Planar64Wide2=fixed_wide::types::I128F128; type Planar64Wide3=fixed_wide::types::I256F256; @@ -49,3 +49,17 @@ fn wide_vec3_length_squared(){ assert_eq!(v3,Planar64Wide3::from(3i128.pow(8)*3)); } + +#[test] +fn wide_matrix_dot_vs_vec_of_vec_dot(){ + let vv=Vector3::>::from_value_2d(Planar64::from(3)); + // do the dot product of the inner vectors multiplied component wise + // this lowers the rank of the data structure and is kind of a weird operation lol + let vv_dot=vv.wide_dot(vv); + assert_eq!(vv_dot,crate::Vector2::from_value(Planar64Wide1::from(3i128.pow(3)))); + + //let m=Matrix3::>::from_value_2d(Planar64::from(3)); + //normal matrix product + //let m_dot=m.wide_dot(m); + //assert_eq!(m_dot,Vector3::from_value(Planar64Wide1::from(3i128.pow(3)))); +}