Add known-failing unit test case for SymmetricEigen

This commit is contained in:
Paul Jakob Schroeder 2023-02-20 12:41:42 -05:00
parent 706caf52c3
commit e2a32af5c3

View File

@ -344,7 +344,36 @@ where
#[cfg(test)]
mod test {
use crate::base::Matrix2;
use crate::base::{Matrix2, Matrix4};
/// Exercises bug reported in issue #1109 of nalgebra (https://github.com/dimforge/nalgebra/issues/1109)
#[test]
fn symmetric_eigen_regression_issue_1109() {
let m = Matrix4::new(
-19884.07f64,
-10.07188,
11.277279,
-188560.63,
-10.07188,
12.518197,
1.3770627,
-102.97504,
11.277279,
1.3770627,
14.587362,
113.26099,
-188560.63,
-102.97504,
113.26099,
-1788112.3,
);
let eig = m.symmetric_eigen();
assert!(relative_eq!(
m.lower_triangle(),
eig.recompose().lower_triangle(),
epsilon = 1.0e-5
));
}
fn expected_shift(m: Matrix2<f64>) -> f64 {
let vals = m.eigenvalues().unwrap();