Skip to content

Commit

Permalink
Merge pull request #78 from probcomp/070924-thomaswc-fixbuild
Browse files Browse the repository at this point in the history
Fix build by upgrading CategoricalEmission::incorporate to take a weight
  • Loading branch information
ThomasColthurst authored Jul 9, 2024
2 parents 208bcf2 + cdc0e40 commit 1276c8f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions cxx/emissions/categorical.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ class CategoricalEmission : public Emission<int> {
}
};

void incorporate(const std::pair<int, int>& x) {
++N;
emission_dists[x.first].incorporate(x.second);
}

void unincorporate(const std::pair<int, int>& x) {
--N;
emission_dists[x.first].unincorporate(x.second);
void incorporate(const std::pair<int, int>& x, double weight = 1.0) {
N += weight;
emission_dists[x.first].incorporate(x.second, weight);
}

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

0 comments on commit 1276c8f

Please sign in to comment.