sararselitsky / FastPG

Fast phenograph, CyTOF
Other
25 stars 6 forks source link

Update parallel_louvain.cpp #1

Closed tom-b closed 4 years ago

tom-b commented 4 years ago

Off by 1 index error when making community assignments to NumericVector res. Node index values passed to fastPG should be 1 to N. But res is a normal C++ array indexed from 0 to N-1. Thus, when preparing the res NumericVector, we should remember that node index value $i should be stored in res at $i-1. That way, back in R, users can see the community assignment for $i by looking at $res[$i].