public class DoubleDenseNdArray extends AbstractDenseNdArray<Double,DoubleNdArray> implements DoubleNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
DoubleDenseNdArray(DoubleDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected DoubleDataBuffer |
buffer() |
DoubleNdArray |
copyTo(NdArray<Double> dst)
Copy the content of this array to the destination array.
|
static DoubleNdArray |
create(DoubleDataBuffer buffer,
Shape shape) |
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) |
elements, equals, get, getObject, hashCode, read, set, setObject, slice, slice, slowCopyTo, writedimensions, scalars, shape, slowEquals, slowHashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitprotected DoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape)
public static DoubleNdArray create(DoubleDataBuffer buffer, Shape shape)
public double getDouble(long... indices)
DoubleNdArrayTo 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
getDouble in interface DoubleNdArrayindices - coordinates of the scalar to resolvepublic DoubleNdArray setDouble(double value, long... indices)
DoubleNdArrayTo 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
setDouble in interface DoubleNdArrayvalue - value to assignindices - coordinates of the scalar to assignpublic DoubleNdArray copyTo(NdArray<Double> 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 DoubleNdArraycopyTo in interface NdArray<Double>dst - array to receive a copy of the content of this arraypublic DoubleNdArray read(DoubleDataBuffer dst)
read in interface DoubleNdArraypublic DoubleNdArray write(DoubleDataBuffer src)
write in interface DoubleNdArrayprotected DoubleDataBuffer buffer()
buffer in class AbstractDenseNdArray<Double,DoubleNdArray>Copyright © 2015–2020. All rights reserved.