Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

empty matrix

Hello all,

I am currently implementing a numerical algorithm and I need to do a lot of matrix manipulations. I often use submatrices via B[m:,:]. The problem is that this operation occasionally yield 0xn matrices. Unfortunately those are handled like 0x0 matrices so I can't multiply them by vectors:

sage: identity_matrix(RDF, 4)[3:,:] * vector(RDF, 4)
sage: identity_matrix(RDF, 4)[4:,:] * vector(RDF, 4)
TypeError: unsupported operand parent(s) for '*':
'Full MatrixSpace of 0 by 0 dense matrices over Real Double Field'
and 'Vector space of dimension 4 over Real Double Field'

I think that the latter operation should be supported and yielding a vector of length 0. Can I force this kind of behaviour (maybe using numpy instead)?