s-news
[Top] [All Lists]

[S] splus to c

To: s-news@wubios.wustl.edu
Subject: [S] splus to c
From: Dan King <dan_k_10017@yahoo.com>
Date: Mon, 25 Sep 2000 09:37:40 -0700 (PDT)
Sender: owner-s-news@wubios.wustl.edu
Hi, all,

In Splus, how does one pass a 2 dimentional array to a
C subroutine? 

For example, I have a matrix in Splus:

> dim(data)
[1] 845  13

The C function is declared as follows:
void Foo ( float ** something, int *Nrow, int * Ncol,
float * result)

So I call "Foo" this way:

> .C("Foo",as(data,"single"),as(845,"integer"),
as(13,"integer"),as(result,"single"))

Will this work? Is the 'something' variable in the C
routine an array of pointers, or is it just a array
with length (Nrow * Ncol)?

Any suggesting/reference will be greatly appreciated.
Thank you.

Dan

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>