Combinatorial Iterators not working parallel
I was working a full search of Combinatorial caculation, the population about 4000, and I want to find 2 or 3 Combinatorial that satisfy certain condition. I thought RcppAlgos might help, but when I parallel , it not working! example: select_n_shr=2 shrs=1:4000 itc <- comboIter(shrs, select_n_shr)
AllPairs <- foreach(i = itc, .packages = c("data.table","urca","vars"), .combine = 'rbind') %dopar% {
print(i)}
the output:
AllPairs [1] 1 2
Hello @elephann,
In order for a general iterator to be compatible with the foreach package, the iterator must be set up with special classes.
Currently the iterators in RcppAlgos are not compatible with foreach and the like. There is ongoing research to address this topic in later releases.
See for example: https://cran.r-project.org/web/packages/iterators/vignettes/writing.pdf
Thanks, Joseph
Oh! Anyway, thanks, great work!~~