On Tue, 18 Apr 2017, Sven Schreiber wrote:
Hi,
not sure if at some earlier stage an error should be thrown:
<hansl>
matrix m1 = {}
eval m1' # gives "empty matrix"
eval mshape(m1, 2, 3) # gives "NULL matrix"
eval transp( mshape(m1, 2, 3) ) # gives syntax error
</hansl>
In particular, perhaps mshape() should be illegal on an empty matrix. Or
alternatively, perhaps it should be filled with NAs.
I don't like this very much. The only algebraically sensible meaning I can
attach to an empty matrix comes from viewing a matrix as a collection of
vectors, and therefore as a (possibly redundant) basis for a vector space.
An empty matrix, then, would simply be an empty set. Filling a matrix with
NAs, or whatever, would have a competely different meaning; if we adhere
to this interpretation, it'd be better to fill it with zeros.
But I believe that the most sensible outcome of "mshaping" an empty matrix
would be another empty matrix.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------