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