@Override public Matrix assign(double value) { for (int row = 0; row < rowSize(); row++) { Arrays.fill(values[row], value); } return this; }
@Override public Matrix like() { return like(rowSize(), columnSize()); }
@Override public Matrix assignColumn(int column, Vector other) { if (rowSize() != other.size()) { throw new CardinalityException(rowSize(), other.size()); } if (column < 0 || column >= columnSize()) { throw new IndexException(column, columnSize()); } for (int row = 0; row < rowSize(); row++) { values[row][column] = other.getQuick(row); } return this; }
@Override public Matrix viewPart(int rowOffset, int rowsRequested, int columnOffset, int columnsRequested) { if (rowOffset < 0) { throw new IndexException(rowOffset, rowSize()); } if (rowOffset + rowsRequested > rowSize()) { throw new IndexException(rowOffset + rowsRequested, rowSize()); } if (columnOffset < 0) { throw new IndexException(columnOffset, columnSize()); } if (columnOffset + columnsRequested > columnSize()) { throw new IndexException(columnOffset + columnsRequested, columnSize()); } return new MatrixView(this, new int[]{rowOffset, columnOffset}, new int[]{rowsRequested, columnsRequested}); }
@Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } if (row < 0 || row >= rowSize()) { throw new IndexException(row, rowSize()); } for (int col = 0; col < columnSize(); col++) { values[row][col] = other.getQuick(col); } return this; }
@Override public Matrix assign(double value) { for (int row = 0; row < rowSize(); row++) { Arrays.fill(values[row], value); } return this; }
@Override public Matrix assign(double value) { for (int row = 0; row < rowSize(); row++) { Arrays.fill(values[row], value); } return this; }
@Override public Matrix like() { return like(rowSize(), columnSize()); }
@Override public Matrix like() { return like(rowSize(), columnSize()); }
@Override public Matrix assignColumn(int column, Vector other) { if (rowSize() != other.size()) { throw new CardinalityException(rowSize(), other.size()); } if (column < 0 || column >= columnSize()) { throw new IndexException(column, columnSize()); } for (int row = 0; row < rowSize(); row++) { values[row][column] = other.getQuick(row); } return this; }
@Override public Matrix assignColumn(int column, Vector other) { if (rowSize() != other.size()) { throw new CardinalityException(rowSize(), other.size()); } if (column < 0 || column >= columnSize()) { throw new IndexException(column, columnSize()); } for (int row = 0; row < rowSize(); row++) { values[row][column] = other.getQuick(row); } return this; }
@Override public Matrix viewPart(int rowOffset, int rowsRequested, int columnOffset, int columnsRequested) { if (rowOffset < 0) { throw new IndexException(rowOffset, rowSize()); } if (rowOffset + rowsRequested > rowSize()) { throw new IndexException(rowOffset + rowsRequested, rowSize()); } if (columnOffset < 0) { throw new IndexException(columnOffset, columnSize()); } if (columnOffset + columnsRequested > columnSize()) { throw new IndexException(columnOffset + columnsRequested, columnSize()); } return new MatrixView(this, new int[]{rowOffset, columnOffset}, new int[]{rowsRequested, columnsRequested}); }
@Override public Matrix viewPart(int rowOffset, int rowsRequested, int columnOffset, int columnsRequested) { if (rowOffset < 0) { throw new IndexException(rowOffset, rowSize()); } if (rowOffset + rowsRequested > rowSize()) { throw new IndexException(rowOffset + rowsRequested, rowSize()); } if (columnOffset < 0) { throw new IndexException(columnOffset, columnSize()); } if (columnOffset + columnsRequested > columnSize()) { throw new IndexException(columnOffset + columnsRequested, columnSize()); } return new MatrixView(this, new int[]{rowOffset, columnOffset}, new int[]{rowsRequested, columnsRequested}); }
@Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } if (row < 0 || row >= rowSize()) { throw new IndexException(row, rowSize()); } for (int col = 0; col < columnSize(); col++) { values[row][col] = other.getQuick(col); } return this; }
@Override public Matrix assignRow(int row, Vector other) { if (columnSize() != other.size()) { throw new CardinalityException(columnSize(), other.size()); } if (row < 0 || row >= rowSize()) { throw new IndexException(row, rowSize()); } for (int col = 0; col < columnSize(); col++) { values[row][col] = other.getQuick(col); } return this; }