[Rd] array indexes in C
Benjamin Tyner
btyner at stat.purdue.edu
Wed Nov 22 02:32:49 CET 2006
Hin-Tak & Tamas,
For example, see what I've done in
http://www.stat.purdue.edu/~btyner/postage_0.1-1.tar.gz
I am by no means a C guru but it works with my compiler. The relevant
lines are
(in postage.c:)
void postage(int *lambda, int *D, int *tau, int r[*tau][*D])
{
(in postage.R:)
r <- .C("postage",
as.integer(lambda),
as.integer(D),
as.integer(tau0),
r = integer(tau0 * D),
PACKAGE="postage")$r
More information about the R-devel
mailing list