Re: [Rd] Confusion regarding allocating Matrices.

2009-10-24 Thread Simon Urbanek
On Oct 24, 2009, at 2:58 PM, Abhijit Bera wrote: Ok I get it. So everytime it does a alloc and copy. I haven't finished the design yet. I'm just thinking about how randomly the data might arrive; its real time data. So I will allocate a large chunk of memory and keep track of when it fills

Re: [Rd] Confusion regarding allocating Matrices.

2009-10-24 Thread Abhijit Bera
Ok I get it. So everytime it does a alloc and copy. I haven't finished the design yet. I'm just thinking about how randomly the data might arrive; its real time data. So I will allocate a large chunk of memory and keep track of when it fills up, once the data exceeds I will alloc and copy the data

Re: [Rd] Confusion regarding allocating Matrices.

2009-10-24 Thread Douglas Bates
On Fri, Oct 23, 2009 at 2:02 PM, Abhijit Bera wrote: > Sorry, I made a mistake while writing the code. The declaration of Data > should have been first. > I still have some doubts: Because you are making some sweeping and incorrect assumptions about the way that the internals of R operate. R al

Re: [Rd] Confusion regarding allocating Matrices.

2009-10-23 Thread Abhijit Bera
Sorry, I made a mistake while writing the code. The declaration of Data should have been first. I still have some doubts: When you say calloc and realloc are you talking about R's C interface Calloc and Realloc or the regular calloc and realloc? I want to feed data directly into a R matrix and g

Re: [Rd] Confusion regarding allocating Matrices.

2009-10-23 Thread Douglas Bates
On Fri, Oct 23, 2009 at 9:23 AM, Douglas Bates wrote: > On Fri, Oct 23, 2009 at 8:39 AM, Abhijit Bera wrote: >> Hi >> >> I'm having slight confusion. > > Indeed. > >> I plan to grow/realloc a matrix depending on the data available in a C >> program. > >> Here is what I'm tried to do: > >> Data=al

Re: [Rd] Confusion regarding allocating Matrices.

2009-10-23 Thread Douglas Bates
On Fri, Oct 23, 2009 at 8:39 AM, Abhijit Bera wrote: > Hi > > I'm having slight confusion. Indeed. > I plan to grow/realloc a matrix depending on the data available in a C > program. > Here is what I'm tried to do: > Data=allocMatrix(REALSXP,3,4); > SEXP Data; Those lines should be in the oth