[ https://issues.apache.org/jira/browse/MATH297?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=12770367#action_12770367
]
Bruce A Johnson edited comment on MATH297 at 10/27/09 3:19 AM:

There still seems to be a problem with the decomposition of some matrices. For example, the
decomposition of the identity matrix {noformat} {{1,0},{0,1}}{noformat}
yields the correct eigenvalues, but NaN for all the eigenvector elements.
Crucially, the "isIncludedColumn" in the EigenDecompositionImplTest.java file always returns
true (at least on my system) when the calculated eigenvectors have NaN elements, so is useless
as a test for this problem.
Also, I discovered this problem when getting NaN values doing an SVD of certain matrices (where
each row has only one nonzero value). Since the SVD algorithm uses the EigenDecompositionImpl
code, this seems to be a result of this current bug. (And ironically, I just told my students
that one reason people love the SVD is that it essentially never fails).
was (Author: bjohnson):
There still seems to be a problem with the decomposition of some matrices. For example,
the decomposition of the identity matrix '{{1,0},{0,1}}' yields the correct eigenvalues, but
NaN for all the eigenvector elements.
Crucially, the "isIncludedColumn" in the EigenDecompositionImplTest.java file always returns
true (at least on my system) when the calculated eigenvectors have NaN elements, so is useless
as a test for this problem.
Also, I discovered this problem when getting NaN values doing an SVD of certain matrices (where
each row has only one nonzero value). Since the SVD algorithm uses the EigenDecompositionImpl
code, this seems to be a result of this current bug. (And ironically, I just told my students
that one reason people love the SVD is that it essentially never fails).
> Eigenvector computation incorrectly returning vectors of NaNs
> 
>
> Key: MATH297
> URL: https://issues.apache.org/jira/browse/MATH297
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Phil Steitz
> Fix For: 2.1
>
>
> As reported by Axel Kramer on commonsdev, the following test case succeeds, but should
fail:
> {code}
> public void testEigenDecomposition() {
> double[][] m = { { 0.0, 1.0, 1.0 }, { 1.0, 1.0, 0.0 }, { 1.0,0.0, 1.0 } };
> RealMatrix rm = new Array2DRowRealMatrix(m);
> assertEquals(rm.toString(),
> "Array2DRowRealMatrix{{0.0,1.0,1.0},{1.0,1.0,0.0},{1.0,0.0,1.0}}");
> EigenDecompositionImpl ed = new EigenDecompositionImpl(rm,
> MathUtils.SAFE_MIN);
> RealVector rv0 = ed.getEigenvector(0);
> assertEquals(rv0.toString(), "{(NaN); (NaN); (NaN)}");
> }
> {code}
> ed.getRealEigenvalues() returns the correct eigenvalues (2, 1, 1), but all three eigenvectors
contain only NaNs.

This message is automatically generated by JIRA.

You can reply to this email to add a comment to the issue online.
