@Override public boolean equals(final Object obj) { if (obj == null) return false; if (getClass() != obj.getClass()) return false; if (hashCode() != obj.hashCode()) return false; final StructureOfContractionsHashed other = (StructureOfContractionsHashed) obj; if (!freeContraction.equals(other.freeContraction)) return false; return Arrays.equals(contractions, other.contractions); }
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 structureOfContractionsHashed = new StructureOfContractionsHashed(freeContraction, contractions);
continue; int indexName; if (cs.get(index).equals(contraction) && ((indexName = st.getIndices().get(0)) & 0x80000000) == 0) list.add(indexName);
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(); }