views:

36

answers:

0

I'm using colt for some algebraic operations with sparse matrices. Actually i want to calculate a sparse matrix inverse, everything looks pretty easy but i'm not able to get it done.

There is a method in "Algebra" called inverse that get a DoubleMatrix2D [abstract], and SparseMatrix2D is a direct subclass of DoubleMatrix2D.

A couble of links about that:

  1. http://acs.lbl.gov/software/colt/api/cern/colt/matrix/linalg/Algebra.html#inverse(cern.colt.matrix.DoubleMatrix2D)
  2. http://acs.lbl.gov/software/colt/api/cern/colt/matrix/DoubleMatrix2D.html

myMethod is pretty much this one:

...

public void myMethod(... params ...){
        SparseDoubleMatrix2D lap = new SparseDoubleMatrix2D(fileMatrix);
        Algebra a = new Algebra();
        double[][] matrix =  a.inverse(lap).toArray();
        ...
    };

The problem is in "a.inverse(lap)" because lap seems to be the wrong type. why?