[Rd] reshape scaling with large numbers of times/rows

Mitchell Skinner mitch at arctur.us
Thu Aug 24 09:26:52 CEST 2006


I wrote:
> It still needs some debugging, to put it mildly
> (doesn't work properly on reals), but the basic idea appears to work.

It works for reals on a 64-bit machine, but not on a 32-bit machine.  I
figure the culprit is this bit of c code:

SET_VECTOR_ELT(wideCol, wideRow, VECTOR_ELT(longCol, rowNum));

It seems like VECTOR_ELT and/or SET_VECTOR_ELT assumes that the vector
elements are word-sized.  If that's right, then they break on (at least)
real and complex vectors, right?  Is there a version of them that works
for arbitrary vectors?  Or am I using them wrong?

In other words, is there some way to do what I want in one line, or do I
have to do a switch(TYPEOF(longCol))?  I was hoping to keep the C code
type-agnostic.

Regards,
Mitch



More information about the R-devel mailing list