Skip to content

Commit

Permalink
Harmonise Stan syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
gowerc committed Jun 19, 2024
1 parent 01cf948 commit f251f81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/stan/base/functions.stan
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ functions {
matrix[rows(x), cols(x)] result;
for (i in 1:rows(x)) {
for (j in 1:cols(x)) {
result[i, j] = x[i, j] < 0 ? replacement : y[i, j];
result[i, j] = x[i, j] >= 0 ? y[i, j] : replacement;
}
}
return result;
}
vector if_gte0_else(vector x, vector y, real replacement) {
vector[rows(x)] result;
for (i in 1:rows(x)) {
result[i] = x[i] < 0 ? replacement : y[i];
result[i] = x[i] >= 0 ? y[i] : replacement;
}
return result;
}
Expand Down

0 comments on commit f251f81

Please sign in to comment.