Class DoubleDenseNdArray
java.lang.Object
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DoubleDataBufferbuffer()copyFrom(DoubleDataBuffer src) copyTo(DoubleDataBuffer 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.scalars()Returns a sequence of all scalars in this array.setDouble(double value, long... indices) Assigns the double value of the scalar found at the given coordinates.shape()protected booleanslowEquals(NdArray<?> array) protected intMethods inherited from class AbstractDenseNdArray
copyFrom, copyTo, elements, equals, get, getObject, hashCode, set, setObject, slice, slice, slowCopyTo, toString, withShapeMethods inherited from interface DoubleNdArray
copyFrom, copyTo, elements, get, getObject, scalars, set, setObject, slice, streamOfDoubles, withShapeMethods inherited from interface NdArray
equals, streamOfObjects
-
Field Details
-
dimensions
-
-
Constructor Details
-
DoubleDenseNdArray
-
-
Method Details
-
create
-
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
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
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
-
copyTo
- Specified by:
copyToin interfaceDoubleNdArray
-
copyFrom
- Specified by:
copyFromin interfaceDoubleNdArray
-
buffer
- Specified by:
bufferin classAbstractDenseNdArray<Double, DoubleNdArray>
-
dimensions
-
shape
-
scalars
Description copied from interface:NdArrayReturns a sequence of all scalars in this array.This is equivalent to call
elements(shape().numDimensions() - 1) -
slowHashCode
protected int slowHashCode() -
slowEquals
-