commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel <axel...@gmail.com>
Subject [Math] EigenDecompositionImpl#getEigenvector()
Date Sun, 20 Sep 2009 05:41:25 GMT
Hello

I'm trying to calculate the Eigenvectors of this Wikipedia example:
http://en.wikipedia.org/wiki/Eigenvalue_algorithm#Identifying_eigenvectors

with this JUnit method:

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

but I'm getting only {(NaN); (NaN); (NaN)} as a result vector.

Is this intentionally (because of numerical inaccuracy?) or am I doing
something wrong in using EigenDecompositionImpl?

-- 
Axel Kramer
http://code.google.com/p/symja

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message