@Override protected int hash() { return 2311 * argument.hashCode(); }
@Override public int hashCode() { return tensor.hashCode(); } }
@Override protected int hash() { return 17 * argument.hashCode(); }
@Override protected int hash() { return 92837 * argument.hashCode(); }
@Override protected int hash() { return 13 * argument.hashCode(); }
@Override protected int hash() { return 92841 * argument.hashCode(); }
private boolean isGamma5(Tensor t) { return t.hashCode() == gamma5 && t.getClass().equals(SimpleTensor.class); } }
protected final boolean isGammaOrGamma5(final Tensor tensor) { int h = tensor.hashCode(); return (h == gammaName || h == gamma5Name) && tensor.getClass().equals(SimpleTensor.class); }
protected final boolean isGamma(final Tensor tensor) { int h = tensor.hashCode(); return (h == gammaName) && tensor.getClass().equals(SimpleTensor.class); }
protected final boolean isGamma5(final Tensor tensor) { int h = tensor.hashCode(); return (h == gamma5Name) && tensor.getClass().equals(SimpleTensor.class); }
public static int hashWithIndices(final Tensor tensor, final int[] indices) { if (indices.length == 0) return tensor.hashCode(); Arrays.sort(indices); return _hashWithIndices(tensor, indices); }
protected final boolean containsGammaMatrices(final Tensor t) { if (t.getClass().equals(SimpleTensor.class)) return t.hashCode() == gammaName; else for (Tensor p : t) if (containsGammaMatrices(p)) return true; return false; }
public static int nontopologicalHash(final Tensor tensor) { if (tensor.getClass() == SimpleTensor.class) return tensor.hashCode(); int hashCode = tensor.getClass().hashCode(); for (Tensor t : tensor) hashCode = 13 * hashCode + nontopologicalHash(t); return hashCode; } }
public void putNew(Tensor base, Tensor exponent) { ArrayList<PowerNode> newNodes = new ArrayList<>(); ArrayList<PowerNode> nodes = powers.putIfAbsent(base.hashCode(), newNodes); if (nodes != null) { nodes.add(new PowerNode(base, exponent)); } else { newNodes.add(new PowerNode(base, exponent)); } }
private static boolean weakMatch(Tensor t0, Tensor t1) { if (t0.hashCode() != t1.hashCode()) return false; if (t0.getClass() != t1.getClass()) return false; //CHECKSTYLE //This test is highly assotiated with current architecture. //Can fail arter architecture change //BEWARE! if (t0.getIndices().getClass() != t1.getIndices().getClass()) return false; return t0.getIndices().size() == t1.getIndices().size(); }
@Override public IndexMappingProvider create(IndexMappingProvider opu, Tensor from, Tensor to) { if (from.size() != to.size()) return IndexMappingProvider.Util.EMPTY_PROVIDER; for (int i = 0; i < from.size(); ++i) if (from.get(i).hashCode() != to.get(i).hashCode()) return IndexMappingProvider.Util.EMPTY_PROVIDER; return new ProviderSum(opu, from, to); } };
private static boolean matchSimpleTensors(Tensor a, Tensor b) { if (a.getClass() != b.getClass()) return false; if (a.hashCode() != b.hashCode()) return false; if (TensorUtils.isPositiveIntegerPowerOfSimpleTensor(a)) return TensorUtils.isPositiveIntegerPowerOfSimpleTensor(b) && a.get(1).equals(b.get(1)) && matchSimpleTensors(a.get(0), b.get(0)); if (a instanceof TensorField) for (int i = a.size() - 1; i >= 0; --i) if (!IndexMappings.positiveMappingExists(a.get(i), b.get(i))) return false; return true; }