On Mon, 26 Sep 2011, Boris Demeshev wrote:
Allin et al,
95/95 votes from russian students for "Addition is addition" (matrix +
scalar is allowed, order does not matter)
I believe that the crux of the matter, as Allin pointed out, is: assume
that the sum between a matrix and a scalar is defined in the obvious way.
Then, is it possible to find cases when the operaton is _not_ commutative?
After some thinking about it, I believe it isn't possible (but then again,
neutrinos may be faster than light [
http://operaweb.lngs.infn.it/], so you
should never say never). As a consequence, IMO (a \pm b) should be ok for
any matrix/scalar combination.
Actually, I believe that most matrix-oriented languages work more or less
like this: use "§" to indicate an arbitrary binary operator which can
operate elementwise on matrices. Then
A § B
is well defined as long as
[ rows(A) == rows(B) || rows(A) == 1 || rows(B) == 1 ]
&&
[ cols(A) == cols(B) || cols(A) == 1 || cols(B) == 1 ]
which makes it legal, for example, to add a (nx1) column vector to a (1xm)
row vector and obtain an (nxm) matrix (which we cannot do at present, we
need ".+" for that).
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti