Re: [Rd] NUMERIC_POINTER question

2005-09-14 Thread Witold Eryk Wolski
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

Re: [Rd] NUMERIC_POINTER question

2005-09-13 Thread Huntsinger, Reid
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

Re: [Rd] NUMERIC_POINTER question

2005-09-13 Thread Simon Urbanek
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

Re: [Rd] NUMERIC_POINTER question

2005-09-13 Thread Roger Bivand
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

[Rd] NUMERIC_POINTER question

2005-09-13 Thread nwew
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