Hello,

Firstly, I would like to thank the develops of Rcpp for this tool.

Then, here is the function:
-----------------------------
code<-'
NumericVector my_id(id);
NumericMatrix my_link(link);
NumericVector lst(1000);

for (int i=0;i<1000;i++){
for (int j=0;j<1000;j++){
if (my_link(my_id[i],my_id[j])==1){
lst[i]+=1;}}}
return lst;
'
fun<-cxxfunction(signature(id="numeric",link="numeric"),body=code,plugin="Rcpp")
------------------------------

And my question is: How to use multicores to calculate the loop and output the 
final result? 

Thank you.

Best,
Zhao
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to