added test for mul_tr in matrix.rs

added a test for mul_tr to verify that we get m.mul_tr(v) is m*v.transpose(). also changed the name of the previous test for tr_mul to clarify which side of the multiplication is being transposed.
This commit is contained in:
Fangs 2024-04-24 11:11:13 +07:00 committed by GitHub
parent a56c215073
commit 83d20d38d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -920,9 +920,13 @@ mod transposition_tests {
}
#[test]
fn tr_mul_is_transpose_then_mul(m in matrix(PROPTEST_F64, Const::<4>, Const::<6>), v in vector4()) {
fn tr_mul_is_transpose_lhs_then_mul(m in matrix(PROPTEST_F64, Const::<4>, Const::<6>), v in vector4()) {
prop_assert!(relative_eq!(m.transpose() * v, m.tr_mul(&v), epsilon = 1.0e-7))
}
#[test]
fn mul_tr_is_transpose_rhs_then_mul(m in matrix(PROPTEST_F64, Const::<4>, Const::<6>), v in vector4()) {
prop_assert!(relative_eq!(m*v.transpose(), m.mul_tr(&v), epsilon = 1.0e-7))
}
}
}