cc.redberry.core.tensor
Class Sum
- java.lang.Object
-
- cc.redberry.core.tensor.Tensor
-
- cc.redberry.core.tensor.MultiTensor
-
- cc.redberry.core.tensor.Sum
-
public final class Sum extends MultiTensor
Representation of sum.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Tensorget(int i)Returns element at i-th position.TensorBuildergetBuilder()Creates a builder for this tensor.TensorFactorygetFactory()Returns a factory for this tensor.Tensor[]getRange(int from, int to)Retrieves several sub-tensors from current tensor.inthash()Hash code of this tensor.Tensorremove(int i)Removes tensor at the specified position and returns the result.Tensorset(int i, Tensor tensor)Returns new tensor instance with i-th sub-tensor replaced by provided tensor.intsize()Returns the number of elements in this tensor.Tensor[]toArray()java.lang.StringtoString(OutputFormat mode)Returns a string representation of a tensor according to the specifiedOutputFormat.-
Methods inherited from class cc.redberry.core.tensor.MultiTensor
getIndices, remove, remove, select
-
-
-
-
Method Detail
-
get
public Tensor get(int i)
Description copied from class:TensorReturns element at i-th position.
-
size
public int size()
Description copied from class:TensorReturns the number of elements in this tensor.
-
getRange
public Tensor[] getRange(int from, int to)
Description copied from class:TensorRetrieves several sub-tensors from current tensor. This function is faster than sequential invocations ofTensor.get(int)method.
-
set
public Tensor set(int i, Tensor tensor)
Description copied from class:TensorReturns new tensor instance with i-th sub-tensor replaced by provided tensor.
-
remove
public Tensor remove(int i)
Description copied from class:MultiTensorRemoves tensor at the specified position and returns the result.- Specified by:
removein classMultiTensor- Parameters:
i- position in tensor- Returns:
- result of removing
-
hash
public int hash()
Description copied from class:TensorHash code of this tensor.- Returns:
- hash code of this tensor
-
getBuilder
public TensorBuilder getBuilder()
Description copied from class:TensorCreates a builder for this tensor. SeeTensorBuilderfor more information.- Specified by:
getBuilderin classTensor- Returns:
- builder for this tensor
-
getFactory
public TensorFactory getFactory()
Description copied from class:TensorReturns a factory for this tensor. SeeTensorFactoryfor more information.- Specified by:
getFactoryin classTensor- Returns:
- builder for this tensor
-
toString
public java.lang.String toString(OutputFormat mode)
Description copied from class:TensorReturns a string representation of a tensor according to the specifiedOutputFormat.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG