From 27154e7d573284c6a7ef5e57d44cd52581e62e0b Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Mon, 11 Sep 2023 19:00:32 -0500 Subject: [PATCH] move out updateExtraDoseGlobals --- src/par_solve.cpp | 6 +++++- src/rxode2_df.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/par_solve.cpp b/src/par_solve.cpp index 5bed97e85..e15852e79 100644 --- a/src/par_solve.cpp +++ b/src/par_solve.cpp @@ -948,7 +948,7 @@ extern "C" void handleSSinf8_iter(double *yp, } extern "C" void updateExtraDoseGlobals(rx_solving_options_ind* ind); -#define handleSS(neq, BadDose,InfusionRate,dose, yp, xout, xp, id, i, nx, istate, op, ind, u_inis, ctx) handleSSGen(neq, BadDose,InfusionRate,dose, yp, xout, xp, id, i, nx, istate, op, ind, u_inis, ctx, solveWith1Pt_ode, handleSSbolus_iter, solveSSinf_iter, handleSSinf8_iter, updateExtraDoseGlobals); +#define handleSS(neq, BadDose,InfusionRate,dose, yp, xout, xp, id, i, nx, istate, op, ind, u_inis, ctx) handleSSGen(neq, BadDose,InfusionRate,dose, yp, xout, xp, id, i, nx, istate, op, ind, u_inis, ctx, solveWith1Pt_ode, handleSSbolus_iter, solveSSinf_iter, handleSSinf8_iter); //================================================================================ @@ -1028,6 +1028,7 @@ extern "C" void ind_indLin0(rx_solve *rx, rx_solving_options *op, int solveid, } if (i+1 != nx) memcpy(getSolve(i+1), yp, neq[0]*sizeof(double)); calc_lhs(neq[1], xout, getSolve(i), ind->lhs); + updateExtraDoseGlobals(ind); ind->slvr_counter[0]++; // doesn't need do be critical; one subject at a time. } } @@ -1187,6 +1188,7 @@ extern "C" void ind_liblsoda0(rx_solve *rx, rx_solving_options *op, struct lsoda } if (i+1 != nx) memcpy(getSolve(i+1), yp, neq[0]*sizeof(double)); calc_lhs(neq[1], xout, getSolve(i), ind->lhs); + updateExtraDoseGlobals(ind); ind->slvr_counter[0]++; // doesn't need do be critical; one subject at a time. /* for(j=0; jsolve[neq[0]*i]; it will be the prior values if (i+1 != ind->n_all_times) memcpy(getSolve(i+1), yp, neq[0]*sizeof(double)); calc_lhs(neq[1], xout, getSolve(i), ind->lhs); + updateExtraDoseGlobals(ind); } } ind->solveTime += ((double)(clock() - t0))/CLOCKS_PER_SEC; @@ -1811,6 +1814,7 @@ extern "C" void ind_dop0(rx_solve *rx, rx_solving_options *op, int solveid, int /* for(j=0; jlhs); + updateExtraDoseGlobals(ind); } } ind->solveTime += ((double)(clock() - t0))/CLOCKS_PER_SEC; diff --git a/src/rxode2_df.cpp b/src/rxode2_df.cpp index 62bdc773e..d0739712c 100644 --- a/src/rxode2_df.cpp +++ b/src/rxode2_df.cpp @@ -362,6 +362,7 @@ extern "C" SEXP rxode2_df(int doDose0, int doTBS) { } if (nlhs){ calc_lhs(neq[1], curT, getSolve(i), ind->lhs); + updateExtraDoseGlobals(ind); } if (subsetEvid == 1){ if (isObs(evid) && evid >= 10) continue;