Public Methods
FloatDataBuffer |
buffer()
|
FloatNdArray | |
static FloatNdArray | |
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)
|
Inherited Methods
Public Methods
public float getFloat (long... indices)
Returns the float value of the scalar found at the given coordinates.
To 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
Parameters
indices | coordinates of the scalar to resolve |
---|
Returns
- value of that scalar
public FloatNdArray setFloat (float value, long... indices)
Assigns the float value of the scalar found at the given coordinates.
To 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
Parameters
value | value to assign |
---|---|
indices | coordinates of the scalar to assign |
Returns
- this array