RealMatrix { public RealMatrix getTranspose() { code.clearOnline(); rcaller.runAndReturnResultOnline(this.name); int[] dims = rcaller.getParser().getDimensions(this.name); double[][] mat = rcaller.getParser().getAsDoubleMatrix(this.name, dims[0], dims[1]); 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 testGetTranspose() { System.out.println("getTranspose"); double[][] t = rm.getTranspose().getData(); assertEquals(matrix[0][0], t[0][0], delta); assertEquals(matrix[0][1], t[1][0], delta); assertEquals(matrix[1][0], t[0][1], delta); assertEquals(matrix[1][1], t[1][1], delta); }