From 66afaf581bffe13b5d77e2ff0ecdb3f17346920a Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Sat, 12 Oct 2024 17:18:14 -0500 Subject: [PATCH 1/2] slight refactor of REG 3 --- inst/models/evtools.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/inst/models/evtools.cpp b/inst/models/evtools.cpp index a11329b1..e9fc72a2 100644 --- a/inst/models/evtools.cpp +++ b/inst/models/evtools.cpp @@ -21,11 +21,8 @@ REG = 1, Until = 24*8 $PKMODEL cmt = "DEPOT CENT", depot = TRUE -$PREAMBLE -reg.init(self); - $PK -if(NEWIND < 1) reg.init(self); +if(NEWIND <= 1) reg.init(self); double CL = exp(log(TVCL) + 0.75*log(WT/70) + ETA(1)); double V = exp(log(TVV) + log(WT/70) + ETA(2)); @@ -53,7 +50,6 @@ if(REG==2) { } if(REG==3) { - reg.init(self); reg.amt(Amt); reg.cmt(1); reg.rate(Rate); From 54563f09e3889e96c739308e6f87ff5ae6d7af42 Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Sat, 12 Oct 2024 17:21:48 -0500 Subject: [PATCH 2/2] check REG when calling init() --- inst/models/evtools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/models/evtools.cpp b/inst/models/evtools.cpp index e9fc72a2..bc152384 100644 --- a/inst/models/evtools.cpp +++ b/inst/models/evtools.cpp @@ -22,7 +22,7 @@ REG = 1, Until = 24*8 $PKMODEL cmt = "DEPOT CENT", depot = TRUE $PK -if(NEWIND <= 1) reg.init(self); +if(REG==3 && NEWIND <= 1) reg.init(self); double CL = exp(log(TVCL) + 0.75*log(WT/70) + ETA(1)); double V = exp(log(TVV) + log(WT/70) + ETA(2));