note that in dedup, I had to change for (j = i - 1; into for (j = n - 1; (namely, only compares with non-skipped contacts), which very slightly changed the dedup behavior regardless of phases, but shouldn't affect correctness
I've also assumed that unknown phases are internally represented as -1, and left conflicting phase info as -2, which hopefully won't affect other things
note that in dedup, I had to change
for (j = i - 1;
intofor (j = n - 1;
(namely, only compares with non-skipped contacts), which very slightly changed the dedup behavior regardless of phases, but shouldn't affect correctnessI've also assumed that unknown phases are internally represented as -1, and left conflicting phase info as -2, which hopefully won't affect other things