private static void assertIntersectionOfTierSubstructuresIsEmpty(IHyperStructure basicGraph, final int tierIndex) throws AssertionError { OpenIntObjectHashMap tierVertices = (OpenIntObjectHashMap) basicGraph.getTiers().get(tierIndex); if (tierVertices.size() == 1) { return; } ICompactTripletsStructure intersection = intersectAll(tierVertices.values()); if (!intersection.isEmpty()) { Helper.prettyPrint(intersection); throw new AssertionError("By the construction rules, intersection of substructure-vertices of a single tier should be an empty substructure"); } }
for (int i = 0; i < tierVertices.size(); i++) IVertex vertex = (IVertex) tierVertices.values().get(i); if (vertex.bothEdgesAreEmpty())
private static void fillVerticesFromLastTier(ObjectArrayList hss, ObjectArrayList structures, OpenIntObjectHashMap verticesFromLastTiers) { IHyperStructure basicGraph = (IHyperStructure) hss.get(0); int tiersCount = basicGraph.getTiers().size(); // Pick any vertex from the last tier of each HS (with the same index for each HS) for(int h = 0; h < hss.size(); h++) { IHyperStructure hs = (IHyperStructure) hss.get(h); IVertex vertexFromTheLastTier = (IVertex) ((OpenIntObjectHashMap) hs.getTiers().get(tiersCount - 1)).values().get(0); verticesFromLastTiers.put(h, vertexFromTheLastTier); ICompactTripletsStructure structure = ((IVertex) verticesFromLastTiers.get(h)).getCTS(); structures.add(structure); } }
/** * * @param hs * @param vertex * @return List of vertices from <code>hs</code> whose substructures has non-empty intersection * with substructure of the <code>vertex</code> argument. */ public static ObjectArrayList findNonEmptyIntersections(IHyperStructure hs, IVertex vertex) { ObjectArrayList result = new ObjectArrayList(); for (int j = 0; j < hs.getTiers().size(); j++) { OpenIntObjectHashMap tierVertices = (OpenIntObjectHashMap) hs.getTiers().get(j); for (int i = 0; i < tierVertices.size(); i++) { IVertex tierVertex = (IVertex) tierVertices.values().get(i); ICompactTripletsStructure clone = ((ICompactTripletsStructure) tierVertex.getCTS().clone()); clone.intersect(vertex.getCTS()); if (!clone.isEmpty()) { result.add(tierVertex); } } } return result; }
IVertex sTierVertex = (IVertex) sTierVertices.values().get(sv);
IVertex prevVertex = (IVertex) prevTier.values().get(0);
prevVertexTierKey = ((IVertex) ((OpenIntObjectHashMap) basicGraph.getTiers().get(j)).values().get(0)).getTripletValue().getTierKey();
IVertex nextTierVertex = (IVertex) nextTier.values().get(s); ICompactTripletsStructure nextTierStructure = (ICompactTripletsStructure) nextTierVertex.getCTS().clone(); nextTierStructure.intersect(lastTierStructure);