bahaelaila7 / sparse-eigensolvers-java

Automatically exported from code.google.com/p/sparse-eigensolvers-java
0 stars 1 forks source link

Standardise JUnit tests #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The tests are very non-standard: some of them appear to be testing the core MTJ 
classes rather than unit testing this library.

I'd be happy to help restructuring of the tests.

Other than unit tests (that test individual classes/methods) I would like to 
see a suite of matrices (perhaps defined in Matrix Market format) which have 
been solved in MATLAB and their answered stored to file. A small test framework 
would then allow a solver to be tested by loading every matrix, solving it 
(options for eigenvalues and vectors) and comparing to the MATLAB answers (up 
to a given precision). Also, some small dense matrices could be tested which 
were solved using more run of the mill solvers.

Original issue reported on code.google.com by Sam.Hall...@gmail.com on 14 Oct 2012 at 4:49

GoogleCodeExporter commented 9 years ago

Original comment by Sam.Hall...@gmail.com on 16 Oct 2012 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by Sam.Hall...@gmail.com on 16 Oct 2012 at 7:18

GoogleCodeExporter commented 9 years ago
Unit tests were added in Release 01.1, hopefully in a standard way, and a 
subset of these tests read in matrix market files. The unit tests read in MM 
files as follows: one for the matrix, one for Matlab computed eigenvalues and 
one for Matlab computed eigenvectors. SEJ is run and the output is compared. To 
compare the eigenspaces, I wrote a version of a program called Subspace that 
computes angles between subspaces, that can be used as a metric to see how 
close the eigenspaces are. Care is needed though when eigenvalues have a 
mutliplicity greater than one. 

Original comment by margent...@gmail.com on 14 Nov 2012 at 2:48

GoogleCodeExporter commented 9 years ago
Correction: Actually the matrices above are generated using an algorithm for 
generating Laplacians that is used both in Matlab and SEJ. The Matlab generated 
eigenvalues and eigenvectors are stored in matrix market formatted files for 
the test cases involving the standard and generalized eigenvalue problems. The 
matrix market files are stored under  src/test/resources. For future needed 
test cases we could store the  matrix as well in a mm file format.

Original comment by margent...@gmail.com on 14 Nov 2012 at 4:13