Hi everyone, I do a lot of work with large variance matrices, and I like to use "crossprod" for speed and to keep everything symmetric, i.e. I often compute "crossprod(Q %*% t(A))" for "A %*% Sigma %*% t(A)", where "Sigma" decomposes as "t(Q) %*% Q". I notice in the code that "crossprod", current definition> crossprodfunction (x, y = x) .Internal(crossprod(x, y)) does not recognise the case where y is the same as x as special. I'd like to extend crossprod to something like> crossprodfunction(x, y = NULL) if (is.null(y)) .Internal(crossprod.symm(x)) else .Internal(crossprod(x, y)) Before I start mesing up my R-1.4.1 installation, does anyone have any thoughts on this? Cheers, Jonathan. -- Jonathan Rougier Science Laboratories Department of Mathematical Sciences South Road University of Durham Durham DH1 3LE tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388 http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "JonR" == Jonathan Rougier <J.C.Rougier@durham.ac.uk> writes:JonR> Hi everyone, I do a lot of work with large variance JonR> matrices, and I like to use "crossprod" for speed and JonR> to keep everything symmetric, i.e. I often compute JonR> "crossprod(Q %*% t(A))" for "A %*% Sigma %*% t(A)", JonR> where "Sigma" decomposes as "t(Q) %*% Q". I notice in JonR> the code that "crossprod", current definition >> crossprod JonR> function (x, y = x) JonR> .Internal(crossprod(x, y)) JonR> does not recognise the case where y is the same as x as special. I'd JonR> like to extend crossprod to something like >> crossprod JonR> function(x, y = NULL) JonR> if (is.null(y)) JonR> .Internal(crossprod.symm(x)) JonR> else JonR> .Internal(crossprod(x, y)) JonR> Before I start mesing up my R-1.4.1 installation, does anyone have any JonR> thoughts on this? Just for clarification: The main point of your suggestion is to pass only half as much data down to C, right? 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._