public class ShortDenseNdArray extends AbstractDenseNdArray<Short,ShortNdArray> implements ShortNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
ShortDenseNdArray(ShortDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected ShortDataBuffer |
buffer() |
ShortNdArray |
copyTo(NdArray<Short> dst)
Copy the content of this array to the destination array.
|
static ShortNdArray |
create(ShortDataBuffer buffer,
Shape shape) |
short |
getShort(long... indices)
Returns the short value of the scalar found at the given coordinates.
|
ShortNdArray |
read(ShortDataBuffer dst) |
ShortNdArray |
setShort(short value,
long... indices)
Assigns the short value of the scalar found at the given coordinates.
|
ShortNdArray |
write(ShortDataBuffer src) |
elements, equals, get, getObject, hashCode, read, set, setObject, slice, slice, slowCopyTo, writedimensions, scalars, shape, slowEquals, slowHashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitprotected ShortDenseNdArray(ShortDataBuffer buffer, Shape shape)
public static ShortNdArray create(ShortDataBuffer buffer, Shape shape)
public short getShort(long... indices)
ShortNdArrayTo access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2
matrix.getShort(0, 1); // succeeds, returns 0.0f
matrix.getShort(0); // throws IllegalRankException
ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getShort(); // succeeds, returns 0.0f
getShort in interface ShortNdArrayindices - coordinates of the scalar to resolvepublic ShortNdArray setShort(short value, long... indices)
ShortNdArrayTo access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2
matrix.setShort(10.0f, 0, 1); // succeeds
matrix.setShort(10.0f, 0); // throws IllegalRankException
ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setShort(10.0f); // succeeds
setShort in interface ShortNdArrayvalue - value to assignindices - coordinates of the scalar to assignpublic ShortNdArray copyTo(NdArray<Short> dst)
NdArrayThe NdArray.shape() of the destination array must be equal to the shape of this array, or
an exception is thrown. After the copy, the content of both arrays can be altered
independently, without affecting each other.
copyTo in interface NdArray<Short>copyTo in interface ShortNdArraydst - array to receive a copy of the content of this arraypublic ShortNdArray read(ShortDataBuffer dst)
read in interface ShortNdArraypublic ShortNdArray write(ShortDataBuffer src)
write in interface ShortNdArrayprotected ShortDataBuffer buffer()
buffer in class AbstractDenseNdArray<Short,ShortNdArray>Copyright © 2015–2020. All rights reserved.