- java.lang.Object
-
- org.tensorflow.ndarray.impl.AbstractNdArray<T,U>
-
- org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Double,DoubleNdArray>
-
- org.tensorflow.ndarray.impl.dense.DoubleDenseNdArray
-
- All Implemented Interfaces:
DoubleNdArray,NdArray<Double>,Shaped
public class DoubleDenseNdArray extends AbstractDenseNdArray<Double,DoubleNdArray> implements DoubleNdArray
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DoubleDataBufferbuffer()DoubleNdArraycopyTo(NdArray<Double> dst)Copy the content of this array to the destination array.static DoubleNdArraycreate(DoubleDataBuffer buffer, Shape shape)doublegetDouble(long... indices)Returns the double value of the scalar found at the given coordinates.DoubleNdArrayread(DoubleDataBuffer dst)DoubleNdArraysetDouble(double value, long... indices)Assigns the double value of the scalar found at the given coordinates.DoubleNdArraywrite(DoubleDataBuffer src)-
Methods inherited from class org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray
elements, equals, get, getObject, hashCode, read, set, setObject, slice, slice, slowCopyTo, toString, write
-
Methods inherited from class org.tensorflow.ndarray.impl.AbstractNdArray
dimensions, scalars, shape, slowEquals, slowHashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tensorflow.ndarray.DoubleNdArray
elements, get, getObject, read, scalars, set, setObject, slice, streamOfDoubles, write
-
Methods inherited from interface org.tensorflow.ndarray.NdArray
equals, streamOfObjects
-
-
-
-
Constructor Detail
-
DoubleDenseNdArray
protected DoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape)
-
-
Method Detail
-
create
public static DoubleNdArray create(DoubleDataBuffer buffer, Shape shape)
-
getDouble
public double getDouble(long... indices)
Description copied from interface:DoubleNdArrayReturns 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- Specified by:
getDoublein interfaceDoubleNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setDouble
public DoubleNdArray setDouble(double value, long... indices)
Description copied from interface:DoubleNdArrayAssigns 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- Specified by:
setDoublein interfaceDoubleNdArray- Parameters:
value- value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
public DoubleNdArray copyTo(NdArray<Double> dst)
Description copied from interface:NdArrayCopy the content of this array to the destination array.The
Shaped.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.- Specified by:
copyToin interfaceDoubleNdArray- Specified by:
copyToin interfaceNdArray<Double>- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
read
public DoubleNdArray read(DoubleDataBuffer dst)
- Specified by:
readin interfaceDoubleNdArray
-
write
public DoubleNdArray write(DoubleDataBuffer src)
- Specified by:
writein interfaceDoubleNdArray
-
buffer
protected DoubleDataBuffer buffer()
- Specified by:
bufferin classAbstractDenseNdArray<Double,DoubleNdArray>
-
-