RealMatrix { public RealMatrix getInverse() { code.clearOnline(); code.addRCode(this.HashString + " <- t(solve(" + this.name + "))"); rcaller.runAndReturnResultOnline(this.HashString); double[][] mat = rcaller.getParser().getAsDoubleMatrix(this.HashString, 2, 2); RealMatrix matnew = new RealMatrix(service); matnew.setData(mat); return (matnew); } RealMatrix(RService service);  RealMatrix(String pathToR, String name); RCaller getRCaller(); void setData(double[][] data); int[] getDimensions(); double[][] getData(); double[] getColumn(int column); double[][] getColumns(int[] columns); double[] getRow(int row); double[][] getRows(int[] rows); double getDeterminant(); RealMatrix getInverse(); double[] getDiagonal(); double getTrace(); RealMatrix getTranspose(); RealMatrix product(double[][] another); RealMatrix product(RealMatrix another); RealMatrix sum(double[][] another); RealMatrix sum(RealMatrix another); RealMatrix productWithScaler(double scaler); RealMatrix subtract(double[][] another); RealMatrix subtract(RealMatrix another); double[] getEigenValues(); RealMatrix getEigenVectors(); SVD getSVD();  }
@Test public void testGetInverse() { System.out.println("getInverse"); double[][] myinverse = rm.getInverse().getData(); assertEquals(inverse[0][0], myinverse[0][0], delta); assertEquals(inverse[1][0], myinverse[1][0], delta); assertEquals(inverse[0][1], myinverse[0][1], delta); assertEquals(inverse[1][1], myinverse[1][1], delta); }