/** * Sanity check for operations requiring two matrices with the same size. * * @throws IllegalArgumentException * if <tt>size() != B.size()</tt>. */ public void checkSize(AbstractMatrix1D B) { if (size != B.size) throw new IllegalArgumentException("Incompatible sizes: " + toStringShort() + " and " + B.toStringShort()); }
/** * Sanity check for operations requiring two matrices with the same size. * * @throws IllegalArgumentException * if <tt>size() != B.size()</tt>. */ public void checkSize(AbstractMatrix1D B) { if (size != B.size) throw new IllegalArgumentException("Incompatible sizes: " + toStringShort() + " and " + B.toStringShort()); }
/** * Sanity check for operations requiring an index to be within bounds. * * @throws IndexOutOfBoundsException * if <tt>index < 0 || index >= size()</tt>. */ protected void checkIndex(int index) { if (index < 0 || index >= size) throw new IndexOutOfBoundsException("Attempted to access " + toStringShort() + " at index=" + index); }
/** * Returns the stride of the given dimension (axis, rank). * * @dimension the index of the dimension. * @return the stride in the given dimension. * @throws IllegalArgumentException * if <tt>dimension != 0</tt>. */ protected int stride(int dimension) { if (dimension != 0) throw new IllegalArgumentException("invalid dimension: " + dimension + "used to access" + toStringShort()); return this.stride; }
/** * Sanity check for operations requiring an index to be within bounds. * * @throws IndexOutOfBoundsException * if <tt>index < 0 || index >= size()</tt>. */ protected void checkIndex(int index) { if (index < 0 || index >= size) throw new IndexOutOfBoundsException("Attempted to access " + toStringShort() + " at index=" + index); }
/** * Returns the stride of the given dimension (axis, rank). * * @dimension the index of the dimension. * @return the stride in the given dimension. * @throws IllegalArgumentException * if <tt>dimension != 0</tt>. */ protected int stride(int dimension) { if (dimension != 0) throw new IllegalArgumentException("invalid dimension: " + dimension + "used to access" + toStringShort()); return this.stride; }