Skip to content

Commit

Permalink
The weight is the minimal overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Nov 11, 2023
1 parent 06c3f47 commit a4b68fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/functions/add_mutation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ namespace
fwdpp::ts::table_index_t p,
std::vector<fwdpp::ts::table_index_t> d, double a, double b,
double c)
: left{l}, right{r}, node{n}, parent{p},
descendants{std::move(d)}, node_time{a}, parent_time{b}, tree_span{c}
: left{l}, right{r}, node{n}, parent{p}, descendants{std::move(d)},
node_time{a}, parent_time{b}, tree_span{c}
{
}
};
Expand Down Expand Up @@ -190,7 +190,6 @@ namespace
pop.tables->nodes, n,
tree.parents[n]))
{
throw std::runtime_error("the last arg here should be the minimal overlap");
candidates.emplace_back(
std::max(tree.left, left),
std::min(tree.right, right),
Expand All @@ -200,7 +199,9 @@ namespace
pop.tables
->nodes[tree.parents[n]]
.time,
tree.right - tree.left);
std::min(tree.right, right)
- std::max(left,
tree.left));
}
}
}
Expand Down

0 comments on commit a4b68fc

Please sign in to comment.