From 92d9f82caff0d216105a64dc806637eb68d9a42f Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Sat, 27 Oct 2018 14:05:17 +0200 Subject: [PATCH] Fix syntax error. --- tests/linalg/eigen.rs | 89 +------------------------------------------ 1 file changed, 2 insertions(+), 87 deletions(-) diff --git a/tests/linalg/eigen.rs b/tests/linalg/eigen.rs index 3f9ac097..0bcd672e 100644 --- a/tests/linalg/eigen.rs +++ b/tests/linalg/eigen.rs @@ -1,4 +1,5 @@ -t +#![cfg_attr(rustfmt, rustfmt_skip)] + use na::DMatrix; #[cfg(feature = "arbitrary")] @@ -103,89 +104,3 @@ fn symmetric_eigen_singular_24x24() { epsilon = 1.0e-5 )); } - -// #[cfg(feature = "arbitrary")] -// quickcheck! { -// FIXME: full eigendecomposition is not implemented yet because of its complexity when some -// eigenvalues have multiplicity > 1. -// -// /* -// * NOTE: for the following tests, we use only upper-triangular matrices. -// * Thes ensures the schur decomposition will work, and allows use to test the eigenvector -// * computation. -// */ -// fn eigen(n: usize) -> bool { -// let n = cmp::max(1, cmp::min(n, 10)); -// let m = DMatrix::::new_random(n, n).upper_triangle(); -// -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// -// fn eigen_with_adjascent_duplicate_diagonals(n: usize) -> bool { -// let n = cmp::max(1, cmp::min(n, 10)); -// let mut m = DMatrix::::new_random(n, n).upper_triangle(); -// -// // Suplicate some adjascent diagonal elements. -// for i in 0 .. n / 2 { -// m[(i * 2 + 1, i * 2 + 1)] = m[(i * 2, i * 2)]; -// } -// -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// -// fn eigen_with_nonadjascent_duplicate_diagonals(n: usize) -> bool { -// let n = cmp::max(3, cmp::min(n, 10)); -// let mut m = DMatrix::::new_random(n, n).upper_triangle(); -// -// // Suplicate some diagonal elements. -// for i in n / 2 .. n { -// m[(i, i)] = m[(i - n / 2, i - n / 2)]; -// } -// -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// -// fn eigen_static_square_4x4(m: Matrix4) -> bool { -// let m = m.upper_triangle(); -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// -// fn eigen_static_square_3x3(m: Matrix3) -> bool { -// let m = m.upper_triangle(); -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// -// fn eigen_static_square_2x2(m: Matrix2) -> bool { -// let m = m.upper_triangle(); -// println!("{}", m); -// let eig = RealEigen::new(m.clone()).unwrap(); -// verify_eigenvectors(m, eig) -// } -// } -// -// fn verify_eigenvectors(m: MatrixN, mut eig: RealEigen) -> bool -// where DefaultAllocator: Allocator + -// Allocator + -// Allocator + -// Allocator, -// MatrixN: Display, -// VectorN: Display { -// let mv = &m * &eig.eigenvectors; -// -// println!("eigenvalues: {}eigenvectors: {}", eig.eigenvalues, eig.eigenvectors); -// -// let dim = m.nrows(); -// for i in 0 .. dim { -// let mut col = eig.eigenvectors.column_mut(i); -// col *= eig.eigenvalues[i]; -// } -// -// println!("{}{:.5}{:.5}", m, mv, eig.eigenvectors); -// -// relative_eq!(eig.eigenvectors, mv, epsilon = 1.0e-5) -// }