Hi Radford,
On 08/25/2010 07:50 PM, Radford Neal wrote:
I've looked at how to speed up the transpose function in R
(ie, t(X)).
The existing code does the work with loops like the following:
for (i = 0; i< len; i++)
REAL(r)[i] = REAL(a)[(i / ncol) + (i % ncol) * nrow];
It
> I've appended below the new version of the modified part of the
> do_transpose function in src/main/array.c.
A quick correction... A "break" went missing from the case INTSXP:
section of the code I posted. Corrected version below.
Radford Neal
--
I've looked at how to speed up the transpose function in R
(ie, t(X)).
The existing code does the work with loops like the following:
for (i = 0; i < len; i++)
REAL(r)[i] = REAL(a)[(i / ncol) + (i % ncol) * nrow];
It seems a bit optimistic to expect a compiler to produce goo