weyns49570 / efficient-java-matrix-library

Automatically exported from code.google.com/p/efficient-java-matrix-library
0 stars 0 forks source link

MatrixFeatures.isSymmetric() returns true for non-symmetric matrices containint NaNs #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This code snippet

        DenseMatrix64F m = new DenseMatrix64F(new double[][] {
                { 1.0, Double.NaN },
                { 3.0, 4.0 },
        });
        System.out.println(MatrixFeatures.isSymmetric(m));

will print 'true', which is wrong because the matrix is not symmetric. The code 
line 'if( diff > tol ) {' should be replaced by 'if (!(diff <= tol)) {' to also 
handle the NaN case correctly.

More methods involving tolerance checks of this kind may be affected because 
they use the same flawed tolerance computation logic, e.g. isSkewSymmetric(), 
isIdentical(), isInverse(), isOrthogonal(), isIdentity(), isConstantVal(), 
isNegative(), isUpperTriangle().

Original issue reported on code.google.com by kaspar.thommen@gmail.com on 14 Apr 2011 at 6:26

GoogleCodeExporter commented 9 years ago

Original comment by peter.ab...@gmail.com on 15 Apr 2011 at 1:39

GoogleCodeExporter commented 9 years ago
Updated unit test and fixed all the specified functions.  With the exception of 
isIdentical() which already had the correct behavior.  Thanks for reporting 
this issue and let me know if you find any problems.  If I hear nothing in a 
few days I'll close this ticket.

Original comment by peter.ab...@gmail.com on 24 Apr 2011 at 4:21

GoogleCodeExporter commented 9 years ago

Original comment by peter.ab...@gmail.com on 2 May 2011 at 12:07