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

guard against repeating fixations in sample when removeFixed is false #71

Closed molpopgen closed 7 years ago

molpopgen commented 7 years ago

This fixes a bug for the case where simulations do not remove fixations from gametes during evolution. In this case, taking a sample (using functions in fwdpp/sugar/sampling.hpp) with removeFixed = false leads to duplication of the fixations. This PR addresses that via a call to std::unique and std::vector::erase following the sorting step.