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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "TL" == Thomas Lumley <thomas@biostat.washington.edu> writes:TL> Is there a good reason not to allow matrix extents to be zero? No, I don't think so. And I agree that it would be really useful to have them in circumstances like yours. TL> I have been writing a function which fits glms under certain linear TL> constraints. I fit the model with a reduced set of variables and TL> then transform back to the original set. This involves operating TL> on submatrices of the covariance matrix and subsets of the TL> coefficients. Sometimes these subsets are empty. A zero-length TL> subset of the coefficient vector causes no problems, but a 0x6 TL> submatrix of the covariance matrix won't work with rbind and cbind. TL> There appears to be no difficulty in deciding how standard matrix TL> and array operations should work with a 0x6 matrix and in fact you TL> might expect that the same C code would usually work. Could you look into implementing them? Martin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._