Re: [Rd] Strange behavior of C compiled program

2009-02-09 Thread Christophe Genolini
Thanks, that was a stupid mistake (I did not know that this is so important). So I still have a problem realy more complex and I do not know was is wrong. I am running a .C procedure in a R loop. After 4, 5 or sometimes 6 call to the C procedure, Rgui crash (it closes asking me if I want to

Re: [Rd] Strange behavior of C compiled program

2009-02-09 Thread Duncan Murdoch
On 09/02/2009 4:05 AM, Christophe Genolini wrote: Thanks, that was a stupid mistake (I did not know that this is so important). So I still have a problem realy more complex and I do not know was is wrong. I am running a .C procedure in a R loop. After 4, 5 or sometimes 6 call to the C

[Rd] Strange behavior of C compiled program

2009-02-08 Thread Christophe Genolini
Hi the list, I need to include some C code in R, but the behavior of the C code is strange : Here is my code : --- 8 --- Rprintf(\n mTraj=%f mClus=%f,mTraj[i+nbId*c],mClustersCenter[j+nbClusters*c]); Rprintf(\nDistA=%d Tmp=%d,dist,tmp); tmp = mTraj[i+nbId* c] -

Re: [Rd] Strange behavior of C compiled program

2009-02-08 Thread Mathieu Ribatet
Hi Christophe, The problem might be that you used %d when printing. I guess that your variables dist and tmp are double so you have to use %f instead. Best, Mathieu Le dimanche 08 février 2009 à 23:37 +0100, Christophe Genolini a écrit : Hi the list, I need to include some C code in R, but