[Rd] Matrix memory layout R vs. C

Luis Carvalho lexcarvalho at gmail.com
Fri Dec 6 16:51:39 CET 2013


> And to be safer on a 64-bit platform
> 
> #define INDEX(i,j) ((i) + rows*(R_xlen_t)(j))
> 
> since rows*j might overflow there.

Shouldn't 'rows' be also a parameter?

#define INDEX(rows,i,j) ((i) + (rows)*((R_xlen_t)(j)))

Cheers,
Luis

-- 
Computers are useless. They can only give you answers.
                -- Pablo Picasso

-- 
Luis Carvalho (Kozure)
lua -e 'print((("lexcarvalho at NO.gmail.SPAM.com"):gsub("(%u+%.)","")))'



More information about the R-devel mailing list