Efficient & pythonic check for singular matrix
So based on the inputs here, I’m marking my original code block with the explicit test as the solution: if linalg.cond(x) < 1/sys.float_info.epsilon: i = linalg.inv(x) else: #handle it Surprisingly, the numpy.linalg.inv function doesn’t perform this test. I checked the code and found it goes through all it’s machinations, then just calls the lapack routine … Read more