0-extent matrices?

Thomas Lumley thomas@biostat.washington.edu
Thu, 9 Apr 1998 09:27:47 -0700 (PDT)


Is there a good reason not to allow matrix extents to be zero? I have been
writing a function which fits glms under certain linear constraints.  I
fit the model with a reduced set of variables and then transform back to
the original set.  This involves operating on submatrices of the
covariance matrix and subsets of the coefficients. Sometimes these subsets
are empty.  A zero-length subset of the coefficient vector causes no
problems, but a 0x6 submatrix of the covariance matrix won't work with
rbind and cbind.  There appears to be no difficulty in deciding how
standard matrix and array operations should work with a 0x6 matrix and in
fact you might expect that the same C code would usually work.

Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._