public class Tensor extends Object implements MatrixValueI
| Constructor and Description |
|---|
Tensor(Dimensions dims)
Creates a Tensor with the given dimension.
|
Tensor(int len,
Dimensions dims)
Creates a tensor with dimensions [len,dims[0],...,dims[n]]
|
Tensor(Tensor t)
Creates a Tensor with same dimension as the arguments.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
bufferAppend(StringBuffer sb,
int currank)
Recursive procedure to print the tensor with lots of brackets.
|
MatrixValueI |
copy()
returns a copy of this value.
|
boolean |
equals(Object obj)
value of constant ele(1).
|
Dimensions |
getDim()
Returns the dimension of this object.
|
Object |
getEle(int i)
gets the i-th element, treats data a a linear array.
|
static MatrixValueI |
getInstance(Dimensions dims)
Factory method to return a new Vector, Matrix or Tensor
with the given dimensions.
|
int |
getNumEles()
The total number of elements.
|
int |
hashCode()
Always override hashCode when you override equals.
|
void |
setEle(int i,
Object value)
sets the i-th element, treats data a a linear array.
|
void |
setEles(MatrixValueI val)
sets the elements to those of the arguments.
|
String |
toString()
Returns a string rep of tensor.
|
public Tensor(Dimensions dims)
public Tensor(Tensor t)
public Tensor(int len,
Dimensions dims)
public MatrixValueI copy()
MatrixValueIcopy in interface MatrixValueIpublic Dimensions getDim()
MatrixValueIgetDim in interface MatrixValueIpublic int getNumEles()
MatrixValueIgetNumEles in interface MatrixValueIpublic void setEle(int i,
Object value)
MatrixValueIsetEle in interface MatrixValueIpublic Object getEle(int i)
MatrixValueIgetEle in interface MatrixValueIpublic void setEles(MatrixValueI val)
setEles in interface MatrixValueIpublic static MatrixValueI getInstance(Dimensions dims)
protected void bufferAppend(StringBuffer sb, int currank)
public String toString()
public boolean equals(Object obj)
Copyright © 2018. All rights reserved.