Skip to content

Commit

Permalink
Replace int with INT
Browse files Browse the repository at this point in the history
  • Loading branch information
rstub committed Oct 10, 2023
1 parent 9c9402b commit 29ce7b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/include/dqrng_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ inline VEC replacement_prob(dqrng::random_64bit_generator &rng, INT n, INT size,
std::generate(result.begin(), result.end(),
[&n, &prob, &max_prob, &rng, &offset] () {
while (true) {
int index = rng(n);
INT index = rng(n);
if (dqrng::uniform01(rng()) < prob[index] / max_prob)
return index + offset;
}
Expand All @@ -65,9 +65,9 @@ inline VEC replacement_alias(dqrng::random_64bit_generator &rng, INT n, INT size
high.push(i);
}
while(!low.empty() && !high.empty()) {
int l = low.front();
INT l = low.front();
low.pop();
int h = high.front();
INT h = high.front();
alias[l] = h;
p[h] = (p[h] + p[l]) - 1.0;
if (p[h] < 1.0) {
Expand Down

0 comments on commit 29ce7b4

Please sign in to comment.