public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkForEqualDimensions(ArrayND a0,
ArrayND a1)
Checks whether given given
ArrayNDs have equal dimensions,
and throws an IllegalArgumentException if not. |
static void |
checkForEqualSizes(ArrayND a0,
ArrayND a1)
Checks whether given given
ArrayNDs have equal sizes,
and throws an IllegalArgumentException if not. |
static void |
checkForNonNegativeElements(IntTuple t)
Checks whether the elements of the given tuple are not negative,
and throws an
IllegalArgumentException if any of
them is negative. |
static void |
checkForValidSubArrayIndices(IntTuple parentSize,
IntTuple fromIndices,
IntTuple toIndices)
Checks whether the given tuples specify a valid range for a sub-array
of an array with the given parent size, and throws an
IllegalArgumentException if not. |
static int |
countDifferences(IntTuple t0,
IntTuple t1)
Returns the number of entries of the given tuples that are
different
|
public static void checkForEqualDimensions(ArrayND a0, ArrayND a1)
ArrayNDs have equal dimensions,
and throws an IllegalArgumentException if not.a0 - The first arraya1 - The second arrayNullPointerException - If any argument is nullIllegalArgumentException - If the given arrays
do not have equal dimensionspublic static void checkForEqualSizes(ArrayND a0, ArrayND a1)
ArrayNDs have equal sizes,
and throws an IllegalArgumentException if not.a0 - The first arraya1 - The second arrayNullPointerException - If any argument is nullIllegalArgumentException - If the given arrays
do not have equal sizespublic static void checkForNonNegativeElements(IntTuple t)
IllegalArgumentException if any of
them is negative.t - The tupleNullPointerException - If the given size is nullIllegalArgumentException - If any element of the given tuple
is negativepublic static void checkForValidSubArrayIndices(IntTuple parentSize, IntTuple fromIndices, IntTuple toIndices)
IllegalArgumentException if not.parentSize - The parent sizefromIndices - The start indices, inclusivetoIndices - The end indices, exclusiveNullPointerException - If any of the given tuples is
nullIllegalArgumentException - If the indices are not valid. This
is the case when the size of the start- or
end indices is different than the parent size, or when
fromIndex < 0 or
toIndex > parentSize.get(i)
or fromIndex > toIndex for any dimension.public static int countDifferences(IntTuple t0, IntTuple t1)
t0 - The first tuplet1 - The second tupleNullPointerException - If any of the arguments is nullIllegalArgumentException - If the given tuples do not have
the same sizeCopyright © 2015. All Rights Reserved.