optimize when the array is mostly unique.

The matrix columns that are already uniquly determined will not
participate the ring.