cc.redberry.core.tensor
Class ProductContent
- java.lang.Object
-
- cc.redberry.core.tensor.ProductContent
-
-
Field Summary
Fields Modifier and Type Field and Description static ProductContentEMPTY_INSTANCESingleton for empty instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Tensorget(int i)Returns i-th element of indexed data in this product.Tensor[]getDataCopy()Copy of indexed data arrayTensorgetNonScalar()Returns non-scalar connected component of product.Tensor[]getRange(int from, int to)Returns a range of indexed data specified byfromandto.Tensor[]getScalars()Return scalar subproducts of this product.shortgetStretchId(int i)short[]getStretchIds()shortgetStretchIndexByHash(int hashCode)StructureOfContractionsgetStructureOfContractions()Returns structure of product contractions.StructureOfContractionsHashedgetStructureOfContractionsHashed()Returns hashed structure of product contractions.java.util.Iterator<Tensor>iterator()intsize()Returns size of indexed data.
-
-
-
Field Detail
-
EMPTY_INSTANCE
public static final ProductContent EMPTY_INSTANCE
Singleton for empty instance.
-
-
Method Detail
-
getStructureOfContractionsHashed
public StructureOfContractionsHashed getStructureOfContractionsHashed()
Returns hashed structure of product contractions.- Returns:
- hashed structure of product contractions
-
getStructureOfContractions
public StructureOfContractions getStructureOfContractions()
Returns structure of product contractions.- Returns:
- structure of product contractions
-
getNonScalar
public Tensor getNonScalar()
Returns non-scalar connected component of product.- Returns:
- non-scalar connected component of product
-
getScalars
public Tensor[] getScalars()
Return scalar subproducts of this product.- Returns:
- an array of scalar subproducts of this product
-
getStretchIds
public short[] getStretchIds()
- Returns:
- ids
-
getStretchId
public short getStretchId(int i)
- Parameters:
i- position- Returns:
- id
-
get
public Tensor get(int i)
Returns i-th element of indexed data in this product.- Parameters:
i- position- Returns:
- i-th element of indexed data in this product
-
size
public int size()
Returns size of indexed data.- Returns:
- size of indexed data
-
getRange
public Tensor[] getRange(int from, int to)
Returns a range of indexed data specified byfromandto.- Parameters:
from- from position (inclusive)to- to position (exclusive)- Returns:
- range
-
getDataCopy
public Tensor[] getDataCopy()
Copy of indexed data array- Returns:
- copy of indexed data array
-
iterator
public java.util.Iterator<Tensor> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Tensor>
-
getStretchIndexByHash
public short getStretchIndexByHash(int hashCode)
- Parameters:
hashCode- hashCode- Returns:
- id
-
-
DataMelt 3.0 © DataMelt by jWork.ORG