javamatrixjama

How to calculate pseudoinverse of a matix using JAMA (A Java Matrix Package)?


I am trying to find inverse of a matrix. When it is singular I need to calculate pseudoinverse. I am not able to find anything like pseudoinverse in JAMA doc. How could I compute it ?


Solution

  • jama makes it for you

    documentation

    public Matrix inverse()
        Matrix inverse or pseudoinverse
        Returns:
            inverse(A) if A is square, pseudoinverse otherwise.