/** * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. * * @param slice the index of the slice-coordinate. * @param row the index of the row-coordinate. * @param column the index of the third-coordinate. */ protected int index(int slice, int row, int column) { return _sliceOffset(_sliceRank(slice)) + _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); } } /**
/** * Checks whether indexes are legal and throws an exception, if necessary. * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < slices())</tt> for any i=0..indexes.length()-1. */ protected void checkSliceIndexes(int[] indexes) { for (int i=indexes.length; --i >= 0; ) { int index = indexes[i]; if (index < 0 || index >= slices) checkSlice(index); } } /**
/** Self modifying version of viewPart(). @throws IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt> */ protected AbstractMatrix3D vPart(int slice, int row, int column, int depth, int height, int width) { checkBox(slice,row,column,depth,height,width); this.sliceZero += this.sliceStride * slice; this.rowZero += this.rowStride * row; this.columnZero += this.columnStride * column; this.slices = depth; 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] < slices())</tt> for any i=0..indexes.length()-1. */ protected void checkSliceIndexes(int[] indexes) { for (int i=indexes.length; --i >= 0; ) { int index = indexes[i]; if (index < 0 || index >= slices) checkSlice(index); } } /**
/** Self modifying version of viewPart(). @throws IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt> */ protected AbstractMatrix3D vPart(int slice, int row, int column, int depth, int height, int width) { checkBox(slice,row,column,depth,height,width); this.sliceZero += this.sliceStride * slice; this.rowZero += this.rowStride * row; this.columnZero += this.columnStride * column; this.slices = depth; 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 slice the index of the slice-coordinate. * @param row the index of the row-coordinate. * @param column the index of the third-coordinate. */ protected int index(int slice, int row, int column) { return _sliceOffset(_sliceRank(slice)) + _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); } } /**