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

Eigenvector computation incorrectly returning vectors of NaNs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: