Comment #17 on issue 2106 by mipavelka: Matrix of shape (1,1) and a number
can't be added
http://code.google.com/p/sympy/issues/detail?id=2106
reply to comment 14:
It would make sense to define the A*B operation (where A and B are Matrix
instances) as
"If dimensions of neighbouring indeces of A and B match, do the dot
product. Tensor product otherwise."
I think that the * would not be defined precisely otherwise.
It also works in SymPy like that:
(1) (1 1 1) (1) (1) (1 1)
(1) * (1 1 1) = (1 1 1) but (1 1 1) * (1) = (3) or (1) * (1 1) = (1 1)
(1) (1 1 1) (1) (1) (1 1)
Then, if the SymPy * operator should have such behavior it should return
the dot product in the case row vector * column vector, i.e. a scalar. Of
course it gives a 1x1 matrix as result of matrix multiplication.
That it would be nice to have 1x1 matrices compatible with scalars. At
least the + and * operators could be able to handle 1x1 matrix <-> scalar
conversion implicitely.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@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.