Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend on dqrng from CRAN again. #305

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@ LazyData: true
Remotes:
mrc-ide/malariaEquilibrium,
mrc-ide/individual
Additional_repositories:
https://mrc-ide.r-universe.dev
Imports:
individual (>= 0.1.16),
malariaEquilibrium (>= 1.0.1),
Rcpp,
statmod,
MASS,
dqrng (>= 0.3.2.2),
dqrng (>= 0.4),
sitmo,
BH,
R6,
Expand Down
6 changes: 3 additions & 3 deletions src/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void Random::prop_sample_bucket(

// all probabilities are the same
if (heavy == n) {
for (auto i = 0; i < size; ++i) {
for (size_t i = 0; i < size; ++i) {
*result = (*rng)((uint64_t)n);
++result;
}
Expand Down Expand Up @@ -121,9 +121,9 @@ void Random::prop_sample_bucket(
}

// sample
for (auto i = 0; i < size; ++i) {
for (size_t i = 0; i < size; ++i) {
size_t bucket = (*rng)((uint64_t)n);
double acceptance = dqrng::uniform01((*rng)());
double acceptance = rng->uniform01();
*result = (acceptance < dividing_probs[bucket]) ? bucket :
alternative_index[bucket];
++result;
Expand Down
Loading