matrix multiplication



   >From mailnull  Fri May 17 19:42:59 2013
   Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of math.utexas.edu designates 146.6.25.6 as permitted sender) client-ip=146.6.25.6; envelope-from=maxima-bounces at math.utexas.edu; helo=irongate.mail.utexas.edu;
   From: Zbigniew Komarnicki <cblasius at gmail.com>
   Date: Fri, 17 May 2013 21:41:08 +0200
   Content-Type: text/plain; charset="us-ascii"

   Hello,

   I try multiply matrices, but te result is strange to me, see

   (%i1) matrix_element_mult: ".";
   (%o1)                                  .
   (%i2) matrix([A],[0],[0]) . matrix([W]) . matrix([E]);
				    [ A ]
				    [   ]
   (%o2)                            [ 0 ] . W . E
				    [   ]
				    [ 0 ]

   Why above result is not expanded? If I use braces around (see below) 
   then it works as expected, why? Is it a bug? What is the reason 
   for this behavior?

   (%i3) (matrix([A],[0],[0]) . matrix([W])) . matrix([E]);
				    [ A . W . E ]
				    [           ]
   (%o3)                            [     0     ]
				    [           ]
				    [     0     ]


   This not work
   (%i4) expand(matrix([A],[0],[0]) . matrix([W]) . matrix([E]));
				    [ A ]
				    [   ]
   (%o4)                            [ 0 ] . W . E
				    [   ]
				    [ 0 ]

   Zbigniew

I think that scalarmatrixp is affecting %o2. If you do

scalarmatrixp:false$

then %o2 should agree with %o3.

Leo