Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2270 by sherjilo...@gmail.com: Matrix(...) + scalar
http://code.google.com/p/sympy/issues/detail?id=2270
Currently,
In [9]: A
Out[9]:
⎡1 2 3 ⎤
⎢ ⎥
⎢1 4 27⎥
⎢ ⎥
⎣4 5 6 ⎦
In [10]: A + x
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/Users/sherjilozair/sympy/<ipython console> in <module>()
/Users/sherjilozair/sympy/sympy/matrices/matrices.pyc in __add__(self, a)
424
425 def __add__(self,a):
--> 426 return matrix_add(self,a)
427
428 def __radd__(self,a):
/Users/sherjilozair/sympy/sympy/matrices/matrices.pyc in matrix_add(A, B)
2164 def matrix_add(A,B):
2165 """Return A+B"""
-> 2166 if A.shape != B.shape:
2167 raise ShapeError()
2168 alst = A.tolist()
AttributeError: 'Symbol' object has no attribute 'shape'
Atleast we can implement __add__ in Matrix class to make this possible,
such that
A + x is interpreted as A + x*eye(3)
NeedsDecision
--
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.