public class LongDenseNdArray extends AbstractDenseNdArray<Long,LongNdArray> implements LongNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
LongDenseNdArray(LongDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected LongDataBuffer |
buffer() |
LongNdArray |
copyTo(NdArray<Long> dst)
Copy the content of this array to the destination array.
|
static LongNdArray |
create(LongDataBuffer buffer,
Shape shape) |
long |
getLong(long... indices)
Returns the long value of the scalar found at the given coordinates.
|
LongNdArray |
read(LongDataBuffer dst) |
LongNdArray |
setLong(long value,
long... indices)
Assigns the long value of the scalar found at the given coordinates.
|
LongNdArray |
write(LongDataBuffer 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 LongDenseNdArray(LongDataBuffer buffer, Shape shape)
public static LongNdArray create(LongDataBuffer buffer, Shape shape)
public long getLong(long... indices)
LongNdArrayTo 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:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2
matrix.getLong(0, 1); // succeeds, returns 0L
matrix.getLong(0); // throws IllegalRankException
LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getLong(); // succeeds, returns 0L
getLong in interface LongNdArrayindices - coordinates of the scalar to resolvepublic LongNdArray setLong(long value, long... indices)
LongNdArrayTo 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:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2
matrix.setLong(10L, 0, 1); // succeeds
matrix.setLong(10L, 0); // throws IllegalRankException
LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setLong(10L); // succeeds
setLong in interface LongNdArrayvalue - value to assignindices - coordinates of the scalar to assignpublic LongNdArray copyTo(NdArray<Long> 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 LongNdArraycopyTo in interface NdArray<Long>dst - array to receive a copy of the content of this arraypublic LongNdArray read(LongDataBuffer dst)
read in interface LongNdArraypublic LongNdArray write(LongDataBuffer src)
write in interface LongNdArrayprotected LongDataBuffer buffer()
buffer in class AbstractDenseNdArray<Long,LongNdArray>Copyright © 2015–2020. All rights reserved.