X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fmatrix_algebra.py;h=69d9aebcabfd566bf95b797ec20444629c62c14f;hb=d2136d7696349ee48790818ed3927cbd9464e342;hp=bd173eaba835b8b82632587e62fcf6a8e7ec4e44;hpb=77d2d169ac8a3e46030ee98e6bdb45df418a59c2;p=sage.d.git diff --git a/mjo/matrix_algebra.py b/mjo/matrix_algebra.py index bd173ea..69d9aeb 100644 --- a/mjo/matrix_algebra.py +++ b/mjo/matrix_algebra.py @@ -57,7 +57,18 @@ class MatrixAlgebraElement(IndexedFreeModuleElement): | 0 | 0 | +---+---+ + TESTS:: + + sage: MatrixAlgebra(0,ZZ,ZZ).zero() + [] + """ + if self.nrows() == 0 or self.ncols() == 0: + # Otherwise we get a crash or a blank space, depending on + # how hard we work for it. This is what MatrixSpace(..., + # 0) returns. + return "[]" + return table(self.rows(), frame=True)._repr_()