List of usage examples for org.apache.commons.math3.linear RealMatrix copySubMatrix
void copySubMatrix(int startRow, int endRow, int startColumn, int endColumn, double[][] destination) throws OutOfRangeException, NumberIsTooSmallException, MatrixDimensionMismatchException;
From source file:lirmm.inria.fr.math.BigSparseRealMatrixTest.java
private void checkCopy(RealMatrix m, double[][] reference, int startRow, int endRow, int startColumn, int endColumn, boolean mustFail) { try {//from w w w . j a v a2 s . c o m double[][] sub = (reference == null) ? new double[1][1] : createIdenticalCopy(reference); m.copySubMatrix(startRow, endRow, startColumn, endColumn, sub); Assert.assertEquals(new BigSparseRealMatrix(reference), new BigSparseRealMatrix(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; } } catch (MatrixDimensionMismatchException e) { if (!mustFail) { throw e; } } }