Updates:
        Labels: smichr NeedsReview

Comment #24 on issue 884 by [email protected]: One line matrix and one column matrix confusion
http://code.google.com/p/sympy/issues/detail?id=884

OK, I found this issue after trying to use the Matrix object the other day. There is presently and inconsistent handling of arguments between Matrix and SparseMatrix, the latter allowing `(1,2,3)` as shorthand for `([1, 2, 3])` which is shorthand for `([[1], [2], [3]])`. `Matrix(1,2,3)` just raises an error. I would really like to have Matrix behave like other sympy containers which dispense with the outer brackets:

Set(1,2,3)
Tuple(1,2,3)
Dict((1,2),(3,4)) # in the works

Matrix should behave similarily with the mental mnemonic that the arguments you list are the rows of the Matrix

Matrix(1,2,3) # row 1 is 1, row 2 is 2, row 3 is 3
[1]
[2]
[3]
Matrix([1,2,3]) # row 1 is [1, 2, 3]
[1, 2, 3]
Matrix([1,2,3],[4,5,6]) # two rows
[1, 2, 3]
[4, 5, 6]

The problem is that I don't know how to maintain backward compatibility if this change were made since Matrix([1,2,3]) would be impossible to interpret as being the old shorthand for a column vector or the new method of giving single row with three columns.

Anyway, we can allow Matrix to at least behave like SparseMatrix and allow the Matrix(1,2,3) to work.

https://github.com/sympy/sympy/pull/580

--
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.

Reply via email to