Comment #7 on issue 2222 by asmeurer: Matrix([Matrix, ...]) should check the row length of empty matrices
http://code.google.com/p/sympy/issues/detail?id=2222
nx0 Matrices are used in my integration3 development branch (see https://github.com/asmeurer/sympy/blob/integration3/sympy/integrals/prde.py#L151). As far as I know, this is the only place that they are used presently (I could be wrong, but I think it is so because I had to fix a bug in that branch where 0 dimensional matrices produced a traceback when printing; see also my integration3-backport branch at pull request 131). They are very useful for this particular algorithm, which returns a list of linear constraints in the form of a Matrix. But there may not be any constraints, so in that case it returns the empty Matrix. These are later tacked on to another Matrix (for example, at https://github.com/asmeurer/sympy/blob/integration3/sympy/integrals/prde.py#L174). Allowing zero dimensional matrices makes this easy. Otherwise, I would have to special case it everywhere for the case where there are no constraints.
Now, if we allowed, for example, to tack a mx0 matrix to the end of a nxn matrix, this would do nothing but help mask a bug in the code. So I think we should respect sizes, even if they are zero.
Another thing to consider is that special casing 0 in the matrices code for no better reason than to allow any 0xn Matrix to behave the same is a useless waste, and will just clutter the code.
-- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en.
