[R] crossprod(x) vs crossprod(x,x)

Thomas Lumley tlumley at u.washington.edu
Tue Nov 21 16:22:00 CET 2006


On Tue, 21 Nov 2006, Prof Brian Ripley wrote:
> On Tue, 21 Nov 2006, Duncan Murdoch wrote:
>> Have you said what version of R you're using?  I tried your code in an Intel
>> Mac with R 2.4.0, and a Windows machine with R-devel, and saw what Brian saw.
>> Maybe the Power Mac changes this, but that doesn't make a lot of sense.  On
>> the other hand, it could be that an older R release is making unnecessary
>> copies in one case but not the other.
>
> I think this indicates a problem with the BLAS on the PPC MacOS, which is
> very different from the Intel one, AFAIK.  Nothing in R itself could be
> directly responsible for that system-time usage, since R is a user
> process.

I can confirm that this really does happen consistently on the PPC MacOS 
in R 2.4.0, but only when x has a small number of columns.  For 3 columns 
I get pretty much what Robin reported, for 300 columns crossprod(x) is 
slightly faster than crossprod(x,x) and doesn't have the suspicious system 
time.

We have had problems with the OS X PPC BLAS before (in earlier versions).

 	-thomas



More information about the R-help mailing list