Public Methods
DoubleNdArray | |
static DoubleNdArray | |
double |
getDouble(long... indices)
Returns the double value of the scalar found at the given coordinates.
|
DoubleNdArray |
read(DoubleDataBuffer dst)
|
DoubleNdArray |
setDouble(double value, long... indices)
Assigns the double value of the scalar found at the given coordinates.
|
DoubleNdArray |
write(DoubleDataBuffer src)
|
Inherited Methods
Public Methods
public double getDouble (long... indices)
Returns the double 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:
DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2)); // matrix rank = 2
matrix.getDouble(0, 1); // succeeds, returns 0.0
matrix.getDouble(0); // throws IllegalRankException
DoubleNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getDouble(); // succeeds, returns 0.0
Parameters
indices | coordinates of the scalar to resolve |
---|
Returns
- value of that scalar
public DoubleNdArray setDouble (double value, long... indices)
Assigns the double 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:
DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2)); // matrix rank = 2
matrix.setDouble(10.0, 0, 1); // succeeds
matrix.setDouble(10.0, 0); // throws IllegalRankException
DoubleNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setDouble(10.0); // succeeds
Parameters
value | value to assign |
---|---|
indices | coordinates of the scalar to assign |
Returns
- this array