| Constructor and Description |
|---|
NdArrays() |
| Modifier and Type | Method and Description |
|---|---|
static BooleanNdArray |
ofBooleans(Shape shape)
Creates an N-dimensional array of booleans of the given shape.
|
static ByteNdArray |
ofBytes(Shape shape)
Creates an N-dimensional array of bytes of the given shape.
|
static DoubleNdArray |
ofDoubles(Shape shape)
Creates an N-dimensional array of doubles of the given shape.
|
static FloatNdArray |
ofFloats(Shape shape)
Creates an N-dimensional array of floats of the given shape.
|
static IntNdArray |
ofInts(Shape shape)
Creates an N-dimensional array of ints of the given shape.
|
static LongNdArray |
ofLongs(Shape shape)
Creates an N-dimensional array of longs of the given shape.
|
static <T> NdArray<T> |
ofObjects(Class<T> clazz,
Shape shape)
Creates an N-dimensional array of the given shape.
|
static ShortNdArray |
ofShorts(Shape shape)
Creates an N-dimensional array of shorts of the given shape.
|
static BooleanNdArray |
scalarOf(boolean value)
Creates boolean scalar (rank 0) initialized with the given value.
|
static ByteNdArray |
scalarOf(byte value)
Creates byte scalar (rank 0) initialized with the given value.
|
static DoubleNdArray |
scalarOf(double value)
Creates double scalar (rank 0) initialized with the given value.
|
static FloatNdArray |
scalarOf(float value)
Creates float scalar (rank 0) initialized with the given value.
|
static IntNdArray |
scalarOf(int value)
Creates long scalar (rank 0) initialized with the given value.
|
static LongNdArray |
scalarOf(long value)
Creates long scalar (rank 0) initialized with the given value.
|
static ShortNdArray |
scalarOf(short value)
Creates short scalar (rank 0) initialized with the given value.
|
static <T> NdArray<T> |
scalarOfObject(T value)
Creates scalar (rank 0) initialized with the given value.
|
static BooleanNdArray |
vectorOf(boolean... values)
Creates a boolean vector (rank 1) initialized with the given values.
|
static ByteNdArray |
vectorOf(byte... values)
Creates a byte vector (rank 1) initialized with the given values.
|
static DoubleNdArray |
vectorOf(double... values)
Creates a double vector (rank 1) initialized with the given values.
|
static FloatNdArray |
vectorOf(float... values)
Creates a float vector (rank 1) initialized with the given values.
|
static IntNdArray |
vectorOf(int... values)
Creates a int vector (rank 1) initialized with the given values.
|
static LongNdArray |
vectorOf(long... values)
Creates a long vector (rank 1) initialized with the given values.
|
static ShortNdArray |
vectorOf(short... values)
Creates a short vector (rank 1) initialized with the given values.
|
static <T> NdArray<T> |
vectorOfObjects(T... values)
Creates a vector (rank 1) initialized with the given values.
|
static ByteNdArray |
wrap(ByteDataBuffer buffer,
Shape shape)
Wraps a buffer in a byte N-dimensional array of a given shape.
|
static BooleanNdArray |
wrap(Shape shape,
BooleanDataBuffer buffer)
Wraps a buffer in a boolean N-dimensional array of a given shape.
|
static <T> NdArray<T> |
wrap(Shape shape,
DataBuffer<T> buffer)
Wraps a buffer in an N-dimensional array of a given shape.
|
static DoubleNdArray |
wrap(Shape shape,
DoubleDataBuffer buffer)
Wraps a buffer in a double N-dimensional array of a given shape.
|
static FloatNdArray |
wrap(Shape shape,
FloatDataBuffer buffer)
Wraps a buffer in a float N-dimensional array of a given shape.
|
static IntNdArray |
wrap(Shape shape,
IntDataBuffer buffer)
Wraps a buffer in an int N-dimensional array of a given shape.
|
static LongNdArray |
wrap(Shape shape,
LongDataBuffer buffer)
Wraps a buffer in a long N-dimensional array of a given shape.
|
static ShortNdArray |
wrap(Shape shape,
ShortDataBuffer buffer)
Wraps a buffer in a short N-dimensional array of a given shape.
|
public static ByteNdArray scalarOf(byte value)
value - scalar valuepublic static ByteNdArray vectorOf(byte... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static ByteNdArray ofBytes(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static ByteNdArray wrap(ByteDataBuffer buffer, Shape shape)
buffer - buffer to wrapshape - shape of the arrayIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static LongNdArray scalarOf(long value)
value - scalar valuepublic static LongNdArray vectorOf(long... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static LongNdArray ofLongs(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static LongNdArray wrap(Shape shape, LongDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static IntNdArray scalarOf(int value)
value - scalar valuepublic static IntNdArray vectorOf(int... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static IntNdArray ofInts(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static IntNdArray wrap(Shape shape, IntDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static ShortNdArray scalarOf(short value)
value - scalar valuepublic static ShortNdArray vectorOf(short... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static ShortNdArray ofShorts(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static ShortNdArray wrap(Shape shape, ShortDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static FloatNdArray scalarOf(float value)
value - scalar valuepublic static FloatNdArray vectorOf(float... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static FloatNdArray ofFloats(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static FloatNdArray wrap(Shape shape, FloatDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static DoubleNdArray scalarOf(double value)
value - scalar valuepublic static DoubleNdArray vectorOf(double... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static DoubleNdArray ofDoubles(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static DoubleNdArray wrap(Shape shape, DoubleDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static BooleanNdArray scalarOf(boolean value)
value - scalar valuepublic static BooleanNdArray vectorOf(boolean... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
values - vector valuesIllegalArgumentException - if values is nullpublic static BooleanNdArray ofBooleans(Shape shape)
All values are initialized to zeros.
shape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static BooleanNdArray wrap(Shape shape, BooleanDataBuffer buffer)
shape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizepublic static <T> NdArray<T> scalarOfObject(T value)
T - the data typevalue - scalar value@SafeVarargs public static <T> NdArray<T> vectorOfObjects(T... values)
Modifying the data of the returned vector will also impact the values in the array passed in parameter.
T - the data typevalues - vector valuesIllegalArgumentException - if values is nullpublic static <T> NdArray<T> ofObjects(Class<T> clazz, Shape shape)
All values are initialized to zeros.
T - the data typeclazz - class of the data to be stored in this arrayshape - shape of the arrayIllegalArgumentException - if shape is null or has unknown dimensionspublic static <T> NdArray<T> wrap(Shape shape, DataBuffer<T> buffer)
T - the data typeshape - shape of the arraybuffer - buffer to wrapIllegalArgumentException - if shape is null, has unknown dimensions or has size bigger
in the buffer sizeCopyright © 2015–2020. All rights reserved.