Thanks Roger, Simon, Reid,
It's indeed trivial, if you stop to believe that S4 provides any type of
type safety. However, having in mind all the arguments why S4, and that
it was designed in order to incorporate type safety on both the R and C
side I was not expecting that when trying for th
uesday, September 13, 2005 2:26 PM
To: r-devel
Subject: [Rd] NUMERIC_POINTER question
Dear R-developers,
Using .Call I pass a S4 class with e.g. the following class definition:
setClass("mmatrix",representation(
data="matrix")
)
On the "C side" i do
mat = GE
Eryk,
On Sep 13, 2005, at 2:26 PM, nwew wrote:
> printf("%f\n",NUMERIC_POINTER(mat)[1]);
> [...]
> However it prints
> 0.
> if [EMAIL PROTECTED] are integers ( [EMAIL PROTECTED]<-matrix(1:12,3,4) ).
>
> Can anyone explain it to me why?
> I thought that NUMERIC_POINTER makes it clear that i ex
On Tue, 13 Sep 2005, nwew wrote:
> Dear R-developers,
>
> Using .Call I pass a S4 class with e.g. the following class definition:
>
> setClass("mmatrix",representation(
>data="matrix")
> )
>
> On the "C side" i do
> mat = GET_SLOT(vs,install("data"));
> and then:
> printf("%f\n",NUMERIC_POI
Dear R-developers,
Using .Call I pass a S4 class with e.g. the following class definition:
setClass("mmatrix",representation(
data="matrix")
)
On the "C side" i do
mat = GET_SLOT(vs,install("data"));
and then:
printf("%f\n",NUMERIC_POINTER(mat)[1]);
The above print statement produces the co