public ProductsBijectionsPort(ProductContent fromContent, ProductContent targetContent) { //this.targetContent = targetContent; //this.fromContent = fromContent; this.targetFContractions = targetContent.getStructureOfContractions(); this.fromFContractions = fromContent.getStructureOfContractions(); this.fromContractions = fromFContractions.contractions; this.targetContractions = targetFContractions.contractions; int[] seeds = new int[fromFContractions.componentCount]; Arrays.fill(seeds, -1); for (int i = 0; i < fromFContractions.components.length; ++i) if (seeds[fromFContractions.components[i]] == -1) seeds[fromFContractions.components[i]] = i; this.seeds = seeds; this.fromData = fromContent.getRange(0, fromContent.size()); this.targetData = targetContent.getRange(0, targetContent.size()); this.planter = new SeedPlanter(); }
/** * Creates partition of graph (or equivalently the product of indexed tensors) specified by {@link ProductContent} * taking into account edges (dummy indices) of specified {@link IndexType}. * * @param productContent {@link ProductContent} representing the graph * @param type type of edges to be taken into account in partition */ public PrimitiveSubgraphPartition(ProductContent productContent, IndexType type) { this.pc = productContent; this.fcs = pc.getStructureOfContractions(); this.size = pc.size(); this.type = type; this.used = new BitArray(size); this.partition = calculatePartition(); }
StructureOfContractions sc = pc.getStructureOfContractions();
StructureOfContractions fs = content.getStructureOfContractions(); sizeOfComponent = epsPositions.size();
@Override protected Tensor transformLine(ProductOfGammas pg, IntArrayList modifiedElements) { assert pg.g5Positions.size() == 0 || (pg.g5Positions.size() == 1 && pg.g5Positions.first() == pg.length - 1) : "G5s are not simplified"; int length = pg.length; if (pg.g5Positions.size() == 1) --length; if (length <= 1) return null; ProductContent pc = pg.pc; StructureOfContractions st = pc.getStructureOfContractions(); Gamma[] gammas = new Gamma[length]; for (int i = 0; i < length; i++) { Tensor gamma = pc.get(pg.gPositions.get(i)); gammas[i] = new Gamma(gamma, gamma.getIndices().get(metricType, 0), getContraction(pg.gPositions.get(i), pc, st)); } Tensor ordered = orderArray(gammas); if (ordered == null) return null; if (pg.g5Positions.size() == 1) { Tensor g5 = pc.get(pg.gPositions.get(pg.g5Positions.first())); if (ordered instanceof Sum) ordered = multiplySumElementsOnFactorAndResolveDummies((Sum) ordered, g5); else ordered = multiplyAndRenameConflictingDummies(ordered, g5); } return ordered; }
int offset = product.sizeOfIndexlessPart(); ProductContent pc = product.getContent(); StructureOfContractions st = pc.getStructureOfContractions();