Package deepboof.tensors
Class Tensor_F64
- All Implemented Interfaces:
ITensor
public class Tensor_F64 extends Tensor<Tensor_F64>
-
Field Summary
Fields Modifier and Type Field Description double[]dStorage for tensor data.Fields inherited from class deepboof.Tensor
startIndex, strides, subtensorFields inherited from class deepboof.BaseTensor
shape -
Constructor Summary
Constructors Constructor Description Tensor_F64()Tensor_F64(int... shape) -
Method Summary
Modifier and Type Method Description Tensor_F64create(int... shape)Creates a tensor of the same type with the specified shapedoubleget(int... coordinate)doublegetAtIndex(int index)ObjectgetData()Returns internal array used to store tensor data.ClassgetDataType()Classof primitive data type used to store tensordoublegetDouble(int... coordinate)Accessor function which allows any tensor's element to be read as a double.protected voidinnerArrayGrow(int N)Re-declare inner array so that it is at least of length Nprotected intinnerArrayLength()Length of inner array as returned by "data.length"voidsetData(Object data)Used to change the internal array in an abstract wayvoidzero()Sets all elements in the tensor to the value of zeroMethods inherited from class deepboof.Tensor
computeStrides, copy, copyShape, createCoor, createLike, idx, idx, idx, idx, idx, idx, indexToCoor, isSub, length, length, reshape, reshape, reshape, reshape, reshape, reshape, reshape, setTo, stride, subtensorMethods inherited from class deepboof.BaseTensor
getDimension, getShape, isShape
-
Field Details
-
d
public double[] dStorage for tensor data. The tensor is stored in a row-major format.
-
-
Constructor Details
-
Tensor_F64
public Tensor_F64(int... shape) -
Tensor_F64
public Tensor_F64()
-
-
Method Details
-
get
public double get(int... coordinate) -
getAtIndex
public double getAtIndex(int index) -
getDouble
public double getDouble(int... coordinate)Description copied from class:TensorAccessor function which allows any tensor's element to be read as a double.- Specified by:
getDoublein classTensor<Tensor_F64>- Parameters:
coordinate- Coordinate of the element which is to be read- Returns:
- Tensor elements's value as a double
-
getData
Description copied from class:TensorReturns internal array used to store tensor data. Data is stored in a row-major order in a single array.- Specified by:
getDatain classTensor<Tensor_F64>- Returns:
- tensor data.
-
setData
Description copied from class:TensorUsed to change the internal array in an abstract way- Specified by:
setDatain classTensor<Tensor_F64>
-
innerArrayGrow
protected void innerArrayGrow(int N)Description copied from class:TensorRe-declare inner array so that it is at least of length N- Specified by:
innerArrayGrowin classTensor<Tensor_F64>- Parameters:
N- Desired minimum length of inner array
-
innerArrayLength
protected int innerArrayLength()Description copied from class:TensorLength of inner array as returned by "data.length"- Specified by:
innerArrayLengthin classTensor<Tensor_F64>- Returns:
- Length of inner array
-
create
Description copied from class:TensorCreates a tensor of the same type with the specified shape- Specified by:
createin classTensor<Tensor_F64>- Parameters:
shape- Shape of the new tensor- Returns:
- New tensor with the specified shape
-
zero
public void zero()Description copied from class:TensorSets all elements in the tensor to the value of zero- Specified by:
zeroin classTensor<Tensor_F64>
-
getDataType
Description copied from interface:ITensorClassof primitive data type used to store tensor- Returns:
- Internal data type class.
-