cc.redberry.core.tensor
Class TensorField
- java.lang.Object
-
- cc.redberry.core.tensor.Tensor
-
- cc.redberry.core.tensor.SimpleTensor
-
- cc.redberry.core.tensor.TensorField
-
public final class TensorField extends SimpleTensor
Representation of tensor field.- 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.SimpleIndices[]getArgIndices()SimpleIndicesgetArgIndices(int i)Tensor[]getArguments()TensorBuildergetBuilder()Creates a builder for this tensor.intgetDeivativeOrder(int i)Returns the order of derivative with respect to argument at specified position.TensorFactorygetFactory()Returns a factory for this tensor.NameDescriptorForTensorFieldgetNameDescriptor()TensorFieldgetParentField()Return tensor field from which the derivative is taken.SimpleIndices[][]getPartitionOfIndices()Calculates and returns partition of derivative indices.Tensor[]getRange(int from, int to)Retrieves several sub-tensors from current tensor.booleanisDerivative()java.util.Iterator<Tensor>iterator()Return read-only iterator over tensor elements.intsize()Returns the number of elements in this tensor.java.lang.StringtoString0(OutputFormat mode)-
Methods inherited from class cc.redberry.core.tensor.SimpleTensor
equals, getIndices, getName, getStringName, toString, toString
-
-
-
-
Method Detail
-
getArguments
public Tensor[] getArguments()
-
getArgIndices
public SimpleIndices[] getArgIndices()
-
getArgIndices
public SimpleIndices getArgIndices(int i)
-
isDerivative
public boolean isDerivative()
-
get
public Tensor get(int i)
Description copied from class:TensorReturns element at i-th position.- Overrides:
getin classSimpleTensor- Parameters:
i- position- Returns:
- element at i-th position
-
size
public int size()
Description copied from class:TensorReturns the number of elements in this tensor.- Overrides:
sizein classSimpleTensor- Returns:
- the number of elements in this tensor
-
iterator
public java.util.Iterator<Tensor> iterator()
Description copied from class:TensorReturn read-only iterator over tensor elements.- Specified by:
iteratorin interfacejava.lang.Iterable<Tensor>- Overrides:
iteratorin classSimpleTensor- Returns:
- read-only iterator over tensor elements
-
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.
-
getNameDescriptor
public NameDescriptorForTensorField getNameDescriptor()
- Overrides:
getNameDescriptorin classSimpleTensor
-
getParentField
public TensorField getParentField()
Return tensor field from which the derivative is taken. Ifthisis derivative (e.g.f_m~(1)[k_a]), returns target tensor field ofthis(i.e.f[k_a]); otherwise, returnsthis.- Returns:
- tensor field from which the derivative is taken
-
getDeivativeOrder
public int getDeivativeOrder(int i)
Returns the order of derivative with respect to argument at specified position.- Returns:
- the order of derivative with respect to argument at specified position
-
getPartitionOfIndices
public SimpleIndices[][] getPartitionOfIndices()
Calculates and returns partition of derivative indices. The resulting array organized as follows:result[0][0]--- contains pure field indices (result[0].length == 1),result[i][j]--- are indices formed by j-th derivative with respect to i-th field argument- Returns:
- partition of derivative indices
-
toString0
public java.lang.String toString0(OutputFormat mode)
-
getBuilder
public TensorBuilder getBuilder()
Description copied from class:TensorCreates a builder for this tensor. SeeTensorBuilderfor more information.- Overrides:
getBuilderin classSimpleTensor- Returns:
- builder for this tensor
-
getFactory
public TensorFactory getFactory()
Description copied from class:TensorReturns a factory for this tensor. SeeTensorFactoryfor more information.- Overrides:
getFactoryin classSimpleTensor- Returns:
- builder for this tensor
-
-
DataMelt 3.0 © DataMelt by jWork.ORG