From e7698f05dae298b1838a44625bdd21f61d556f2f Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Sun, 7 Apr 2024 00:12:44 -0500 Subject: [PATCH] Different fix that doesn't change random numbers --- src/rxode2_df.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rxode2_df.cpp b/src/rxode2_df.cpp index 07f50a71a..6c6633a31 100644 --- a/src/rxode2_df.cpp +++ b/src/rxode2_df.cpp @@ -355,12 +355,12 @@ extern "C" SEXP rxode2_df(int doDose0, int doTBS) { if (updateErr){ for (j=0; j < errNcol; j++){ // The error pointer is updated if needed - par_ptr[svar[j]] = errs[errNrow*j+min2(kk, errNrow-1)]; + par_ptr[svar[j]] = errs[errNrow*j+kk]; } if ((doDose && evid!= 9) || (evid0 == 0 && isObs(evid)) || (evid0 == 1 && evid==0)){ // Only increment if this is an observation or of this a // simulation that requests dosing information too. - kk++; + kk=min2(kk+1, errNrow-1); } } if (nlhs){