MatrixView extends AbstractMatrix { @Override public Matrix like() { return matrix.like(rowSize(), columnSize()); } private  MatrixView();  MatrixView(Matrix matrix, int[] offset, int[] size); @Override Matrix clone(); @Override double getQuick(int row, int column); @Override Matrix like(); @Override Matrix like(int rows, int columns); @Override void setQuick(int row, int column, double value); @Override int[] getNumNondefaultElements(); @Override Matrix viewPart(int[] offset, int[] size); @Override Matrix assignColumn(int column, Vector other); @Override Matrix assignRow(int row, Vector other); @Override Vector getColumn(int column); @Override Vector getRow(int row);  }
@Test public void testLike() { Matrix like = test.like(); assertTrue("type", like instanceof DenseMatrix); assertEquals("rows", test.size()[ROW], like.size()[ROW]); assertEquals("columns", test.size()[COL], like.size()[COL]); }
@Test public void testLikeIntInt() { Matrix like = test.like(4, 4); assertTrue("type", like instanceof DenseMatrix); assertEquals("rows", 4, like.size()[ROW]); assertEquals("columns", 4, like.size()[COL]); }
@Test(expected = CardinalityException.class) public void testTimesMatrixCardinality() { Matrix other = test.like(5, 8); test.times(other); }