Skip to content

Commit

Permalink
Merge pull request #6 from mrc-ide/mrc-5081
Browse files Browse the repository at this point in the history
Import dust rng headers, with name translation
  • Loading branch information
richfitz authored Feb 22, 2024
2 parents 432b2aa + dd25c89 commit c1b2fa7
Show file tree
Hide file tree
Showing 80 changed files with 9,093 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ RoxygenNote: 7.3.1
URL: https://github.com/mrc-ide/mcstate2
BugReports: https://github.com/mrc-ide/mcstate2/issues
Imports:
R6,
cli
LinkingTo:
cpp11
Suggests:
cpp11,
decor,
mvtnorm,
numDeriv,
pkgload,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Language: en-GB
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Generated by roxygen2: do not edit by hand

export(mcstate_model)
export(mcstate_rng)
export(mcstate_rng_distributed_pointer)
export(mcstate_rng_distributed_state)
export(mcstate_rng_pointer)
export(mcstate_sample)
export(mcstate_sampler_random_walk)
importFrom(R6,R6Class)
importFrom(stats,rnorm)
importFrom(stats,runif)
useDynLib(mcstate2, .registration = TRUE)
81 changes: 81 additions & 0 deletions R/cpp11.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Generated by cpp11: do not edit by hand

mcstate_rng_alloc <- function(r_seed, n_streams, deterministic, is_float) {
.Call(`_mcstate2_mcstate_rng_alloc`, r_seed, n_streams, deterministic, is_float)
}

mcstate_rng_jump <- function(ptr, is_float) {
invisible(.Call(`_mcstate2_mcstate_rng_jump`, ptr, is_float))
}

mcstate_rng_long_jump <- function(ptr, is_float) {
invisible(.Call(`_mcstate2_mcstate_rng_long_jump`, ptr, is_float))
}

mcstate_rng_random_real <- function(ptr, n, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_random_real`, ptr, n, n_threads, is_float)
}

mcstate_rng_random_normal <- function(ptr, n, n_threads, algorithm, is_float) {
.Call(`_mcstate2_mcstate_rng_random_normal`, ptr, n, n_threads, algorithm, is_float)
}

mcstate_rng_uniform <- function(ptr, n, r_min, r_max, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_uniform`, ptr, n, r_min, r_max, n_threads, is_float)
}

mcstate_rng_exponential <- function(ptr, n, r_rate, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_exponential`, ptr, n, r_rate, n_threads, is_float)
}

mcstate_rng_normal <- function(ptr, n, r_mean, r_sd, n_threads, algorithm, is_float) {
.Call(`_mcstate2_mcstate_rng_normal`, ptr, n, r_mean, r_sd, n_threads, algorithm, is_float)
}

mcstate_rng_binomial <- function(ptr, n, r_size, r_prob, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_binomial`, ptr, n, r_size, r_prob, n_threads, is_float)
}

mcstate_rng_nbinomial <- function(ptr, n, r_size, r_prob, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_nbinomial`, ptr, n, r_size, r_prob, n_threads, is_float)
}

mcstate_rng_hypergeometric <- function(ptr, n, r_n1, r_n2, r_k, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_hypergeometric`, ptr, n, r_n1, r_n2, r_k, n_threads, is_float)
}

mcstate_rng_gamma <- function(ptr, n, r_a, r_b, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_gamma`, ptr, n, r_a, r_b, n_threads, is_float)
}

mcstate_rng_poisson <- function(ptr, n, r_lambda, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_poisson`, ptr, n, r_lambda, n_threads, is_float)
}

mcstate_rng_cauchy <- function(ptr, n, r_location, r_scale, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_cauchy`, ptr, n, r_location, r_scale, n_threads, is_float)
}

mcstate_rng_multinomial <- function(ptr, n, r_size, r_prob, n_threads, is_float) {
.Call(`_mcstate2_mcstate_rng_multinomial`, ptr, n, r_size, r_prob, n_threads, is_float)
}

mcstate_rng_state <- function(ptr, is_float) {
.Call(`_mcstate2_mcstate_rng_state`, ptr, is_float)
}

mcstate_rng_pointer_init <- function(n_streams, seed, long_jump, algorithm) {
.Call(`_mcstate2_mcstate_rng_pointer_init`, n_streams, seed, long_jump, algorithm)
}

mcstate_rng_pointer_sync <- function(obj, algorithm) {
invisible(.Call(`_mcstate2_mcstate_rng_pointer_sync`, obj, algorithm))
}

test_rng_pointer_get <- function(obj, n_streams) {
.Call(`_mcstate2_test_rng_pointer_get`, obj, n_streams)
}

test_xoshiro_run <- function(obj) {
.Call(`_mcstate2_test_xoshiro_run`, obj)
}
Loading

0 comments on commit c1b2fa7

Please sign in to comment.