From eb4d837f58db57b907d19d91847c3bdd9f20ce8f Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Mon, 18 Aug 2025 15:17:58 -0700 Subject: [PATCH] src/radmeth/radmeth.cpp: fixing a bug in which the estimated values for p were used even if the estimation was not done due to insufficient variance or coverage for the given site. This is fixed by just assignign 0 values for such sites after checking that the estimates for p are non-empty --- src/radmeth/radmeth.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/radmeth/radmeth.cpp b/src/radmeth/radmeth.cpp index 2e96a721..89c035a4 100644 --- a/src/radmeth/radmeth.cpp +++ b/src/radmeth/radmeth.cpp @@ -305,6 +305,8 @@ that the design matrix and the proportion table are correctly formatted. const int n_param_bytes = [&] { std::int32_t n_bytes = 0; + if (p_estim_alt.empty()) + p_estim_alt.resize(n_groups, 0.0); for (auto g_idx = 0u; g_idx < n_groups; ++g_idx) { const int n = std::sprintf(cursor, "\t%f", p_estim_alt[g_idx]); cursor += n;