id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
3734	[with patch, positive review] inverse() fails for 0 by 0 matrices	cremona	was	"As reported to sage-devel on 2008-07-19:

{{{
Puzzle question:  find a matrix with rank 0 but determinant 1:

sage: type(M)
<type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'>
sage: M.rank()
0
sage: M.determinant()
1.00000000000000

Answer:  M is 0x0:
sage: M
[]
sage: [M.nrows(), M.ncols()]
[0, 0]

Now I am happy with all that (since I am computing regulators of
elliptic curves which may have rank 0).  And with this:
sage: M.is_invertible()
True
but then disappointed by this:
sage: M.inverse()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)

/home/john/sage-3.0.4/<ipython console> in <module>()

/home/john/sage-3.0.4/matrix2.pyx in
sage.matrix.matrix2.Matrix.inverse (sage/matrix/matrix2.c:19932)()

/home/john/sage-3.0.4/matrix0.pyx in
sage.matrix.matrix0.Matrix.__invert__ (sage/matrix/matrix0.c:14525)()

/home/john/sage-3.0.4/matrix0.pyx in
sage.matrix.matrix0.Matrix.__getitem__ (sage/matrix/matrix0.c:3129)()

IndexError: matrix index out of range
}}}

The matrix inversion code should catch this case and return the same matrix.
"	defect	closed	minor	sage-3.1	linear algebra	fixed									
