Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-297

Eigenvector computation incorrectly returning vectors of NaNs

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      As reported by Axel Kramer on commons-dev, the following test case succeeds, but should fail:

      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)}");
        }
      

      ed.getRealEigenvalues() returns the correct eigenvalues (2, 1, -1), but all three eigenvectors contain only NaNs.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              psteitz Phil Steitz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: