Recent changes to 372: scalar/matrix addition inconsistenthttps://sourceforge.net/p/maxima/bugs/372/Recent changes to 372: scalar/matrix addition inconsistentenFri, 01 Aug 2003 22:16:17 -0000scalar/matrix addition inconsistenthttps://sourceforge.net/p/maxima/bugs/372/I claim that componentwise addition of scalars to
matrices is wrong.
By default, doallmxops=true.
Define m:matrix\(\[a,b\],\[c,d\]\).
Calculate ratsimp\(m.m^^-1+m\). This yields matrix
\(\[a+1,b\],\[c,d+1\]\). Good.
Now calculate subst\(m,n,n.n^^-1+n\). This yields matrix
\(\[a+1,b+1\],\[c+1,d+1\]\). I believe this is wrong.
Note that this happens even when dotident is not equal
to 1. Only if dotexptsimp=false \(which is a pretty radical
restriction\) does the subst case match the non-subst
case.
As far as I can tell, the only sensible thing for
scalar+matrix to mean is scalar\*identitymatrix + matrix.
I do not believe that componentwise addition of scalar
to matrix is ever useful; if it is, you can always write it
as scalar\*allonesmatrix + matrix.
Note that scalar/matrix \*multiplication\* is a completely
different matter -- componentwise is perfectly
meaningful and useful there.
Maxima 5.9.0Stavros MacrakisFri, 01 Aug 2003 22:16:17 -0000https://sourceforge.nete9e9d73b6cc3ee47b7fa55f5cd9a0fcd27ccfe9f