Status: Accepted
Owner: ----
CC: krastano...@gmail.com
Labels: Type-Defect Priority-Medium Matrices
New issue 3140 by mrock...@gmail.com: Calling Matrix on a MatrixExpr should
produce a Matrix
http://code.google.com/p/sympy/issues/detail?id=3140
Currently to convert from a matrix expression we use the
method .as_explicit() i.e.
In [1]: X = ImmutableMatrix(3,3, range(9))
In [4]: Y = ImmutableMatrix(ones(3, 3))
In [6]: X*Y
Out[6]:
⎡0 1 2⎤⋅⎡1 1 1⎤
⎢ ⎥ ⎢ ⎥
⎢3 4 5⎥ ⎢1 1 1⎥
⎢ ⎥ ⎢ ⎥
⎣6 7 8⎦ ⎣1 1 1⎦
In [8]: (X*Y).as_explicit()
Out[8]:
⎡3 3 3 ⎤
⎢ ⎥
⎢12 12 12⎥
⎢ ⎥
⎣21 21 21⎦
A user is more likely to try something like the following
In [9]: ImmutableMatrix(X*Y)
This currently produces an empty ImmutableMatrix (so we have a wrong
result).
Calling Matrix or ImmutableMatrix on a MatrixExpr should call as_explicit
or as_mutable.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.