Skip to content

Commit

Permalink
Do not apply transform to mcounts_from_preserved_nodes in
Browse files Browse the repository at this point in the history
final_population_cleanup.

Fixes #844
  • Loading branch information
molpopgen committed Nov 3, 2021
1 parent fb33387 commit 019671e
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions fwdpy11/src/evolve_population/evolvets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,26 @@ final_population_cleanup(
bool suppress_edge_table_indexing, bool preserve_selected_fixations,
bool remove_extinct_mutations_at_finish, bool simulating_neutral_variants,
bool reset_treeseqs_to_alive_nodes_after_simplification,
std::uint32_t last_preserved_generation,
const std::vector<std::uint32_t> &last_preserved_generation_counts,
std::uint32_t /*last_preserved_generation*/,
const std::vector<std::uint32_t> & /*last_preserved_generation_counts*/,
fwdpy11::DiploidPopulation &pop)
{
index_and_count_mutations(suppress_edge_table_indexing, simulating_neutral_variants,
reset_treeseqs_to_alive_nodes_after_simplification, pop);
check_mutation_table_consistency_with_count_vectors(pop, __FILE__, __LINE__);
if (pop.generation == last_preserved_generation
&& !reset_treeseqs_to_alive_nodes_after_simplification
&& !simulating_neutral_variants)
{
std::transform(begin(pop.mcounts_from_preserved_nodes),
end(pop.mcounts_from_preserved_nodes),
begin(last_preserved_generation_counts),
begin(pop.mcounts_from_preserved_nodes),
std::minus<std::uint32_t>());
}
check_mutation_table_consistency_with_count_vectors(pop, __FILE__, __LINE__);
// The following block was commented out in GitHub PR 845
// in order to fix GitHub issue 844
// if (pop.generation == last_preserved_generation
// && !reset_treeseqs_to_alive_nodes_after_simplification
// && !simulating_neutral_variants)
// {
// std::transform(begin(pop.mcounts_from_preserved_nodes),
// end(pop.mcounts_from_preserved_nodes),
// begin(last_preserved_generation_counts),
// begin(pop.mcounts_from_preserved_nodes),
// std::minus<std::uint32_t>());
// }
// check_mutation_table_consistency_with_count_vectors(pop, __FILE__, __LINE__);
if (!preserve_selected_fixations)
{
auto itr = std::remove_if(
Expand Down

0 comments on commit 019671e

Please sign in to comment.