Skip to content

Commit

Permalink
Sometimes::incorporate must pass weight when calling incorporate on i…
Browse files Browse the repository at this point in the history
…ts members!
  • Loading branch information
ThomasColthurst committed Jul 10, 2024
1 parent cef8528 commit 26bbc4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cxx/emissions/sometimes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ class Sometimes : public Emission<SampleType> {
double weight = 1.0) {
this->N += weight;
if (x.first != x.second) {
bb.incorporate(true);
be->incorporate(x);
bb.incorporate(true, weight);
be->incorporate(x, weight);
return;
}
if (can_dirty_equal_clean) {
double p_came_from_be = exp(bb.logp(true) + be->logp(x));
bb.incorporate(true, p_came_from_be);
be->incorporate(x, p_came_from_be);
bb.incorporate(false, 1.0 - p_came_from_be);
bb.incorporate(true, p_came_from_be * weight);
be->incorporate(x, p_came_from_be * weight);
bb.incorporate(false, (1.0 - p_came_from_be) * weight);
return;
}
bb.incorporate(false);
bb.incorporate(false, weight);
}

double logp(const std::pair<SampleType, SampleType>& x) const {
Expand Down

0 comments on commit 26bbc4d

Please sign in to comment.