private int calculateHash() { int result; if (factor == Complex.ONE || factor == Complex.MINUS_ONE) result = 0; //important for -a.hash() == a.hash() else result = factor.hashCode(); for (Tensor t : indexlessData) result = result * 31 + t.hashCode(); for (Tensor t : data) result = result * 17 + t.hashCode(); if (factor == Complex.MINUS_ONE && size() == 2) return result; return result - 79 * getContent().getStructureOfContractionsHashed().hashCode(); }
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)));
return IndexMappingProvider.Util.EMPTY_PROVIDER; ProductContent fromContent = pfrom.getContent(), toContent = pto.getContent(); if (!fromContent.getStructureOfContractionsHashed().equals(toContent.getStructureOfContractionsHashed())) return IndexMappingProvider.Util.EMPTY_PROVIDER; Tensor[] fromScalars = pfrom.getAllScalarsWithoutFactor(), toScalars = pto.getAllScalarsWithoutFactor();
StructureOfContractionsHashed cs = content.getStructureOfContractionsHashed(); short si = content.getStretchIndexByHash(name); if (si == -1)