Documentation of 'cc.redberry.core.tensor.ApplyIndexMapping' Java class
ApplyIndexMapping
cc.redberry.core.tensor

Class ApplyIndexMapping



  • public final class ApplyIndexMapping
    extends java.lang.Object
    Static methods to rename indices of tensors.
    Since:
    1.0
    • Constructor Detail

      • ApplyIndexMapping

        public ApplyIndexMapping()
    • Method Detail

      • renameDummy

        public static Tensor renameDummy(Tensor tensor,
                                         int[] forbiddenNames,
                                         int[] allowedDummiesNames)
        Renames dummy indices of tensor prohibiting some dummy index to be equal to one of the specified forbidden indices.
        Parameters:
        tensor - tensor
        forbiddenNames - forbidden indices names
        allowedDummiesNames - array of allowed dummies names
        Returns:
        tensor with renamed dummies
      • renameDummy

        public static Tensor renameDummy(Tensor tensor,
                                         int[] forbiddenNames,
                                         TIntHashSet added)
        Renames dummy indices of tensor prohibiting some dummy index to be equal to one of the specified forbidden indices.
        Parameters:
        tensor - tensor
        forbiddenNames - forbidden indices names
        added - set which will be added by generated dummy indices
        Returns:
        tensor with renamed dummies
      • renameDummy

        public static Tensor renameDummy(Tensor tensor,
                                         int[] forbiddenNames)
        Renames dummy indices of tensor prohibiting some dummy index to be equal to one of the specified forbidden indices.
        Parameters:
        tensor - tensor
        forbiddenNames - forbidden indices names
        Returns:
        tensor with renamed dummies
      • optimizeDummies

        public static Tensor optimizeDummies(Tensor t)
        Minimizes total dummies count.
        Parameters:
        t - tensor
        Returns:
        result
      • applyIndexMappingAutomatically

        public static Tensor applyIndexMappingAutomatically(Tensor tensor,
                                                            Mapping mapping)
        Applies given mapping of indices to tensor. In contrast to applyIndexMapping(Tensor, Mapping, int[]) this method does not assumes that from indices matches exactly free indices of tensor: if some free index of specified tensor does not present in map, then it will be mapped on itself; if some index present in map, but does not present in free indices of tensor, then this mapping rule will be ignored.
        Parameters:
        tensor - tensor
        mapping - mapping of indices
        Returns:
        tensor with renamed indices
        Throws:
        java.lang.IllegalArgumentException - if from.length != to.length
      • applyIndexMappingAutomatically

        public static Tensor applyIndexMappingAutomatically(Tensor tensor,
                                                            Mapping mapping,
                                                            int[] forbidden)
        Applies given mapping of indices to tensor. In contrast to applyIndexMapping(Tensor, Mapping, int[]) this method does not assumes that from indices matches exactly free indices of tensor: if some free index of specified tensor does not present in map, then it will be mapped on itself; if some index present in map, but does not present in free indices of tensor, then this mapping rule will be ignored.
        Parameters:
        tensor - tensor
        mapping - mapping of indices
        forbidden - forbidden indices names
        Returns:
        tensor with renamed indices
        Throws:
        java.lang.IllegalArgumentException - if from.length != to.length
      • applyIndexMapping

        public static Tensor applyIndexMapping(Tensor tensor,
                                               Mapping mapping)
        Applies specified mapping of indices to tensor.
        Parameters:
        tensor - tensor
        mapping - mapping of indices
        Returns:
        tensor with renamed indices
      • applyIndexMapping

        public static Tensor applyIndexMapping(Tensor tensor,
                                               Mapping mapping,
                                               int[] forbidden)
        Applies specified mapping of indices to tensor preventing some dummy index to be equal to one of the specified forbidden indices.
        Parameters:
        tensor - tensor
        mapping - mapping of indices
        forbidden - forbidden indices
        Returns:
        tensor with renamed indices
      • applyIndexMappingAndRenameAllDummies

        public static Tensor applyIndexMappingAndRenameAllDummies(Tensor tensor,
                                                                  Mapping mapping,
                                                                  int[] allowedDummies)
      • renameIndicesOfFieldsArguments

        public static Tensor renameIndicesOfFieldsArguments(Tensor tensor,
                                                            TIntSet forbidden)

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.