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(); }
for (i = 1; i <= fromContent.size(); ++i) if (i == fromContent.size() || !fromContent.getStructureOfContractionsHashed().get(i).equals(fromContent.getStructureOfContractionsHashed().get(i - 1))) { if (i - 1 != begin) stretches.add(new Pair(fromContent.getRange(begin, i), toContent.getRange(begin, i)));
Product product = (Product) tensor; ProductContent pc = product.getContent(); if (pc.size() == 1) { int dataHash = _hashWithIndices(pc.get(0), indices); return product.getFactor().isOneOrMinusOne() for (int i = pc.size() - 1; i >= 0; --i) hash += HashFunctions.JenkinWang32shift((int) pc.getStretchId(i)) * _hashWithIndices(pc.get(i), indices); return hash;
int i = 0, sizeOfComponent = content.size(); for (; i < sizeOfComponent; ++i) if (isLeviCivita(content.get(i), leviCivita))
IntArrayList toRemvoe = new IntArrayList(); Tensor current; int size = content.size(); for (index = 0; index < size; ++index) { current = content.get(index);