BlockFieldMatrix extends AbstractFieldMatrix<T> implements Serializable { @Override public void setRowVector(final int row, final FieldVector<T> vector) throws MatrixDimensionMismatchException, OutOfRangeException { try { setRow(row, ((ArrayFieldVector<T>) vector).getDataRef()); } catch (ClassCastException cce) { super.setRowVector(row, vector); } } BlockFieldMatrix(final Field<T> field, final int rows,
                            final int columns);  BlockFieldMatrix(final T[][] rawData);  BlockFieldMatrix(final int rows, final int columns,
                            final T[][] blockData, final boolean copyArray); static T[][] toBlocksLayout(final T[][] rawData); static T[][] createBlocksLayout(final Field<T> field,
                                                                       final int rows, final int columns); @Override FieldMatrix<T> createMatrix(final int rowDimension,
                                       final int columnDimension); @Override FieldMatrix<T> copy(); @Override FieldMatrix<T> add(final FieldMatrix<T> m); BlockFieldMatrix<T> add(final BlockFieldMatrix<T> m); @Override FieldMatrix<T> subtract(final FieldMatrix<T> m); BlockFieldMatrix<T> subtract(final BlockFieldMatrix<T> m); @Override FieldMatrix<T> scalarAdd(final T d); @Override FieldMatrix<T> scalarMultiply(final T d); @Override FieldMatrix<T> multiply(final FieldMatrix<T> m); BlockFieldMatrix<T> multiply(BlockFieldMatrix<T> m); @Override T[][] getData(); @Override FieldMatrix<T> getSubMatrix(final int startRow, final int endRow,
                                       final int startColumn,
                                       final int endColumn); @Override void setSubMatrix(final T[][] subMatrix, final int row,
                             final int column); @Override FieldMatrix<T> getRowMatrix(final int row); @Override void setRowMatrix(final int row, final FieldMatrix<T> matrix); void setRowMatrix(final int row, final BlockFieldMatrix<T> matrix); @Override FieldMatrix<T> getColumnMatrix(final int column); @Override void setColumnMatrix(final int column, final FieldMatrix<T> matrix); @Override FieldVector<T> getRowVector(final int row); @Override void setRowVector(final int row, final FieldVector<T> vector); @Override FieldVector<T> getColumnVector(final int column); @Override void setColumnVector(final int column, final FieldVector<T> vector); @Override T[] getRow(final int row); @Override void setRow(final int row, final T[] array); @Override T[] getColumn(final int column); @Override void setColumn(final int column, final T[] array); @Override T getEntry(final int row, final int column); @Override void setEntry(final int row, final int column, final T value); @Override void addToEntry(final int row, final int column, final T increment); @Override void multiplyEntry(final int row, final int column, final T factor); @Override FieldMatrix<T> transpose(); @Override int getRowDimension(); @Override int getColumnDimension(); @Override T[] operate(final T[] v); @Override T[] preMultiply(final T[] v); @Override T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor); @Override T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor); @Override T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn); @Override T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn); @Override T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor); @Override T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor); @Override T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor,
                                  final int startRow, final int endRow,
                                  final int startColumn, final int endColumn); @Override T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor,
                                  final int startRow, final int endRow,
                                  final int startColumn, final int endColumn); static final int BLOCK_SIZE; }
@Test public void testSetRowVector() { FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData); FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]); Assert.assertNotSame(mRow3, m.getRowMatrix(0)); m.setRowVector(0, mRow3); Assert.assertEquals(mRow3, m.getRowVector(0)); try { m.setRowVector(-1, mRow3); Assert.fail("Expecting OutOfRangeException"); } catch (OutOfRangeException ex) { } try { m.setRowVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5)); Assert.fail("Expecting MatrixDimensionMismatchException"); } catch (MatrixDimensionMismatchException ex) { } }