code: public static DoubleMatrix pinv(DoubleMatrix A) {
      return solveLeastSquares(A, DoubleMatrix.eye(A.rows));
    }
docs: Computes the pseudo-inverse.
  
  Note, this function uses the solveLeastSquares and might produce different numerical
  solutions for the underdetermined case than matlab.
  
  @param A rectangular matrix
  @return matrix P such that A*P*A = A and P*A*P = P.