@Override public Tensor transform(Tensor t) { return ApplyIndexMapping.applyIndexMappingAutomatically(t, this); }
/** * Applies given mapping of indices to tensor. In contrast to {@link #applyIndexMapping(Tensor, Mapping, int[])} * this method does not assumes that {@code 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. * * @param tensor tensor * @param mapping mapping of indices * @return tensor with renamed indices * @throws IllegalArgumentException if {@code from.length != to.length} */ public static Tensor applyIndexMappingAutomatically(Tensor tensor, Mapping mapping) { return applyIndexMappingAutomatically(tensor, mapping, new int[0]); }
base.summands.add(ApplyIndexMapping.applyIndexMappingAutomatically(toAdd.summands.get(0), mapping, base.forbidden)); continue out;
for (Permutation permutation; cosetRepresentatives.hasNext(); ) { permutation = cosetRepresentatives.next(); sb.put(ApplyIndexMapping.applyIndexMappingAutomatically(t, new Mapping(indicesArray, permutation.permute(indicesArray), permutation.antisymmetry())));