This is the general outline of my code:: main(argc,argv){ ... Rf_initEmbeddedR(argc,argv); ... Test_tryEval("source(test.r)"); ... } ############# # test.r ############# ... dyn.load("toload.so")
tmp <-matrix(data=1,nrow=narray*2,ncol=nclust) .Call("Init",tmp,...) while(...) { criteria <-feval(tmp) if (criteria < criteria.min) tmp.last <- tmp else tmp <- tmp.last ... .Call("replace",tmp,...) } #################################### When I try to recover tmp tmp <- tmp.last I got the modified value of tmp. It means that tmp.last is modified when I modified tmp in the C funciont replace. The program seems to work fine if I change to this:: tmp.last <- tmp*1.0 tmp <- tmp.last*1.0 Any comments ? Alex ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel