Re: [R] .Call function crashes initializing matrix

2010-04-11 Thread William Dunlap
> -Original Message- > From: Erik Wright [mailto:eswri...@wisc.edu] > Sent: Sunday, April 11, 2010 1:59 PM > To: William Dunlap > Cc: r help > Subject: Re: [R] .Call function crashes initializing matrix > > Hi Bill, > > You were right, thanks! > &

Re: [R] .Call function crashes initializing matrix

2010-04-11 Thread Erik Wright
Hi Bill, You were right, thanks! Now I have: int size = 5000; double *matrix = (double *) R_alloc(size^2, sizeof(double)); Which works for larger sizes! But now I have discovered a new problem with it. When I go to set the value of the elements it *sometimes* crashes: for (i = 0; i < (size

Re: [R] .Call function crashes initializing matrix

2010-04-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Wright > Sent: Saturday, April 10, 2010 3:23 PM > To: r help > Subject: [R] .Call function crashes initializing matrix > > Hello, > > I have a C function that I call from R