From cccf9b11c16718bd5c82cc071f4646924d36c6bd Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Fri, 18 Oct 2024 18:38:20 -0500 Subject: [PATCH] Always reset --- src/poped.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/poped.cpp b/src/poped.cpp index 13aaf5d6..7bf1a7ca 100644 --- a/src/poped.cpp +++ b/src/poped.cpp @@ -218,6 +218,9 @@ Rcpp::NumericVector popedMultipleEndpointParam(Rcpp::NumericVector p, Rcpp::IntegerVector modelSwitch, int maxMT, bool optTime=true) { + if (optTime && globalTimeIndexer.isInitialized()) { + globalTimeIndexer.reset(); + } globalTimeIndexer.initialize(modelSwitch, times, optTime); Rcpp::NumericVector ret(p.size()-1+maxMT); std::fill(ret.begin(), ret.end(), globalTimeIndexer.getMaxTime());