code: public static boolean invert(DMatrixSparseCSC A, DMatrixRMaj inverse ) {
          if( A.numRows != A.numCols )
              throw new IllegalArgumentException("A must be a square matrix");
          inverse.reshape(A.numRows,A.numCols);
  
          LinearSolverSparse<DMatrixSparseCSC,DMatrixRMaj> solver;
          solver = LinearSolverFactory_DSCC.lu(FillReducing.NONE);
  
          // Ensure that the input isn't modified
          if( solver.modifiesA() )
              A = A.copy();
  
          DMatrixRMaj I = CommonOps_DDRM.identity(A.numRows);
  
          // decompose then solve the matrix
          if( !solver.setA(A) )
              return false;
  
          solver.solve(I, inverse);
          return true;
      }
docs: <p>
  Performs a matrix inversion operation that does not modify the original
  and stores the results in another matrix.  The two matrices must have the
  same dimension.<br>
  <br>
  B = A<sup>-1</sup>
  </p>
  
  <p>
  If the algorithm could not invert the matrix then false is returned.  If it returns true
  that just means the algorithm finished.  The results could still be bad
  because the matrix is singular or nearly singular.
  </p>
  
  <p>
  For medium to large matrices there might be a slight performance boost to using
  {@link LinearSolverFactory_DSCC} instead.
  </p>
  
  @param A (Input) The matrix that is to be inverted. Not modified.
  @param inverse (Output) Where the inverse matrix is stored.  Modified.
  @return true if it could invert the matrix false if it could not.