On 4/15/07, Robert Miller <[EMAIL PROTECTED]> wrote:
> There should be no difference between the matrices [[]] and [],
> especially if they're printing as the same matrix. There is no
> mathematical reason for having a matrix consisting of one row and zero
> columns.

Yes there is.   Most matrix algorithms have as corner cases either
the number of rows or number of columns equal to 0.  Two years
ago John Cremona advocated strongly that I allow both cases, so
SAGE would be much more pleasant to use than, say, LiDIA.  I've done
so, even though in many cases it was a surprising amount of extra work.
For the record, MAGMA takes the same approach:

sage: magma.RMatrixSpace(RationalField(),0,1)
Full KMatrixSpace of 0 by 1 matrices over Rational Field

> Even if there were, there doesn't seem to be a way to create
> a matrix with zero rows and one column.

Yes there is.

sage: a = matrix(QQ,0,1,[]);
sage: a.nrows(), a.ncols()
(0, 1)


>  I'm of the opinion that [[]]
> should be treated as having zero rows *and* zero columns.

No.  It has one row [], which has 0 columns.

Printing doesn't determine objects in SAGE, so that a 0,1 and a 0,0 matrix
print the same way isn't convincing.

 -- William

> On Apr 13, 11:18 am, David Harvey <[EMAIL PROTECTED]> wrote:
> > On Apr 13, 2007, at 2:08 PM, Robert Miller wrote:
> >
> > > sage: A = Matrix( GF(2), [[]] )
> > > sage: B = Matrix( GF(2), [[0]] )
> > > sage: A
> > > []
> > > sage: B
> > > [0]
> > > sage: A.block_sum(B)
> >
> > > [0]
> > > [0]
> > > sage: A = Matrix( GF(2), [] )
> > > sage: A
> > > []
> > > sage: A.block_sum(B)
> > > [0]
> >
> > I don't understand the problem. In all cases, the number of rows of A
> > plus the number of rows of B equals the number of rows of
> > A.block_sum(B), and similarly for columns. What am I missing?
> >
> > david
>
>
> >
>


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to