MATH-1167

Use user-specified threshold to allow detection of singular matrix.
[Reported, with fix, by Neil Ireson.]