From 279098f5b3f9317afbe34e3c8d1f514223ad45bd Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 5 Oct 2023 15:08:44 -0600 Subject: [PATCH] Predict is fast again --- include/barry/model-meat.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/barry/model-meat.hpp b/include/barry/model-meat.hpp index aa43b34ab..00537e396 100644 --- a/include/barry/model-meat.hpp +++ b/include/barry/model-meat.hpp @@ -226,7 +226,10 @@ inline void Model -1) + params_last[i] = params; size_t n_params = params.size(); pset_probs.resize( @@ -1402,10 +1405,7 @@ Model::sample( // Updating the current pset if (pset_probs.size() == 0u) - { update_pset_probs(params, 1u, static_cast(a)); - params_last[a] = params; - } // Sampling an array size_t j = 0u; @@ -1423,7 +1423,6 @@ Model::sample( } else { update_pset_probs(params, 1u, static_cast(a)); - params_last[a] = params; const double * probs = &pset_probs[pset_locations[a]]; while (cumprob < r)