@Override
public void handleEntry(Entry<CmpVertex, Map<Label, List<CmpVertex>>> entryA, @SuppressWarnings("unused") int threadNo)
{// we are never called with entryA which has been filtered out.
Collection<Entry<Label,List<CmpVertex>>> rowA_collection = matrixInverse.transitionMatrix.get(entryA.getKey()).entrySet();// the "inverse" row
BitVector inputsAcceptedFromA = inputsAccepted.get(entryA.getKey()), inputsRejectedFromA = inputsRejected.get(entryA.getKey());
// Now iterate through states, pre-filtered during construction of matrixInverse but in the same order
// because they are ordered by their IDs and we are using a TreeMap to store 'em.
Iterator<Entry<CmpVertex,Map<Label,List<CmpVertex>>>> stateB_It = matrixInverse.transitionMatrix.entrySet().iterator();
while(stateB_It.hasNext())
{
Entry<CmpVertex,Map<Label,List<CmpVertex>>> stateB = stateB_It.next();// stateB should not have been filtered out by construction of matrixInverse
int currentStatePair = vertexToIntNR(stateB.getKey(),entryA.getKey());
assert prevStatePairNumber < 0 || currentStatePair == prevStatePairNumber+1;prevStatePairNumber=currentStatePair;
// Note that we are iterating state pairs consecutively in an increasing order and
// different threads handle non-intersecting ranges of them, hence most of the time,
// there should be no "cache thrashing".
BitVector B_accepted=inputsAccepted.get(stateB.getKey()),B_rejected=inputsRejected.get(stateB.getKey());
if (!AbstractLearnerGraph.checkCompatible(stateB.getKey(), entryA.getKey(), pairCompatibility) ||// relevant in two cases:
// (A) if we do not filter any states initially; this is the case where there are states
// without outgoing transitions which may be incompatible due to different labelling.
// (B) some pairs of states are recorded as incompatible
intersects(inputsAcceptedFromA,B_rejected) || intersects(inputsRejectedFromA,B_accepted))