Avoid computing determinants in numpy involving inf/nan.
Avoid computing determinants in numpy involving inf/nan.

Newer versions of numpy print out a runtime warning and return zero
when encountering a NaN during the determinant computation.  This
leads to incorrect comparisons.
