From cdc0e40c86db3284051c4c85d656f8a4b04c52ac Mon Sep 17 00:00:00 2001 From: Thomas Colthurst Date: Tue, 9 Jul 2024 18:01:22 +0000 Subject: [PATCH] Fix build by upgrading CategoricalEmission::incorporate to take a weight --- cxx/emissions/categorical.hh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cxx/emissions/categorical.hh b/cxx/emissions/categorical.hh index 477bf1a..ffad5a3 100644 --- a/cxx/emissions/categorical.hh +++ b/cxx/emissions/categorical.hh @@ -20,14 +20,9 @@ class CategoricalEmission : public Emission { } }; - void incorporate(const std::pair& x) { - ++N; - emission_dists[x.first].incorporate(x.second); - } - - void unincorporate(const std::pair& x) { - --N; - emission_dists[x.first].unincorporate(x.second); + void incorporate(const std::pair& x, double weight = 1.0) { + N += weight; + emission_dists[x.first].incorporate(x.second, weight); } double logp(const std::pair& x) const {