RealMatrix { public double getTrace() { code.clearOnline(); code.addRCode(this.HashString + " <- sum(diag(" + this.name + "))"); rcaller.runAndReturnResultOnline(this.HashString); return (rcaller.getParser().getAsDoubleArray(this.HashString)[0]); } 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 testGetTrace() { System.out.println("getTrace"); double trace = rm.getTrace(); assertEquals(10.0, trace, delta); }