<br><br><div class="gmail_quote">On Sat, Jun 6, 2009 at 9:29 AM, Alan G Isaac <span dir="ltr"><<a href="mailto:aisaac@american.edu">aisaac@american.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 6/6/2009 12:41 AM Charles R Harris apparently wrote:<br>
> Well, one could argue that. The x.T is a member of the dual, hence maps<br>
> vectors to the reals. Usually the reals aren't represented by 1x1<br>
> matrices. Just my [.02] cents.<br>
<br>
</div>Of course that same perspective could<br>
lead you to argue that a M×N matrix<br>
is for mapping N vectors to M vectors,<br>
not for doing matrix multiplication.<br>
<br>
Matrix multiplication produces a<br>
matrix result **by definition**.<br>
Treating 1×1 matrices as equivalent<br>
to scalars is just a convenient anomaly<br>
in certain popular matrix-oriented<br>
languages.<br>
</blockquote><div><br>So is eye(3)*(v.T*v) valid? If (v.T*v) is 1x1 you have incompatible dimensions for the multiplication, whereas if it is a scalar you can multiply eye(3) by it. The usual matrix algebra gets a bit confused here because it isn't clear about the distinction between inner products and the expression v.T*v which is typically used in it's place.  I think the only consistent way around this is to treat 1x1 matrices as scalars, which I believe matlab does,  but then the expression eye(3)*(v.T*v) isn't associative and we lose some checks.<br>
<br>I don't think we can change the current matrix class, to do so would break too much code. It would be nice to extend it with an explicit inner product, but I can't think of any simple notation for it that python would parse.<br>
<br>Chuck<br><br></div></div><br>