On Fri, 11 Jun 2004, Alex Nu wrote:
>
> Dr. Ripley,
>
> Thanks for your answer, I guest the key is that
> in my code R can't know tmp is being modified.
>
> I couldn't find a duplicate function for the
> R environment. Is there any ?
No. You should be doing this in your C/C++ code.
>
Dr. Ripley,
Thanks for your answer, I guest the key is that
in my code R can't know tmp is being modified.
I couldn't find a duplicate function for the
R environment. Is there any ?
So I could avoid doing tmp.last <-tmp*1.0
Thanks
Alex
--- Prof Brian Ripley <[EMAIL PROTECTED]> w
Without seeing your code for the .Call parts it is impossible for us to
know, but as .Call does not duplicate its arguments (unlike .C), it is
possible for it to change both tmp and a copy of tmp, tmp.last.
So it seems likely there is a bug in your C code if that is not your
intention. The norma
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(...) {