Skip to content

Commit

Permalink
candidate fix for #639
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Jan 24, 2021
1 parent 1fcbaac commit a7abc47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions fwdpy11/headers/fwdpy11/evolvets/simplify_tables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ namespace fwdpy11
std::vector<fwdpp::ts::table_index_t> &alive_at_last_simplification,
fwdpp::ts::std_table_collection &tables, SimplificationState &simplifier_state,
fwdpp::ts::edge_buffer &new_edge_buffer, const bool preserve_selected_fixations,
const bool simulating_neutral_variants, const bool suppress_edge_table_indexing)
const bool simulating_neutral_variants, const bool suppress_edge_table_indexing,
const bool reset_treeseqs_to_alive_nodes_after_simplification)
{
// As of 0.8.0, we do not need to sort edges!
fwdpp::ts::sort_mutation_table(tables);
Expand Down Expand Up @@ -93,7 +94,7 @@ namespace fwdpy11
return rv;
}
pop.tables->build_indexes();
if (pop.tables->preserved_nodes.empty())
if (pop.tables->preserved_nodes.empty() || reset_treeseqs_to_alive_nodes_after_simplification)
{
fwdpp::ts::count_mutations(tables, pop.mutations, pop.alive_nodes,
pop.mcounts, mcounts_from_preserved_nodes);
Expand Down
3 changes: 2 additions & 1 deletion fwdpy11/src/evolve_population/with_tree_sequences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ simplification(
alive_at_last_simplification,
*pop.tables, simplifier_state, new_edge_buffer,
preserve_selected_fixations, simulating_neutral_variants,
suppress_edge_table_indexing);
suppress_edge_table_indexing,
reset_treeseqs_to_alive_nodes_after_simplification);
if (pop.mcounts.size() != pop.mcounts_from_preserved_nodes.size())
{
throw std::runtime_error("evolvets: count vector size mismatch after "
Expand Down

0 comments on commit a7abc47

Please sign in to comment.