Package deepboof.tensors
Class Tensor_S64
java.lang.Object
- All Implemented Interfaces:
ITensor
public class Tensor_S64 extends Tensor<Tensor_S64>
-
Field Summary
Fields Modifier and Type Field Description long[]d -
Constructor Summary
Constructors Constructor Description Tensor_S64()Tensor_S64(int... shape) -
Method Summary
Modifier and Type Method Description Tensor_S64create(int... shape)Creates a tensor of the same type with the specified shapejava.lang.ObjectgetData()Returns internal array used to store tensor data.java.lang.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(java.lang.Object data)Used to change the internal array in an abstract wayvoidzero()Sets all elements in the tensor to the value of zero
-
Field Details
-
d
public long[] d
-
-
Constructor Details
-
Tensor_S64
public Tensor_S64(int... shape) -
Tensor_S64
public Tensor_S64()
-
-
Method Details
-
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_S64>- Parameters:
coordinate- Coordinate of the element which is to be read- Returns:
- Tensor elements's value as a double
-
getData
public java.lang.Object 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_S64>- Returns:
- tensor data.
-
setData
public void setData(java.lang.Object data)Description copied from class:TensorUsed to change the internal array in an abstract way- Specified by:
setDatain classTensor<Tensor_S64>
-
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_S64>- 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_S64>- 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_S64>- 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_S64>
-
getDataType
public java.lang.Class getDataType()Description copied from interface:ITensorClassof primitive data type used to store tensor- Returns:
- Internal data type class.
-