protected static INDArrayIndex validate(long size, INDArrayIndex index) { if ((index instanceof IntervalIndex || index instanceof PointIndex) && size <= index.current() && size > 1) throw new IllegalArgumentException("NDArrayIndex is out of range. Beginning index: " + index.current() + " must be less than its size: " + size); if (index instanceof IntervalIndex && size < index.end()) { long begin = ((IntervalIndex) index).begin; index = NDArrayIndex.interval(begin, index.stride(), size); } return index; }
protected static INDArrayIndex validate(long size, INDArrayIndex index) { if ((index instanceof IntervalIndex || index instanceof PointIndex) && size <= index.current() && size > 1) throw new IllegalArgumentException("NDArrayIndex is out of range. Beginning index: " + index.current() + " must be less than its size: " + size); if (index instanceof IntervalIndex && size < index.end()) { long begin = ((IntervalIndex) index).begin; index = NDArrayIndex.interval(begin, index.stride(), size); } return index; }