@Test(expected = CardinalityException.class) public void testAssignRowCardinality() { double[] data = {2.1, 3.2, 4.3}; test.assignRow(1, new DenseVector(data)); }
@Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } for (int col = 0; col < columnSize(); col++) { matrix .setQuick(row + offset[ROW], col + offset[COL], other.getQuick(col)); } return this; }
MatrixView extends AbstractMatrix { @Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } for (int col = 0; col < columnSize(); col++) { matrix .setQuick(row + offset[ROW], col + offset[COL], other.getQuick(col)); } return this; } }
MatrixView extends AbstractMatrix { @Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } for (int col = 0; col < columnSize(); col++) { matrix .setQuick(row + offset[ROW], col + offset[COL], other.getQuick(col)); } return this; } MatrixView(Matrix matrix, int[] offset, int[] size); }
MatrixView extends AbstractMatrix { @Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } for (int col = 0; col < columnSize(); col++) { matrix .setQuick(row + offset[ROW], col + offset[COL], other.getQuick(col)); } return this; } 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 viewColumn(int column); @Override Vector viewRow(int row); }
MatrixView extends AbstractMatrix { @Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } for (int col = 0; col < columnSize(); col++) { matrix .setQuick(row + offset[ROW], col + offset[COL], other.getQuick(col)); } return this; } 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 viewColumn(int column); @Override Vector viewRow(int row);  }