| Modifier and Type | Method and Description |
|---|---|
static long |
computeSize(int[] shape)
Compute total number of elements in the array.
|
static Object |
copyPrimitiveArray(Array<?> data) |
static <T> Array<T> |
factory(ArrayType dataType,
int[] shape)
Create Array using empty java array of T, or java primitive array, same size as shape.
|
static <T> Array<T> |
factory(ArrayType dataType,
int[] shape,
Object dataArray)
Create Array using java array of T, or java primitive array, as storage.
|
static <T> Array<T> |
factory(ArrayType dataType,
int[] shape,
Storage<T> storage)
Create Array using java array of T, or java primitive array, as storage.
|
static <T> Array<T> |
factoryArrays(ArrayType dataType,
int[] shape,
List<Array<?>> dataArrays)
Experimental: keep list of Arrays separate.
|
static <T> Array<T> |
factoryCopy(ArrayType dataType,
int[] shape,
List<Array<T>> dataArrays)
Combine list of Array's by copying the underlying Array's into a single primitive array
|
static <T> Array<T> |
flip(Array<T> org,
int dim)
Create a new Array using same backing store as the org Array, by
flipping the index so that it runs from shape[index]-1 to 0.
|
static ByteBuffer |
getByteBuffer(Array<Byte> from)
Convert an Array\
|
static com.google.protobuf.ByteString |
getByteString(Array<Byte> from)
Convert the Array into a ByteString.
|
static MinMax |
getMinMaxSkipMissingData(Array<? extends Number> a,
IsMissingEvaluator eval)
Get the min and max of the array, skipping missing data if eval.hasMissing().
|
static <T> Array<T> |
makeArray(ArrayType type,
int npts,
double start,
double incr,
int... shape)
Make a numeric array from a start and incr.
|
static String |
makeStringFromChar(Array<Byte> from)
Create a String out of an Array\
|
static Array<String> |
makeStringsFromChar(Array<Byte> from)
Create an Array of Strings out of an Array\
|
static <T> Array<T> |
permute(Array<T> org,
int[] dims)
Create a new Array using same backing store as the org Array, by
permuting the indices.
|
static <T> Array<T> |
reduce(Array<T> org)
Create a new Array using same backing store as the org Array, by
eliminating any dimensions with length one.
|
static <T> Array<T> |
reduce(Array<T> org,
int dim)
Create a new Array using same backing store as the org Array, by
eliminating the specified dimension.
|
static int[] |
removeVlen(int[] shape)
If there are any VLEN dimensions (length < 0), remove it and all dimensions to the right.
|
static <T> Array<T> |
reshape(Array<T> org,
int[] shape)
Create a new Array using same backing store with given shape
|
static <T> Array<T> |
section(Array<T> org,
Section section)
Create a new Array as a subsection of the org Array, without rank reduction.
|
static <T> Array<T> |
slice(Array<T> org,
int dim,
int value)
Create a new Array using same backing store as the org Array, by
fixing the specified dimension at the specified index value.
|
static Array<Double> |
toDouble(Array<?> array)
Convert a numeric array to double values.
|
static <T> Array<T> |
transpose(Array<T> org,
int dim1,
int dim2)
Create a new Array using same backing store as the org Array, by
transposing two of the indices.
|
public static <T> Array<T> factory(ArrayType dataType, int[] shape, Storage<T> storage)
dataType - data type of the data. Vlen detected from the shape.shape - multidimensional shape, must have same total length as dataArray.storage - storage for type T.public static <T> Array<T> factory(ArrayType dataType, int[] shape, Object dataArray)
dataType - data type of the data. Vlen detected from the shape.shape - multidimensional shape, must have same total length as dataArray.dataArray - must be java array of T, or java primitive arraypublic static <T> Array<T> factory(ArrayType dataType, int[] shape)
shape - multidimensional shapepublic static <T> Array<T> factoryCopy(ArrayType dataType, int[] shape, List<Array<T>> dataArrays)
public static <T> Array<T> factoryArrays(ArrayType dataType, int[] shape, List<Array<?>> dataArrays)
public static <T> Array<T> flip(Array<T> org, int dim)
org - original Arraydim - dimension to flippublic static <T> Array<T> permute(Array<T> org, int[] dims)
org - original Arraydims - the old index dims[k] becomes the new kth index.public static <T> Array<T> reshape(Array<T> org, int[] shape)
org - original Arrayshape - the new shapepublic static <T> Array<T> reduce(Array<T> org)
org - original Arraypublic static <T> Array<T> reduce(Array<T> org, int dim)
org - original Arraydim - dimension to eliminate: must be of length one.public static <T> Array<T> section(Array<T> org, Section section) throws InvalidRangeException
org - original Arraysection - list of Ranges that specify the array subset.
Must be same rank as original Array.
A particular Range: 1) may be a subset, or 2) may be null, meaning use entire Range.InvalidRangeExceptionpublic static <T> Array<T> slice(Array<T> org, int dim, int value) throws InvalidRangeException
org - original Arraydim - which dimension to fixvalue - at what index valueInvalidRangeExceptionpublic static <T> Array<T> transpose(Array<T> org, int dim1, int dim2)
org - original Arraydim1 - transpose these two indicesdim2 - transpose these two indicespublic static long computeSize(int[] shape)
shape - length of array in each dimension.public static int[] removeVlen(int[] shape)
shape - multidimensional shapepublic static Array<Double> toDouble(Array<?> array)
public static MinMax getMinMaxSkipMissingData(Array<? extends Number> a, @Nullable IsMissingEvaluator eval)
public static <T> Array<T> makeArray(ArrayType type, int npts, double start, double incr, int... shape)
type - type of arraynpts - number of pointsstart - starting valueincr - incrementshape - shape of resulting array. if not set, use 1 dim array of length npts.public static Array<String> makeStringsFromChar(Array<Byte> from)
public static String makeStringFromChar(Array<Byte> from)
public static ByteBuffer getByteBuffer(Array<Byte> from)