Skip to content

Commit

Permalink
chore: Add test that fails before fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollkornaffe committed Mar 8, 2024
1 parent 4decc80 commit dd44414
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion tests/linalg/eigen.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use na::DMatrix;
use na::{DMatrix, Matrix3};

#[cfg(feature = "proptest-support")]
mod proptest_tests {
Expand Down Expand Up @@ -116,6 +116,31 @@ fn symmetric_eigen_singular_24x24() {
);
}

// Test for #1368
#[test]
fn very_small_deviation_from_identity() {
let m = Matrix3::<f32>::new(
1.0,
3.1575704e-23,
8.1146196e-23,
3.1575704e-23,
1.0,
1.7471054e-22,
8.1146196e-23,
1.7471054e-22,
1.0,
);

for v in m
.try_symmetric_eigen(f32::EPSILON, 0)
.unwrap()
.eigenvalues
.into_iter()
{
assert_relative_eq!(*v, 1.);
}
}

// #[cfg(feature = "arbitrary")]
// quickcheck! {
// TODO: full eigendecomposition is not implemented yet because of its complexity when some
Expand Down

0 comments on commit dd44414

Please sign in to comment.