public class IntDenseNdArray extends AbstractDenseNdArray<Integer,IntNdArray> implements IntNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
IntDenseNdArray(IntDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected IntDataBuffer |
buffer() |
IntNdArray |
copyTo(NdArray<Integer> dst)
Copy the content of this array to the destination array.
|
static IntNdArray |
create(IntDataBuffer buffer,
Shape shape) |
int |
getInt(long... indices)
Returns the integer value of the scalar found at the given coordinates.
|
IntNdArray |
read(IntDataBuffer dst) |
IntNdArray |
setInt(int value,
long... indices)
Assigns the integer value of the scalar found at the given coordinates.
|
IntNdArray |
write(IntDataBuffer 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 IntDenseNdArray(IntDataBuffer buffer, Shape shape)
public static IntNdArray create(IntDataBuffer buffer, Shape shape)
public int getInt(long... indices)
IntNdArrayTo 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:
IntNdArray matrix = NdArrays.ofInts(shape(2, 2)); // matrix rank = 2
matrix.getInt(0, 1); // succeeds, returns 0
matrix.getInt(0); // throws IllegalRankException
IntNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getInt(); // succeeds, returns 0
getInt in interface IntNdArrayindices - coordinates of the scalar to resolvepublic IntNdArray setInt(int value, long... indices)
IntNdArrayTo 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:
IntNdArray matrix = NdArrays.ofInts(shape(2, 2)); // matrix rank = 2
matrix.setInt(10, 0, 1); // succeeds
matrix.setInt(10, 0); // throws IllegalRankException
IntNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setInt(10); // succeeds
setInt in interface IntNdArrayvalue - value to assignindices - coordinates of the scalar to assignpublic IntNdArray copyTo(NdArray<Integer> 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 IntNdArraycopyTo in interface NdArray<Integer>dst - array to receive a copy of the content of this arraypublic IntNdArray read(IntDataBuffer dst)
read in interface IntNdArraypublic IntNdArray write(IntDataBuffer src)
write in interface IntNdArrayprotected IntDataBuffer buffer()
buffer in class AbstractDenseNdArray<Integer,IntNdArray>Copyright © 2015–2020. All rights reserved.