Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from nlmixr2/91-initialize-all-variables-to-na…
Browse files Browse the repository at this point in the history
…-when-declaring-them-doubles

doubles are declared as NA_REAL
  • Loading branch information
mattfidler authored Apr 9, 2024
2 parents cfeb768 + 09b0186 commit c17ceaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Added a evid suffix of 60 for cases where evid=2 adds an on event

* Initialize all variables to `NA`

# rxode2parse 2.0.18

* Removed linear compartment solutions with gradients from rxode2parse
Expand Down
8 changes: 4 additions & 4 deletions src/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static inline void printParamLags(char *buf, int *j) {
sAppendN(&sbOut, "#define last_", 13);
doDot(&sbOut, buf);
sAppend(&sbOut, "1(x) _getParCov(_cSub, _solveData, %d, (&_solveData->subjects[_cSub])->n_all_times - 1)\n", *j);

sAppendN(&sbOut, "#undef lead_", 12);
doDot(&sbOut, buf);
sAppendN(&sbOut, "1\n", 2);
Expand All @@ -169,14 +169,14 @@ static inline void printParamLags(char *buf, int *j) {

sAppendN(&sbOut, "#undef lag_", 11);
doDot(&sbOut, buf);
sAppendN(&sbOut, "1\n", 2);
sAppendN(&sbOut, "1\n", 2);
sAppendN(&sbOut, "#define lag_", 12);
doDot(&sbOut, buf);
sAppend(&sbOut, "1(x) _getParCov(_cSub, _solveData, %d, (&_solveData->subjects[_cSub])->idx - 1)\n", *j);

sAppendN(&sbOut, "#undef lag_", 11);
doDot(&sbOut, buf);
sAppendN(&sbOut, "\n", 1);
sAppendN(&sbOut, "\n", 1);
sAppendN(&sbOut, "#define lag_", 12);
doDot(&sbOut, buf);
sAppend(&sbOut, "(x,y) _getParCov(_cSub, _solveData, %d, (&_solveData->subjects[_cSub])->idx - (y))\n", *j);
Expand Down Expand Up @@ -219,7 +219,7 @@ static inline void printDoubleDeclaration(char *buf) {
!strcmp("rx_hi_", buf) || !strcmp("rx_low_", buf)){
sAppendN(&sbOut, "__", 2);
}
sAppendN(&sbOut, ";\n", 2);
sAppendN(&sbOut, " = NA_REAL;\n", 12);
}

static inline void printVoidDeclaration(char *buf) {
Expand Down

0 comments on commit c17ceaa

Please sign in to comment.