cc.redberry.core.indexmapping
Class IndexMappings
- java.lang.Object
-
- cc.redberry.core.indexmapping.IndexMappings
-
public final class IndexMappings extends java.lang.ObjectCentral public facade of this package. Provides static methods for calculation of mappings between indices.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static booleananyMappingExists(Tensor a, Tensor b)Returnstrueif there is mapping fromaon tensorbor vice versa.static java.lang.Booleancompare1(Tensor u, Tensor v)Returnstrueif tensor u mathematically (not programming) equals to tensor v,falseif they they differ only in the sign andnullotherwise.static MappingsPortcreateBijectiveProductPort(Tensor[] from, Tensor[] to)Creates output port of mappings of two products of tensors represented as arrays of multipliers, where each multiplier offromwill be mapped on the multiplier oftoat the same position.static MappingsPortcreatePort(Tensor from, Tensor to)Creates output port of mappings from tensorfromonto tensorto.static booleanequals(Tensor u, Tensor v)Returnstrueif tensor u mathematically (not programming) equals to tensor v.static java.util.Set<Mapping>getAllMappings(Tensor from, Tensor to)Returns a set of all possible mappings of tensorfromon tensorto.static MappinggetFirst(Tensor from, Tensor to)Returns the first mapping of tensorfromon tensorto.static booleanisZeroDueToSymmetry(Tensor t)Returnstrueif specified tensor is zero in consequence of its symmetries: is both symmetric and asymmetric with respect to some permutation at the same time.static booleanmappingExists(Tensor from, Tensor to)Returnstrueif there is mapping of tensorfromon tensorto.static booleanpositiveMappingExists(Tensor from, Tensor to)Returnstrueif there is positive mapping of tensorfromon tensorto.static MappingsPortsimpleTensorsPort(SimpleTensor from, SimpleTensor to)Creates output port of mappings of two simple tensors and does not take into account the arguments of fields.static booleantestMapping(Mapping mapping, Tensor from, Tensor to)Tests whether specified mapping is a mapping fromfromtensor ontototensor.
-
-
-
Method Detail
-
createPort
public static MappingsPort createPort(Tensor from, Tensor to)
Creates output port of mappings from tensorfromonto tensorto.- Parameters:
from- from tensorto- to tensor- Returns:
- output port of mappings
-
simpleTensorsPort
public static MappingsPort simpleTensorsPort(SimpleTensor from, SimpleTensor to)
Creates output port of mappings of two simple tensors and does not take into account the arguments of fields.- Parameters:
from- from tensorto- to tensor- Returns:
- port of mappings of indices
-
createBijectiveProductPort
public static MappingsPort createBijectiveProductPort(Tensor[] from, Tensor[] to)
Creates output port of mappings of two products of tensors represented as arrays of multipliers, where each multiplier offromwill be mapped on the multiplier oftoat the same position. Such ordering can be obtained viaProductsBijectionsPort. In contrast tocreatePortOfBuffers(cc.redberry.core.tensor.Tensor, cc.redberry.core.tensor.Tensor), this method will fully handles mappings of free indices on contracted ones (like e.g. _i^j -> _k^k).- Parameters:
from- from tensorto- to tensor- Returns:
- port of mappings of indices
-
getFirst
public static Mapping getFirst(Tensor from, Tensor to)
Returns the first mapping of tensorfromon tensorto.- Parameters:
from- from tensorto- to tensor- Returns:
- mapping of indices of tensor
fromon tensorto
-
testMapping
public static boolean testMapping(Mapping mapping, Tensor from, Tensor to)
Tests whether specified mapping is a mapping fromfromtensor ontototensor.- Parameters:
mapping- mappingfrom- tensorfromto- tensorto- Returns:
trueif specified mapping is a mapping fromfromtensor ontototensor andfalsein other case.
-
anyMappingExists
public static boolean anyMappingExists(Tensor a, Tensor b)
Returnstrueif there is mapping fromaon tensorbor vice versa.- Parameters:
a- tensorb- tensor- Returns:
trueif there is mapping fromaon tensorbor vice versa
-
mappingExists
public static boolean mappingExists(Tensor from, Tensor to)
Returnstrueif there is mapping of tensorfromon tensorto.- Parameters:
from- from tensorto- to tensor- Returns:
trueif there is mapping of tensorfromon tensorto
-
positiveMappingExists
public static boolean positiveMappingExists(Tensor from, Tensor to)
Returnstrueif there is positive mapping of tensorfromon tensorto.- Parameters:
from- from tensorto- to tensor- Returns:
trueif there is positivemapping of tensorfromon tensorto
-
equals
public static boolean equals(Tensor u, Tensor v)
Returnstrueif tensor u mathematically (not programming) equals to tensor v.- Parameters:
u- tensorv- tensor- Returns:
trueif specified tensors are mathematically (not programming) equal
-
compare1
public static java.lang.Boolean compare1(Tensor u, Tensor v)
Returnstrueif tensor u mathematically (not programming) equals to tensor v,falseif they they differ only in the sign andnullotherwise.- Parameters:
u- tensorv- tensor- Returns:
truetrueif tensor u mathematically (not programming) equals to tensor v,falseif they they differ only in the sign andnullotherwise
-
isZeroDueToSymmetry
public static boolean isZeroDueToSymmetry(Tensor t)
Returnstrueif specified tensor is zero in consequence of its symmetries: is both symmetric and asymmetric with respect to some permutation at the same time.- Parameters:
t- tensor- Returns:
trueif specified tensor is zero in consequence of its symmetries
-
-
DataMelt 3.0 © DataMelt by jWork.ORG