Re: [Rd] array indexes in C

From: Benjamin Tyner <btyner_at_stat.purdue.edu>
Date: Wed 22 Nov 2006 - 01:32:49 GMT


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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Nov 22 18:13:33 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 22 Nov 2006 - 08:30:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.