On Sat, 8 Dec 2012, Riccardo (Jack) Lucchetti wrote:
On Fri, 7 Dec 2012, Allin Cottrell wrote:
> In fact, although we could go either way in terms of resolving the
> inconsistency of treatment of X'Y and X'*Y, for X or Y 1x1 and not
> strictly conformable with the other operand, it would be easier (I
> think) to make the latter operation reduce to the former, hence
> (absent any other changes) enforcing the stricter interpretation. If
> that's what we want.
Premise: matrix-oriented languages have a short history, compared to the
tradition in mathematically-formal matrix notation. A few conventions have
been emerging in Gauss, Matlab and Ox, with hansl and mata as the newcomers
in the field. It's perfectly natural that some good ideas become de facto
standards (or almost such, such as the A'B syntax, matlab being the
exception), while at the same time there may be inconsistencies and oddities.
Moreover, hansl has not been "designed": many of its features have been added
incrementally as needed, so quirks may arise just as they do in natural
languages, such as English. Sometimes (like in the case of left- and right-
matrix divisions) changing to conform to what others do is a good idea,
sometimes it isn't. I'd say it depends. IMO, the objective must be to conform
to intuition (and established mathematical conventions) as closely as
possible without infringing consistency and predictability of behaviour.
This said, I think both expressions should be legal: in the expressions
"a'b"
and "a' * b" the 'prime' character actually performs a different
role (as
Allin already said): in the first case, it's shorthand for "transpose and
then multiply"; in the second case, it means "transpose and see what happens
next".
In the interest of common sense, I imagine that everybody agrees that
transposition on a 1x1 matrix should be a no-op which takes precedence on
anything else, so "a' * b" is exactly equivalent to "a*b". For
similar
reasons, "a'b" should be interpreted as "since this is shorthand for
"(a')*b,
just do the same".
I think you're right. That's now the situation in CVS.
Allin Cottrell