molpopgen / fwdpp

fwdpp is a C++ template library for implementing efficient forward-time population genetic simulations
http://fwdpp.readthedocs.io
GNU General Public License v3.0
27 stars 11 forks source link

Mutation recycling from tree sequences #234

Closed molpopgen closed 4 years ago

molpopgen commented 4 years ago

The current implementation of fwdpp::ts::make_mut_queue is O(NlogN), but it can be O(N). The sorting step is unnecessary. Instead, we can simply use the input data to mark the mindexes vector with a value like UINT_MAX, and we can then add all value != UINT_MAX to the output.