public class FloatDenseNdArray extends AbstractDenseNdArray<Float,FloatNdArray> implements FloatNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
FloatDenseNdArray(FloatDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
FloatDataBuffer |
buffer() |
FloatNdArray |
copyTo(NdArray<Float> dst)
Copy the content of this array to the destination array.
|
static FloatNdArray |
create(FloatDataBuffer buffer,
Shape shape) |
float |
getFloat(long... indices)
Returns the float value of the scalar found at the given coordinates.
|
FloatNdArray |
read(FloatDataBuffer dst) |
FloatNdArray |
setFloat(float value,
long... indices)
Assigns the float value of the scalar found at the given coordinates.
|
FloatNdArray |
write(FloatDataBuffer 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 FloatDenseNdArray(FloatDataBuffer buffer, Shape shape)
public static FloatNdArray create(FloatDataBuffer buffer, Shape shape)
public float getFloat(long... indices)
FloatNdArrayTo 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:
FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2)); // matrix rank = 2
matrix.getFloat(0, 1); // succeeds, returns 0.0f
matrix.getFloat(0); // throws IllegalRankException
FloatNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getFloat(); // succeeds, returns 0.0f
getFloat in interface FloatNdArrayindices - coordinates of the scalar to resolvepublic FloatNdArray setFloat(float value, long... indices)
FloatNdArrayTo 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:
FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2)); // matrix rank = 2
matrix.setFloat(10.0f, 0, 1); // succeeds
matrix.setFloat(10.0f, 0); // throws IllegalRankException
FloatNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setFloat(10.0f); // succeeds
setFloat in interface FloatNdArrayvalue - value to assignindices - coordinates of the scalar to assignpublic FloatNdArray copyTo(NdArray<Float> 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 FloatNdArraycopyTo in interface NdArray<Float>dst - array to receive a copy of the content of this arraypublic FloatNdArray read(FloatDataBuffer dst)
read in interface FloatNdArraypublic FloatNdArray write(FloatDataBuffer src)
write in interface FloatNdArraypublic FloatDataBuffer buffer()
buffer in class AbstractDenseNdArray<Float,FloatNdArray>Copyright © 2015–2020. All rights reserved.