List of usage examples for org.apache.commons.math3.linear RealMatrix getSubMatrix
RealMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns) throws NullArgumentException, NoDataException, OutOfRangeException;
From source file:lirmm.inria.fr.math.BigSparseRealMatrixTest.java
private void checkGetSubMatrix(RealMatrix m, double[][] reference, int[] selectedRows, int[] selectedColumns, boolean mustFail) { try {//from w w w .j ava2 s .co m RealMatrix sub = m.getSubMatrix(selectedRows, selectedColumns); Assert.assertEquals(new BigSparseRealMatrix(reference), sub); if (mustFail) { Assert.fail("Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException"); } } catch (OutOfRangeException e) { if (!mustFail) { throw e; } } catch (NumberIsTooSmallException e) { if (!mustFail) { throw e; } } catch (NoDataException e) { if (!mustFail) { throw e; } } }