/** * Returns the position of the given coordinate within the (virtual or * non-virtual) internal 1-dimensional array. * * @param row * the index of the row-coordinate. * @param column * the index of the column-coordinate. */ public long index(int row, int column) { return _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column)); }
/** * Checks whether indexes are legal and throws an exception, if necessary. * * @throws IndexOutOfBoundsException * if <tt>! (0 <= indexes[i] < columns())</tt> for any * i=0..indexes.length()-1. */ protected void checkColumnIndexes(int[] indexes) { for (int i = indexes.length; --i >= 0;) { int index = indexes[i]; if (index < 0 || index >= columns) checkColumn(index); } }
/** * Checks whether indexes are legal and throws an exception, if necessary. * * @throws IndexOutOfBoundsException * if <tt>! (0 <= indexes[i] < rows())</tt> for any * i=0..indexes.length()-1. */ protected void checkRowIndexes(int[] indexes) { for (int i = indexes.length; --i >= 0;) { int index = indexes[i]; if (index < 0 || index >= rows) checkRow(index); } }
/** * Sets up a matrix with a given number of rows and columns. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @throws IllegalArgumentException * if * <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> * . */ protected void setUp(int rows, int columns) { setUp(rows, columns, 0, 0, columns, 1); }
/** * Self modifying version of viewPart(). * * @throws IndexOutOfBoundsException * if * <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt> */ protected AbstractMatrix2D vPart(int row, int column, int height, int width) { checkBox(row, column, height, width); this.rowZero += this.rowStride * row; this.columnZero += this.columnStride * column; this.rows = height; this.columns = width; this.isNoView = false; return this; }
/** * Checks whether indexes are legal and throws an exception, if necessary. * * @throws IndexOutOfBoundsException * if <tt>! (0 <= indexes[i] < columns())</tt> for any * i=0..indexes.length()-1. */ protected void checkColumnIndexes(int[] indexes) { for (int i = indexes.length; --i >= 0;) { int index = indexes[i]; if (index < 0 || index >= columns) checkColumn(index); } }
/** * Checks whether indexes are legal and throws an exception, if necessary. * * @throws IndexOutOfBoundsException * if <tt>! (0 <= indexes[i] < rows())</tt> for any * i=0..indexes.length()-1. */ protected void checkRowIndexes(int[] indexes) { for (int i = indexes.length; --i >= 0;) { int index = indexes[i]; if (index < 0 || index >= rows) checkRow(index); } }
/** * Sets up a matrix with a given number of rows and columns. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @throws IllegalArgumentException * if * <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> * . */ protected void setUp(int rows, int columns) { setUp(rows, columns, 0, 0, columns, 1); }
/** * Self modifying version of viewPart(). * * @throws IndexOutOfBoundsException * if * <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt> */ protected AbstractMatrix2D vPart(int row, int column, int height, int width) { checkBox(row, column, height, width); this.rowZero += this.rowStride * row; this.columnZero += this.columnStride * column; this.rows = height; this.columns = width; this.isNoView = false; return this; }
/** * Returns the position of the given coordinate within the (virtual or * non-virtual) internal 1-dimensional array. * * @param row * the index of the row-coordinate. * @param column * the index of the column-coordinate. */ public long index(int row, int column) { return _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column)); }