{
int size=gr.getStateNumber()*(gr.getStateNumber()+1)/2;
DoubleMatrix1D result = DoubleFactory1D.dense.make(size);
StatesToConsider filter = LearnerGraphND.ignoreRejectStates;
GDLearnerGraph ndGraph = new GDLearnerGraph(gr,filter, false);
DetermineDiagonalAndRightHandSide ddrhInstance = new GDLearnerGraph.DDRH_default();
for(Entry<CmpVertex,Map<String,List<CmpVertex>>> entryA:ndGraph.matrixForward.transitionMatrix.entrySet())
{
// Now iterate through states
Iterator<Entry<CmpVertex,Map<String,List<CmpVertex>>>> stateB_It = ndGraph.matrixForward.transitionMatrix.entrySet().iterator();
while(stateB_It.hasNext())
{
Entry<CmpVertex,Map<String,List<CmpVertex>>> stateB = stateB_It.next();
int currentStatePair = ndGraph.vertexToIntNR(stateB.getKey(),entryA.getKey());
ddrhInstance.compute(!AbstractLearnerGraph.checkCompatible(entryA.getKey(),stateB.getKey(),gr.incompatibles),entryA.getValue(),stateB.getValue());
result.setQuick(currentStatePair, ddrhInstance.getRightHandSide());
if (stateB.getKey().equals(entryA.getKey())) break; // we only process a triangular subset.
}
}