public class DoubleArraysND extends Object
DoubleArrayND instances| Modifier and Type | Method and Description |
|---|---|
static java.util.function.ToDoubleFunction<IntTuple> |
asFunction(DoubleArrayND array)
Returns a view on the given
DoubleArrayND as a function
that maps coordinates to array entry values. |
static MutableDoubleArrayND |
create(int... size)
Creates a new
MutableDoubleArrayND with the specified size |
static MutableDoubleArrayND |
create(IntTuple size)
Creates a new
MutableDoubleArrayND with the specified size |
static DoubleArrayND |
createSubArray(DoubleArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static MutableDoubleArrayND |
createSubArray(MutableDoubleArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static double |
max(DoubleArrayND array)
Returns the maximum value in the given array, or
Double.NEGATIVE_INFINITY if the given array
has a size of 0. |
static double |
min(DoubleArrayND array)
Returns the minimum value in the given array, or
Double.POSITIVE_INFINITY if the given array
has a size of 0. |
static String |
toFormattedString(DoubleArrayND array)
Creates a formatted representation of the given array.
|
static String |
toFormattedString(DoubleArrayND array,
String format)
Creates a formatted representation of the given array.
|
static MutableDoubleArrayND |
wrap(double[][] array)
Creates a view on the given array as a
MutableDoubleArrayND. |
static DoubleArrayND |
wrap(DoubleTuple t,
IntTuple size)
Creates a view on the given tuple as a
DoubleArrayND. |
static MutableDoubleArrayND |
wrap(MutableDoubleTuple t,
IntTuple size)
Creates a view on the given tuple as a
DoubleArrayND. |
public static MutableDoubleArrayND create(IntTuple size)
MutableDoubleArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableDoubleArrayND create(int... size)
MutableDoubleArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableDoubleArrayND wrap(double[][] array)
MutableDoubleArrayND. Changes in the given array
will be visible in the returned array, and vice versa.null elements).array - The backing arrayNullPointerException - If the given array is nullpublic static DoubleArrayND wrap(DoubleTuple t, IntTuple size)
DoubleArrayND.
Changes in the given tuple will be visible in the returned array.t - The tuplesize - The size of the arrayNullPointerException - If any argument is nullIllegalArgumentException - If the
size of the tuple does not match the
given array size (that is, the product of all elements of the given
tuple).public static MutableDoubleArrayND wrap(MutableDoubleTuple t, IntTuple size)
DoubleArrayND.
Changes in the given tuple will be visible in the returned array,
and vice versa.t - The tuplesize - The size of the arrayNullPointerException - If any argument is nullIllegalArgumentException - If the
size of the tuple does not match the
given array size (that is, the product of all elements of the given
tuple).public static java.util.function.ToDoubleFunction<IntTuple> asFunction(DoubleArrayND array)
DoubleArrayND as a function
that maps coordinates to array entry values. This function may
throw an IndexOutOfBoundsException when the given indices are not
valid. That is, if fromIndex < 0 or toIndex > size or
fromIndex > toIndex for any dimension. But explicit bounds
checking is not guaranteed.array - The arrayNullPointerException - If the given array is nullpublic static DoubleArrayND createSubArray(DoubleArrayND parent, IntTuple fromIndices, IntTuple toIndices)
parent - The parent arrayfromIndices - The start indices in the parent, inclusivetoIndices - The end indices in the parent, exclusiveNullPointerException - If any argument 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(i)
or fromIndex > toIndex for any dimension.public static MutableDoubleArrayND createSubArray(MutableDoubleArrayND parent, IntTuple fromIndices, IntTuple toIndices)
parent - The parent arrayfromIndices - The start indices in the parent, inclusivetoIndices - The end indices in the parent, exclusiveNullPointerException - If the given parent or 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(i)
or fromIndex > toIndex for any dimension.public static double min(DoubleArrayND array)
Double.POSITIVE_INFINITY if the given array
has a size of 0.array - The arraypublic static double max(DoubleArrayND array)
Double.NEGATIVE_INFINITY if the given array
has a size of 0.array - The arraypublic static String toFormattedString(DoubleArrayND array)
array - The arraypublic static String toFormattedString(DoubleArrayND array, String format)
array - The arrayformat - The format for the array entriesCopyright © 2015. All Rights Reserved.