{
final int [] incompatiblePairs = new int[getPairNumber()];for(int i=0;i<incompatiblePairs.length;++i) incompatiblePairs[i]=PAIR_OK;
final int pairsNumber = findIncompatiblePairs(incompatiblePairs,ThreadNumber);
LSolver solver = buildMatrix_internal(incompatiblePairs, pairsNumber, ThreadNumber,ddrh);
solver.solve(ThreadNumber);
solver.freeAllButResult();// deallocate memory before creating a large array.
double statePairScores[] = new double[incompatiblePairs.length];
// now fill in the scores in the array.
for(int i=0;i<incompatiblePairs.length;++i)
if (incompatiblePairs[i] >=0) statePairScores[i]=solver.j_x[incompatiblePairs[i]];
else statePairScores[i]=incompatiblePairs[i];// PAIR_INCOMPATIBLE