On Thu, Apr 28, 2011 at 11:32 AM, Jake Mannix <[email protected]> wrote:

>
> You're probably correct here.  I thought there was a unit test in
> LanczosSolverTest
> which compared eigenvalues to that of using the old COLT Eigendecomposition
> class, like "testEigenvalue()" or something like that?  I may have written
> that test
> wrong, and then convinced myself I had to make the test pass... :\
>

Arg:

lines 38-48 of TestLanczosSolver:

    Matrix m = randomHierarchicalSymmetricMatrix(size);
    int desiredRank = 80;

    Vector initialVector = new DenseVector(size);
    initialVector.assign(1d / Math.sqrt(size));
    LanczosSolver solver = new LanczosSolver();
    LanczosState state = new LanczosState(m, size, desiredRank,
initialVector);
    // set initial vector?
    solver.solve(state, desiredRank);

    EigenvalueDecomposition decomposition = new EigenvalueDecomposition(m);
...

LanczosSolver.solve(LanczosState, int) -> .solve(LanczosState, int, false)

ie defaults to assuming *not* symmetric (so uses timesSquared()), but then
what was passed in was a symmetric matrix.

Of course, it's also not really checking (approximate) equality of the
eigenvalues,
even though it's printing it out.  That test should also be checking that
the
COLT-derived eigenvalue is not too different from the Lanczos one.

  -jake

Reply via email to