/** * Sanity check for operations requiring matrices with the same number of slices, rows and columns. * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns() || slices() != C.slices() || rows() != C.rows() || columns() != C.columns()</tt>. */ public void checkShape(AbstractMatrix3D B, AbstractMatrix3D C) { if (slices != B.slices || rows != B.rows || columns != B.columns || slices != C.slices || rows != C.rows || columns != C.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort()); } /**
/** * Sanity check for operations requiring matrices with the same number of slices, rows and columns. * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns() || slices() != C.slices() || rows() != C.rows() || columns() != C.columns()</tt>. */ public void checkShape(AbstractMatrix3D B, AbstractMatrix3D C) { if (slices != B.slices || rows != B.rows || columns != B.columns || slices != C.slices || rows != C.rows || columns != C.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort()); } /**
/** * Sanity check for operations requiring two matrices with the same number of slices, rows and columns. * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns()</tt>. */ public void checkShape(AbstractMatrix3D B) { if (slices != B.slices || rows != B.rows || columns != B.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort()); } /**
/** * Sanity check for operations requiring two matrices with the same number of slices, rows and columns. * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns()</tt>. */ public void checkShape(AbstractMatrix3D B) { if (slices != B.slices || rows != B.rows || columns != B.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort()); } /**
/** * Checks whether the receiver contains the given box and throws an exception, if necessary. * @throws IndexOutOfBoundsException if <tt>row<0 || height<0 || row+height>rows || slice<0 || depth<0 || slice+depth>slices || column<0 || width<0 || column+width>columns</tt> */ protected void checkBox(int slice, int row, int column, int depth, int height, int width) { if (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+", slice:"+slice+", row:"+row+" ,column:"+column+", depth:"+depth+" ,height:"+height+", width:"+width); } /**
/** * Sanity check for operations requiring a column index to be within bounds. * @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>. */ protected void checkColumn(int column) { if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column); } /**
/** * Sanity check for operations requiring a slice index to be within bounds. * @throws IndexOutOfBoundsException if <tt>slice < 0 || slice >= slices()</tt>. */ protected void checkSlice(int slice) { if (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at slice="+slice); } /**
/** * Sanity check for operations requiring a column index to be within bounds. * @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>. */ protected void checkColumn(int column) { if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column); } /**
/** * Sanity check for operations requiring a slice index to be within bounds. * @throws IndexOutOfBoundsException if <tt>slice < 0 || slice >= slices()</tt>. */ protected void checkSlice(int slice) { if (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at slice="+slice); } /**
/** * Sanity check for operations requiring a row index to be within bounds. * @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows()</tt>. */ protected void checkRow(int row) { if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row); } /**
/** * Checks whether the receiver contains the given box and throws an exception, if necessary. * @throws IndexOutOfBoundsException if <tt>row<0 || height<0 || row+height>rows || slice<0 || depth<0 || slice+depth>slices || column<0 || width<0 || column+width>columns</tt> */ protected void checkBox(int slice, int row, int column, int depth, int height, int width) { if (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+", slice:"+slice+", row:"+row+" ,column:"+column+", depth:"+depth+" ,height:"+height+", width:"+width); } /**
/** * Sanity check for operations requiring a row index to be within bounds. * @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows()</tt>. */ protected void checkRow(int row) { if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row); } /**