public class ByteDenseNdArray extends AbstractDenseNdArray<Byte,ByteNdArray> implements ByteNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
ByteDenseNdArray(ByteDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected ByteDataBuffer |
buffer() |
ByteNdArray |
copyTo(NdArray<Byte> dst)
Copy the content of this array to the destination array.
|
static ByteNdArray |
create(ByteDataBuffer buffer,
Shape shape) |
byte |
getByte(long... indices)
Returns the byte value of the scalar found at the given coordinates.
|
ByteNdArray |
read(ByteDataBuffer dst) |
ByteNdArray |
setByte(byte value,
long... indices)
Assigns the byte value of the scalar found at the given coordinates.
|
ByteNdArray |
write(ByteDataBuffer 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 ByteDenseNdArray(ByteDataBuffer buffer, Shape shape)
public static ByteNdArray create(ByteDataBuffer buffer, Shape shape)
public byte getByte(long... indices)
ByteNdArrayTo 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:
ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2)); // matrix rank = 2
matrix.getByte(0, 1); // succeeds, returns 0
matrix.getByte(0); // throws IllegalRankException
ByteNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getByte(); // succeeds, returns 0
getByte in interface ByteNdArrayindices - coordinates of the scalar to resolvepublic ByteNdArray setByte(byte value, long... indices)
ByteNdArrayTo 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:
ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2)); // matrix rank = 2
matrix.setByte(10, 0, 1); // succeeds
matrix.setByte(10, 0); // throws IllegalRankException
ByteNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setByte(10); // succeeds
setByte in interface ByteNdArrayvalue - the value to assignindices - coordinates of the scalar to assignpublic ByteNdArray copyTo(NdArray<Byte> 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 ByteNdArraycopyTo in interface NdArray<Byte>dst - array to receive a copy of the content of this arraypublic ByteNdArray read(ByteDataBuffer dst)
read in interface ByteNdArraypublic ByteNdArray write(ByteDataBuffer src)
write in interface ByteNdArrayprotected ByteDataBuffer buffer()
buffer in class AbstractDenseNdArray<Byte,ByteNdArray>Copyright © 2015–2020. All rights reserved.