Closed
Description
Since LAPACK functions cannot handle 0-by-0 matrices, numpy must explicitly handle those cases. However, while in newer versions of numpy, the inverse is computed correctly, the determinant raises LinAlgError
:
>>> A = numpy.empty((0, 0))
>>> numpy.linalg.inv(A)
array([], shape=(0, 0), dtype=float64)
>>> numpy.linalg.det(A)
LinAlgError: Arrays cannot be empty
Since the determinant of a zero-by-zero matrix is well-defined, a LinAlgError is IMHO wrong, since it indicates a numerics problem rather than the purely technical fact that the backend cannot handle this.
Thus, expected result:
>>> numpy.linalg.det(A)
1.0
Numpy version: 1.11.0 (also present in git master)
Python version: 2.7.12