From 4f67d128505409f619fdc7da35aaf196e5a5b16a Mon Sep 17 00:00:00 2001 From: Jason Wood Date: Tue, 5 Aug 2025 13:05:04 +0100 Subject: [PATCH 01/13] adding get_values to CategoricalVariable and making a new function for IntegerVariable --- R/RcppExports.R | 1006 ++++----- R/categorical_variable.R | 9 + R/integer_variable.R | 9 + inst/include/CategoricalVariable.h | 23 +- inst/include/IntegerVariable.h | 18 + inst/include/individual_types.h | 1 + src/RcppExports.cpp | 3251 ++++++++++++++-------------- src/categorical_variable.cpp | 11 + src/integer_variable.cpp | 9 + 9 files changed, 2225 insertions(+), 2112 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index e8f2962..6967dfe 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -1,499 +1,507 @@ -# Generated by using Rcpp::compileAttributes() -> do not edit by hand -# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -create_bitset <- function(size) { - .Call(`_individual_create_bitset`, size) -} - -bitset_copy <- function(b) { - .Call(`_individual_bitset_copy`, b) -} - -bitset_insert <- function(b, v) { - invisible(.Call(`_individual_bitset_insert`, b, v)) -} - -bitset_remove <- function(b, v) { - invisible(.Call(`_individual_bitset_remove`, b, v)) -} - -bitset_clear <- function(b) { - invisible(.Call(`_individual_bitset_clear`, b)) -} - -bitset_size <- function(b) { - .Call(`_individual_bitset_size`, b) -} - -bitset_max_size <- function(b) { - .Call(`_individual_bitset_max_size`, b) -} - -bitset_and <- function(a, b) { - invisible(.Call(`_individual_bitset_and`, a, b)) -} - -bitset_not <- function(b, inplace) { - .Call(`_individual_bitset_not`, b, inplace) -} - -bitset_or <- function(a, b) { - invisible(.Call(`_individual_bitset_or`, a, b)) -} - -bitset_copy_from <- function(a, b) { - invisible(.Call(`_individual_bitset_copy_from`, a, b)) -} - -bitset_xor <- function(a, b) { - invisible(.Call(`_individual_bitset_xor`, a, b)) -} - -bitset_set_difference <- function(a, b) { - invisible(.Call(`_individual_bitset_set_difference`, a, b)) -} - -bitset_sample <- function(b, rate) { - invisible(.Call(`_individual_bitset_sample`, b, rate)) -} - -bitset_sample_vector <- function(b, rate) { - invisible(.Call(`_individual_bitset_sample_vector`, b, rate)) -} - -bitset_to_vector <- function(b) { - .Call(`_individual_bitset_to_vector`, b) -} - -filter_bitset_integer <- function(b, other) { - .Call(`_individual_filter_bitset_integer`, b, other) -} - -filter_bitset_bitset <- function(b, other) { - .Call(`_individual_filter_bitset_bitset`, b, other) -} - -filter_bitset_logical <- function(bitset, other) { - .Call(`_individual_filter_bitset_logical`, bitset, other) -} - -bitset_choose <- function(b, k) { - invisible(.Call(`_individual_bitset_choose`, b, k)) -} - -create_categorical_variable <- function(categories, values) { - .Call(`_individual_create_categorical_variable`, categories, values) -} - -categorical_variable_get_size <- function(variable) { - .Call(`_individual_categorical_variable_get_size`, variable) -} - -categorical_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_categorical_variable_queue_update`, variable, value, index)) -} - -categorical_variable_get_index_of <- function(variable, values) { - .Call(`_individual_categorical_variable_get_index_of`, variable, values) -} - -categorical_variable_get_size_of <- function(variable, values) { - .Call(`_individual_categorical_variable_get_size_of`, variable, values) -} - -categorical_variable_get_categories <- function(variable) { - .Call(`_individual_categorical_variable_get_categories`, variable) -} - -categorical_variable_queue_update_vector <- function(variable, value, index) { - invisible(.Call(`_individual_categorical_variable_queue_update_vector`, variable, value, index)) -} - -categorical_variable_update <- function(variable) { - invisible(.Call(`_individual_categorical_variable_update`, variable)) -} - -categorical_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_categorical_variable_queue_extend`, variable, values)) -} - -categorical_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_categorical_variable_queue_shrink`, variable, index)) -} - -categorical_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_categorical_variable_queue_shrink_bitset`, variable, index)) -} - -create_double_variable <- function(values) { - .Call(`_individual_create_double_variable`, values) -} - -double_variable_get_values <- function(variable) { - .Call(`_individual_double_variable_get_values`, variable) -} - -double_variable_get_values_at_index <- function(variable, index) { - .Call(`_individual_double_variable_get_values_at_index`, variable, index) -} - -double_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_double_variable_get_values_at_index_vector`, variable, index) -} - -double_variable_get_index_of_range <- function(variable, a, b) { - .Call(`_individual_double_variable_get_index_of_range`, variable, a, b) -} - -double_variable_get_size_of_range <- function(variable, a, b) { - .Call(`_individual_double_variable_get_size_of_range`, variable, a, b) -} - -double_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_double_variable_queue_fill`, variable, value)) -} - -double_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_double_variable_queue_update`, variable, value, index)) -} - -double_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_double_variable_queue_update_bitset`, variable, value, index)) -} - -double_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_double_variable_queue_extend`, variable, values)) -} - -double_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_double_variable_queue_shrink`, variable, index)) -} - -double_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_double_variable_queue_shrink_bitset`, variable, index)) -} - -create_event <- function() { - .Call(`_individual_create_event`) -} - -create_targeted_event <- function(size) { - .Call(`_individual_create_targeted_event`, size) -} - -event_base_tick <- function(event) { - invisible(.Call(`_individual_event_base_tick`, event)) -} - -event_base_get_timestep <- function(event) { - .Call(`_individual_event_base_get_timestep`, event) -} - -event_base_set_timestep <- function(event, time) { - invisible(.Call(`_individual_event_base_set_timestep`, event, time)) -} - -event_base_should_trigger <- function(event) { - .Call(`_individual_event_base_should_trigger`, event) -} - -event_schedule <- function(event, delays) { - invisible(.Call(`_individual_event_schedule`, event, delays)) -} - -event_clear_schedule <- function(event) { - invisible(.Call(`_individual_event_clear_schedule`, event)) -} - -event_checkpoint <- function(event) { - .Call(`_individual_event_checkpoint`, event) -} - -event_restore <- function(event, schedule) { - invisible(.Call(`_individual_event_restore`, event, schedule)) -} - -targeted_event_clear_schedule_vector <- function(event, target) { - invisible(.Call(`_individual_targeted_event_clear_schedule_vector`, event, target)) -} - -targeted_event_clear_schedule <- function(event, target) { - invisible(.Call(`_individual_targeted_event_clear_schedule`, event, target)) -} - -targeted_event_get_scheduled <- function(event) { - .Call(`_individual_targeted_event_get_scheduled`, event) -} - -targeted_event_schedule <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule`, event, target, delay)) -} - -targeted_event_queue_shrink_bitset <- function(event, index) { - invisible(.Call(`_individual_targeted_event_queue_shrink_bitset`, event, index)) -} - -targeted_event_queue_shrink <- function(event, index) { - invisible(.Call(`_individual_targeted_event_queue_shrink`, event, index)) -} - -targeted_event_queue_extend <- function(event, n) { - invisible(.Call(`_individual_targeted_event_queue_extend`, event, n)) -} - -targeted_event_queue_extend_with_schedule <- function(event, delays) { - invisible(.Call(`_individual_targeted_event_queue_extend_with_schedule`, event, delays)) -} - -targeted_event_schedule_vector <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_vector`, event, target, delay)) -} - -targeted_event_schedule_multi_delay <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_multi_delay`, event, target, delay)) -} - -targeted_event_schedule_multi_delay_vector <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_multi_delay_vector`, event, target, delay)) -} - -targeted_event_get_target <- function(event) { - .Call(`_individual_targeted_event_get_target`, event) -} - -targeted_event_resize <- function(event) { - invisible(.Call(`_individual_targeted_event_resize`, event)) -} - -targeted_event_checkpoint <- function(event) { - .Call(`_individual_targeted_event_checkpoint`, event) -} - -targeted_event_restore <- function(event, state) { - invisible(.Call(`_individual_targeted_event_restore`, event, state)) -} - -process_listener <- function(event, listener) { - invisible(.Call(`_individual_process_listener`, event, listener)) -} - -process_targeted_listener <- function(event, listener, target) { - invisible(.Call(`_individual_process_targeted_listener`, event, listener, target)) -} - -create_integer_variable <- function(values) { - .Call(`_individual_create_integer_variable`, values) -} - -integer_variable_get_values <- function(variable) { - .Call(`_individual_integer_variable_get_values`, variable) -} - -integer_variable_get_values_at_index <- function(variable, index) { - .Call(`_individual_integer_variable_get_values_at_index`, variable, index) -} - -integer_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_variable_get_values_at_index_vector`, variable, index) -} - -integer_variable_get_index_of_set_vector <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_index_of_set_vector`, variable, values_set) -} - -integer_variable_get_index_of_set_scalar <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_index_of_set_scalar`, variable, values_set) -} - -integer_variable_get_index_of_range <- function(variable, a, b) { - .Call(`_individual_integer_variable_get_index_of_range`, variable, a, b) -} - -integer_variable_get_size_of_set_vector <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_size_of_set_vector`, variable, values_set) -} - -integer_variable_get_size_of_set_scalar <- function(variable, value) { - .Call(`_individual_integer_variable_get_size_of_set_scalar`, variable, value) -} - -integer_variable_get_size_of_range <- function(variable, a, b) { - .Call(`_individual_integer_variable_get_size_of_range`, variable, a, b) -} - -integer_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_integer_variable_queue_fill`, variable, value)) -} - -integer_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_integer_variable_queue_update`, variable, value, index)) -} - -integer_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_integer_variable_queue_update_bitset`, variable, value, index)) -} - -integer_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_integer_variable_queue_extend`, variable, values)) -} - -integer_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_integer_variable_queue_shrink`, variable, index)) -} - -integer_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_integer_variable_queue_shrink_bitset`, variable, index)) -} - -fixed_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate, destination_probabilities) { - .Call(`_individual_fixed_probability_multinomial_process_internal`, variable, source_state, destination_states, rate, destination_probabilities) -} - -multi_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate_variable, destination_probabilities) { - .Call(`_individual_multi_probability_multinomial_process_internal`, variable, source_state, destination_states, rate_variable, destination_probabilities) -} - -multi_probability_bernoulli_process_internal <- function(variable, from, to, rate_variable) { - .Call(`_individual_multi_probability_bernoulli_process_internal`, variable, from, to, rate_variable) -} - -infection_age_process_internal <- function(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) { - .Call(`_individual_infection_age_process_internal`, state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) -} - -create_double_ragged_variable <- function(values) { - .Call(`_individual_create_double_ragged_variable`, values) -} - -double_ragged_variable_get_values <- function(variable) { - .Call(`_individual_double_ragged_variable_get_values`, variable) -} - -double_ragged_variable_get_values_at_index_bitset <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_values_at_index_bitset`, variable, index) -} - -double_ragged_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_values_at_index_vector`, variable, index) -} - -double_ragged_variable_get_length <- function(variable) { - .Call(`_individual_double_ragged_variable_get_length`, variable) -} - -double_ragged_variable_get_length_at_index_bitset <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_length_at_index_bitset`, variable, index) -} - -double_ragged_variable_get_length_at_index_vector <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_length_at_index_vector`, variable, index) -} - -double_ragged_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_double_ragged_variable_queue_fill`, variable, value)) -} - -double_ragged_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_update`, variable, value, index)) -} - -double_ragged_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_update_bitset`, variable, value, index)) -} - -double_ragged_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_double_ragged_variable_queue_extend`, variable, values)) -} - -double_ragged_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_shrink`, variable, index)) -} - -double_ragged_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_shrink_bitset`, variable, index)) -} - -create_integer_ragged_variable <- function(values) { - .Call(`_individual_create_integer_ragged_variable`, values) -} - -integer_ragged_variable_get_values <- function(variable) { - .Call(`_individual_integer_ragged_variable_get_values`, variable) -} - -integer_ragged_variable_get_values_at_index_bitset <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_values_at_index_bitset`, variable, index) -} - -integer_ragged_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_values_at_index_vector`, variable, index) -} - -integer_ragged_variable_get_length <- function(variable) { - .Call(`_individual_integer_ragged_variable_get_length`, variable) -} - -integer_ragged_variable_get_length_at_index_bitset <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_length_at_index_bitset`, variable, index) -} - -integer_ragged_variable_get_length_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_length_at_index_vector`, variable, index) -} - -integer_ragged_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_integer_ragged_variable_queue_fill`, variable, value)) -} - -integer_ragged_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_update`, variable, value, index)) -} - -integer_ragged_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_update_bitset`, variable, value, index)) -} - -integer_ragged_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_integer_ragged_variable_queue_extend`, variable, values)) -} - -integer_ragged_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_shrink`, variable, index)) -} - -integer_ragged_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_shrink_bitset`, variable, index)) -} - -create_render_vector <- function(data) { - .Call(`_individual_create_render_vector`, data) -} - -render_vector_update <- function(v, index, value) { - invisible(.Call(`_individual_render_vector_update`, v, index, value)) -} - -render_vector_data <- function(v) { - .Call(`_individual_render_vector_data`, v) -} - -execute_process <- function(process, timestep) { - invisible(.Call(`_individual_execute_process`, process, timestep)) -} - -variable_get_size <- function(variable) { - .Call(`_individual_variable_get_size`, variable) -} - -variable_update <- function(variable) { - invisible(.Call(`_individual_variable_update`, variable)) -} - -variable_resize <- function(variable) { - invisible(.Call(`_individual_variable_resize`, variable)) -} - -# Register entry points for exported C++ functions -methods::setLoadAction(function(ns) { - .Call(`_individual_RcppExport_registerCCallable`) -}) +# Generated by using Rcpp::compileAttributes() -> do not edit by hand +# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +create_bitset <- function(size) { + .Call(`_individual_create_bitset`, size) +} + +bitset_copy <- function(b) { + .Call(`_individual_bitset_copy`, b) +} + +bitset_insert <- function(b, v) { + invisible(.Call(`_individual_bitset_insert`, b, v)) +} + +bitset_remove <- function(b, v) { + invisible(.Call(`_individual_bitset_remove`, b, v)) +} + +bitset_clear <- function(b) { + invisible(.Call(`_individual_bitset_clear`, b)) +} + +bitset_size <- function(b) { + .Call(`_individual_bitset_size`, b) +} + +bitset_max_size <- function(b) { + .Call(`_individual_bitset_max_size`, b) +} + +bitset_and <- function(a, b) { + invisible(.Call(`_individual_bitset_and`, a, b)) +} + +bitset_not <- function(b, inplace) { + .Call(`_individual_bitset_not`, b, inplace) +} + +bitset_or <- function(a, b) { + invisible(.Call(`_individual_bitset_or`, a, b)) +} + +bitset_copy_from <- function(a, b) { + invisible(.Call(`_individual_bitset_copy_from`, a, b)) +} + +bitset_xor <- function(a, b) { + invisible(.Call(`_individual_bitset_xor`, a, b)) +} + +bitset_set_difference <- function(a, b) { + invisible(.Call(`_individual_bitset_set_difference`, a, b)) +} + +bitset_sample <- function(b, rate) { + invisible(.Call(`_individual_bitset_sample`, b, rate)) +} + +bitset_sample_vector <- function(b, rate) { + invisible(.Call(`_individual_bitset_sample_vector`, b, rate)) +} + +bitset_to_vector <- function(b) { + .Call(`_individual_bitset_to_vector`, b) +} + +filter_bitset_integer <- function(b, other) { + .Call(`_individual_filter_bitset_integer`, b, other) +} + +filter_bitset_bitset <- function(b, other) { + .Call(`_individual_filter_bitset_bitset`, b, other) +} + +filter_bitset_logical <- function(bitset, other) { + .Call(`_individual_filter_bitset_logical`, bitset, other) +} + +bitset_choose <- function(b, k) { + invisible(.Call(`_individual_bitset_choose`, b, k)) +} + +create_categorical_variable <- function(categories, values) { + .Call(`_individual_create_categorical_variable`, categories, values) +} + +categorical_variable_get_size <- function(variable) { + .Call(`_individual_categorical_variable_get_size`, variable) +} + +categorical_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_categorical_variable_queue_update`, variable, value, index)) +} + +categorical_variable_get_index_of <- function(variable, values) { + .Call(`_individual_categorical_variable_get_index_of`, variable, values) +} + +categorical_variable_get_size_of <- function(variable, values) { + .Call(`_individual_categorical_variable_get_size_of`, variable, values) +} + +categorical_variable_get_categories <- function(variable) { + .Call(`_individual_categorical_variable_get_categories`, variable) +} + +categorical_variable_queue_update_vector <- function(variable, value, index) { + invisible(.Call(`_individual_categorical_variable_queue_update_vector`, variable, value, index)) +} + +categorical_variable_update <- function(variable) { + invisible(.Call(`_individual_categorical_variable_update`, variable)) +} + +categorical_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_categorical_variable_queue_extend`, variable, values)) +} + +categorical_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_categorical_variable_queue_shrink`, variable, index)) +} + +categorical_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_categorical_variable_queue_shrink_bitset`, variable, index)) +} + +categorical_variable_get_values <- function(variable, index) { + .Call(`_individual_categorical_variable_get_values`, variable, index) +} + +create_double_variable <- function(values) { + .Call(`_individual_create_double_variable`, values) +} + +double_variable_get_values <- function(variable) { + .Call(`_individual_double_variable_get_values`, variable) +} + +double_variable_get_values_at_index <- function(variable, index) { + .Call(`_individual_double_variable_get_values_at_index`, variable, index) +} + +double_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_double_variable_get_values_at_index_vector`, variable, index) +} + +double_variable_get_index_of_range <- function(variable, a, b) { + .Call(`_individual_double_variable_get_index_of_range`, variable, a, b) +} + +double_variable_get_size_of_range <- function(variable, a, b) { + .Call(`_individual_double_variable_get_size_of_range`, variable, a, b) +} + +double_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_double_variable_queue_fill`, variable, value)) +} + +double_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_double_variable_queue_update`, variable, value, index)) +} + +double_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_double_variable_queue_update_bitset`, variable, value, index)) +} + +double_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_double_variable_queue_extend`, variable, values)) +} + +double_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_double_variable_queue_shrink`, variable, index)) +} + +double_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_double_variable_queue_shrink_bitset`, variable, index)) +} + +create_event <- function() { + .Call(`_individual_create_event`) +} + +create_targeted_event <- function(size) { + .Call(`_individual_create_targeted_event`, size) +} + +event_base_tick <- function(event) { + invisible(.Call(`_individual_event_base_tick`, event)) +} + +event_base_get_timestep <- function(event) { + .Call(`_individual_event_base_get_timestep`, event) +} + +event_base_set_timestep <- function(event, time) { + invisible(.Call(`_individual_event_base_set_timestep`, event, time)) +} + +event_base_should_trigger <- function(event) { + .Call(`_individual_event_base_should_trigger`, event) +} + +event_schedule <- function(event, delays) { + invisible(.Call(`_individual_event_schedule`, event, delays)) +} + +event_clear_schedule <- function(event) { + invisible(.Call(`_individual_event_clear_schedule`, event)) +} + +event_checkpoint <- function(event) { + .Call(`_individual_event_checkpoint`, event) +} + +event_restore <- function(event, schedule) { + invisible(.Call(`_individual_event_restore`, event, schedule)) +} + +targeted_event_clear_schedule_vector <- function(event, target) { + invisible(.Call(`_individual_targeted_event_clear_schedule_vector`, event, target)) +} + +targeted_event_clear_schedule <- function(event, target) { + invisible(.Call(`_individual_targeted_event_clear_schedule`, event, target)) +} + +targeted_event_get_scheduled <- function(event) { + .Call(`_individual_targeted_event_get_scheduled`, event) +} + +targeted_event_schedule <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule`, event, target, delay)) +} + +targeted_event_queue_shrink_bitset <- function(event, index) { + invisible(.Call(`_individual_targeted_event_queue_shrink_bitset`, event, index)) +} + +targeted_event_queue_shrink <- function(event, index) { + invisible(.Call(`_individual_targeted_event_queue_shrink`, event, index)) +} + +targeted_event_queue_extend <- function(event, n) { + invisible(.Call(`_individual_targeted_event_queue_extend`, event, n)) +} + +targeted_event_queue_extend_with_schedule <- function(event, delays) { + invisible(.Call(`_individual_targeted_event_queue_extend_with_schedule`, event, delays)) +} + +targeted_event_schedule_vector <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_vector`, event, target, delay)) +} + +targeted_event_schedule_multi_delay <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_multi_delay`, event, target, delay)) +} + +targeted_event_schedule_multi_delay_vector <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_multi_delay_vector`, event, target, delay)) +} + +targeted_event_get_target <- function(event) { + .Call(`_individual_targeted_event_get_target`, event) +} + +targeted_event_resize <- function(event) { + invisible(.Call(`_individual_targeted_event_resize`, event)) +} + +targeted_event_checkpoint <- function(event) { + .Call(`_individual_targeted_event_checkpoint`, event) +} + +targeted_event_restore <- function(event, state) { + invisible(.Call(`_individual_targeted_event_restore`, event, state)) +} + +process_listener <- function(event, listener) { + invisible(.Call(`_individual_process_listener`, event, listener)) +} + +process_targeted_listener <- function(event, listener, target) { + invisible(.Call(`_individual_process_targeted_listener`, event, listener, target)) +} + +create_integer_variable <- function(values) { + .Call(`_individual_create_integer_variable`, values) +} + +integer_variable_get_values <- function(variable) { + .Call(`_individual_integer_variable_get_values`, variable) +} + +integer_variable_get_modulo_differences <- function(variable, value, difference) { + .Call(`_individual_integer_variable_get_modulo_differences`, variable, value, difference) +} + +integer_variable_get_values_at_index <- function(variable, index) { + .Call(`_individual_integer_variable_get_values_at_index`, variable, index) +} + +integer_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_variable_get_values_at_index_vector`, variable, index) +} + +integer_variable_get_index_of_set_vector <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_index_of_set_vector`, variable, values_set) +} + +integer_variable_get_index_of_set_scalar <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_index_of_set_scalar`, variable, values_set) +} + +integer_variable_get_index_of_range <- function(variable, a, b) { + .Call(`_individual_integer_variable_get_index_of_range`, variable, a, b) +} + +integer_variable_get_size_of_set_vector <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_size_of_set_vector`, variable, values_set) +} + +integer_variable_get_size_of_set_scalar <- function(variable, value) { + .Call(`_individual_integer_variable_get_size_of_set_scalar`, variable, value) +} + +integer_variable_get_size_of_range <- function(variable, a, b) { + .Call(`_individual_integer_variable_get_size_of_range`, variable, a, b) +} + +integer_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_integer_variable_queue_fill`, variable, value)) +} + +integer_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_integer_variable_queue_update`, variable, value, index)) +} + +integer_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_integer_variable_queue_update_bitset`, variable, value, index)) +} + +integer_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_integer_variable_queue_extend`, variable, values)) +} + +integer_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_integer_variable_queue_shrink`, variable, index)) +} + +integer_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_integer_variable_queue_shrink_bitset`, variable, index)) +} + +fixed_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate, destination_probabilities) { + .Call(`_individual_fixed_probability_multinomial_process_internal`, variable, source_state, destination_states, rate, destination_probabilities) +} + +multi_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate_variable, destination_probabilities) { + .Call(`_individual_multi_probability_multinomial_process_internal`, variable, source_state, destination_states, rate_variable, destination_probabilities) +} + +multi_probability_bernoulli_process_internal <- function(variable, from, to, rate_variable) { + .Call(`_individual_multi_probability_bernoulli_process_internal`, variable, from, to, rate_variable) +} + +infection_age_process_internal <- function(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) { + .Call(`_individual_infection_age_process_internal`, state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) +} + +create_double_ragged_variable <- function(values) { + .Call(`_individual_create_double_ragged_variable`, values) +} + +double_ragged_variable_get_values <- function(variable) { + .Call(`_individual_double_ragged_variable_get_values`, variable) +} + +double_ragged_variable_get_values_at_index_bitset <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_values_at_index_bitset`, variable, index) +} + +double_ragged_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_values_at_index_vector`, variable, index) +} + +double_ragged_variable_get_length <- function(variable) { + .Call(`_individual_double_ragged_variable_get_length`, variable) +} + +double_ragged_variable_get_length_at_index_bitset <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_length_at_index_bitset`, variable, index) +} + +double_ragged_variable_get_length_at_index_vector <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_length_at_index_vector`, variable, index) +} + +double_ragged_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_double_ragged_variable_queue_fill`, variable, value)) +} + +double_ragged_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_update`, variable, value, index)) +} + +double_ragged_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_update_bitset`, variable, value, index)) +} + +double_ragged_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_double_ragged_variable_queue_extend`, variable, values)) +} + +double_ragged_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_shrink`, variable, index)) +} + +double_ragged_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_shrink_bitset`, variable, index)) +} + +create_integer_ragged_variable <- function(values) { + .Call(`_individual_create_integer_ragged_variable`, values) +} + +integer_ragged_variable_get_values <- function(variable) { + .Call(`_individual_integer_ragged_variable_get_values`, variable) +} + +integer_ragged_variable_get_values_at_index_bitset <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_values_at_index_bitset`, variable, index) +} + +integer_ragged_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_values_at_index_vector`, variable, index) +} + +integer_ragged_variable_get_length <- function(variable) { + .Call(`_individual_integer_ragged_variable_get_length`, variable) +} + +integer_ragged_variable_get_length_at_index_bitset <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_length_at_index_bitset`, variable, index) +} + +integer_ragged_variable_get_length_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_length_at_index_vector`, variable, index) +} + +integer_ragged_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_integer_ragged_variable_queue_fill`, variable, value)) +} + +integer_ragged_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_update`, variable, value, index)) +} + +integer_ragged_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_update_bitset`, variable, value, index)) +} + +integer_ragged_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_integer_ragged_variable_queue_extend`, variable, values)) +} + +integer_ragged_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_shrink`, variable, index)) +} + +integer_ragged_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_shrink_bitset`, variable, index)) +} + +create_render_vector <- function(data) { + .Call(`_individual_create_render_vector`, data) +} + +render_vector_update <- function(v, index, value) { + invisible(.Call(`_individual_render_vector_update`, v, index, value)) +} + +render_vector_data <- function(v) { + .Call(`_individual_render_vector_data`, v) +} + +execute_process <- function(process, timestep) { + invisible(.Call(`_individual_execute_process`, process, timestep)) +} + +variable_get_size <- function(variable) { + .Call(`_individual_variable_get_size`, variable) +} + +variable_update <- function(variable) { + invisible(.Call(`_individual_variable_update`, variable)) +} + +variable_resize <- function(variable) { + invisible(.Call(`_individual_variable_resize`, variable)) +} + +# Register entry points for exported C++ functions +methods::setLoadAction(function(ns) { + .Call(`_individual_RcppExport_registerCCallable`) +}) diff --git a/R/categorical_variable.R b/R/categorical_variable.R index 8a172b1..93e5eb9 100644 --- a/R/categorical_variable.R +++ b/R/categorical_variable.R @@ -43,6 +43,15 @@ CategoricalVariable <- R6Class( categorical_variable_get_categories(self$.variable) }, + #' @description return the value of the variable for the given individuals + #' @param index the indices of individuals whose categories will be returned + get_values = function(index) { + stopifnot(is.finite(index)) + stopifnot(index > 0) + results <- categorical_variable_get_values(self$.variable, index) + return(results) + }, + #' @description queue an update for this variable #' @param value the new value #' @param index the indices of individuals whose value will be updated diff --git a/R/integer_variable.R b/R/integer_variable.R index 2e3543e..adc477d 100644 --- a/R/integer_variable.R +++ b/R/integer_variable.R @@ -39,6 +39,15 @@ IntegerVariable <- R6Class( }, + #' @description Return a vector of individuals with 0 modulo difference from input value + #' and the distance being compared + #' @param value the value to check + #' @param difference the difference to check, e.g. difference = 2 checks whether the + #' difference is even + get_modulo_differences = function(value, difference){ + integer_variable_get_modulo_differences(self$.variable, value, difference) + }, + #' @description Return a \code{\link[individual]{Bitset}} for individuals with some subset of values. #' Either search for indices corresponding to values in \code{set}, or #' for indices corresponding to values in range \eqn{[a,b]}. Either \code{set} diff --git a/inst/include/CategoricalVariable.h b/inst/include/CategoricalVariable.h index 69a631c..66aefb0 100644 --- a/inst/include/CategoricalVariable.h +++ b/inst/include/CategoricalVariable.h @@ -52,6 +52,7 @@ class CategoricalVariable : public Variable { virtual void resize() override; virtual size_t size() const override; virtual void update() override; + virtual std::vector get_values(const std::vector&); }; @@ -228,5 +229,25 @@ inline size_t CategoricalVariable::size() const { inline const std::vector& CategoricalVariable::get_categories() const { return categories; } - +//' @title get values at index given by a vector +inline std::vector CategoricalVariable::get_values(const std::vector& index){ + + // Generate empty output vector + auto result = std::vector(index.size()); + for (auto i = 0u; i < index.size(); ++i) { + // Determine which category the individual is within + for (auto cat: categories) { + if (indices.find(cat) == indices.end()) { + std::stringstream message; + message << "unknown category: " << cat; + Rcpp::stop(message.str()); + } + if (indices.at(cat).find(index[i]) != indices.at(cat).end()) { + result[i] = cat; + break; + } + } + } + return result; +} #endif /* INST_INCLUDE_CATEGORICAL_VARIABLE_H_ */ diff --git a/inst/include/IntegerVariable.h b/inst/include/IntegerVariable.h index 346ee6d..294075b 100644 --- a/inst/include/IntegerVariable.h +++ b/inst/include/IntegerVariable.h @@ -30,6 +30,7 @@ struct IntegerVariable : public NumericVariable { virtual size_t get_size_of_set(const std::vector&) const; virtual size_t get_size_of_set(const int) const; virtual size_t get_size_of_range(const int, const int) const; + virtual individual_index_t get_modulo_differences(const int, const int) const; }; inline IntegerVariable::IntegerVariable(const std::vector& values) @@ -66,6 +67,23 @@ inline individual_index_t IntegerVariable::get_index_of_set( return result; } +//' @title return bitset giving index of individuals whose difference between +// the current value and the queried value is a multiple of the queried difference +inline individual_index_t IntegerVariable::get_modulo_differences( + const int value, + const int difference +) const { + + auto result = individual_index_t(size()); + for (auto i = 0u; i < values.size(); ++i) { + if ( (values[i] - value) % difference == 0 ) { + result.insert(i); + } + } + + return result; +} + //' @title return bitset giving index of individuals whose value is in some range [a,b] inline individual_index_t IntegerVariable::get_index_of_range( const int a, const int b diff --git a/inst/include/individual_types.h b/inst/include/individual_types.h index 8d4a925..8386ca9 100644 --- a/inst/include/individual_types.h +++ b/inst/include/individual_types.h @@ -10,6 +10,7 @@ #include #include "CategoricalVariable.h" +// #include "FunctionalVariable.h" #include "IntegerVariable.h" #include "DoubleVariable.h" #include "RaggedInteger.h" diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 1c5e23d..7309f3e 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,1612 +1,1639 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include "../inst/include/individual.h" -#include "../inst/include/individual_types.h" -#include -#include -#include - -using namespace Rcpp; - -#ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); -Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); -#endif - -// create_bitset -Rcpp::XPtr create_bitset(size_t size); -RcppExport SEXP _individual_create_bitset(SEXP sizeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); - rcpp_result_gen = Rcpp::wrap(create_bitset(size)); - return rcpp_result_gen; -END_RCPP -} -// bitset_copy -Rcpp::XPtr bitset_copy(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_copy(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_copy(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_insert -void bitset_insert(const Rcpp::XPtr b, std::vector v); -RcppExport SEXP _individual_bitset_insert(SEXP bSEXP, SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); - bitset_insert(b, v); - return R_NilValue; -END_RCPP -} -// bitset_remove -void bitset_remove(const Rcpp::XPtr b, std::vector v); -RcppExport SEXP _individual_bitset_remove(SEXP bSEXP, SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); - bitset_remove(b, v); - return R_NilValue; -END_RCPP -} -// bitset_clear -void bitset_clear(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_clear(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_clear(b); - return R_NilValue; -END_RCPP -} -// bitset_size -size_t bitset_size(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_size(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_size(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_max_size -size_t bitset_max_size(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_max_size(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_max_size(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_and -void bitset_and(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_and(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_and(a, b); - return R_NilValue; -END_RCPP -} -// bitset_not -Rcpp::XPtr bitset_not(const Rcpp::XPtr b, const bool inplace); -RcppExport SEXP _individual_bitset_not(SEXP bSEXP, SEXP inplaceSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const bool >::type inplace(inplaceSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_not(b, inplace)); - return rcpp_result_gen; -END_RCPP -} -// bitset_or -void bitset_or(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_or(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_or(a, b); - return R_NilValue; -END_RCPP -} -// bitset_copy_from -void bitset_copy_from(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_copy_from(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_copy_from(a, b); - return R_NilValue; -END_RCPP -} -// bitset_xor -void bitset_xor(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_xor(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_xor(a, b); - return R_NilValue; -END_RCPP -} -// bitset_set_difference -void bitset_set_difference(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_set_difference(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_set_difference(a, b); - return R_NilValue; -END_RCPP -} -// bitset_sample -void bitset_sample(const Rcpp::XPtr b, double rate); -RcppExport SEXP _individual_bitset_sample(SEXP bSEXP, SEXP rateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< double >::type rate(rateSEXP); - bitset_sample(b, rate); - return R_NilValue; -END_RCPP -} -// bitset_sample_vector -void bitset_sample_vector(const Rcpp::XPtr b, std::vector rate); -RcppExport SEXP _individual_bitset_sample_vector(SEXP bSEXP, SEXP rateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type rate(rateSEXP); - bitset_sample_vector(b, rate); - return R_NilValue; -END_RCPP -} -// bitset_to_vector -std::vector bitset_to_vector(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_to_vector(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_to_vector(b)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_integer -Rcpp::XPtr filter_bitset_integer(const Rcpp::XPtr b, std::vector other); -RcppExport SEXP _individual_filter_bitset_integer(SEXP bSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_integer(b, other)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_bitset -Rcpp::XPtr filter_bitset_bitset(const Rcpp::XPtr b, const Rcpp::XPtr other); -RcppExport SEXP _individual_filter_bitset_bitset(SEXP bSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_bitset(b, other)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_logical -Rcpp::XPtr filter_bitset_logical(const Rcpp::XPtr bitset, Rcpp::LogicalVector other); -RcppExport SEXP _individual_filter_bitset_logical(SEXP bitsetSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type bitset(bitsetSEXP); - Rcpp::traits::input_parameter< Rcpp::LogicalVector >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_logical(bitset, other)); - return rcpp_result_gen; -END_RCPP -} -// bitset_choose -void bitset_choose(const Rcpp::XPtr b, const size_t k); -RcppExport SEXP _individual_bitset_choose(SEXP bSEXP, SEXP kSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const size_t >::type k(kSEXP); - bitset_choose(b, k); - return R_NilValue; -END_RCPP -} -// create_categorical_variable -Rcpp::XPtr create_categorical_variable(const std::vector& categories, const std::vector& values); -RcppExport SEXP _individual_create_categorical_variable(SEXP categoriesSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type categories(categoriesSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_categorical_variable(categories, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_size -size_t categorical_variable_get_size(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_get_size(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size(variable)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_queue_update -void categorical_variable_queue_update(Rcpp::XPtr variable, const std::string& value, Rcpp::XPtr index); -RcppExport SEXP _individual_categorical_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - categorical_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_get_index_of -Rcpp::XPtr categorical_variable_get_index_of(Rcpp::XPtr variable, const std::vector& values); -RcppExport SEXP _individual_categorical_variable_get_index_of(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_index_of(variable, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_size_of -int categorical_variable_get_size_of(Rcpp::XPtr variable, const std::vector& values); -RcppExport SEXP _individual_categorical_variable_get_size_of(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size_of(variable, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_categories -std::vector categorical_variable_get_categories(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_get_categories(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_categories(variable)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_queue_update_vector -void categorical_variable_queue_update_vector(Rcpp::XPtr variable, const std::string& value, std::vector& index); -RcppExport SEXP _individual_categorical_variable_queue_update_vector(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - categorical_variable_queue_update_vector(variable, value, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_update -void categorical_variable_update(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_update(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - categorical_variable_update(variable); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_extend -void categorical_variable_queue_extend(Rcpp::XPtr variable, std::vector& values); -RcppExport SEXP _individual_categorical_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type values(valuesSEXP); - categorical_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_shrink -void categorical_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_categorical_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - categorical_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_shrink_bitset -void categorical_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_categorical_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - categorical_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// dummy -void dummy(); -static SEXP _individual_dummy_try() { -BEGIN_RCPP - dummy(); - return R_NilValue; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _individual_dummy() { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_individual_dummy_try()); - } - Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); - if (rcpp_isInterrupt_gen) { - UNPROTECT(1); - Rf_onintr(); - } - bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); - if (rcpp_isLongjump_gen) { - Rcpp::internal::resumeJump(rcpp_result_gen); - } - Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); - if (rcpp_isError_gen) { - SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); - UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} -// create_double_variable -Rcpp::XPtr create_double_variable(const std::vector& values); -RcppExport SEXP _individual_create_double_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_double_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values -const std::vector& double_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values_at_index -std::vector double_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values_at_index_vector -std::vector double_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_index_of_range -Rcpp::XPtr double_variable_get_index_of_range(Rcpp::XPtr variable, const double a, const double b); -RcppExport SEXP _individual_double_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const double >::type a(aSEXP); - Rcpp::traits::input_parameter< const double >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_index_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_size_of_range -size_t double_variable_get_size_of_range(Rcpp::XPtr variable, const double a, const double b); -RcppExport SEXP _individual_double_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const double >::type a(aSEXP); - Rcpp::traits::input_parameter< const double >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_size_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_queue_fill -void double_variable_queue_fill(Rcpp::XPtr variable, std::vector value); -RcppExport SEXP _individual_double_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - double_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// double_variable_queue_update -void double_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); -RcppExport SEXP _individual_double_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_update_bitset -void double_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_extend -void double_variable_queue_extend(Rcpp::XPtr variable, std::vector values); -RcppExport SEXP _individual_double_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); - double_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// double_variable_queue_shrink -void double_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_shrink_bitset -void double_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_event -Rcpp::XPtr create_event(); -RcppExport SEXP _individual_create_event() { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = Rcpp::wrap(create_event()); - return rcpp_result_gen; -END_RCPP -} -// create_targeted_event -Rcpp::XPtr create_targeted_event(size_t size); -RcppExport SEXP _individual_create_targeted_event(SEXP sizeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); - rcpp_result_gen = Rcpp::wrap(create_targeted_event(size)); - return rcpp_result_gen; -END_RCPP -} -// event_base_tick -void event_base_tick(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_tick(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - event_base_tick(event); - return R_NilValue; -END_RCPP -} -// event_base_get_timestep -size_t event_base_get_timestep(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_get_timestep(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_base_get_timestep(event)); - return rcpp_result_gen; -END_RCPP -} -// event_base_set_timestep -void event_base_set_timestep(const Rcpp::XPtr event, size_t time); -RcppExport SEXP _individual_event_base_set_timestep(SEXP eventSEXP, SEXP timeSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< size_t >::type time(timeSEXP); - event_base_set_timestep(event, time); - return R_NilValue; -END_RCPP -} -// event_base_should_trigger -bool event_base_should_trigger(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_should_trigger(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_base_should_trigger(event)); - return rcpp_result_gen; -END_RCPP -} -// event_schedule -void event_schedule(const Rcpp::XPtr event, std::vector delays); -RcppExport SEXP _individual_event_schedule(SEXP eventSEXP, SEXP delaysSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type delays(delaysSEXP); - event_schedule(event, delays); - return R_NilValue; -END_RCPP -} -// event_clear_schedule -void event_clear_schedule(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_clear_schedule(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - event_clear_schedule(event); - return R_NilValue; -END_RCPP -} -// event_checkpoint -std::vector event_checkpoint(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_checkpoint(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_checkpoint(event)); - return rcpp_result_gen; -END_RCPP -} -// event_restore -void event_restore(const Rcpp::XPtr event, std::vector schedule); -RcppExport SEXP _individual_event_restore(SEXP eventSEXP, SEXP scheduleSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type schedule(scheduleSEXP); - event_restore(event, schedule); - return R_NilValue; -END_RCPP -} -// targeted_event_clear_schedule_vector -void targeted_event_clear_schedule_vector(const Rcpp::XPtr event, std::vector target); -RcppExport SEXP _individual_targeted_event_clear_schedule_vector(SEXP eventSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - targeted_event_clear_schedule_vector(event, target); - return R_NilValue; -END_RCPP -} -// targeted_event_clear_schedule -void targeted_event_clear_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target); -RcppExport SEXP _individual_targeted_event_clear_schedule(SEXP eventSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - targeted_event_clear_schedule(event, target); - return R_NilValue; -END_RCPP -} -// targeted_event_get_scheduled -Rcpp::XPtr targeted_event_get_scheduled(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_get_scheduled(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_get_scheduled(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_schedule -void targeted_event_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target, double delay); -RcppExport SEXP _individual_targeted_event_schedule(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - Rcpp::traits::input_parameter< double >::type delay(delaySEXP); - targeted_event_schedule(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_shrink_bitset -void targeted_event_queue_shrink_bitset(const Rcpp::XPtr event, const Rcpp::XPtr index); -RcppExport SEXP _individual_targeted_event_queue_shrink_bitset(SEXP eventSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type index(indexSEXP); - targeted_event_queue_shrink_bitset(event, index); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_shrink -void targeted_event_queue_shrink(const Rcpp::XPtr event, std::vector& index); -RcppExport SEXP _individual_targeted_event_queue_shrink(SEXP eventSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - targeted_event_queue_shrink(event, index); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_extend -void targeted_event_queue_extend(const Rcpp::XPtr event, size_t n); -RcppExport SEXP _individual_targeted_event_queue_extend(SEXP eventSEXP, SEXP nSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< size_t >::type n(nSEXP); - targeted_event_queue_extend(event, n); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_extend_with_schedule -void targeted_event_queue_extend_with_schedule(const Rcpp::XPtr event, const std::vector& delays); -RcppExport SEXP _individual_targeted_event_queue_extend_with_schedule(SEXP eventSEXP, SEXP delaysSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type delays(delaysSEXP); - targeted_event_queue_extend_with_schedule(event, delays); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_vector -void targeted_event_schedule_vector(const Rcpp::XPtr event, std::vector target, double delay); -RcppExport SEXP _individual_targeted_event_schedule_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - Rcpp::traits::input_parameter< double >::type delay(delaySEXP); - targeted_event_schedule_vector(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_multi_delay -void targeted_event_schedule_multi_delay(const Rcpp::XPtr event, const Rcpp::XPtr target, const std::vector delay); -RcppExport SEXP _individual_targeted_event_schedule_multi_delay(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); - targeted_event_schedule_multi_delay(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_multi_delay_vector -void targeted_event_schedule_multi_delay_vector(const Rcpp::XPtr event, std::vector target, const std::vector delay); -RcppExport SEXP _individual_targeted_event_schedule_multi_delay_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); - targeted_event_schedule_multi_delay_vector(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_get_target -Rcpp::XPtr targeted_event_get_target(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_get_target(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_get_target(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_resize -void targeted_event_resize(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_resize(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - targeted_event_resize(event); - return R_NilValue; -END_RCPP -} -// targeted_event_checkpoint -Rcpp::List targeted_event_checkpoint(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_checkpoint(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_checkpoint(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_restore -void targeted_event_restore(const Rcpp::XPtr event, Rcpp::List state); -RcppExport SEXP _individual_targeted_event_restore(SEXP eventSEXP, SEXP stateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type state(stateSEXP); - targeted_event_restore(event, state); - return R_NilValue; -END_RCPP -} -// process_listener -void process_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener); -RcppExport SEXP _individual_process_listener(SEXP eventSEXP, SEXP listenerSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); - process_listener(event, listener); - return R_NilValue; -END_RCPP -} -// process_targeted_listener -void process_targeted_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener, const Rcpp::XPtr target); -RcppExport SEXP _individual_process_targeted_listener(SEXP eventSEXP, SEXP listenerSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - process_targeted_listener(event, listener, target); - return R_NilValue; -END_RCPP -} -// create_integer_variable -Rcpp::XPtr create_integer_variable(const std::vector& values); -RcppExport SEXP _individual_create_integer_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_integer_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values -const std::vector& integer_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values_at_index -std::vector integer_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values_at_index_vector -std::vector integer_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_set_vector -Rcpp::XPtr integer_variable_get_index_of_set_vector(Rcpp::XPtr variable, std::vector values_set); -RcppExport SEXP _individual_integer_variable_get_index_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_vector(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_set_scalar -Rcpp::XPtr integer_variable_get_index_of_set_scalar(Rcpp::XPtr variable, const int values_set); -RcppExport SEXP _individual_integer_variable_get_index_of_set_scalar(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_scalar(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_range -Rcpp::XPtr integer_variable_get_index_of_range(Rcpp::XPtr variable, const int a, const int b); -RcppExport SEXP _individual_integer_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type a(aSEXP); - Rcpp::traits::input_parameter< const int >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_set_vector -size_t integer_variable_get_size_of_set_vector(Rcpp::XPtr variable, const std::vector values_set); -RcppExport SEXP _individual_integer_variable_get_size_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_vector(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_set_scalar -size_t integer_variable_get_size_of_set_scalar(Rcpp::XPtr variable, const int value); -RcppExport SEXP _individual_integer_variable_get_size_of_set_scalar(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_scalar(variable, value)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_range -size_t integer_variable_get_size_of_range(Rcpp::XPtr variable, const int a, const int b); -RcppExport SEXP _individual_integer_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type a(aSEXP); - Rcpp::traits::input_parameter< const int >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_queue_fill -void integer_variable_queue_fill(Rcpp::XPtr variable, std::vector value); -RcppExport SEXP _individual_integer_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - integer_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_update -void integer_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); -RcppExport SEXP _individual_integer_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_update_bitset -void integer_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_extend -void integer_variable_queue_extend(Rcpp::XPtr variable, std::vector values); -RcppExport SEXP _individual_integer_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); - integer_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_shrink -void integer_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_shrink_bitset -void integer_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// fixed_probability_multinomial_process_internal -Rcpp::XPtr fixed_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const double rate, const std::vector destination_probabilities); -RcppExport SEXP _individual_fixed_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rateSEXP, SEXP destination_probabilitiesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); - Rcpp::traits::input_parameter< const double >::type rate(rateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); - rcpp_result_gen = Rcpp::wrap(fixed_probability_multinomial_process_internal(variable, source_state, destination_states, rate, destination_probabilities)); - return rcpp_result_gen; -END_RCPP -} -// multi_probability_multinomial_process_internal -Rcpp::XPtr multi_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const Rcpp::XPtr rate_variable, const std::vector destination_probabilities); -RcppExport SEXP _individual_multi_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rate_variableSEXP, SEXP destination_probabilitiesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); - rcpp_result_gen = Rcpp::wrap(multi_probability_multinomial_process_internal(variable, source_state, destination_states, rate_variable, destination_probabilities)); - return rcpp_result_gen; -END_RCPP -} -// multi_probability_bernoulli_process_internal -Rcpp::XPtr multi_probability_bernoulli_process_internal(Rcpp::XPtr variable, const std::string from, const std::string to, const Rcpp::XPtr rate_variable); -RcppExport SEXP _individual_multi_probability_bernoulli_process_internal(SEXP variableSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP rate_variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type from(fromSEXP); - Rcpp::traits::input_parameter< const std::string >::type to(toSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); - rcpp_result_gen = Rcpp::wrap(multi_probability_bernoulli_process_internal(variable, from, to, rate_variable)); - return rcpp_result_gen; -END_RCPP -} -// infection_age_process_internal -Rcpp::XPtr infection_age_process_internal(Rcpp::XPtr state, const std::string susceptible, const std::string exposed, const std::string infectious, const Rcpp::XPtr age, const int age_bins, const double p, const double dt, const Rcpp::NumericMatrix mixing); -RcppExport SEXP _individual_infection_age_process_internal(SEXP stateSEXP, SEXP susceptibleSEXP, SEXP exposedSEXP, SEXP infectiousSEXP, SEXP ageSEXP, SEXP age_binsSEXP, SEXP pSEXP, SEXP dtSEXP, SEXP mixingSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type state(stateSEXP); - Rcpp::traits::input_parameter< const std::string >::type susceptible(susceptibleSEXP); - Rcpp::traits::input_parameter< const std::string >::type exposed(exposedSEXP); - Rcpp::traits::input_parameter< const std::string >::type infectious(infectiousSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type age(ageSEXP); - Rcpp::traits::input_parameter< const int >::type age_bins(age_binsSEXP); - Rcpp::traits::input_parameter< const double >::type p(pSEXP); - Rcpp::traits::input_parameter< const double >::type dt(dtSEXP); - Rcpp::traits::input_parameter< const Rcpp::NumericMatrix >::type mixing(mixingSEXP); - rcpp_result_gen = Rcpp::wrap(infection_age_process_internal(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing)); - return rcpp_result_gen; -END_RCPP -} -// create_double_ragged_variable -Rcpp::XPtr create_double_ragged_variable(const std::vector>& values); -RcppExport SEXP _individual_create_double_ragged_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_double_ragged_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values -std::vector> double_ragged_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_ragged_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values_at_index_bitset -std::vector> double_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values_at_index_vector -std::vector> double_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length -std::vector double_ragged_variable_get_length(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_ragged_variable_get_length(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length_at_index_bitset -std::vector double_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length_at_index_vector -std::vector double_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_queue_fill -void double_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); -RcppExport SEXP _individual_double_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - double_ragged_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_update -void double_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_ragged_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_update_bitset -void double_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_ragged_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_extend -void double_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); -RcppExport SEXP _individual_double_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); - double_ragged_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_shrink -void double_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_double_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - double_ragged_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_shrink_bitset -void double_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_ragged_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_integer_ragged_variable -Rcpp::XPtr create_integer_ragged_variable(const std::vector>& values); -RcppExport SEXP _individual_create_integer_ragged_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_integer_ragged_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values -std::vector> integer_ragged_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_ragged_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values_at_index_bitset -std::vector> integer_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values_at_index_vector -std::vector> integer_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length -std::vector integer_ragged_variable_get_length(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_ragged_variable_get_length(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length_at_index_bitset -std::vector integer_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length_at_index_vector -std::vector integer_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_queue_fill -void integer_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); -RcppExport SEXP _individual_integer_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - integer_ragged_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_update -void integer_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_ragged_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_update_bitset -void integer_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_ragged_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_extend -void integer_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); -RcppExport SEXP _individual_integer_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); - integer_ragged_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_shrink -void integer_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_integer_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - integer_ragged_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_shrink_bitset -void integer_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_ragged_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_render_vector -Rcpp::XPtr create_render_vector(std::vector data); -RcppExport SEXP _individual_create_render_vector(SEXP dataSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::vector >::type data(dataSEXP); - rcpp_result_gen = Rcpp::wrap(create_render_vector(data)); - return rcpp_result_gen; -END_RCPP -} -// render_vector_update -void render_vector_update(Rcpp::XPtr v, size_t index, double value); -RcppExport SEXP _individual_render_vector_update(SEXP vSEXP, SEXP indexSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); - Rcpp::traits::input_parameter< size_t >::type index(indexSEXP); - Rcpp::traits::input_parameter< double >::type value(valueSEXP); - render_vector_update(v, index, value); - return R_NilValue; -END_RCPP -} -// render_vector_data -std::vector render_vector_data(Rcpp::XPtr v); -RcppExport SEXP _individual_render_vector_data(SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); - rcpp_result_gen = Rcpp::wrap(render_vector_data(v)); - return rcpp_result_gen; -END_RCPP -} -// execute_process -void execute_process(Rcpp::XPtr process, size_t timestep); -RcppExport SEXP _individual_execute_process(SEXP processSEXP, SEXP timestepSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type process(processSEXP); - Rcpp::traits::input_parameter< size_t >::type timestep(timestepSEXP); - execute_process(process, timestep); - return R_NilValue; -END_RCPP -} -// variable_get_size -size_t variable_get_size(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_get_size(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(variable_get_size(variable)); - return rcpp_result_gen; -END_RCPP -} -// variable_update -void variable_update(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_update(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - variable_update(variable); - return R_NilValue; -END_RCPP -} -// variable_resize -void variable_resize(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_resize(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - variable_resize(variable); - return R_NilValue; -END_RCPP -} - -// validate (ensure exported C++ functions exist before calling them) -static int _individual_RcppExport_validate(const char* sig) { - static std::set signatures; - if (signatures.empty()) { - signatures.insert("void(*dummy)()"); - } - return signatures.find(sig) != signatures.end(); -} - -// registerCCallable (register entry points for exported C++ functions) -RcppExport SEXP _individual_RcppExport_registerCCallable() { - R_RegisterCCallable("individual", "_individual_dummy", (DL_FUNC)_individual_dummy_try); - R_RegisterCCallable("individual", "_individual_RcppExport_validate", (DL_FUNC)_individual_RcppExport_validate); - return R_NilValue; -} - -RcppExport SEXP run_testthat_tests(SEXP); - -static const R_CallMethodDef CallEntries[] = { - {"_individual_create_bitset", (DL_FUNC) &_individual_create_bitset, 1}, - {"_individual_bitset_copy", (DL_FUNC) &_individual_bitset_copy, 1}, - {"_individual_bitset_insert", (DL_FUNC) &_individual_bitset_insert, 2}, - {"_individual_bitset_remove", (DL_FUNC) &_individual_bitset_remove, 2}, - {"_individual_bitset_clear", (DL_FUNC) &_individual_bitset_clear, 1}, - {"_individual_bitset_size", (DL_FUNC) &_individual_bitset_size, 1}, - {"_individual_bitset_max_size", (DL_FUNC) &_individual_bitset_max_size, 1}, - {"_individual_bitset_and", (DL_FUNC) &_individual_bitset_and, 2}, - {"_individual_bitset_not", (DL_FUNC) &_individual_bitset_not, 2}, - {"_individual_bitset_or", (DL_FUNC) &_individual_bitset_or, 2}, - {"_individual_bitset_copy_from", (DL_FUNC) &_individual_bitset_copy_from, 2}, - {"_individual_bitset_xor", (DL_FUNC) &_individual_bitset_xor, 2}, - {"_individual_bitset_set_difference", (DL_FUNC) &_individual_bitset_set_difference, 2}, - {"_individual_bitset_sample", (DL_FUNC) &_individual_bitset_sample, 2}, - {"_individual_bitset_sample_vector", (DL_FUNC) &_individual_bitset_sample_vector, 2}, - {"_individual_bitset_to_vector", (DL_FUNC) &_individual_bitset_to_vector, 1}, - {"_individual_filter_bitset_integer", (DL_FUNC) &_individual_filter_bitset_integer, 2}, - {"_individual_filter_bitset_bitset", (DL_FUNC) &_individual_filter_bitset_bitset, 2}, - {"_individual_filter_bitset_logical", (DL_FUNC) &_individual_filter_bitset_logical, 2}, - {"_individual_bitset_choose", (DL_FUNC) &_individual_bitset_choose, 2}, - {"_individual_create_categorical_variable", (DL_FUNC) &_individual_create_categorical_variable, 2}, - {"_individual_categorical_variable_get_size", (DL_FUNC) &_individual_categorical_variable_get_size, 1}, - {"_individual_categorical_variable_queue_update", (DL_FUNC) &_individual_categorical_variable_queue_update, 3}, - {"_individual_categorical_variable_get_index_of", (DL_FUNC) &_individual_categorical_variable_get_index_of, 2}, - {"_individual_categorical_variable_get_size_of", (DL_FUNC) &_individual_categorical_variable_get_size_of, 2}, - {"_individual_categorical_variable_get_categories", (DL_FUNC) &_individual_categorical_variable_get_categories, 1}, - {"_individual_categorical_variable_queue_update_vector", (DL_FUNC) &_individual_categorical_variable_queue_update_vector, 3}, - {"_individual_categorical_variable_update", (DL_FUNC) &_individual_categorical_variable_update, 1}, - {"_individual_categorical_variable_queue_extend", (DL_FUNC) &_individual_categorical_variable_queue_extend, 2}, - {"_individual_categorical_variable_queue_shrink", (DL_FUNC) &_individual_categorical_variable_queue_shrink, 2}, - {"_individual_categorical_variable_queue_shrink_bitset", (DL_FUNC) &_individual_categorical_variable_queue_shrink_bitset, 2}, - {"_individual_dummy", (DL_FUNC) &_individual_dummy, 0}, - {"_individual_create_double_variable", (DL_FUNC) &_individual_create_double_variable, 1}, - {"_individual_double_variable_get_values", (DL_FUNC) &_individual_double_variable_get_values, 1}, - {"_individual_double_variable_get_values_at_index", (DL_FUNC) &_individual_double_variable_get_values_at_index, 2}, - {"_individual_double_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_variable_get_values_at_index_vector, 2}, - {"_individual_double_variable_get_index_of_range", (DL_FUNC) &_individual_double_variable_get_index_of_range, 3}, - {"_individual_double_variable_get_size_of_range", (DL_FUNC) &_individual_double_variable_get_size_of_range, 3}, - {"_individual_double_variable_queue_fill", (DL_FUNC) &_individual_double_variable_queue_fill, 2}, - {"_individual_double_variable_queue_update", (DL_FUNC) &_individual_double_variable_queue_update, 3}, - {"_individual_double_variable_queue_update_bitset", (DL_FUNC) &_individual_double_variable_queue_update_bitset, 3}, - {"_individual_double_variable_queue_extend", (DL_FUNC) &_individual_double_variable_queue_extend, 2}, - {"_individual_double_variable_queue_shrink", (DL_FUNC) &_individual_double_variable_queue_shrink, 2}, - {"_individual_double_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_variable_queue_shrink_bitset, 2}, - {"_individual_create_event", (DL_FUNC) &_individual_create_event, 0}, - {"_individual_create_targeted_event", (DL_FUNC) &_individual_create_targeted_event, 1}, - {"_individual_event_base_tick", (DL_FUNC) &_individual_event_base_tick, 1}, - {"_individual_event_base_get_timestep", (DL_FUNC) &_individual_event_base_get_timestep, 1}, - {"_individual_event_base_set_timestep", (DL_FUNC) &_individual_event_base_set_timestep, 2}, - {"_individual_event_base_should_trigger", (DL_FUNC) &_individual_event_base_should_trigger, 1}, - {"_individual_event_schedule", (DL_FUNC) &_individual_event_schedule, 2}, - {"_individual_event_clear_schedule", (DL_FUNC) &_individual_event_clear_schedule, 1}, - {"_individual_event_checkpoint", (DL_FUNC) &_individual_event_checkpoint, 1}, - {"_individual_event_restore", (DL_FUNC) &_individual_event_restore, 2}, - {"_individual_targeted_event_clear_schedule_vector", (DL_FUNC) &_individual_targeted_event_clear_schedule_vector, 2}, - {"_individual_targeted_event_clear_schedule", (DL_FUNC) &_individual_targeted_event_clear_schedule, 2}, - {"_individual_targeted_event_get_scheduled", (DL_FUNC) &_individual_targeted_event_get_scheduled, 1}, - {"_individual_targeted_event_schedule", (DL_FUNC) &_individual_targeted_event_schedule, 3}, - {"_individual_targeted_event_queue_shrink_bitset", (DL_FUNC) &_individual_targeted_event_queue_shrink_bitset, 2}, - {"_individual_targeted_event_queue_shrink", (DL_FUNC) &_individual_targeted_event_queue_shrink, 2}, - {"_individual_targeted_event_queue_extend", (DL_FUNC) &_individual_targeted_event_queue_extend, 2}, - {"_individual_targeted_event_queue_extend_with_schedule", (DL_FUNC) &_individual_targeted_event_queue_extend_with_schedule, 2}, - {"_individual_targeted_event_schedule_vector", (DL_FUNC) &_individual_targeted_event_schedule_vector, 3}, - {"_individual_targeted_event_schedule_multi_delay", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay, 3}, - {"_individual_targeted_event_schedule_multi_delay_vector", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay_vector, 3}, - {"_individual_targeted_event_get_target", (DL_FUNC) &_individual_targeted_event_get_target, 1}, - {"_individual_targeted_event_resize", (DL_FUNC) &_individual_targeted_event_resize, 1}, - {"_individual_targeted_event_checkpoint", (DL_FUNC) &_individual_targeted_event_checkpoint, 1}, - {"_individual_targeted_event_restore", (DL_FUNC) &_individual_targeted_event_restore, 2}, - {"_individual_process_listener", (DL_FUNC) &_individual_process_listener, 2}, - {"_individual_process_targeted_listener", (DL_FUNC) &_individual_process_targeted_listener, 3}, - {"_individual_create_integer_variable", (DL_FUNC) &_individual_create_integer_variable, 1}, - {"_individual_integer_variable_get_values", (DL_FUNC) &_individual_integer_variable_get_values, 1}, - {"_individual_integer_variable_get_values_at_index", (DL_FUNC) &_individual_integer_variable_get_values_at_index, 2}, - {"_individual_integer_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_variable_get_values_at_index_vector, 2}, - {"_individual_integer_variable_get_index_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_index_of_set_vector, 2}, - {"_individual_integer_variable_get_index_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_index_of_set_scalar, 2}, - {"_individual_integer_variable_get_index_of_range", (DL_FUNC) &_individual_integer_variable_get_index_of_range, 3}, - {"_individual_integer_variable_get_size_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_size_of_set_vector, 2}, - {"_individual_integer_variable_get_size_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_size_of_set_scalar, 2}, - {"_individual_integer_variable_get_size_of_range", (DL_FUNC) &_individual_integer_variable_get_size_of_range, 3}, - {"_individual_integer_variable_queue_fill", (DL_FUNC) &_individual_integer_variable_queue_fill, 2}, - {"_individual_integer_variable_queue_update", (DL_FUNC) &_individual_integer_variable_queue_update, 3}, - {"_individual_integer_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_variable_queue_update_bitset, 3}, - {"_individual_integer_variable_queue_extend", (DL_FUNC) &_individual_integer_variable_queue_extend, 2}, - {"_individual_integer_variable_queue_shrink", (DL_FUNC) &_individual_integer_variable_queue_shrink, 2}, - {"_individual_integer_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_variable_queue_shrink_bitset, 2}, - {"_individual_fixed_probability_multinomial_process_internal", (DL_FUNC) &_individual_fixed_probability_multinomial_process_internal, 5}, - {"_individual_multi_probability_multinomial_process_internal", (DL_FUNC) &_individual_multi_probability_multinomial_process_internal, 5}, - {"_individual_multi_probability_bernoulli_process_internal", (DL_FUNC) &_individual_multi_probability_bernoulli_process_internal, 4}, - {"_individual_infection_age_process_internal", (DL_FUNC) &_individual_infection_age_process_internal, 9}, - {"_individual_create_double_ragged_variable", (DL_FUNC) &_individual_create_double_ragged_variable, 1}, - {"_individual_double_ragged_variable_get_values", (DL_FUNC) &_individual_double_ragged_variable_get_values, 1}, - {"_individual_double_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_bitset, 2}, - {"_individual_double_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_vector, 2}, - {"_individual_double_ragged_variable_get_length", (DL_FUNC) &_individual_double_ragged_variable_get_length, 1}, - {"_individual_double_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_bitset, 2}, - {"_individual_double_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_vector, 2}, - {"_individual_double_ragged_variable_queue_fill", (DL_FUNC) &_individual_double_ragged_variable_queue_fill, 2}, - {"_individual_double_ragged_variable_queue_update", (DL_FUNC) &_individual_double_ragged_variable_queue_update, 3}, - {"_individual_double_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_update_bitset, 3}, - {"_individual_double_ragged_variable_queue_extend", (DL_FUNC) &_individual_double_ragged_variable_queue_extend, 2}, - {"_individual_double_ragged_variable_queue_shrink", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink, 2}, - {"_individual_double_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink_bitset, 2}, - {"_individual_create_integer_ragged_variable", (DL_FUNC) &_individual_create_integer_ragged_variable, 1}, - {"_individual_integer_ragged_variable_get_values", (DL_FUNC) &_individual_integer_ragged_variable_get_values, 1}, - {"_individual_integer_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_bitset, 2}, - {"_individual_integer_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_vector, 2}, - {"_individual_integer_ragged_variable_get_length", (DL_FUNC) &_individual_integer_ragged_variable_get_length, 1}, - {"_individual_integer_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_bitset, 2}, - {"_individual_integer_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_vector, 2}, - {"_individual_integer_ragged_variable_queue_fill", (DL_FUNC) &_individual_integer_ragged_variable_queue_fill, 2}, - {"_individual_integer_ragged_variable_queue_update", (DL_FUNC) &_individual_integer_ragged_variable_queue_update, 3}, - {"_individual_integer_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_update_bitset, 3}, - {"_individual_integer_ragged_variable_queue_extend", (DL_FUNC) &_individual_integer_ragged_variable_queue_extend, 2}, - {"_individual_integer_ragged_variable_queue_shrink", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink, 2}, - {"_individual_integer_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink_bitset, 2}, - {"_individual_create_render_vector", (DL_FUNC) &_individual_create_render_vector, 1}, - {"_individual_render_vector_update", (DL_FUNC) &_individual_render_vector_update, 3}, - {"_individual_render_vector_data", (DL_FUNC) &_individual_render_vector_data, 1}, - {"_individual_execute_process", (DL_FUNC) &_individual_execute_process, 2}, - {"_individual_variable_get_size", (DL_FUNC) &_individual_variable_get_size, 1}, - {"_individual_variable_update", (DL_FUNC) &_individual_variable_update, 1}, - {"_individual_variable_resize", (DL_FUNC) &_individual_variable_resize, 1}, - {"_individual_RcppExport_registerCCallable", (DL_FUNC) &_individual_RcppExport_registerCCallable, 0}, - {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 1}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_individual(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} +// Generated by using Rcpp::compileAttributes() -> do not edit by hand +// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +#include "../inst/include/individual.h" +#include "../inst/include/individual_types.h" +#include +#include +#include + +using namespace Rcpp; + +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + +// create_bitset +Rcpp::XPtr create_bitset(size_t size); +RcppExport SEXP _individual_create_bitset(SEXP sizeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); + rcpp_result_gen = Rcpp::wrap(create_bitset(size)); + return rcpp_result_gen; +END_RCPP +} +// bitset_copy +Rcpp::XPtr bitset_copy(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_copy(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_copy(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_insert +void bitset_insert(const Rcpp::XPtr b, std::vector v); +RcppExport SEXP _individual_bitset_insert(SEXP bSEXP, SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); + bitset_insert(b, v); + return R_NilValue; +END_RCPP +} +// bitset_remove +void bitset_remove(const Rcpp::XPtr b, std::vector v); +RcppExport SEXP _individual_bitset_remove(SEXP bSEXP, SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); + bitset_remove(b, v); + return R_NilValue; +END_RCPP +} +// bitset_clear +void bitset_clear(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_clear(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_clear(b); + return R_NilValue; +END_RCPP +} +// bitset_size +size_t bitset_size(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_size(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_size(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_max_size +size_t bitset_max_size(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_max_size(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_max_size(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_and +void bitset_and(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_and(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_and(a, b); + return R_NilValue; +END_RCPP +} +// bitset_not +Rcpp::XPtr bitset_not(const Rcpp::XPtr b, const bool inplace); +RcppExport SEXP _individual_bitset_not(SEXP bSEXP, SEXP inplaceSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const bool >::type inplace(inplaceSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_not(b, inplace)); + return rcpp_result_gen; +END_RCPP +} +// bitset_or +void bitset_or(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_or(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_or(a, b); + return R_NilValue; +END_RCPP +} +// bitset_copy_from +void bitset_copy_from(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_copy_from(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_copy_from(a, b); + return R_NilValue; +END_RCPP +} +// bitset_xor +void bitset_xor(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_xor(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_xor(a, b); + return R_NilValue; +END_RCPP +} +// bitset_set_difference +void bitset_set_difference(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_set_difference(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_set_difference(a, b); + return R_NilValue; +END_RCPP +} +// bitset_sample +void bitset_sample(const Rcpp::XPtr b, double rate); +RcppExport SEXP _individual_bitset_sample(SEXP bSEXP, SEXP rateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< double >::type rate(rateSEXP); + bitset_sample(b, rate); + return R_NilValue; +END_RCPP +} +// bitset_sample_vector +void bitset_sample_vector(const Rcpp::XPtr b, std::vector rate); +RcppExport SEXP _individual_bitset_sample_vector(SEXP bSEXP, SEXP rateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type rate(rateSEXP); + bitset_sample_vector(b, rate); + return R_NilValue; +END_RCPP +} +// bitset_to_vector +std::vector bitset_to_vector(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_to_vector(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_to_vector(b)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_integer +Rcpp::XPtr filter_bitset_integer(const Rcpp::XPtr b, std::vector other); +RcppExport SEXP _individual_filter_bitset_integer(SEXP bSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_integer(b, other)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_bitset +Rcpp::XPtr filter_bitset_bitset(const Rcpp::XPtr b, const Rcpp::XPtr other); +RcppExport SEXP _individual_filter_bitset_bitset(SEXP bSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_bitset(b, other)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_logical +Rcpp::XPtr filter_bitset_logical(const Rcpp::XPtr bitset, Rcpp::LogicalVector other); +RcppExport SEXP _individual_filter_bitset_logical(SEXP bitsetSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type bitset(bitsetSEXP); + Rcpp::traits::input_parameter< Rcpp::LogicalVector >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_logical(bitset, other)); + return rcpp_result_gen; +END_RCPP +} +// bitset_choose +void bitset_choose(const Rcpp::XPtr b, const size_t k); +RcppExport SEXP _individual_bitset_choose(SEXP bSEXP, SEXP kSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const size_t >::type k(kSEXP); + bitset_choose(b, k); + return R_NilValue; +END_RCPP +} +// create_categorical_variable +Rcpp::XPtr create_categorical_variable(const std::vector& categories, const std::vector& values); +RcppExport SEXP _individual_create_categorical_variable(SEXP categoriesSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type categories(categoriesSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_categorical_variable(categories, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_size +size_t categorical_variable_get_size(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_size(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_queue_update +void categorical_variable_queue_update(Rcpp::XPtr variable, const std::string& value, Rcpp::XPtr index); +RcppExport SEXP _individual_categorical_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + categorical_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_get_index_of +Rcpp::XPtr categorical_variable_get_index_of(Rcpp::XPtr variable, const std::vector& values); +RcppExport SEXP _individual_categorical_variable_get_index_of(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_index_of(variable, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_size_of +int categorical_variable_get_size_of(Rcpp::XPtr variable, const std::vector& values); +RcppExport SEXP _individual_categorical_variable_get_size_of(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size_of(variable, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_categories +std::vector categorical_variable_get_categories(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_categories(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_categories(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_queue_update_vector +void categorical_variable_queue_update_vector(Rcpp::XPtr variable, const std::string& value, std::vector& index); +RcppExport SEXP _individual_categorical_variable_queue_update_vector(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + categorical_variable_queue_update_vector(variable, value, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_update +void categorical_variable_update(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_update(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + categorical_variable_update(variable); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_extend +void categorical_variable_queue_extend(Rcpp::XPtr variable, std::vector& values); +RcppExport SEXP _individual_categorical_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type values(valuesSEXP); + categorical_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_shrink +void categorical_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_categorical_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + categorical_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_shrink_bitset +void categorical_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_categorical_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + categorical_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_get_values +std::vector categorical_variable_get_values(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_categorical_variable_get_values(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// dummy +void dummy(); +static SEXP _individual_dummy_try() { +BEGIN_RCPP + dummy(); + return R_NilValue; +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _individual_dummy() { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_individual_dummy_try()); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; +} +// create_double_variable +Rcpp::XPtr create_double_variable(const std::vector& values); +RcppExport SEXP _individual_create_double_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_double_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values +const std::vector& double_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values_at_index +std::vector double_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values_at_index_vector +std::vector double_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_index_of_range +Rcpp::XPtr double_variable_get_index_of_range(Rcpp::XPtr variable, const double a, const double b); +RcppExport SEXP _individual_double_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const double >::type a(aSEXP); + Rcpp::traits::input_parameter< const double >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_index_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_size_of_range +size_t double_variable_get_size_of_range(Rcpp::XPtr variable, const double a, const double b); +RcppExport SEXP _individual_double_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const double >::type a(aSEXP); + Rcpp::traits::input_parameter< const double >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_size_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_queue_fill +void double_variable_queue_fill(Rcpp::XPtr variable, std::vector value); +RcppExport SEXP _individual_double_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + double_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// double_variable_queue_update +void double_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); +RcppExport SEXP _individual_double_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_update_bitset +void double_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_extend +void double_variable_queue_extend(Rcpp::XPtr variable, std::vector values); +RcppExport SEXP _individual_double_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); + double_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// double_variable_queue_shrink +void double_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_shrink_bitset +void double_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_event +Rcpp::XPtr create_event(); +RcppExport SEXP _individual_create_event() { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = Rcpp::wrap(create_event()); + return rcpp_result_gen; +END_RCPP +} +// create_targeted_event +Rcpp::XPtr create_targeted_event(size_t size); +RcppExport SEXP _individual_create_targeted_event(SEXP sizeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); + rcpp_result_gen = Rcpp::wrap(create_targeted_event(size)); + return rcpp_result_gen; +END_RCPP +} +// event_base_tick +void event_base_tick(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_tick(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + event_base_tick(event); + return R_NilValue; +END_RCPP +} +// event_base_get_timestep +size_t event_base_get_timestep(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_get_timestep(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_base_get_timestep(event)); + return rcpp_result_gen; +END_RCPP +} +// event_base_set_timestep +void event_base_set_timestep(const Rcpp::XPtr event, size_t time); +RcppExport SEXP _individual_event_base_set_timestep(SEXP eventSEXP, SEXP timeSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< size_t >::type time(timeSEXP); + event_base_set_timestep(event, time); + return R_NilValue; +END_RCPP +} +// event_base_should_trigger +bool event_base_should_trigger(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_should_trigger(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_base_should_trigger(event)); + return rcpp_result_gen; +END_RCPP +} +// event_schedule +void event_schedule(const Rcpp::XPtr event, std::vector delays); +RcppExport SEXP _individual_event_schedule(SEXP eventSEXP, SEXP delaysSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type delays(delaysSEXP); + event_schedule(event, delays); + return R_NilValue; +END_RCPP +} +// event_clear_schedule +void event_clear_schedule(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_clear_schedule(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + event_clear_schedule(event); + return R_NilValue; +END_RCPP +} +// event_checkpoint +std::vector event_checkpoint(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_checkpoint(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_checkpoint(event)); + return rcpp_result_gen; +END_RCPP +} +// event_restore +void event_restore(const Rcpp::XPtr event, std::vector schedule); +RcppExport SEXP _individual_event_restore(SEXP eventSEXP, SEXP scheduleSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type schedule(scheduleSEXP); + event_restore(event, schedule); + return R_NilValue; +END_RCPP +} +// targeted_event_clear_schedule_vector +void targeted_event_clear_schedule_vector(const Rcpp::XPtr event, std::vector target); +RcppExport SEXP _individual_targeted_event_clear_schedule_vector(SEXP eventSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + targeted_event_clear_schedule_vector(event, target); + return R_NilValue; +END_RCPP +} +// targeted_event_clear_schedule +void targeted_event_clear_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target); +RcppExport SEXP _individual_targeted_event_clear_schedule(SEXP eventSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + targeted_event_clear_schedule(event, target); + return R_NilValue; +END_RCPP +} +// targeted_event_get_scheduled +Rcpp::XPtr targeted_event_get_scheduled(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_get_scheduled(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_get_scheduled(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_schedule +void targeted_event_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target, double delay); +RcppExport SEXP _individual_targeted_event_schedule(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + Rcpp::traits::input_parameter< double >::type delay(delaySEXP); + targeted_event_schedule(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_shrink_bitset +void targeted_event_queue_shrink_bitset(const Rcpp::XPtr event, const Rcpp::XPtr index); +RcppExport SEXP _individual_targeted_event_queue_shrink_bitset(SEXP eventSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type index(indexSEXP); + targeted_event_queue_shrink_bitset(event, index); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_shrink +void targeted_event_queue_shrink(const Rcpp::XPtr event, std::vector& index); +RcppExport SEXP _individual_targeted_event_queue_shrink(SEXP eventSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + targeted_event_queue_shrink(event, index); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_extend +void targeted_event_queue_extend(const Rcpp::XPtr event, size_t n); +RcppExport SEXP _individual_targeted_event_queue_extend(SEXP eventSEXP, SEXP nSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< size_t >::type n(nSEXP); + targeted_event_queue_extend(event, n); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_extend_with_schedule +void targeted_event_queue_extend_with_schedule(const Rcpp::XPtr event, const std::vector& delays); +RcppExport SEXP _individual_targeted_event_queue_extend_with_schedule(SEXP eventSEXP, SEXP delaysSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type delays(delaysSEXP); + targeted_event_queue_extend_with_schedule(event, delays); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_vector +void targeted_event_schedule_vector(const Rcpp::XPtr event, std::vector target, double delay); +RcppExport SEXP _individual_targeted_event_schedule_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + Rcpp::traits::input_parameter< double >::type delay(delaySEXP); + targeted_event_schedule_vector(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_multi_delay +void targeted_event_schedule_multi_delay(const Rcpp::XPtr event, const Rcpp::XPtr target, const std::vector delay); +RcppExport SEXP _individual_targeted_event_schedule_multi_delay(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); + targeted_event_schedule_multi_delay(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_multi_delay_vector +void targeted_event_schedule_multi_delay_vector(const Rcpp::XPtr event, std::vector target, const std::vector delay); +RcppExport SEXP _individual_targeted_event_schedule_multi_delay_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); + targeted_event_schedule_multi_delay_vector(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_get_target +Rcpp::XPtr targeted_event_get_target(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_get_target(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_get_target(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_resize +void targeted_event_resize(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_resize(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + targeted_event_resize(event); + return R_NilValue; +END_RCPP +} +// targeted_event_checkpoint +Rcpp::List targeted_event_checkpoint(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_checkpoint(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_checkpoint(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_restore +void targeted_event_restore(const Rcpp::XPtr event, Rcpp::List state); +RcppExport SEXP _individual_targeted_event_restore(SEXP eventSEXP, SEXP stateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type state(stateSEXP); + targeted_event_restore(event, state); + return R_NilValue; +END_RCPP +} +// process_listener +void process_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener); +RcppExport SEXP _individual_process_listener(SEXP eventSEXP, SEXP listenerSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); + process_listener(event, listener); + return R_NilValue; +END_RCPP +} +// process_targeted_listener +void process_targeted_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener, const Rcpp::XPtr target); +RcppExport SEXP _individual_process_targeted_listener(SEXP eventSEXP, SEXP listenerSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + process_targeted_listener(event, listener, target); + return R_NilValue; +END_RCPP +} +// create_integer_variable +Rcpp::XPtr create_integer_variable(const std::vector& values); +RcppExport SEXP _individual_create_integer_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_integer_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values +const std::vector& integer_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_modulo_differences +individual_index_t integer_variable_get_modulo_differences(Rcpp::XPtr variable, const int value, const int difference); +RcppExport SEXP _individual_integer_variable_get_modulo_differences(SEXP variableSEXP, SEXP valueSEXP, SEXP differenceSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type value(valueSEXP); + Rcpp::traits::input_parameter< const int >::type difference(differenceSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_modulo_differences(variable, value, difference)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values_at_index +std::vector integer_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values_at_index_vector +std::vector integer_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_set_vector +Rcpp::XPtr integer_variable_get_index_of_set_vector(Rcpp::XPtr variable, std::vector values_set); +RcppExport SEXP _individual_integer_variable_get_index_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_vector(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_set_scalar +Rcpp::XPtr integer_variable_get_index_of_set_scalar(Rcpp::XPtr variable, const int values_set); +RcppExport SEXP _individual_integer_variable_get_index_of_set_scalar(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_scalar(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_range +Rcpp::XPtr integer_variable_get_index_of_range(Rcpp::XPtr variable, const int a, const int b); +RcppExport SEXP _individual_integer_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type a(aSEXP); + Rcpp::traits::input_parameter< const int >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_set_vector +size_t integer_variable_get_size_of_set_vector(Rcpp::XPtr variable, const std::vector values_set); +RcppExport SEXP _individual_integer_variable_get_size_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_vector(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_set_scalar +size_t integer_variable_get_size_of_set_scalar(Rcpp::XPtr variable, const int value); +RcppExport SEXP _individual_integer_variable_get_size_of_set_scalar(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type value(valueSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_scalar(variable, value)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_range +size_t integer_variable_get_size_of_range(Rcpp::XPtr variable, const int a, const int b); +RcppExport SEXP _individual_integer_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type a(aSEXP); + Rcpp::traits::input_parameter< const int >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_queue_fill +void integer_variable_queue_fill(Rcpp::XPtr variable, std::vector value); +RcppExport SEXP _individual_integer_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + integer_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_update +void integer_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); +RcppExport SEXP _individual_integer_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_update_bitset +void integer_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_extend +void integer_variable_queue_extend(Rcpp::XPtr variable, std::vector values); +RcppExport SEXP _individual_integer_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); + integer_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_shrink +void integer_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_shrink_bitset +void integer_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// fixed_probability_multinomial_process_internal +Rcpp::XPtr fixed_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const double rate, const std::vector destination_probabilities); +RcppExport SEXP _individual_fixed_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rateSEXP, SEXP destination_probabilitiesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); + Rcpp::traits::input_parameter< const double >::type rate(rateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); + rcpp_result_gen = Rcpp::wrap(fixed_probability_multinomial_process_internal(variable, source_state, destination_states, rate, destination_probabilities)); + return rcpp_result_gen; +END_RCPP +} +// multi_probability_multinomial_process_internal +Rcpp::XPtr multi_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const Rcpp::XPtr rate_variable, const std::vector destination_probabilities); +RcppExport SEXP _individual_multi_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rate_variableSEXP, SEXP destination_probabilitiesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); + rcpp_result_gen = Rcpp::wrap(multi_probability_multinomial_process_internal(variable, source_state, destination_states, rate_variable, destination_probabilities)); + return rcpp_result_gen; +END_RCPP +} +// multi_probability_bernoulli_process_internal +Rcpp::XPtr multi_probability_bernoulli_process_internal(Rcpp::XPtr variable, const std::string from, const std::string to, const Rcpp::XPtr rate_variable); +RcppExport SEXP _individual_multi_probability_bernoulli_process_internal(SEXP variableSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP rate_variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type from(fromSEXP); + Rcpp::traits::input_parameter< const std::string >::type to(toSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); + rcpp_result_gen = Rcpp::wrap(multi_probability_bernoulli_process_internal(variable, from, to, rate_variable)); + return rcpp_result_gen; +END_RCPP +} +// infection_age_process_internal +Rcpp::XPtr infection_age_process_internal(Rcpp::XPtr state, const std::string susceptible, const std::string exposed, const std::string infectious, const Rcpp::XPtr age, const int age_bins, const double p, const double dt, const Rcpp::NumericMatrix mixing); +RcppExport SEXP _individual_infection_age_process_internal(SEXP stateSEXP, SEXP susceptibleSEXP, SEXP exposedSEXP, SEXP infectiousSEXP, SEXP ageSEXP, SEXP age_binsSEXP, SEXP pSEXP, SEXP dtSEXP, SEXP mixingSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type state(stateSEXP); + Rcpp::traits::input_parameter< const std::string >::type susceptible(susceptibleSEXP); + Rcpp::traits::input_parameter< const std::string >::type exposed(exposedSEXP); + Rcpp::traits::input_parameter< const std::string >::type infectious(infectiousSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type age(ageSEXP); + Rcpp::traits::input_parameter< const int >::type age_bins(age_binsSEXP); + Rcpp::traits::input_parameter< const double >::type p(pSEXP); + Rcpp::traits::input_parameter< const double >::type dt(dtSEXP); + Rcpp::traits::input_parameter< const Rcpp::NumericMatrix >::type mixing(mixingSEXP); + rcpp_result_gen = Rcpp::wrap(infection_age_process_internal(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing)); + return rcpp_result_gen; +END_RCPP +} +// create_double_ragged_variable +Rcpp::XPtr create_double_ragged_variable(const std::vector>& values); +RcppExport SEXP _individual_create_double_ragged_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_double_ragged_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values +std::vector> double_ragged_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_ragged_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values_at_index_bitset +std::vector> double_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values_at_index_vector +std::vector> double_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length +std::vector double_ragged_variable_get_length(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_ragged_variable_get_length(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length_at_index_bitset +std::vector double_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length_at_index_vector +std::vector double_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_queue_fill +void double_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); +RcppExport SEXP _individual_double_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + double_ragged_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_update +void double_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_ragged_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_update_bitset +void double_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_ragged_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_extend +void double_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); +RcppExport SEXP _individual_double_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); + double_ragged_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_shrink +void double_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_double_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + double_ragged_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_shrink_bitset +void double_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_ragged_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_integer_ragged_variable +Rcpp::XPtr create_integer_ragged_variable(const std::vector>& values); +RcppExport SEXP _individual_create_integer_ragged_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_integer_ragged_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values +std::vector> integer_ragged_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_ragged_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values_at_index_bitset +std::vector> integer_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values_at_index_vector +std::vector> integer_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length +std::vector integer_ragged_variable_get_length(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_ragged_variable_get_length(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length_at_index_bitset +std::vector integer_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length_at_index_vector +std::vector integer_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_queue_fill +void integer_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); +RcppExport SEXP _individual_integer_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + integer_ragged_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_update +void integer_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_ragged_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_update_bitset +void integer_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_ragged_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_extend +void integer_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); +RcppExport SEXP _individual_integer_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); + integer_ragged_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_shrink +void integer_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_integer_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + integer_ragged_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_shrink_bitset +void integer_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_ragged_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_render_vector +Rcpp::XPtr create_render_vector(std::vector data); +RcppExport SEXP _individual_create_render_vector(SEXP dataSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< std::vector >::type data(dataSEXP); + rcpp_result_gen = Rcpp::wrap(create_render_vector(data)); + return rcpp_result_gen; +END_RCPP +} +// render_vector_update +void render_vector_update(Rcpp::XPtr v, size_t index, double value); +RcppExport SEXP _individual_render_vector_update(SEXP vSEXP, SEXP indexSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); + Rcpp::traits::input_parameter< size_t >::type index(indexSEXP); + Rcpp::traits::input_parameter< double >::type value(valueSEXP); + render_vector_update(v, index, value); + return R_NilValue; +END_RCPP +} +// render_vector_data +std::vector render_vector_data(Rcpp::XPtr v); +RcppExport SEXP _individual_render_vector_data(SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); + rcpp_result_gen = Rcpp::wrap(render_vector_data(v)); + return rcpp_result_gen; +END_RCPP +} +// execute_process +void execute_process(Rcpp::XPtr process, size_t timestep); +RcppExport SEXP _individual_execute_process(SEXP processSEXP, SEXP timestepSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type process(processSEXP); + Rcpp::traits::input_parameter< size_t >::type timestep(timestepSEXP); + execute_process(process, timestep); + return R_NilValue; +END_RCPP +} +// variable_get_size +size_t variable_get_size(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_get_size(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(variable_get_size(variable)); + return rcpp_result_gen; +END_RCPP +} +// variable_update +void variable_update(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_update(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + variable_update(variable); + return R_NilValue; +END_RCPP +} +// variable_resize +void variable_resize(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_resize(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + variable_resize(variable); + return R_NilValue; +END_RCPP +} + +// validate (ensure exported C++ functions exist before calling them) +static int _individual_RcppExport_validate(const char* sig) { + static std::set signatures; + if (signatures.empty()) { + signatures.insert("void(*dummy)()"); + } + return signatures.find(sig) != signatures.end(); +} + +// registerCCallable (register entry points for exported C++ functions) +RcppExport SEXP _individual_RcppExport_registerCCallable() { + R_RegisterCCallable("individual", "_individual_dummy", (DL_FUNC)_individual_dummy_try); + R_RegisterCCallable("individual", "_individual_RcppExport_validate", (DL_FUNC)_individual_RcppExport_validate); + return R_NilValue; +} + +RcppExport SEXP run_testthat_tests(SEXP); + +static const R_CallMethodDef CallEntries[] = { + {"_individual_create_bitset", (DL_FUNC) &_individual_create_bitset, 1}, + {"_individual_bitset_copy", (DL_FUNC) &_individual_bitset_copy, 1}, + {"_individual_bitset_insert", (DL_FUNC) &_individual_bitset_insert, 2}, + {"_individual_bitset_remove", (DL_FUNC) &_individual_bitset_remove, 2}, + {"_individual_bitset_clear", (DL_FUNC) &_individual_bitset_clear, 1}, + {"_individual_bitset_size", (DL_FUNC) &_individual_bitset_size, 1}, + {"_individual_bitset_max_size", (DL_FUNC) &_individual_bitset_max_size, 1}, + {"_individual_bitset_and", (DL_FUNC) &_individual_bitset_and, 2}, + {"_individual_bitset_not", (DL_FUNC) &_individual_bitset_not, 2}, + {"_individual_bitset_or", (DL_FUNC) &_individual_bitset_or, 2}, + {"_individual_bitset_copy_from", (DL_FUNC) &_individual_bitset_copy_from, 2}, + {"_individual_bitset_xor", (DL_FUNC) &_individual_bitset_xor, 2}, + {"_individual_bitset_set_difference", (DL_FUNC) &_individual_bitset_set_difference, 2}, + {"_individual_bitset_sample", (DL_FUNC) &_individual_bitset_sample, 2}, + {"_individual_bitset_sample_vector", (DL_FUNC) &_individual_bitset_sample_vector, 2}, + {"_individual_bitset_to_vector", (DL_FUNC) &_individual_bitset_to_vector, 1}, + {"_individual_filter_bitset_integer", (DL_FUNC) &_individual_filter_bitset_integer, 2}, + {"_individual_filter_bitset_bitset", (DL_FUNC) &_individual_filter_bitset_bitset, 2}, + {"_individual_filter_bitset_logical", (DL_FUNC) &_individual_filter_bitset_logical, 2}, + {"_individual_bitset_choose", (DL_FUNC) &_individual_bitset_choose, 2}, + {"_individual_create_categorical_variable", (DL_FUNC) &_individual_create_categorical_variable, 2}, + {"_individual_categorical_variable_get_size", (DL_FUNC) &_individual_categorical_variable_get_size, 1}, + {"_individual_categorical_variable_queue_update", (DL_FUNC) &_individual_categorical_variable_queue_update, 3}, + {"_individual_categorical_variable_get_index_of", (DL_FUNC) &_individual_categorical_variable_get_index_of, 2}, + {"_individual_categorical_variable_get_size_of", (DL_FUNC) &_individual_categorical_variable_get_size_of, 2}, + {"_individual_categorical_variable_get_categories", (DL_FUNC) &_individual_categorical_variable_get_categories, 1}, + {"_individual_categorical_variable_queue_update_vector", (DL_FUNC) &_individual_categorical_variable_queue_update_vector, 3}, + {"_individual_categorical_variable_update", (DL_FUNC) &_individual_categorical_variable_update, 1}, + {"_individual_categorical_variable_queue_extend", (DL_FUNC) &_individual_categorical_variable_queue_extend, 2}, + {"_individual_categorical_variable_queue_shrink", (DL_FUNC) &_individual_categorical_variable_queue_shrink, 2}, + {"_individual_categorical_variable_queue_shrink_bitset", (DL_FUNC) &_individual_categorical_variable_queue_shrink_bitset, 2}, + {"_individual_categorical_variable_get_values", (DL_FUNC) &_individual_categorical_variable_get_values, 2}, + {"_individual_dummy", (DL_FUNC) &_individual_dummy, 0}, + {"_individual_create_double_variable", (DL_FUNC) &_individual_create_double_variable, 1}, + {"_individual_double_variable_get_values", (DL_FUNC) &_individual_double_variable_get_values, 1}, + {"_individual_double_variable_get_values_at_index", (DL_FUNC) &_individual_double_variable_get_values_at_index, 2}, + {"_individual_double_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_variable_get_values_at_index_vector, 2}, + {"_individual_double_variable_get_index_of_range", (DL_FUNC) &_individual_double_variable_get_index_of_range, 3}, + {"_individual_double_variable_get_size_of_range", (DL_FUNC) &_individual_double_variable_get_size_of_range, 3}, + {"_individual_double_variable_queue_fill", (DL_FUNC) &_individual_double_variable_queue_fill, 2}, + {"_individual_double_variable_queue_update", (DL_FUNC) &_individual_double_variable_queue_update, 3}, + {"_individual_double_variable_queue_update_bitset", (DL_FUNC) &_individual_double_variable_queue_update_bitset, 3}, + {"_individual_double_variable_queue_extend", (DL_FUNC) &_individual_double_variable_queue_extend, 2}, + {"_individual_double_variable_queue_shrink", (DL_FUNC) &_individual_double_variable_queue_shrink, 2}, + {"_individual_double_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_variable_queue_shrink_bitset, 2}, + {"_individual_create_event", (DL_FUNC) &_individual_create_event, 0}, + {"_individual_create_targeted_event", (DL_FUNC) &_individual_create_targeted_event, 1}, + {"_individual_event_base_tick", (DL_FUNC) &_individual_event_base_tick, 1}, + {"_individual_event_base_get_timestep", (DL_FUNC) &_individual_event_base_get_timestep, 1}, + {"_individual_event_base_set_timestep", (DL_FUNC) &_individual_event_base_set_timestep, 2}, + {"_individual_event_base_should_trigger", (DL_FUNC) &_individual_event_base_should_trigger, 1}, + {"_individual_event_schedule", (DL_FUNC) &_individual_event_schedule, 2}, + {"_individual_event_clear_schedule", (DL_FUNC) &_individual_event_clear_schedule, 1}, + {"_individual_event_checkpoint", (DL_FUNC) &_individual_event_checkpoint, 1}, + {"_individual_event_restore", (DL_FUNC) &_individual_event_restore, 2}, + {"_individual_targeted_event_clear_schedule_vector", (DL_FUNC) &_individual_targeted_event_clear_schedule_vector, 2}, + {"_individual_targeted_event_clear_schedule", (DL_FUNC) &_individual_targeted_event_clear_schedule, 2}, + {"_individual_targeted_event_get_scheduled", (DL_FUNC) &_individual_targeted_event_get_scheduled, 1}, + {"_individual_targeted_event_schedule", (DL_FUNC) &_individual_targeted_event_schedule, 3}, + {"_individual_targeted_event_queue_shrink_bitset", (DL_FUNC) &_individual_targeted_event_queue_shrink_bitset, 2}, + {"_individual_targeted_event_queue_shrink", (DL_FUNC) &_individual_targeted_event_queue_shrink, 2}, + {"_individual_targeted_event_queue_extend", (DL_FUNC) &_individual_targeted_event_queue_extend, 2}, + {"_individual_targeted_event_queue_extend_with_schedule", (DL_FUNC) &_individual_targeted_event_queue_extend_with_schedule, 2}, + {"_individual_targeted_event_schedule_vector", (DL_FUNC) &_individual_targeted_event_schedule_vector, 3}, + {"_individual_targeted_event_schedule_multi_delay", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay, 3}, + {"_individual_targeted_event_schedule_multi_delay_vector", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay_vector, 3}, + {"_individual_targeted_event_get_target", (DL_FUNC) &_individual_targeted_event_get_target, 1}, + {"_individual_targeted_event_resize", (DL_FUNC) &_individual_targeted_event_resize, 1}, + {"_individual_targeted_event_checkpoint", (DL_FUNC) &_individual_targeted_event_checkpoint, 1}, + {"_individual_targeted_event_restore", (DL_FUNC) &_individual_targeted_event_restore, 2}, + {"_individual_process_listener", (DL_FUNC) &_individual_process_listener, 2}, + {"_individual_process_targeted_listener", (DL_FUNC) &_individual_process_targeted_listener, 3}, + {"_individual_create_integer_variable", (DL_FUNC) &_individual_create_integer_variable, 1}, + {"_individual_integer_variable_get_values", (DL_FUNC) &_individual_integer_variable_get_values, 1}, + {"_individual_integer_variable_get_modulo_differences", (DL_FUNC) &_individual_integer_variable_get_modulo_differences, 3}, + {"_individual_integer_variable_get_values_at_index", (DL_FUNC) &_individual_integer_variable_get_values_at_index, 2}, + {"_individual_integer_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_variable_get_values_at_index_vector, 2}, + {"_individual_integer_variable_get_index_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_index_of_set_vector, 2}, + {"_individual_integer_variable_get_index_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_index_of_set_scalar, 2}, + {"_individual_integer_variable_get_index_of_range", (DL_FUNC) &_individual_integer_variable_get_index_of_range, 3}, + {"_individual_integer_variable_get_size_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_size_of_set_vector, 2}, + {"_individual_integer_variable_get_size_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_size_of_set_scalar, 2}, + {"_individual_integer_variable_get_size_of_range", (DL_FUNC) &_individual_integer_variable_get_size_of_range, 3}, + {"_individual_integer_variable_queue_fill", (DL_FUNC) &_individual_integer_variable_queue_fill, 2}, + {"_individual_integer_variable_queue_update", (DL_FUNC) &_individual_integer_variable_queue_update, 3}, + {"_individual_integer_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_variable_queue_update_bitset, 3}, + {"_individual_integer_variable_queue_extend", (DL_FUNC) &_individual_integer_variable_queue_extend, 2}, + {"_individual_integer_variable_queue_shrink", (DL_FUNC) &_individual_integer_variable_queue_shrink, 2}, + {"_individual_integer_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_variable_queue_shrink_bitset, 2}, + {"_individual_fixed_probability_multinomial_process_internal", (DL_FUNC) &_individual_fixed_probability_multinomial_process_internal, 5}, + {"_individual_multi_probability_multinomial_process_internal", (DL_FUNC) &_individual_multi_probability_multinomial_process_internal, 5}, + {"_individual_multi_probability_bernoulli_process_internal", (DL_FUNC) &_individual_multi_probability_bernoulli_process_internal, 4}, + {"_individual_infection_age_process_internal", (DL_FUNC) &_individual_infection_age_process_internal, 9}, + {"_individual_create_double_ragged_variable", (DL_FUNC) &_individual_create_double_ragged_variable, 1}, + {"_individual_double_ragged_variable_get_values", (DL_FUNC) &_individual_double_ragged_variable_get_values, 1}, + {"_individual_double_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_bitset, 2}, + {"_individual_double_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_vector, 2}, + {"_individual_double_ragged_variable_get_length", (DL_FUNC) &_individual_double_ragged_variable_get_length, 1}, + {"_individual_double_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_bitset, 2}, + {"_individual_double_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_vector, 2}, + {"_individual_double_ragged_variable_queue_fill", (DL_FUNC) &_individual_double_ragged_variable_queue_fill, 2}, + {"_individual_double_ragged_variable_queue_update", (DL_FUNC) &_individual_double_ragged_variable_queue_update, 3}, + {"_individual_double_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_update_bitset, 3}, + {"_individual_double_ragged_variable_queue_extend", (DL_FUNC) &_individual_double_ragged_variable_queue_extend, 2}, + {"_individual_double_ragged_variable_queue_shrink", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink, 2}, + {"_individual_double_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink_bitset, 2}, + {"_individual_create_integer_ragged_variable", (DL_FUNC) &_individual_create_integer_ragged_variable, 1}, + {"_individual_integer_ragged_variable_get_values", (DL_FUNC) &_individual_integer_ragged_variable_get_values, 1}, + {"_individual_integer_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_bitset, 2}, + {"_individual_integer_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_vector, 2}, + {"_individual_integer_ragged_variable_get_length", (DL_FUNC) &_individual_integer_ragged_variable_get_length, 1}, + {"_individual_integer_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_bitset, 2}, + {"_individual_integer_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_vector, 2}, + {"_individual_integer_ragged_variable_queue_fill", (DL_FUNC) &_individual_integer_ragged_variable_queue_fill, 2}, + {"_individual_integer_ragged_variable_queue_update", (DL_FUNC) &_individual_integer_ragged_variable_queue_update, 3}, + {"_individual_integer_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_update_bitset, 3}, + {"_individual_integer_ragged_variable_queue_extend", (DL_FUNC) &_individual_integer_ragged_variable_queue_extend, 2}, + {"_individual_integer_ragged_variable_queue_shrink", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink, 2}, + {"_individual_integer_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink_bitset, 2}, + {"_individual_create_render_vector", (DL_FUNC) &_individual_create_render_vector, 1}, + {"_individual_render_vector_update", (DL_FUNC) &_individual_render_vector_update, 3}, + {"_individual_render_vector_data", (DL_FUNC) &_individual_render_vector_data, 1}, + {"_individual_execute_process", (DL_FUNC) &_individual_execute_process, 2}, + {"_individual_variable_get_size", (DL_FUNC) &_individual_variable_get_size, 1}, + {"_individual_variable_update", (DL_FUNC) &_individual_variable_update, 1}, + {"_individual_variable_resize", (DL_FUNC) &_individual_variable_resize, 1}, + {"_individual_RcppExport_registerCCallable", (DL_FUNC) &_individual_RcppExport_registerCCallable, 0}, + {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 1}, + {NULL, NULL, 0} +}; + +RcppExport void R_init_individual(DllInfo *dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); +} diff --git a/src/categorical_variable.cpp b/src/categorical_variable.cpp index f8c99fa..3975b22 100644 --- a/src/categorical_variable.cpp +++ b/src/categorical_variable.cpp @@ -103,3 +103,14 @@ void categorical_variable_queue_shrink_bitset( ) { variable->queue_shrink(*index); } + +//[[Rcpp::export]] +std::vector categorical_variable_get_values( + Rcpp::XPtr variable, + std::vector& index + ) { + decrement(index); + std::vector results; + results = variable->get_values(index); + return results; +} \ No newline at end of file diff --git a/src/integer_variable.cpp b/src/integer_variable.cpp index b878520..90c362a 100644 --- a/src/integer_variable.cpp +++ b/src/integer_variable.cpp @@ -26,6 +26,15 @@ const std::vector& integer_variable_get_values( return variable->get_values(); } +//[[Rcpp::export]] +individual_index_t integer_variable_get_modulo_differences( + Rcpp::XPtr variable, + const int value, + const int difference +) { + return variable->get_modulo_differences(value, difference); +} + //[[Rcpp::export]] std::vector integer_variable_get_values_at_index( Rcpp::XPtr variable, From ddfb1613f8695ec5dff9205f683d744e0ac75ff9 Mon Sep 17 00:00:00 2001 From: Jason Wood <91839602+JasonRWood@users.noreply.github.com> Date: Wed, 6 Aug 2025 09:51:27 +0100 Subject: [PATCH 02/13] Update individual_types.h Realised I'd left a commented out line that was part of an earlier idea --- inst/include/individual_types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/inst/include/individual_types.h b/inst/include/individual_types.h index 8386ca9..8d4a925 100644 --- a/inst/include/individual_types.h +++ b/inst/include/individual_types.h @@ -10,7 +10,6 @@ #include #include "CategoricalVariable.h" -// #include "FunctionalVariable.h" #include "IntegerVariable.h" #include "DoubleVariable.h" #include "RaggedInteger.h" From b6f1177d344bb5dd71ea87e089f7fa8f4fc34622 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Wed, 6 Aug 2025 10:18:21 +0100 Subject: [PATCH 03/13] Update cache action --- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/pkgdown.yml | 2 +- .github/workflows/test_coverage.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8928644..6deca2c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -43,7 +43,7 @@ jobs: shell: Rscript {0} - name: Restore R package cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 3b8baf9..5422bdd 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -30,7 +30,7 @@ jobs: shell: Rscript {0} - name: Cache R packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index b8f2c4d..09b0098 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -27,7 +27,7 @@ jobs: shell: Rscript {0} - name: Cache R packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} From 4c0df4286ff2cd414b5d9f270732b496bf49d177 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Wed, 6 Aug 2025 10:27:44 +0100 Subject: [PATCH 04/13] Change ubuntu action --- .github/workflows/R-CMD-check.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6deca2c..a35eaac 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -18,8 +18,7 @@ jobs: config: - {os: windows-latest, r: 'release'} - {os: macOS-latest, r: 'release'} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } + - {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true From 42468bd12f8348ed8daf60e4ba4f99d7b5fc4a63 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Wed, 6 Aug 2025 11:01:48 +0100 Subject: [PATCH 05/13] Update benchmarking documentation in contributing --- tests/performance/benchmark.sh | 2 -- vignettes/Contributing.Rmd | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 tests/performance/benchmark.sh diff --git a/tests/performance/benchmark.sh b/tests/performance/benchmark.sh deleted file mode 100644 index 8793550..0000000 --- a/tests/performance/benchmark.sh +++ /dev/null @@ -1,2 +0,0 @@ -R -e "library('remotes'); install_local()" -/usr/bin/time -v Rscript tests/performance/big_deterministic.R diff --git a/vignettes/Contributing.Rmd b/vignettes/Contributing.Rmd index ed345ed..2a562cf 100644 --- a/vignettes/Contributing.Rmd +++ b/vignettes/Contributing.Rmd @@ -77,6 +77,10 @@ Our review process is based off of [RESIDE's PR review process](https://reside-i ## Microbenchmarks +We have R based benchmarks in tests/performance. Please add new benchmarks for performance critical code. + +Please note the google benchmarks are deprecated. The below instructions will not work since building requires including R and Rcpp. + We use [google benchmark](https://github.com/google/benchmark) for our microbenchmarks. You can compile and run the benchmarks like this: @@ -92,4 +96,4 @@ g++ *_benchmark.cpp -std=c++14 -lbenchmark -lpthread -o benchmark.out * More Variables * Speed optimisations (tests TBC) * CRAN - * Anything on the github issue board \ No newline at end of file + * Anything on the github issue board From 82baa863c172aa5fc572d78e4470bd537312a5db Mon Sep 17 00:00:00 2001 From: Jason Wood Date: Thu, 7 Aug 2025 12:06:35 +0100 Subject: [PATCH 06/13] adding no index case, adding tests to verify functionality --- R/RcppExports.R | 8 +- R/categorical_variable.R | 10 +- inst/include/CategoricalVariable.h | 22 ++ inst/include/individual_types.h | 1 - src/RcppExports.cpp | 20 +- src/categorical_variable.cpp | 8 + .../test-categoricalvariable-resize.R | 134 +++++----- tests/testthat/test-categoricalvariable.R | 229 ++++++++++-------- 8 files changed, 258 insertions(+), 174 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index 6967dfe..d941673 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -125,8 +125,12 @@ categorical_variable_queue_shrink_bitset <- function(variable, index) { invisible(.Call(`_individual_categorical_variable_queue_shrink_bitset`, variable, index)) } -categorical_variable_get_values <- function(variable, index) { - .Call(`_individual_categorical_variable_get_values`, variable, index) +categorical_variable_get_values <- function(variable) { + .Call(`_individual_categorical_variable_get_values`, variable) +} + +categorical_variable_get_values_with_index <- function(variable, index) { + .Call(`_individual_categorical_variable_get_values_with_index`, variable, index) } create_double_variable <- function(values) { diff --git a/R/categorical_variable.R b/R/categorical_variable.R index 93e5eb9..4a882af 100644 --- a/R/categorical_variable.R +++ b/R/categorical_variable.R @@ -45,10 +45,16 @@ CategoricalVariable <- R6Class( #' @description return the value of the variable for the given individuals #' @param index the indices of individuals whose categories will be returned - get_values = function(index) { + get_values = function(index = NULL) { stopifnot(is.finite(index)) stopifnot(index > 0) - results <- categorical_variable_get_values(self$.variable, index) + if (length(index) == 0){ + # temp_inds <- + results <- categorical_variable_get_values(self$.variable) + } + else{ + results <- categorical_variable_get_values_with_index(self$.variable, index) + } return(results) }, diff --git a/inst/include/CategoricalVariable.h b/inst/include/CategoricalVariable.h index 66aefb0..91e1ce1 100644 --- a/inst/include/CategoricalVariable.h +++ b/inst/include/CategoricalVariable.h @@ -53,6 +53,7 @@ class CategoricalVariable : public Variable { virtual size_t size() const override; virtual void update() override; virtual std::vector get_values(const std::vector&); + virtual std::vector get_values(); }; @@ -250,4 +251,25 @@ inline std::vector CategoricalVariable::get_values(const std::vecto } return result; } +//' @title get values of full variable +inline std::vector CategoricalVariable::get_values(){ + + // Generate empty output vector + auto result = std::vector(size()); + for(auto i = 0u; i < size(); ++i){ + // Determine which category the individual is within + for (auto cat: categories) { + if (indices.find(cat) == indices.end()) { + std::stringstream message; + message << "unknown category: " << cat; + Rcpp::stop(message.str()); + } + if (indices.at(cat).find(i) != indices.at(cat).end()) { + result[i] = cat; + break; + } + } + } + return result; +} #endif /* INST_INCLUDE_CATEGORICAL_VARIABLE_H_ */ diff --git a/inst/include/individual_types.h b/inst/include/individual_types.h index 8386ca9..8d4a925 100644 --- a/inst/include/individual_types.h +++ b/inst/include/individual_types.h @@ -10,7 +10,6 @@ #include #include "CategoricalVariable.h" -// #include "FunctionalVariable.h" #include "IntegerVariable.h" #include "DoubleVariable.h" #include "RaggedInteger.h" diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 7309f3e..94c6a58 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -363,14 +363,25 @@ BEGIN_RCPP END_RCPP } // categorical_variable_get_values -std::vector categorical_variable_get_values(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_categorical_variable_get_values(SEXP variableSEXP, SEXP indexSEXP) { +std::vector categorical_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_values_with_index +std::vector categorical_variable_get_values_with_index(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_categorical_variable_get_values_with_index(SEXP variableSEXP, SEXP indexSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values(variable, index)); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values_with_index(variable, index)); return rcpp_result_gen; END_RCPP } @@ -1533,7 +1544,8 @@ static const R_CallMethodDef CallEntries[] = { {"_individual_categorical_variable_queue_extend", (DL_FUNC) &_individual_categorical_variable_queue_extend, 2}, {"_individual_categorical_variable_queue_shrink", (DL_FUNC) &_individual_categorical_variable_queue_shrink, 2}, {"_individual_categorical_variable_queue_shrink_bitset", (DL_FUNC) &_individual_categorical_variable_queue_shrink_bitset, 2}, - {"_individual_categorical_variable_get_values", (DL_FUNC) &_individual_categorical_variable_get_values, 2}, + {"_individual_categorical_variable_get_values", (DL_FUNC) &_individual_categorical_variable_get_values, 1}, + {"_individual_categorical_variable_get_values_with_index", (DL_FUNC) &_individual_categorical_variable_get_values_with_index, 2}, {"_individual_dummy", (DL_FUNC) &_individual_dummy, 0}, {"_individual_create_double_variable", (DL_FUNC) &_individual_create_double_variable, 1}, {"_individual_double_variable_get_values", (DL_FUNC) &_individual_double_variable_get_values, 1}, diff --git a/src/categorical_variable.cpp b/src/categorical_variable.cpp index 3975b22..5ad2ba0 100644 --- a/src/categorical_variable.cpp +++ b/src/categorical_variable.cpp @@ -106,6 +106,14 @@ void categorical_variable_queue_shrink_bitset( //[[Rcpp::export]] std::vector categorical_variable_get_values( + Rcpp::XPtr variable + ) { + std::vector results; + results = variable->get_values(); + return results; +} +//[[Rcpp::export]] +std::vector categorical_variable_get_values_with_index( Rcpp::XPtr variable, std::vector& index ) { diff --git a/tests/testthat/test-categoricalvariable-resize.R b/tests/testthat/test-categoricalvariable-resize.R index 3b988bc..212b7d0 100644 --- a/tests/testthat/test-categoricalvariable-resize.R +++ b/tests/testthat/test-categoricalvariable-resize.R @@ -1,62 +1,72 @@ -SIR <- c('S', 'I', 'R') - -test_that("CategoricalVariable extending variables returns the new values", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - expect_equal(x$get_index_of('S')$to_vector(), 1:10) - x$queue_extend(values = c('S', 'I', 'R')) - x$.resize() - expect_equal(x$get_index_of('S')$to_vector(), 1:11) - expect_equal(x$get_index_of('I')$to_vector(), 12) - expect_equal(x$get_index_of('R')$to_vector(), 13) -}) - -test_that("CategoricalVariable shrinking variables removes values (bitset)", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - x$queue_shrink(index = Bitset$new(10)$insert(1:5)) - x$.resize() - expect_equal(x$get_index_of('S')$to_vector(), 1:5) -}) - -test_that("CategoricalVariable shrinking variables removes values (vector)", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - x$queue_shrink(index = 6:10) - x$.resize() - expect_equal(x$get_index_of('S')$to_vector(), 1:5) -}) - -test_that("CategoricalVariable resizing variables returns the correct size", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - expect_equal(x$size(), 10) - x$queue_extend(values = rep('S', 10)) - x$queue_shrink(index = 5:10) - x$.resize() - expect_equal(x$size(), 14) -}) - - -test_that("CategoricalVariable shrinks are combined", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - x$queue_shrink(index = 1:5) - x$queue_shrink(index = 3:8) - x$.resize() - expect_equal(x$get_index_of('S')$to_vector(), 1:2) -}) - -test_that("CategoricalVariable shrinks are applied before extentions", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - x$queue_shrink(index = 5:10) - x$queue_extend(values = rep('I', 10)) - x$queue_shrink(index = 1:5) - x$queue_extend(values = rep('R', 10)) - x$.resize() - expect_equal(x$get_index_of('S')$to_vector(), double(0)) - expect_equal(x$get_index_of('I')$to_vector(), 1:10) - expect_equal(x$get_index_of('R')$to_vector(), 11:20) -}) - -test_that("CategoricalVariable invalid shrinking operations error at queue time", { - x <- CategoricalVariable$new(SIR, rep('S', 10)) - expect_error(x$queue_shrink(index = 1:20)) - expect_error(x$queue_shrink(index = -1:5)) - expect_error(x$queue_shrink(index = Bitset$new(size + 1)$insert(1:20))) -}) +SIR <- c('S', 'I', 'R') + +test_that("CategoricalVariable extending variables returns the new values", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + expect_equal(x$get_index_of('S')$to_vector(), 1:10) + x$queue_extend(values = c('S', 'I', 'R')) + x$.resize() + expect_equal(x$get_index_of('S')$to_vector(), 1:11) + expect_equal(x$get_index_of('I')$to_vector(), 12) + expect_equal(x$get_index_of('R')$to_vector(), 13) +}) + +test_that("CategoricalVariables returns correct values after resize", { + categories = c('S', 'S', 'R', 'I') + + # standard case + x <- CategoricalVariable$new(SIR, categories) + x$queue_extend(values = rep('I', 2)) + x$.resize() + expect_equal(x$get_values(seq(1:length(c(categories, rep('I', 2))))), c(categories, rep('I', 2))) +}) + +test_that("CategoricalVariable shrinking variables removes values (bitset)", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + x$queue_shrink(index = Bitset$new(10)$insert(1:5)) + x$.resize() + expect_equal(x$get_index_of('S')$to_vector(), 1:5) +}) + +test_that("CategoricalVariable shrinking variables removes values (vector)", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + x$queue_shrink(index = 6:10) + x$.resize() + expect_equal(x$get_index_of('S')$to_vector(), 1:5) +}) + +test_that("CategoricalVariable resizing variables returns the correct size", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + expect_equal(x$size(), 10) + x$queue_extend(values = rep('S', 10)) + x$queue_shrink(index = 5:10) + x$.resize() + expect_equal(x$size(), 14) +}) + + +test_that("CategoricalVariable shrinks are combined", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + x$queue_shrink(index = 1:5) + x$queue_shrink(index = 3:8) + x$.resize() + expect_equal(x$get_index_of('S')$to_vector(), 1:2) +}) + +test_that("CategoricalVariable shrinks are applied before extentions", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + x$queue_shrink(index = 5:10) + x$queue_extend(values = rep('I', 10)) + x$queue_shrink(index = 1:5) + x$queue_extend(values = rep('R', 10)) + x$.resize() + expect_equal(x$get_index_of('S')$to_vector(), double(0)) + expect_equal(x$get_index_of('I')$to_vector(), 1:10) + expect_equal(x$get_index_of('R')$to_vector(), 11:20) +}) + +test_that("CategoricalVariable invalid shrinking operations error at queue time", { + x <- CategoricalVariable$new(SIR, rep('S', 10)) + expect_error(x$queue_shrink(index = 1:20)) + expect_error(x$queue_shrink(index = -1:5)) + expect_error(x$queue_shrink(index = Bitset$new(size + 1)$insert(1:20))) +}) diff --git a/tests/testthat/test-categoricalvariable.R b/tests/testthat/test-categoricalvariable.R index d748076..867bb4a 100644 --- a/tests/testthat/test-categoricalvariable.R +++ b/tests/testthat/test-categoricalvariable.R @@ -1,103 +1,126 @@ -SIR <- c('S', 'I', 'R') - -test_that("Creating CategoricalVariables errors with bad input", { - expect_error(CategoricalVariable$new(NULL, NULL)) - expect_error(CategoricalVariable$new(NaN, NaN)) - expect_error(CategoricalVariable$new(NA, NA)) - expect_error(CategoricalVariable$new(categories = LETTERS[1:2], initial_values = letters[1:2])) - expect_error(CategoricalVariable$new(categories = character(0), initial_values = letters[1:2])) -}) - -test_that("CategoricalVariable get index works returns correct values", { - size <- 10 - state <- CategoricalVariable$new(SIR, rep('S', size)) - expect_setequal(state$get_index_of('S')$to_vector(), seq(10)) - - state <- CategoricalVariable$new( - SIR, - c(rep('S', 10), rep('I', 100), rep('R', 20)) - ) - - expect_setequal( - state$get_index_of('S')$to_vector(), - seq(10) - ) - - expect_setequal( - state$get_index_of(c('S', 'R'))$to_vector(), - c(seq(10), seq(20) + 110) - ) - - expect_setequal( - state$get_index_of(c('S'))$to_vector(), - seq(10) - ) - -}) - -test_that("CategoricalVariable get index errors with incorrect input", { - size <- 10 - state <- CategoricalVariable$new(SIR, rep('S', size)) - - expect_error(state$get_index_of(values = 'A')) - expect_error(state$get_index_of(values = c('S', 'A'))) - expect_error(state$get_index_of(values = LETTERS[1:3])) - expect_error(state$get_index_of(values = integer(0))) - expect_error(state$get_index_of(values = NULL)) - expect_error(state$get_index_of(values = NA)) - expect_error(state$get_index_of(values = NaN)) -}) - -test_that("CategoricalVariable get size of categories works returns correct values", { - size <- 10 - state <- CategoricalVariable$new(SIR, rep('S', size)) - expect_setequal(state$get_size_of('S'), size) - - state <- CategoricalVariable$new( - SIR, - c(rep('S', 10), rep('I', 100), rep('R', 20)) - ) - - expect_equal(state$get_size_of(c('S', 'R')), 30) - expect_equal(state$get_size_of(c('S', 'I')), 110) - expect_equal(state$get_size_of(c('S')), 10) - -}) - -test_that("CategoricalVariable get size of categories errors with incorrect input", { - size <- 10 - state <- CategoricalVariable$new(SIR, rep('S', size)) - - expect_error(state$get_size_of(values = 'A')) - expect_error(state$get_size_of(values = c('S', 'A'))) - expect_error(state$get_size_of(values = LETTERS[1:3])) - expect_error(state$get_size_of(values = integer(0))) - expect_error(state$get_size_of(values = NULL)) - expect_error(state$get_size_of(values = NA)) - expect_error(state$get_size_of(values = NaN)) -}) - -test_that("CategoricalVariables get categories works", { - size <- 10 - state <- CategoricalVariable$new(SIR, rep('S', size)) - expect_length(setdiff(state$get_categories(), SIR), 0) -}) - -test_that("CategoricalVariables supports checkpoint and restore", { - size <- 10 - - old_variable <- CategoricalVariable$new(SIR, rep('S', size)) - old_variable$queue_update('I', c(1, 3)) - old_variable$queue_update('R', c(2, 7)) - old_variable$.update() - - state <- old_variable$save_state() - - new_variable <- CategoricalVariable$new(SIR, rep('S', size)) - new_variable$restore_state(1, state) - - expect_equal(new_variable$get_index_of('S')$to_vector(), c(4,5,6,8,9,10)) - expect_equal(new_variable$get_index_of('I')$to_vector(), c(1,3)) - expect_equal(new_variable$get_index_of('R')$to_vector(), c(2,7)) - expect_equal(new_variable$save_state(), state) -}) +SIR <- c('S', 'I', 'R') + +test_that("Creating CategoricalVariables errors with bad input", { + expect_error(CategoricalVariable$new(NULL, NULL)) + expect_error(CategoricalVariable$new(NaN, NaN)) + expect_error(CategoricalVariable$new(NA, NA)) + expect_error(CategoricalVariable$new(categories = LETTERS[1:2], initial_values = letters[1:2])) + expect_error(CategoricalVariable$new(categories = character(0), initial_values = letters[1:2])) +}) + +test_that("CategoricalVariables returns correct values", { + categories = c('S', 'S', 'R', 'I') + + # standard case + variable <- CategoricalVariable$new(SIR, categories) + expect_equal(variable$get_values(seq(1,4)), categories) + expect_equal(variable$get_values(c(2,4)), c(categories[c(2,4)])) + + # empty case + variable <- CategoricalVariable$new(SIR, character(0)) + expect_equal(variable$get_values() , character(0)) +}) + +test_that("CategoricalVariables returns correct values after update", { + categories = c('S', 'S', 'R', 'I') + + # standard case + variable <- CategoricalVariable$new(SIR, categories) + variable$queue_update('I', 1) + variable$.update() + expect_equal(variable$get_values(seq(1,4)), c('I', 'S', 'R', 'I')) +}) + +test_that("CategoricalVariable get index works returns correct values", { + size <- 10 + state <- CategoricalVariable$new(SIR, rep('S', size)) + expect_setequal(state$get_index_of('S')$to_vector(), seq(10)) + + state <- CategoricalVariable$new( + SIR, + c(rep('S', 10), rep('I', 100), rep('R', 20)) + ) + + expect_setequal( + state$get_index_of('S')$to_vector(), + seq(10) + ) + + expect_setequal( + state$get_index_of(c('S', 'R'))$to_vector(), + c(seq(10), seq(20) + 110) + ) + + expect_setequal( + state$get_index_of(c('S'))$to_vector(), + seq(10) + ) + +}) + +test_that("CategoricalVariable get index errors with incorrect input", { + size <- 10 + state <- CategoricalVariable$new(SIR, rep('S', size)) + + expect_error(state$get_index_of(values = 'A')) + expect_error(state$get_index_of(values = c('S', 'A'))) + expect_error(state$get_index_of(values = LETTERS[1:3])) + expect_error(state$get_index_of(values = integer(0))) + expect_error(state$get_index_of(values = NULL)) + expect_error(state$get_index_of(values = NA)) + expect_error(state$get_index_of(values = NaN)) +}) + +test_that("CategoricalVariable get size of categories works returns correct values", { + size <- 10 + state <- CategoricalVariable$new(SIR, rep('S', size)) + expect_setequal(state$get_size_of('S'), size) + + state <- CategoricalVariable$new( + SIR, + c(rep('S', 10), rep('I', 100), rep('R', 20)) + ) + + expect_equal(state$get_size_of(c('S', 'R')), 30) + expect_equal(state$get_size_of(c('S', 'I')), 110) + expect_equal(state$get_size_of(c('S')), 10) + +}) + +test_that("CategoricalVariable get size of categories errors with incorrect input", { + size <- 10 + state <- CategoricalVariable$new(SIR, rep('S', size)) + + expect_error(state$get_size_of(values = 'A')) + expect_error(state$get_size_of(values = c('S', 'A'))) + expect_error(state$get_size_of(values = LETTERS[1:3])) + expect_error(state$get_size_of(values = integer(0))) + expect_error(state$get_size_of(values = NULL)) + expect_error(state$get_size_of(values = NA)) + expect_error(state$get_size_of(values = NaN)) +}) + +test_that("CategoricalVariables get categories works", { + size <- 10 + state <- CategoricalVariable$new(SIR, rep('S', size)) + expect_length(setdiff(state$get_categories(), SIR), 0) +}) + +test_that("CategoricalVariables supports checkpoint and restore", { + size <- 10 + + old_variable <- CategoricalVariable$new(SIR, rep('S', size)) + old_variable$queue_update('I', c(1, 3)) + old_variable$queue_update('R', c(2, 7)) + old_variable$.update() + + state <- old_variable$save_state() + + new_variable <- CategoricalVariable$new(SIR, rep('S', size)) + new_variable$restore_state(1, state) + + expect_equal(new_variable$get_index_of('S')$to_vector(), c(4,5,6,8,9,10)) + expect_equal(new_variable$get_index_of('I')$to_vector(), c(1,3)) + expect_equal(new_variable$get_index_of('R')$to_vector(), c(2,7)) + expect_equal(new_variable$save_state(), state) +}) From dea944b9b526afa082137aaf1b801a5e1c853ca1 Mon Sep 17 00:00:00 2001 From: Jason Wood Date: Thu, 7 Aug 2025 14:00:25 +0100 Subject: [PATCH 07/13] tests for integer variable, error processing, documentation --- DESCRIPTION | 2 +- R/integer_variable.R | 4 + man/CategoricalVariable.Rd | 18 ++ man/IntegerVariable.Rd | 22 ++ tests/testthat/test-integervariable.R | 437 ++++++++++++++------------ 5 files changed, 275 insertions(+), 208 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9ead8fd..05ef975 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -65,7 +65,7 @@ Suggests: testthat (>= 2.1.0), xml2, bench -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 VignetteBuilder: knitr LinkingTo: Rcpp, diff --git a/R/integer_variable.R b/R/integer_variable.R index adc477d..0bd746a 100644 --- a/R/integer_variable.R +++ b/R/integer_variable.R @@ -45,6 +45,10 @@ IntegerVariable <- R6Class( #' @param difference the difference to check, e.g. difference = 2 checks whether the #' difference is even get_modulo_differences = function(value, difference){ + stopifnot(!is.null(value)) + stopifnot(is.finite(value)) + stopifnot(!is.null(difference)) + stopifnot(is.finite(difference)) integer_variable_get_modulo_differences(self$.variable, value, difference) }, diff --git a/man/CategoricalVariable.Rd b/man/CategoricalVariable.Rd index 09bbb5d..6778898 100644 --- a/man/CategoricalVariable.Rd +++ b/man/CategoricalVariable.Rd @@ -17,6 +17,7 @@ if possible because certain operations will be faster. \item \href{#method-CategoricalVariable-get_index_of}{\code{CategoricalVariable$get_index_of()}} \item \href{#method-CategoricalVariable-get_size_of}{\code{CategoricalVariable$get_size_of()}} \item \href{#method-CategoricalVariable-get_categories}{\code{CategoricalVariable$get_categories()}} +\item \href{#method-CategoricalVariable-get_values}{\code{CategoricalVariable$get_values()}} \item \href{#method-CategoricalVariable-queue_update}{\code{CategoricalVariable$queue_update()}} \item \href{#method-CategoricalVariable-queue_extend}{\code{CategoricalVariable$queue_extend()}} \item \href{#method-CategoricalVariable-queue_shrink}{\code{CategoricalVariable$queue_shrink()}} @@ -94,6 +95,23 @@ unordered storage type. \if{html}{\out{
}}\preformatted{CategoricalVariable$get_categories()}\if{html}{\out{
}} } +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-CategoricalVariable-get_values}{}}} +\subsection{Method \code{get_values()}}{ +return the value of the variable for the given individuals +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{CategoricalVariable$get_values(index = NULL)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{index}}{the indices of individuals whose categories will be returned} +} +\if{html}{\out{
}} +} } \if{html}{\out{
}} \if{html}{\out{}} diff --git a/man/IntegerVariable.Rd b/man/IntegerVariable.Rd index 1215f6a..fcc2778 100644 --- a/man/IntegerVariable.Rd +++ b/man/IntegerVariable.Rd @@ -15,6 +15,7 @@ household or age bin. \itemize{ \item \href{#method-IntegerVariable-new}{\code{IntegerVariable$new()}} \item \href{#method-IntegerVariable-get_values}{\code{IntegerVariable$get_values()}} +\item \href{#method-IntegerVariable-get_modulo_differences}{\code{IntegerVariable$get_modulo_differences()}} \item \href{#method-IntegerVariable-get_index_of}{\code{IntegerVariable$get_index_of()}} \item \href{#method-IntegerVariable-get_size_of}{\code{IntegerVariable$get_size_of()}} \item \href{#method-IntegerVariable-queue_update}{\code{IntegerVariable$queue_update()}} @@ -65,6 +66,27 @@ or integer vector, return values of those individuals.} } } \if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-IntegerVariable-get_modulo_differences}{}}} +\subsection{Method \code{get_modulo_differences()}}{ +Return a vector of individuals with 0 modulo difference from input value +and the distance being compared +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{IntegerVariable$get_modulo_differences(value, difference)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{value}}{the value to check} + +\item{\code{difference}}{the difference to check, e.g. difference = 2 checks whether the +difference is even} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-IntegerVariable-get_index_of}{}}} \subsection{Method \code{get_index_of()}}{ diff --git a/tests/testthat/test-integervariable.R b/tests/testthat/test-integervariable.R index d79e994..5aea6c5 100644 --- a/tests/testthat/test-integervariable.R +++ b/tests/testthat/test-integervariable.R @@ -1,207 +1,230 @@ -test_that("Creating IntegerVariables errors with bad input", { - expect_error(IntegerVariable$new(NULL)) - expect_error(IntegerVariable$new(NaN)) - expect_error(IntegerVariable$new(c(1,NaN))) - expect_error(IntegerVariable$new(NA)) - expect_error(IntegerVariable$new(c(1,NA))) - expect_error(IntegerVariable$new(Inf)) - expect_error(IntegerVariable$new(c(1,Inf))) - expect_error(IntegerVariable$new(-Inf)) - expect_error(IntegerVariable$new(c(1,-Inf))) - expect_error(IntegerVariable$new("1")) -}) - -test_that("IntegerVariable get values returns correct values without index", { - size <- 10 - variable <- IntegerVariable$new(seq_len(size)) - expect_equal(variable$get_values(), 1:10) - - variable <- IntegerVariable$new(seq_len(size) + 10) - expect_equal(variable$get_values(), (1:10) + 10) - - variable <- IntegerVariable$new(seq_len(size)) - expect_equal(variable$get_values(c(1, 1, 2, 2)), c(1, 1, 2, 2)) -}) - -test_that("IntegerVariable get values returns correct values with vector index", { - size <- 10 - variable <- IntegerVariable$new(seq_len(size)) - expect_equal(variable$get_values(NULL), 1:10) - - variable <- IntegerVariable$new(seq_len(size) + 10) - expect_equal(variable$get_values(5:10), 15:20) -}) - -test_that("IntegerVariable get values returns correct values with bitset index", { - size <- 10 - variable <- IntegerVariable$new(seq_len(size) + 10) - expect_equal(variable$get_values(Bitset$new(size = size)$insert(5:10)), 15:20) -}) - -test_that("IntegerVariable get values fails with incorrect index", { - variable <- IntegerVariable$new(initial_values = 1:100) - b <- Bitset$new(1000) - expect_error(variable$get_values(b)) - expect_error(variable$get_values(b$insert(90:110))) - expect_error(variable$get_values(90:110)) - expect_error(variable$get_values(-5:2)) - expect_error(variable$get_values(NaN)) - expect_error(variable$get_values(NA)) - expect_error(variable$get_values(Inf)) - expect_error(variable$get_values("10")) -}) - -test_that("IntegerVariable get index of set works correctly", { - variable <- IntegerVariable$new(5:10) - - indices <- variable$get_index_of(set = 6:8) - expect_equal(indices$to_vector(), 2:4) - - indices <- variable$get_index_of(set = 10) - expect_equal(indices$to_vector(), 6) - - indices <- variable$get_index_of(set = 1e3:1.001e3) - expect_equal(indices$size(), 0) - - indices <- variable$get_index_of(set = -5) - expect_equal(indices$size(), 0) - - indices <- variable$get_index_of(set = integer(0)) - expect_equal(indices$size(), 0) - - indices <- variable$get_index_of(set = numeric(0)) - expect_equal(indices$size(), 0) - - variable <- IntegerVariable$new(-10:10) - indices <- variable$get_index_of(set = c(-2,-1,1,2)) - expect_equal(indices$to_vector(), c(9, 10, 12, 13)) -}) - -test_that("IntegerVariable get index of set fails with incorrect set", { - variable <- IntegerVariable$new(1:10) - expect_error(variable$get_index_of(set = Inf)) - expect_error(variable$get_index_of(set = -Inf)) - expect_error(variable$get_index_of(set = NULL)) - expect_error(variable$get_index_of(set = NA)) - expect_error(variable$get_index_of(set = NaN)) - expect_error(variable$get_index_of(set = "5")) -}) - - -test_that("IntegerVariable get index of bounds [a,b] works correctly", { - variable <- IntegerVariable$new(5:10) - - indices <- variable$get_index_of(a = 6, b = 8) - expect_equal(indices$to_vector(), 2:4) - - indices <- variable$get_index_of(a = 7, b = 7) - expect_equal(indices$to_vector(), 3) - - indices <- variable$get_index_of(a = 1e3, b = 1.001e3) - expect_length(indices$to_vector(), 0) -}) - -test_that("IntegerVariable get index of bounds [a,b] fails with incorrect bounds", { - variable <- IntegerVariable$new(5:10) - - expect_error(variable$get_index_of(a = a, b = NULL)) - expect_error(variable$get_index_of(a = a, b = a - 10)) - expect_error(variable$get_index_of(a = a, b = NA)) - expect_error(variable$get_index_of(a = a, b = NaN)) - expect_error(variable$get_index_of(a = a, b = Inf)) - expect_error(variable$get_index_of(a = a, b = -Inf)) - - expect_error(variable$get_index_of(a = NULL, b = b)) - expect_error(variable$get_index_of(a = b + 10, b = b)) - expect_error(variable$get_index_of(a = NA, b = b)) - expect_error(variable$get_index_of(a = NaN, b = b)) - expect_error(variable$get_index_of(a = Inf, b = b)) - expect_error(variable$get_index_of(a = -Inf, b = b)) - - expect_error(variable$get_index_of(a = integer(0), b = b)) - expect_error(variable$get_index_of(a = numeric(0), b = b)) - - expect_error(variable$get_index_of(a = a, b = integer(0))) - expect_error(variable$get_index_of(a = a, b = integer(0))) - - expect_error(variable$get_index_of(a = integer(0), b = integer(0))) - expect_error(variable$get_index_of(a = numeric(0), b = numeric(0))) -}) - -test_that("IntegerVariable get size of set works correctly", { - variable <- IntegerVariable$new(-10:10) - set <- c(-2,-1,1,2) - expect_equal(variable$get_size_of(set = set), length(set)) - - expect_equal(variable$get_size_of(set = -20:-15), 0) - expect_equal(variable$get_size_of(set = 10), 1) - expect_equal(variable$get_size_of(set = numeric(0)), 0) - expect_equal(variable$get_size_of(set = integer(0)), 0) -}) - -test_that("IntegerVariable get size of set fails with incorrect input", { - variable <- IntegerVariable$new(-10:10) - expect_error(variable$get_size_of(set = NULL)) - expect_error(variable$get_size_of(set = NA)) - expect_error(variable$get_size_of(set = NaN)) - expect_error(variable$get_size_of(set = Inf)) - expect_error(variable$get_size_of(set = -Inf)) - expect_error(variable$get_size_of(set = "5")) -}) - -test_that("IntegerVariable get size of set in bounds [a,b] works correctly", { - variable <- IntegerVariable$new(-10:10) - expect_equal(variable$get_size_of(a = 5, b = 7), 3) - expect_equal(variable$get_size_of(a = 5, b = 5), 1) - expect_equal(variable$get_size_of(a = -10, b = -5), 6) - expect_equal(variable$get_size_of(a = -50, b = -40), 0) -}) - -test_that("IntegerVariable get size of set in bounds [a,b] fails with incorrect input", { - variable <- IntegerVariable$new(-10:10) - - expect_error(variable$get_size_of(a = a, b = NULL)) - expect_error(variable$get_size_of(a = a, b = a - 10)) - expect_error(variable$get_size_of(a = a, b = NA)) - expect_error(variable$get_size_of(a = a, b = NaN)) - expect_error(variable$get_size_of(a = a, b = Inf)) - expect_error(variable$get_size_of(a = a, b = -Inf)) - - expect_error(variable$get_size_of(a = NULL, b = b)) - expect_error(variable$get_size_of(a = b + 10, b = b)) - expect_error(variable$get_size_of(a = NA, b = b)) - expect_error(variable$get_size_of(a = NaN, b = b)) - expect_error(variable$get_size_of(a = Inf, b = b)) - expect_error(variable$get_size_of(a = -Inf, b = b)) - - expect_error(variable$get_size_of(a = integer(0), b = b)) - expect_error(variable$get_size_of(a = numeric(0), b = b)) - - expect_error(variable$get_size_of(a = a, b = integer(0))) - expect_error(variable$get_size_of(a = a, b = integer(0))) - - expect_error(variable$get_size_of(a = integer(0), b = integer(0))) - expect_error(variable$get_size_of(a = numeric(0), b = numeric(0))) -}) - -test_that("IntegerVariable get size and index of set in bounds [a,b] and set gives same answer for equal intervals", { - variable <- IntegerVariable$new(-10:10) - expect_equal(variable$get_size_of(a = 5, b = 7), variable$get_size_of(set = 5:7)) - expect_equal(variable$get_index_of(a = 5, b = 7)$to_vector(), variable$get_index_of(set = 5:7)$to_vector()) -}) - -test_that("IntegerVariable supports checkpoint and restore", { - size <- 10 - - old_variable <- IntegerVariable$new(rep(0, size)) - old_variable$queue_update(values = seq_len(size)) - old_variable$.update() - - state <- old_variable$save_state() - - new_variable <- IntegerVariable$new(rep(0, size)) - new_variable$restore_state(1, state) - - expect_equal(new_variable$get_values(), seq_len(size)) - expect_equal(new_variable$save_state(), state) -}) +test_that("Creating IntegerVariables errors with bad input", { + expect_error(IntegerVariable$new(NULL)) + expect_error(IntegerVariable$new(NaN)) + expect_error(IntegerVariable$new(c(1,NaN))) + expect_error(IntegerVariable$new(NA)) + expect_error(IntegerVariable$new(c(1,NA))) + expect_error(IntegerVariable$new(Inf)) + expect_error(IntegerVariable$new(c(1,Inf))) + expect_error(IntegerVariable$new(-Inf)) + expect_error(IntegerVariable$new(c(1,-Inf))) + expect_error(IntegerVariable$new("1")) +}) + +test_that("IntegerVariable get values returns correct values without index", { + size <- 10 + variable <- IntegerVariable$new(seq_len(size)) + expect_equal(variable$get_values(), 1:10) + + variable <- IntegerVariable$new(seq_len(size) + 10) + expect_equal(variable$get_values(), (1:10) + 10) + + variable <- IntegerVariable$new(seq_len(size)) + expect_equal(variable$get_values(c(1, 1, 2, 2)), c(1, 1, 2, 2)) +}) + +test_that("IntegerVariables returns correct modulo differences", { + size <- 10 + variable <- IntegerVariable$new(seq_len(size)) + vals <- variable$get_values() + x <- 3 + d <- 3 + expected_modulo_differences <- c() + ind <- 1 + for(i in seq_len(size)){ + val <- vals[i] + if ((val - x) %% d == 0){ + expected_modulo_differences[ind] <- i - 1 + ind <- ind + 1 + } + } + expect_equal(variable$get_modulo_differences(x, d), expected_modulo_differences) +}) + +test_that("IntegerVariables errors for invalid modulo differences", { + expect_error(variable$get_modulo_differences()) + expect_error(variable$get_modulo_differences("a", 1)) + expect_error(variable$get_modulo_differences(1, "1")) +}) +test_that("IntegerVariable get values returns correct values with vector index", { + size <- 10 + variable <- IntegerVariable$new(seq_len(size)) + expect_equal(variable$get_values(NULL), 1:10) + + variable <- IntegerVariable$new(seq_len(size) + 10) + expect_equal(variable$get_values(5:10), 15:20) +}) + +test_that("IntegerVariable get values returns correct values with bitset index", { + size <- 10 + variable <- IntegerVariable$new(seq_len(size) + 10) + expect_equal(variable$get_values(Bitset$new(size = size)$insert(5:10)), 15:20) +}) + +test_that("IntegerVariable get values fails with incorrect index", { + variable <- IntegerVariable$new(initial_values = 1:100) + b <- Bitset$new(1000) + expect_error(variable$get_values(b)) + expect_error(variable$get_values(b$insert(90:110))) + expect_error(variable$get_values(90:110)) + expect_error(variable$get_values(-5:2)) + expect_error(variable$get_values(NaN)) + expect_error(variable$get_values(NA)) + expect_error(variable$get_values(Inf)) + expect_error(variable$get_values("10")) +}) + +test_that("IntegerVariable get index of set works correctly", { + variable <- IntegerVariable$new(5:10) + + indices <- variable$get_index_of(set = 6:8) + expect_equal(indices$to_vector(), 2:4) + + indices <- variable$get_index_of(set = 10) + expect_equal(indices$to_vector(), 6) + + indices <- variable$get_index_of(set = 1e3:1.001e3) + expect_equal(indices$size(), 0) + + indices <- variable$get_index_of(set = -5) + expect_equal(indices$size(), 0) + + indices <- variable$get_index_of(set = integer(0)) + expect_equal(indices$size(), 0) + + indices <- variable$get_index_of(set = numeric(0)) + expect_equal(indices$size(), 0) + + variable <- IntegerVariable$new(-10:10) + indices <- variable$get_index_of(set = c(-2,-1,1,2)) + expect_equal(indices$to_vector(), c(9, 10, 12, 13)) +}) + +test_that("IntegerVariable get index of set fails with incorrect set", { + variable <- IntegerVariable$new(1:10) + expect_error(variable$get_index_of(set = Inf)) + expect_error(variable$get_index_of(set = -Inf)) + expect_error(variable$get_index_of(set = NULL)) + expect_error(variable$get_index_of(set = NA)) + expect_error(variable$get_index_of(set = NaN)) + expect_error(variable$get_index_of(set = "5")) +}) + + +test_that("IntegerVariable get index of bounds [a,b] works correctly", { + variable <- IntegerVariable$new(5:10) + + indices <- variable$get_index_of(a = 6, b = 8) + expect_equal(indices$to_vector(), 2:4) + + indices <- variable$get_index_of(a = 7, b = 7) + expect_equal(indices$to_vector(), 3) + + indices <- variable$get_index_of(a = 1e3, b = 1.001e3) + expect_length(indices$to_vector(), 0) +}) + +test_that("IntegerVariable get index of bounds [a,b] fails with incorrect bounds", { + variable <- IntegerVariable$new(5:10) + + expect_error(variable$get_index_of(a = a, b = NULL)) + expect_error(variable$get_index_of(a = a, b = a - 10)) + expect_error(variable$get_index_of(a = a, b = NA)) + expect_error(variable$get_index_of(a = a, b = NaN)) + expect_error(variable$get_index_of(a = a, b = Inf)) + expect_error(variable$get_index_of(a = a, b = -Inf)) + + expect_error(variable$get_index_of(a = NULL, b = b)) + expect_error(variable$get_index_of(a = b + 10, b = b)) + expect_error(variable$get_index_of(a = NA, b = b)) + expect_error(variable$get_index_of(a = NaN, b = b)) + expect_error(variable$get_index_of(a = Inf, b = b)) + expect_error(variable$get_index_of(a = -Inf, b = b)) + + expect_error(variable$get_index_of(a = integer(0), b = b)) + expect_error(variable$get_index_of(a = numeric(0), b = b)) + + expect_error(variable$get_index_of(a = a, b = integer(0))) + expect_error(variable$get_index_of(a = a, b = integer(0))) + + expect_error(variable$get_index_of(a = integer(0), b = integer(0))) + expect_error(variable$get_index_of(a = numeric(0), b = numeric(0))) +}) + +test_that("IntegerVariable get size of set works correctly", { + variable <- IntegerVariable$new(-10:10) + set <- c(-2,-1,1,2) + expect_equal(variable$get_size_of(set = set), length(set)) + + expect_equal(variable$get_size_of(set = -20:-15), 0) + expect_equal(variable$get_size_of(set = 10), 1) + expect_equal(variable$get_size_of(set = numeric(0)), 0) + expect_equal(variable$get_size_of(set = integer(0)), 0) +}) + +test_that("IntegerVariable get size of set fails with incorrect input", { + variable <- IntegerVariable$new(-10:10) + expect_error(variable$get_size_of(set = NULL)) + expect_error(variable$get_size_of(set = NA)) + expect_error(variable$get_size_of(set = NaN)) + expect_error(variable$get_size_of(set = Inf)) + expect_error(variable$get_size_of(set = -Inf)) + expect_error(variable$get_size_of(set = "5")) +}) + +test_that("IntegerVariable get size of set in bounds [a,b] works correctly", { + variable <- IntegerVariable$new(-10:10) + expect_equal(variable$get_size_of(a = 5, b = 7), 3) + expect_equal(variable$get_size_of(a = 5, b = 5), 1) + expect_equal(variable$get_size_of(a = -10, b = -5), 6) + expect_equal(variable$get_size_of(a = -50, b = -40), 0) +}) + +test_that("IntegerVariable get size of set in bounds [a,b] fails with incorrect input", { + variable <- IntegerVariable$new(-10:10) + + expect_error(variable$get_size_of(a = a, b = NULL)) + expect_error(variable$get_size_of(a = a, b = a - 10)) + expect_error(variable$get_size_of(a = a, b = NA)) + expect_error(variable$get_size_of(a = a, b = NaN)) + expect_error(variable$get_size_of(a = a, b = Inf)) + expect_error(variable$get_size_of(a = a, b = -Inf)) + + expect_error(variable$get_size_of(a = NULL, b = b)) + expect_error(variable$get_size_of(a = b + 10, b = b)) + expect_error(variable$get_size_of(a = NA, b = b)) + expect_error(variable$get_size_of(a = NaN, b = b)) + expect_error(variable$get_size_of(a = Inf, b = b)) + expect_error(variable$get_size_of(a = -Inf, b = b)) + + expect_error(variable$get_size_of(a = integer(0), b = b)) + expect_error(variable$get_size_of(a = numeric(0), b = b)) + + expect_error(variable$get_size_of(a = a, b = integer(0))) + expect_error(variable$get_size_of(a = a, b = integer(0))) + + expect_error(variable$get_size_of(a = integer(0), b = integer(0))) + expect_error(variable$get_size_of(a = numeric(0), b = numeric(0))) +}) + +test_that("IntegerVariable get size and index of set in bounds [a,b] and set gives same answer for equal intervals", { + variable <- IntegerVariable$new(-10:10) + expect_equal(variable$get_size_of(a = 5, b = 7), variable$get_size_of(set = 5:7)) + expect_equal(variable$get_index_of(a = 5, b = 7)$to_vector(), variable$get_index_of(set = 5:7)$to_vector()) +}) + +test_that("IntegerVariable supports checkpoint and restore", { + size <- 10 + + old_variable <- IntegerVariable$new(rep(0, size)) + old_variable$queue_update(values = seq_len(size)) + old_variable$.update() + + state <- old_variable$save_state() + + new_variable <- IntegerVariable$new(rep(0, size)) + new_variable$restore_state(1, state) + + expect_equal(new_variable$get_values(), seq_len(size)) + expect_equal(new_variable$save_state(), state) +}) From b9d1529c37f56355adb916bc15437fa30d346e9a Mon Sep 17 00:00:00 2001 From: Jason Wood <91839602+JasonRWood@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:20:02 +0100 Subject: [PATCH 08/13] Apply suggestions from code review Co-authored-by: Giovanni --- R/categorical_variable.R | 1 - R/integer_variable.R | 2 -- 2 files changed, 3 deletions(-) diff --git a/R/categorical_variable.R b/R/categorical_variable.R index 4a882af..bce3a8e 100644 --- a/R/categorical_variable.R +++ b/R/categorical_variable.R @@ -49,7 +49,6 @@ CategoricalVariable <- R6Class( stopifnot(is.finite(index)) stopifnot(index > 0) if (length(index) == 0){ - # temp_inds <- results <- categorical_variable_get_values(self$.variable) } else{ diff --git a/R/integer_variable.R b/R/integer_variable.R index 0bd746a..f39b0e1 100644 --- a/R/integer_variable.R +++ b/R/integer_variable.R @@ -45,9 +45,7 @@ IntegerVariable <- R6Class( #' @param difference the difference to check, e.g. difference = 2 checks whether the #' difference is even get_modulo_differences = function(value, difference){ - stopifnot(!is.null(value)) stopifnot(is.finite(value)) - stopifnot(!is.null(difference)) stopifnot(is.finite(difference)) integer_variable_get_modulo_differences(self$.variable, value, difference) }, From fb5bfd01d1908c85193f852e520d9a173af17a14 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Wed, 7 Aug 2024 11:55:40 +0100 Subject: [PATCH 09/13] Add bitset_count_and --- R/RcppExports.R | 1026 +++++----- R/bitset.R | 12 + inst/include/IterableBitset.h | 13 + src/RcppExports.cpp | 3315 +++++++++++++++++---------------- src/bitset.cpp | 8 + tests/testthat/test-bitset.R | 38 + 6 files changed, 2250 insertions(+), 2162 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index d941673..354ab8f 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -1,511 +1,515 @@ -# Generated by using Rcpp::compileAttributes() -> do not edit by hand -# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -create_bitset <- function(size) { - .Call(`_individual_create_bitset`, size) -} - -bitset_copy <- function(b) { - .Call(`_individual_bitset_copy`, b) -} - -bitset_insert <- function(b, v) { - invisible(.Call(`_individual_bitset_insert`, b, v)) -} - -bitset_remove <- function(b, v) { - invisible(.Call(`_individual_bitset_remove`, b, v)) -} - -bitset_clear <- function(b) { - invisible(.Call(`_individual_bitset_clear`, b)) -} - -bitset_size <- function(b) { - .Call(`_individual_bitset_size`, b) -} - -bitset_max_size <- function(b) { - .Call(`_individual_bitset_max_size`, b) -} - -bitset_and <- function(a, b) { - invisible(.Call(`_individual_bitset_and`, a, b)) -} - -bitset_not <- function(b, inplace) { - .Call(`_individual_bitset_not`, b, inplace) -} - -bitset_or <- function(a, b) { - invisible(.Call(`_individual_bitset_or`, a, b)) -} - -bitset_copy_from <- function(a, b) { - invisible(.Call(`_individual_bitset_copy_from`, a, b)) -} - -bitset_xor <- function(a, b) { - invisible(.Call(`_individual_bitset_xor`, a, b)) -} - -bitset_set_difference <- function(a, b) { - invisible(.Call(`_individual_bitset_set_difference`, a, b)) -} - -bitset_sample <- function(b, rate) { - invisible(.Call(`_individual_bitset_sample`, b, rate)) -} - -bitset_sample_vector <- function(b, rate) { - invisible(.Call(`_individual_bitset_sample_vector`, b, rate)) -} - -bitset_to_vector <- function(b) { - .Call(`_individual_bitset_to_vector`, b) -} - -filter_bitset_integer <- function(b, other) { - .Call(`_individual_filter_bitset_integer`, b, other) -} - -filter_bitset_bitset <- function(b, other) { - .Call(`_individual_filter_bitset_bitset`, b, other) -} - -filter_bitset_logical <- function(bitset, other) { - .Call(`_individual_filter_bitset_logical`, bitset, other) -} - -bitset_choose <- function(b, k) { - invisible(.Call(`_individual_bitset_choose`, b, k)) -} - -create_categorical_variable <- function(categories, values) { - .Call(`_individual_create_categorical_variable`, categories, values) -} - -categorical_variable_get_size <- function(variable) { - .Call(`_individual_categorical_variable_get_size`, variable) -} - -categorical_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_categorical_variable_queue_update`, variable, value, index)) -} - -categorical_variable_get_index_of <- function(variable, values) { - .Call(`_individual_categorical_variable_get_index_of`, variable, values) -} - -categorical_variable_get_size_of <- function(variable, values) { - .Call(`_individual_categorical_variable_get_size_of`, variable, values) -} - -categorical_variable_get_categories <- function(variable) { - .Call(`_individual_categorical_variable_get_categories`, variable) -} - -categorical_variable_queue_update_vector <- function(variable, value, index) { - invisible(.Call(`_individual_categorical_variable_queue_update_vector`, variable, value, index)) -} - -categorical_variable_update <- function(variable) { - invisible(.Call(`_individual_categorical_variable_update`, variable)) -} - -categorical_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_categorical_variable_queue_extend`, variable, values)) -} - -categorical_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_categorical_variable_queue_shrink`, variable, index)) -} - -categorical_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_categorical_variable_queue_shrink_bitset`, variable, index)) -} - -categorical_variable_get_values <- function(variable) { - .Call(`_individual_categorical_variable_get_values`, variable) -} - -categorical_variable_get_values_with_index <- function(variable, index) { - .Call(`_individual_categorical_variable_get_values_with_index`, variable, index) -} - -create_double_variable <- function(values) { - .Call(`_individual_create_double_variable`, values) -} - -double_variable_get_values <- function(variable) { - .Call(`_individual_double_variable_get_values`, variable) -} - -double_variable_get_values_at_index <- function(variable, index) { - .Call(`_individual_double_variable_get_values_at_index`, variable, index) -} - -double_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_double_variable_get_values_at_index_vector`, variable, index) -} - -double_variable_get_index_of_range <- function(variable, a, b) { - .Call(`_individual_double_variable_get_index_of_range`, variable, a, b) -} - -double_variable_get_size_of_range <- function(variable, a, b) { - .Call(`_individual_double_variable_get_size_of_range`, variable, a, b) -} - -double_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_double_variable_queue_fill`, variable, value)) -} - -double_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_double_variable_queue_update`, variable, value, index)) -} - -double_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_double_variable_queue_update_bitset`, variable, value, index)) -} - -double_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_double_variable_queue_extend`, variable, values)) -} - -double_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_double_variable_queue_shrink`, variable, index)) -} - -double_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_double_variable_queue_shrink_bitset`, variable, index)) -} - -create_event <- function() { - .Call(`_individual_create_event`) -} - -create_targeted_event <- function(size) { - .Call(`_individual_create_targeted_event`, size) -} - -event_base_tick <- function(event) { - invisible(.Call(`_individual_event_base_tick`, event)) -} - -event_base_get_timestep <- function(event) { - .Call(`_individual_event_base_get_timestep`, event) -} - -event_base_set_timestep <- function(event, time) { - invisible(.Call(`_individual_event_base_set_timestep`, event, time)) -} - -event_base_should_trigger <- function(event) { - .Call(`_individual_event_base_should_trigger`, event) -} - -event_schedule <- function(event, delays) { - invisible(.Call(`_individual_event_schedule`, event, delays)) -} - -event_clear_schedule <- function(event) { - invisible(.Call(`_individual_event_clear_schedule`, event)) -} - -event_checkpoint <- function(event) { - .Call(`_individual_event_checkpoint`, event) -} - -event_restore <- function(event, schedule) { - invisible(.Call(`_individual_event_restore`, event, schedule)) -} - -targeted_event_clear_schedule_vector <- function(event, target) { - invisible(.Call(`_individual_targeted_event_clear_schedule_vector`, event, target)) -} - -targeted_event_clear_schedule <- function(event, target) { - invisible(.Call(`_individual_targeted_event_clear_schedule`, event, target)) -} - -targeted_event_get_scheduled <- function(event) { - .Call(`_individual_targeted_event_get_scheduled`, event) -} - -targeted_event_schedule <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule`, event, target, delay)) -} - -targeted_event_queue_shrink_bitset <- function(event, index) { - invisible(.Call(`_individual_targeted_event_queue_shrink_bitset`, event, index)) -} - -targeted_event_queue_shrink <- function(event, index) { - invisible(.Call(`_individual_targeted_event_queue_shrink`, event, index)) -} - -targeted_event_queue_extend <- function(event, n) { - invisible(.Call(`_individual_targeted_event_queue_extend`, event, n)) -} - -targeted_event_queue_extend_with_schedule <- function(event, delays) { - invisible(.Call(`_individual_targeted_event_queue_extend_with_schedule`, event, delays)) -} - -targeted_event_schedule_vector <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_vector`, event, target, delay)) -} - -targeted_event_schedule_multi_delay <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_multi_delay`, event, target, delay)) -} - -targeted_event_schedule_multi_delay_vector <- function(event, target, delay) { - invisible(.Call(`_individual_targeted_event_schedule_multi_delay_vector`, event, target, delay)) -} - -targeted_event_get_target <- function(event) { - .Call(`_individual_targeted_event_get_target`, event) -} - -targeted_event_resize <- function(event) { - invisible(.Call(`_individual_targeted_event_resize`, event)) -} - -targeted_event_checkpoint <- function(event) { - .Call(`_individual_targeted_event_checkpoint`, event) -} - -targeted_event_restore <- function(event, state) { - invisible(.Call(`_individual_targeted_event_restore`, event, state)) -} - -process_listener <- function(event, listener) { - invisible(.Call(`_individual_process_listener`, event, listener)) -} - -process_targeted_listener <- function(event, listener, target) { - invisible(.Call(`_individual_process_targeted_listener`, event, listener, target)) -} - -create_integer_variable <- function(values) { - .Call(`_individual_create_integer_variable`, values) -} - -integer_variable_get_values <- function(variable) { - .Call(`_individual_integer_variable_get_values`, variable) -} - -integer_variable_get_modulo_differences <- function(variable, value, difference) { - .Call(`_individual_integer_variable_get_modulo_differences`, variable, value, difference) -} - -integer_variable_get_values_at_index <- function(variable, index) { - .Call(`_individual_integer_variable_get_values_at_index`, variable, index) -} - -integer_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_variable_get_values_at_index_vector`, variable, index) -} - -integer_variable_get_index_of_set_vector <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_index_of_set_vector`, variable, values_set) -} - -integer_variable_get_index_of_set_scalar <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_index_of_set_scalar`, variable, values_set) -} - -integer_variable_get_index_of_range <- function(variable, a, b) { - .Call(`_individual_integer_variable_get_index_of_range`, variable, a, b) -} - -integer_variable_get_size_of_set_vector <- function(variable, values_set) { - .Call(`_individual_integer_variable_get_size_of_set_vector`, variable, values_set) -} - -integer_variable_get_size_of_set_scalar <- function(variable, value) { - .Call(`_individual_integer_variable_get_size_of_set_scalar`, variable, value) -} - -integer_variable_get_size_of_range <- function(variable, a, b) { - .Call(`_individual_integer_variable_get_size_of_range`, variable, a, b) -} - -integer_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_integer_variable_queue_fill`, variable, value)) -} - -integer_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_integer_variable_queue_update`, variable, value, index)) -} - -integer_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_integer_variable_queue_update_bitset`, variable, value, index)) -} - -integer_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_integer_variable_queue_extend`, variable, values)) -} - -integer_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_integer_variable_queue_shrink`, variable, index)) -} - -integer_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_integer_variable_queue_shrink_bitset`, variable, index)) -} - -fixed_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate, destination_probabilities) { - .Call(`_individual_fixed_probability_multinomial_process_internal`, variable, source_state, destination_states, rate, destination_probabilities) -} - -multi_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate_variable, destination_probabilities) { - .Call(`_individual_multi_probability_multinomial_process_internal`, variable, source_state, destination_states, rate_variable, destination_probabilities) -} - -multi_probability_bernoulli_process_internal <- function(variable, from, to, rate_variable) { - .Call(`_individual_multi_probability_bernoulli_process_internal`, variable, from, to, rate_variable) -} - -infection_age_process_internal <- function(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) { - .Call(`_individual_infection_age_process_internal`, state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) -} - -create_double_ragged_variable <- function(values) { - .Call(`_individual_create_double_ragged_variable`, values) -} - -double_ragged_variable_get_values <- function(variable) { - .Call(`_individual_double_ragged_variable_get_values`, variable) -} - -double_ragged_variable_get_values_at_index_bitset <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_values_at_index_bitset`, variable, index) -} - -double_ragged_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_values_at_index_vector`, variable, index) -} - -double_ragged_variable_get_length <- function(variable) { - .Call(`_individual_double_ragged_variable_get_length`, variable) -} - -double_ragged_variable_get_length_at_index_bitset <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_length_at_index_bitset`, variable, index) -} - -double_ragged_variable_get_length_at_index_vector <- function(variable, index) { - .Call(`_individual_double_ragged_variable_get_length_at_index_vector`, variable, index) -} - -double_ragged_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_double_ragged_variable_queue_fill`, variable, value)) -} - -double_ragged_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_update`, variable, value, index)) -} - -double_ragged_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_update_bitset`, variable, value, index)) -} - -double_ragged_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_double_ragged_variable_queue_extend`, variable, values)) -} - -double_ragged_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_shrink`, variable, index)) -} - -double_ragged_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_double_ragged_variable_queue_shrink_bitset`, variable, index)) -} - -create_integer_ragged_variable <- function(values) { - .Call(`_individual_create_integer_ragged_variable`, values) -} - -integer_ragged_variable_get_values <- function(variable) { - .Call(`_individual_integer_ragged_variable_get_values`, variable) -} - -integer_ragged_variable_get_values_at_index_bitset <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_values_at_index_bitset`, variable, index) -} - -integer_ragged_variable_get_values_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_values_at_index_vector`, variable, index) -} - -integer_ragged_variable_get_length <- function(variable) { - .Call(`_individual_integer_ragged_variable_get_length`, variable) -} - -integer_ragged_variable_get_length_at_index_bitset <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_length_at_index_bitset`, variable, index) -} - -integer_ragged_variable_get_length_at_index_vector <- function(variable, index) { - .Call(`_individual_integer_ragged_variable_get_length_at_index_vector`, variable, index) -} - -integer_ragged_variable_queue_fill <- function(variable, value) { - invisible(.Call(`_individual_integer_ragged_variable_queue_fill`, variable, value)) -} - -integer_ragged_variable_queue_update <- function(variable, value, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_update`, variable, value, index)) -} - -integer_ragged_variable_queue_update_bitset <- function(variable, value, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_update_bitset`, variable, value, index)) -} - -integer_ragged_variable_queue_extend <- function(variable, values) { - invisible(.Call(`_individual_integer_ragged_variable_queue_extend`, variable, values)) -} - -integer_ragged_variable_queue_shrink <- function(variable, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_shrink`, variable, index)) -} - -integer_ragged_variable_queue_shrink_bitset <- function(variable, index) { - invisible(.Call(`_individual_integer_ragged_variable_queue_shrink_bitset`, variable, index)) -} - -create_render_vector <- function(data) { - .Call(`_individual_create_render_vector`, data) -} - -render_vector_update <- function(v, index, value) { - invisible(.Call(`_individual_render_vector_update`, v, index, value)) -} - -render_vector_data <- function(v) { - .Call(`_individual_render_vector_data`, v) -} - -execute_process <- function(process, timestep) { - invisible(.Call(`_individual_execute_process`, process, timestep)) -} - -variable_get_size <- function(variable) { - .Call(`_individual_variable_get_size`, variable) -} - -variable_update <- function(variable) { - invisible(.Call(`_individual_variable_update`, variable)) -} - -variable_resize <- function(variable) { - invisible(.Call(`_individual_variable_resize`, variable)) -} - -# Register entry points for exported C++ functions -methods::setLoadAction(function(ns) { - .Call(`_individual_RcppExport_registerCCallable`) -}) +# Generated by using Rcpp::compileAttributes() -> do not edit by hand +# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +create_bitset <- function(size) { + .Call(`_individual_create_bitset`, size) +} + +bitset_copy <- function(b) { + .Call(`_individual_bitset_copy`, b) +} + +bitset_insert <- function(b, v) { + invisible(.Call(`_individual_bitset_insert`, b, v)) +} + +bitset_remove <- function(b, v) { + invisible(.Call(`_individual_bitset_remove`, b, v)) +} + +bitset_clear <- function(b) { + invisible(.Call(`_individual_bitset_clear`, b)) +} + +bitset_size <- function(b) { + .Call(`_individual_bitset_size`, b) +} + +bitset_max_size <- function(b) { + .Call(`_individual_bitset_max_size`, b) +} + +bitset_and <- function(a, b) { + invisible(.Call(`_individual_bitset_and`, a, b)) +} + +bitset_not <- function(b, inplace) { + .Call(`_individual_bitset_not`, b, inplace) +} + +bitset_or <- function(a, b) { + invisible(.Call(`_individual_bitset_or`, a, b)) +} + +bitset_copy_from <- function(a, b) { + invisible(.Call(`_individual_bitset_copy_from`, a, b)) +} + +bitset_xor <- function(a, b) { + invisible(.Call(`_individual_bitset_xor`, a, b)) +} + +bitset_set_difference <- function(a, b) { + invisible(.Call(`_individual_bitset_set_difference`, a, b)) +} + +bitset_sample <- function(b, rate) { + invisible(.Call(`_individual_bitset_sample`, b, rate)) +} + +bitset_sample_vector <- function(b, rate) { + invisible(.Call(`_individual_bitset_sample_vector`, b, rate)) +} + +bitset_to_vector <- function(b) { + .Call(`_individual_bitset_to_vector`, b) +} + +filter_bitset_integer <- function(b, other) { + .Call(`_individual_filter_bitset_integer`, b, other) +} + +filter_bitset_bitset <- function(b, other) { + .Call(`_individual_filter_bitset_bitset`, b, other) +} + +filter_bitset_logical <- function(bitset, other) { + .Call(`_individual_filter_bitset_logical`, bitset, other) +} + +bitset_choose <- function(b, k) { + invisible(.Call(`_individual_bitset_choose`, b, k)) +} + +bitset_count_and_cpp <- function(a, b) { + .Call(`_individual_bitset_count_and_cpp`, a, b) +} + +create_categorical_variable <- function(categories, values) { + .Call(`_individual_create_categorical_variable`, categories, values) +} + +categorical_variable_get_size <- function(variable) { + .Call(`_individual_categorical_variable_get_size`, variable) +} + +categorical_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_categorical_variable_queue_update`, variable, value, index)) +} + +categorical_variable_get_index_of <- function(variable, values) { + .Call(`_individual_categorical_variable_get_index_of`, variable, values) +} + +categorical_variable_get_size_of <- function(variable, values) { + .Call(`_individual_categorical_variable_get_size_of`, variable, values) +} + +categorical_variable_get_categories <- function(variable) { + .Call(`_individual_categorical_variable_get_categories`, variable) +} + +categorical_variable_queue_update_vector <- function(variable, value, index) { + invisible(.Call(`_individual_categorical_variable_queue_update_vector`, variable, value, index)) +} + +categorical_variable_update <- function(variable) { + invisible(.Call(`_individual_categorical_variable_update`, variable)) +} + +categorical_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_categorical_variable_queue_extend`, variable, values)) +} + +categorical_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_categorical_variable_queue_shrink`, variable, index)) +} + +categorical_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_categorical_variable_queue_shrink_bitset`, variable, index)) +} + +categorical_variable_get_values <- function(variable) { + .Call(`_individual_categorical_variable_get_values`, variable) +} + +categorical_variable_get_values_with_index <- function(variable, index) { + .Call(`_individual_categorical_variable_get_values_with_index`, variable, index) +} + +create_double_variable <- function(values) { + .Call(`_individual_create_double_variable`, values) +} + +double_variable_get_values <- function(variable) { + .Call(`_individual_double_variable_get_values`, variable) +} + +double_variable_get_values_at_index <- function(variable, index) { + .Call(`_individual_double_variable_get_values_at_index`, variable, index) +} + +double_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_double_variable_get_values_at_index_vector`, variable, index) +} + +double_variable_get_index_of_range <- function(variable, a, b) { + .Call(`_individual_double_variable_get_index_of_range`, variable, a, b) +} + +double_variable_get_size_of_range <- function(variable, a, b) { + .Call(`_individual_double_variable_get_size_of_range`, variable, a, b) +} + +double_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_double_variable_queue_fill`, variable, value)) +} + +double_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_double_variable_queue_update`, variable, value, index)) +} + +double_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_double_variable_queue_update_bitset`, variable, value, index)) +} + +double_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_double_variable_queue_extend`, variable, values)) +} + +double_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_double_variable_queue_shrink`, variable, index)) +} + +double_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_double_variable_queue_shrink_bitset`, variable, index)) +} + +create_event <- function() { + .Call(`_individual_create_event`) +} + +create_targeted_event <- function(size) { + .Call(`_individual_create_targeted_event`, size) +} + +event_base_tick <- function(event) { + invisible(.Call(`_individual_event_base_tick`, event)) +} + +event_base_get_timestep <- function(event) { + .Call(`_individual_event_base_get_timestep`, event) +} + +event_base_set_timestep <- function(event, time) { + invisible(.Call(`_individual_event_base_set_timestep`, event, time)) +} + +event_base_should_trigger <- function(event) { + .Call(`_individual_event_base_should_trigger`, event) +} + +event_schedule <- function(event, delays) { + invisible(.Call(`_individual_event_schedule`, event, delays)) +} + +event_clear_schedule <- function(event) { + invisible(.Call(`_individual_event_clear_schedule`, event)) +} + +event_checkpoint <- function(event) { + .Call(`_individual_event_checkpoint`, event) +} + +event_restore <- function(event, schedule) { + invisible(.Call(`_individual_event_restore`, event, schedule)) +} + +targeted_event_clear_schedule_vector <- function(event, target) { + invisible(.Call(`_individual_targeted_event_clear_schedule_vector`, event, target)) +} + +targeted_event_clear_schedule <- function(event, target) { + invisible(.Call(`_individual_targeted_event_clear_schedule`, event, target)) +} + +targeted_event_get_scheduled <- function(event) { + .Call(`_individual_targeted_event_get_scheduled`, event) +} + +targeted_event_schedule <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule`, event, target, delay)) +} + +targeted_event_queue_shrink_bitset <- function(event, index) { + invisible(.Call(`_individual_targeted_event_queue_shrink_bitset`, event, index)) +} + +targeted_event_queue_shrink <- function(event, index) { + invisible(.Call(`_individual_targeted_event_queue_shrink`, event, index)) +} + +targeted_event_queue_extend <- function(event, n) { + invisible(.Call(`_individual_targeted_event_queue_extend`, event, n)) +} + +targeted_event_queue_extend_with_schedule <- function(event, delays) { + invisible(.Call(`_individual_targeted_event_queue_extend_with_schedule`, event, delays)) +} + +targeted_event_schedule_vector <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_vector`, event, target, delay)) +} + +targeted_event_schedule_multi_delay <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_multi_delay`, event, target, delay)) +} + +targeted_event_schedule_multi_delay_vector <- function(event, target, delay) { + invisible(.Call(`_individual_targeted_event_schedule_multi_delay_vector`, event, target, delay)) +} + +targeted_event_get_target <- function(event) { + .Call(`_individual_targeted_event_get_target`, event) +} + +targeted_event_resize <- function(event) { + invisible(.Call(`_individual_targeted_event_resize`, event)) +} + +targeted_event_checkpoint <- function(event) { + .Call(`_individual_targeted_event_checkpoint`, event) +} + +targeted_event_restore <- function(event, state) { + invisible(.Call(`_individual_targeted_event_restore`, event, state)) +} + +process_listener <- function(event, listener) { + invisible(.Call(`_individual_process_listener`, event, listener)) +} + +process_targeted_listener <- function(event, listener, target) { + invisible(.Call(`_individual_process_targeted_listener`, event, listener, target)) +} + +create_integer_variable <- function(values) { + .Call(`_individual_create_integer_variable`, values) +} + +integer_variable_get_values <- function(variable) { + .Call(`_individual_integer_variable_get_values`, variable) +} + +integer_variable_get_modulo_differences <- function(variable, value, difference) { + .Call(`_individual_integer_variable_get_modulo_differences`, variable, value, difference) +} + +integer_variable_get_values_at_index <- function(variable, index) { + .Call(`_individual_integer_variable_get_values_at_index`, variable, index) +} + +integer_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_variable_get_values_at_index_vector`, variable, index) +} + +integer_variable_get_index_of_set_vector <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_index_of_set_vector`, variable, values_set) +} + +integer_variable_get_index_of_set_scalar <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_index_of_set_scalar`, variable, values_set) +} + +integer_variable_get_index_of_range <- function(variable, a, b) { + .Call(`_individual_integer_variable_get_index_of_range`, variable, a, b) +} + +integer_variable_get_size_of_set_vector <- function(variable, values_set) { + .Call(`_individual_integer_variable_get_size_of_set_vector`, variable, values_set) +} + +integer_variable_get_size_of_set_scalar <- function(variable, value) { + .Call(`_individual_integer_variable_get_size_of_set_scalar`, variable, value) +} + +integer_variable_get_size_of_range <- function(variable, a, b) { + .Call(`_individual_integer_variable_get_size_of_range`, variable, a, b) +} + +integer_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_integer_variable_queue_fill`, variable, value)) +} + +integer_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_integer_variable_queue_update`, variable, value, index)) +} + +integer_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_integer_variable_queue_update_bitset`, variable, value, index)) +} + +integer_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_integer_variable_queue_extend`, variable, values)) +} + +integer_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_integer_variable_queue_shrink`, variable, index)) +} + +integer_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_integer_variable_queue_shrink_bitset`, variable, index)) +} + +fixed_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate, destination_probabilities) { + .Call(`_individual_fixed_probability_multinomial_process_internal`, variable, source_state, destination_states, rate, destination_probabilities) +} + +multi_probability_multinomial_process_internal <- function(variable, source_state, destination_states, rate_variable, destination_probabilities) { + .Call(`_individual_multi_probability_multinomial_process_internal`, variable, source_state, destination_states, rate_variable, destination_probabilities) +} + +multi_probability_bernoulli_process_internal <- function(variable, from, to, rate_variable) { + .Call(`_individual_multi_probability_bernoulli_process_internal`, variable, from, to, rate_variable) +} + +infection_age_process_internal <- function(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) { + .Call(`_individual_infection_age_process_internal`, state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing) +} + +create_double_ragged_variable <- function(values) { + .Call(`_individual_create_double_ragged_variable`, values) +} + +double_ragged_variable_get_values <- function(variable) { + .Call(`_individual_double_ragged_variable_get_values`, variable) +} + +double_ragged_variable_get_values_at_index_bitset <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_values_at_index_bitset`, variable, index) +} + +double_ragged_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_values_at_index_vector`, variable, index) +} + +double_ragged_variable_get_length <- function(variable) { + .Call(`_individual_double_ragged_variable_get_length`, variable) +} + +double_ragged_variable_get_length_at_index_bitset <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_length_at_index_bitset`, variable, index) +} + +double_ragged_variable_get_length_at_index_vector <- function(variable, index) { + .Call(`_individual_double_ragged_variable_get_length_at_index_vector`, variable, index) +} + +double_ragged_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_double_ragged_variable_queue_fill`, variable, value)) +} + +double_ragged_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_update`, variable, value, index)) +} + +double_ragged_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_update_bitset`, variable, value, index)) +} + +double_ragged_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_double_ragged_variable_queue_extend`, variable, values)) +} + +double_ragged_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_shrink`, variable, index)) +} + +double_ragged_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_double_ragged_variable_queue_shrink_bitset`, variable, index)) +} + +create_integer_ragged_variable <- function(values) { + .Call(`_individual_create_integer_ragged_variable`, values) +} + +integer_ragged_variable_get_values <- function(variable) { + .Call(`_individual_integer_ragged_variable_get_values`, variable) +} + +integer_ragged_variable_get_values_at_index_bitset <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_values_at_index_bitset`, variable, index) +} + +integer_ragged_variable_get_values_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_values_at_index_vector`, variable, index) +} + +integer_ragged_variable_get_length <- function(variable) { + .Call(`_individual_integer_ragged_variable_get_length`, variable) +} + +integer_ragged_variable_get_length_at_index_bitset <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_length_at_index_bitset`, variable, index) +} + +integer_ragged_variable_get_length_at_index_vector <- function(variable, index) { + .Call(`_individual_integer_ragged_variable_get_length_at_index_vector`, variable, index) +} + +integer_ragged_variable_queue_fill <- function(variable, value) { + invisible(.Call(`_individual_integer_ragged_variable_queue_fill`, variable, value)) +} + +integer_ragged_variable_queue_update <- function(variable, value, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_update`, variable, value, index)) +} + +integer_ragged_variable_queue_update_bitset <- function(variable, value, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_update_bitset`, variable, value, index)) +} + +integer_ragged_variable_queue_extend <- function(variable, values) { + invisible(.Call(`_individual_integer_ragged_variable_queue_extend`, variable, values)) +} + +integer_ragged_variable_queue_shrink <- function(variable, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_shrink`, variable, index)) +} + +integer_ragged_variable_queue_shrink_bitset <- function(variable, index) { + invisible(.Call(`_individual_integer_ragged_variable_queue_shrink_bitset`, variable, index)) +} + +create_render_vector <- function(data) { + .Call(`_individual_create_render_vector`, data) +} + +render_vector_update <- function(v, index, value) { + invisible(.Call(`_individual_render_vector_update`, v, index, value)) +} + +render_vector_data <- function(v) { + .Call(`_individual_render_vector_data`, v) +} + +execute_process <- function(process, timestep) { + invisible(.Call(`_individual_execute_process`, process, timestep)) +} + +variable_get_size <- function(variable) { + .Call(`_individual_variable_get_size`, variable) +} + +variable_update <- function(variable) { + invisible(.Call(`_individual_variable_update`, variable)) +} + +variable_resize <- function(variable) { + invisible(.Call(`_individual_variable_resize`, variable)) +} + +# Register entry points for exported C++ functions +methods::setLoadAction(function(ns) { + .Call('_individual_RcppExport_registerCCallable', PACKAGE = 'individual') +}) diff --git a/R/bitset.R b/R/bitset.R index 7c551a8..b0da440 100644 --- a/R/bitset.R +++ b/R/bitset.R @@ -291,3 +291,15 @@ filter_bitset = function(bitset, other) { } } } + +#' @title Count bitset and +#' @description This non-modifying function returns the number of intersecting +#' elements between two bitsets \code{a} and \code{b}. This should be faster than +#' writing \code{a$copy()$and(b)$size()} as it avoids the memory allocations of $copy(). +#' +#' @param a a \code{\link{Bitset}} +#' @param b another \code{\link{Bitset}} +#' @export +bitset_count_and = function(a, b) { + bitset_count_and_cpp(a$.bitset, b$.bitset) +} diff --git a/inst/include/IterableBitset.h b/inst/include/IterableBitset.h index 6643aaf..a942f62 100644 --- a/inst/include/IterableBitset.h +++ b/inst/include/IterableBitset.h @@ -79,6 +79,7 @@ class IterableBitset { IterableBitset& operator&=(const IterableBitset&); IterableBitset& operator|=(const IterableBitset&); IterableBitset& operator^=(const IterableBitset&); + size_t count_and(const IterableBitset&) const; IterableBitset& clear(); IterableBitset& inverse(); iterator begin(); @@ -293,6 +294,18 @@ inline IterableBitset& IterableBitset::operator &=(const IterableBitset return *this; } +template +inline size_t IterableBitset::count_and(const IterableBitset& other) const { + if (max_size() != other.max_size()) { + Rcpp::stop("Incompatible bitmap sizes"); + } + auto n = 0u; + for (auto i = 0u; i < bitmap.size(); ++i) { + n += popcount(bitmap[i] & other.bitmap[i]); + } + return n; +} + template inline IterableBitset& IterableBitset::operator |=(const IterableBitset& other) { if (max_size() != other.max_size()) { diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 94c6a58..4c34b84 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,1651 +1,1664 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include "../inst/include/individual.h" -#include "../inst/include/individual_types.h" -#include -#include -#include - -using namespace Rcpp; - -#ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); -Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); -#endif - -// create_bitset -Rcpp::XPtr create_bitset(size_t size); -RcppExport SEXP _individual_create_bitset(SEXP sizeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); - rcpp_result_gen = Rcpp::wrap(create_bitset(size)); - return rcpp_result_gen; -END_RCPP -} -// bitset_copy -Rcpp::XPtr bitset_copy(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_copy(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_copy(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_insert -void bitset_insert(const Rcpp::XPtr b, std::vector v); -RcppExport SEXP _individual_bitset_insert(SEXP bSEXP, SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); - bitset_insert(b, v); - return R_NilValue; -END_RCPP -} -// bitset_remove -void bitset_remove(const Rcpp::XPtr b, std::vector v); -RcppExport SEXP _individual_bitset_remove(SEXP bSEXP, SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); - bitset_remove(b, v); - return R_NilValue; -END_RCPP -} -// bitset_clear -void bitset_clear(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_clear(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_clear(b); - return R_NilValue; -END_RCPP -} -// bitset_size -size_t bitset_size(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_size(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_size(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_max_size -size_t bitset_max_size(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_max_size(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_max_size(b)); - return rcpp_result_gen; -END_RCPP -} -// bitset_and -void bitset_and(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_and(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_and(a, b); - return R_NilValue; -END_RCPP -} -// bitset_not -Rcpp::XPtr bitset_not(const Rcpp::XPtr b, const bool inplace); -RcppExport SEXP _individual_bitset_not(SEXP bSEXP, SEXP inplaceSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const bool >::type inplace(inplaceSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_not(b, inplace)); - return rcpp_result_gen; -END_RCPP -} -// bitset_or -void bitset_or(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_or(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_or(a, b); - return R_NilValue; -END_RCPP -} -// bitset_copy_from -void bitset_copy_from(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_copy_from(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_copy_from(a, b); - return R_NilValue; -END_RCPP -} -// bitset_xor -void bitset_xor(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_xor(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_xor(a, b); - return R_NilValue; -END_RCPP -} -// bitset_set_difference -void bitset_set_difference(const Rcpp::XPtr a, const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_set_difference(SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - bitset_set_difference(a, b); - return R_NilValue; -END_RCPP -} -// bitset_sample -void bitset_sample(const Rcpp::XPtr b, double rate); -RcppExport SEXP _individual_bitset_sample(SEXP bSEXP, SEXP rateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< double >::type rate(rateSEXP); - bitset_sample(b, rate); - return R_NilValue; -END_RCPP -} -// bitset_sample_vector -void bitset_sample_vector(const Rcpp::XPtr b, std::vector rate); -RcppExport SEXP _individual_bitset_sample_vector(SEXP bSEXP, SEXP rateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type rate(rateSEXP); - bitset_sample_vector(b, rate); - return R_NilValue; -END_RCPP -} -// bitset_to_vector -std::vector bitset_to_vector(const Rcpp::XPtr b); -RcppExport SEXP _individual_bitset_to_vector(SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(bitset_to_vector(b)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_integer -Rcpp::XPtr filter_bitset_integer(const Rcpp::XPtr b, std::vector other); -RcppExport SEXP _individual_filter_bitset_integer(SEXP bSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< std::vector >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_integer(b, other)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_bitset -Rcpp::XPtr filter_bitset_bitset(const Rcpp::XPtr b, const Rcpp::XPtr other); -RcppExport SEXP _individual_filter_bitset_bitset(SEXP bSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_bitset(b, other)); - return rcpp_result_gen; -END_RCPP -} -// filter_bitset_logical -Rcpp::XPtr filter_bitset_logical(const Rcpp::XPtr bitset, Rcpp::LogicalVector other); -RcppExport SEXP _individual_filter_bitset_logical(SEXP bitsetSEXP, SEXP otherSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type bitset(bitsetSEXP); - Rcpp::traits::input_parameter< Rcpp::LogicalVector >::type other(otherSEXP); - rcpp_result_gen = Rcpp::wrap(filter_bitset_logical(bitset, other)); - return rcpp_result_gen; -END_RCPP -} -// bitset_choose -void bitset_choose(const Rcpp::XPtr b, const size_t k); -RcppExport SEXP _individual_bitset_choose(SEXP bSEXP, SEXP kSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); - Rcpp::traits::input_parameter< const size_t >::type k(kSEXP); - bitset_choose(b, k); - return R_NilValue; -END_RCPP -} -// create_categorical_variable -Rcpp::XPtr create_categorical_variable(const std::vector& categories, const std::vector& values); -RcppExport SEXP _individual_create_categorical_variable(SEXP categoriesSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type categories(categoriesSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_categorical_variable(categories, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_size -size_t categorical_variable_get_size(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_get_size(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size(variable)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_queue_update -void categorical_variable_queue_update(Rcpp::XPtr variable, const std::string& value, Rcpp::XPtr index); -RcppExport SEXP _individual_categorical_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - categorical_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_get_index_of -Rcpp::XPtr categorical_variable_get_index_of(Rcpp::XPtr variable, const std::vector& values); -RcppExport SEXP _individual_categorical_variable_get_index_of(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_index_of(variable, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_size_of -int categorical_variable_get_size_of(Rcpp::XPtr variable, const std::vector& values); -RcppExport SEXP _individual_categorical_variable_get_size_of(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size_of(variable, values)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_categories -std::vector categorical_variable_get_categories(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_get_categories(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_categories(variable)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_queue_update_vector -void categorical_variable_queue_update_vector(Rcpp::XPtr variable, const std::string& value, std::vector& index); -RcppExport SEXP _individual_categorical_variable_queue_update_vector(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - categorical_variable_queue_update_vector(variable, value, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_update -void categorical_variable_update(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_update(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - categorical_variable_update(variable); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_extend -void categorical_variable_queue_extend(Rcpp::XPtr variable, std::vector& values); -RcppExport SEXP _individual_categorical_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type values(valuesSEXP); - categorical_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_shrink -void categorical_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_categorical_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - categorical_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_queue_shrink_bitset -void categorical_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_categorical_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - categorical_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// categorical_variable_get_values -std::vector categorical_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_categorical_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// categorical_variable_get_values_with_index -std::vector categorical_variable_get_values_with_index(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_categorical_variable_get_values_with_index(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values_with_index(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// dummy -void dummy(); -static SEXP _individual_dummy_try() { -BEGIN_RCPP - dummy(); - return R_NilValue; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _individual_dummy() { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_individual_dummy_try()); - } - Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); - if (rcpp_isInterrupt_gen) { - UNPROTECT(1); - Rf_onintr(); - } - bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); - if (rcpp_isLongjump_gen) { - Rcpp::internal::resumeJump(rcpp_result_gen); - } - Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); - if (rcpp_isError_gen) { - SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); - UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} -// create_double_variable -Rcpp::XPtr create_double_variable(const std::vector& values); -RcppExport SEXP _individual_create_double_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_double_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values -const std::vector& double_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values_at_index -std::vector double_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_values_at_index_vector -std::vector double_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_index_of_range -Rcpp::XPtr double_variable_get_index_of_range(Rcpp::XPtr variable, const double a, const double b); -RcppExport SEXP _individual_double_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const double >::type a(aSEXP); - Rcpp::traits::input_parameter< const double >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_index_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_get_size_of_range -size_t double_variable_get_size_of_range(Rcpp::XPtr variable, const double a, const double b); -RcppExport SEXP _individual_double_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const double >::type a(aSEXP); - Rcpp::traits::input_parameter< const double >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(double_variable_get_size_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// double_variable_queue_fill -void double_variable_queue_fill(Rcpp::XPtr variable, std::vector value); -RcppExport SEXP _individual_double_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - double_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// double_variable_queue_update -void double_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); -RcppExport SEXP _individual_double_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_update_bitset -void double_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_extend -void double_variable_queue_extend(Rcpp::XPtr variable, std::vector values); -RcppExport SEXP _individual_double_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); - double_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// double_variable_queue_shrink -void double_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// double_variable_queue_shrink_bitset -void double_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_event -Rcpp::XPtr create_event(); -RcppExport SEXP _individual_create_event() { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = Rcpp::wrap(create_event()); - return rcpp_result_gen; -END_RCPP -} -// create_targeted_event -Rcpp::XPtr create_targeted_event(size_t size); -RcppExport SEXP _individual_create_targeted_event(SEXP sizeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); - rcpp_result_gen = Rcpp::wrap(create_targeted_event(size)); - return rcpp_result_gen; -END_RCPP -} -// event_base_tick -void event_base_tick(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_tick(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - event_base_tick(event); - return R_NilValue; -END_RCPP -} -// event_base_get_timestep -size_t event_base_get_timestep(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_get_timestep(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_base_get_timestep(event)); - return rcpp_result_gen; -END_RCPP -} -// event_base_set_timestep -void event_base_set_timestep(const Rcpp::XPtr event, size_t time); -RcppExport SEXP _individual_event_base_set_timestep(SEXP eventSEXP, SEXP timeSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< size_t >::type time(timeSEXP); - event_base_set_timestep(event, time); - return R_NilValue; -END_RCPP -} -// event_base_should_trigger -bool event_base_should_trigger(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_base_should_trigger(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_base_should_trigger(event)); - return rcpp_result_gen; -END_RCPP -} -// event_schedule -void event_schedule(const Rcpp::XPtr event, std::vector delays); -RcppExport SEXP _individual_event_schedule(SEXP eventSEXP, SEXP delaysSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type delays(delaysSEXP); - event_schedule(event, delays); - return R_NilValue; -END_RCPP -} -// event_clear_schedule -void event_clear_schedule(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_clear_schedule(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - event_clear_schedule(event); - return R_NilValue; -END_RCPP -} -// event_checkpoint -std::vector event_checkpoint(const Rcpp::XPtr event); -RcppExport SEXP _individual_event_checkpoint(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(event_checkpoint(event)); - return rcpp_result_gen; -END_RCPP -} -// event_restore -void event_restore(const Rcpp::XPtr event, std::vector schedule); -RcppExport SEXP _individual_event_restore(SEXP eventSEXP, SEXP scheduleSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type schedule(scheduleSEXP); - event_restore(event, schedule); - return R_NilValue; -END_RCPP -} -// targeted_event_clear_schedule_vector -void targeted_event_clear_schedule_vector(const Rcpp::XPtr event, std::vector target); -RcppExport SEXP _individual_targeted_event_clear_schedule_vector(SEXP eventSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - targeted_event_clear_schedule_vector(event, target); - return R_NilValue; -END_RCPP -} -// targeted_event_clear_schedule -void targeted_event_clear_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target); -RcppExport SEXP _individual_targeted_event_clear_schedule(SEXP eventSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - targeted_event_clear_schedule(event, target); - return R_NilValue; -END_RCPP -} -// targeted_event_get_scheduled -Rcpp::XPtr targeted_event_get_scheduled(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_get_scheduled(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_get_scheduled(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_schedule -void targeted_event_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target, double delay); -RcppExport SEXP _individual_targeted_event_schedule(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - Rcpp::traits::input_parameter< double >::type delay(delaySEXP); - targeted_event_schedule(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_shrink_bitset -void targeted_event_queue_shrink_bitset(const Rcpp::XPtr event, const Rcpp::XPtr index); -RcppExport SEXP _individual_targeted_event_queue_shrink_bitset(SEXP eventSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type index(indexSEXP); - targeted_event_queue_shrink_bitset(event, index); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_shrink -void targeted_event_queue_shrink(const Rcpp::XPtr event, std::vector& index); -RcppExport SEXP _individual_targeted_event_queue_shrink(SEXP eventSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - targeted_event_queue_shrink(event, index); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_extend -void targeted_event_queue_extend(const Rcpp::XPtr event, size_t n); -RcppExport SEXP _individual_targeted_event_queue_extend(SEXP eventSEXP, SEXP nSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< size_t >::type n(nSEXP); - targeted_event_queue_extend(event, n); - return R_NilValue; -END_RCPP -} -// targeted_event_queue_extend_with_schedule -void targeted_event_queue_extend_with_schedule(const Rcpp::XPtr event, const std::vector& delays); -RcppExport SEXP _individual_targeted_event_queue_extend_with_schedule(SEXP eventSEXP, SEXP delaysSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const std::vector& >::type delays(delaysSEXP); - targeted_event_queue_extend_with_schedule(event, delays); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_vector -void targeted_event_schedule_vector(const Rcpp::XPtr event, std::vector target, double delay); -RcppExport SEXP _individual_targeted_event_schedule_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - Rcpp::traits::input_parameter< double >::type delay(delaySEXP); - targeted_event_schedule_vector(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_multi_delay -void targeted_event_schedule_multi_delay(const Rcpp::XPtr event, const Rcpp::XPtr target, const std::vector delay); -RcppExport SEXP _individual_targeted_event_schedule_multi_delay(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); - targeted_event_schedule_multi_delay(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_schedule_multi_delay_vector -void targeted_event_schedule_multi_delay_vector(const Rcpp::XPtr event, std::vector target, const std::vector delay); -RcppExport SEXP _individual_targeted_event_schedule_multi_delay_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); - Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); - targeted_event_schedule_multi_delay_vector(event, target, delay); - return R_NilValue; -END_RCPP -} -// targeted_event_get_target -Rcpp::XPtr targeted_event_get_target(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_get_target(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_get_target(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_resize -void targeted_event_resize(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_resize(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - targeted_event_resize(event); - return R_NilValue; -END_RCPP -} -// targeted_event_checkpoint -Rcpp::List targeted_event_checkpoint(const Rcpp::XPtr event); -RcppExport SEXP _individual_targeted_event_checkpoint(SEXP eventSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - rcpp_result_gen = Rcpp::wrap(targeted_event_checkpoint(event)); - return rcpp_result_gen; -END_RCPP -} -// targeted_event_restore -void targeted_event_restore(const Rcpp::XPtr event, Rcpp::List state); -RcppExport SEXP _individual_targeted_event_restore(SEXP eventSEXP, SEXP stateSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type state(stateSEXP); - targeted_event_restore(event, state); - return R_NilValue; -END_RCPP -} -// process_listener -void process_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener); -RcppExport SEXP _individual_process_listener(SEXP eventSEXP, SEXP listenerSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); - process_listener(event, listener); - return R_NilValue; -END_RCPP -} -// process_targeted_listener -void process_targeted_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener, const Rcpp::XPtr target); -RcppExport SEXP _individual_process_targeted_listener(SEXP eventSEXP, SEXP listenerSEXP, SEXP targetSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); - process_targeted_listener(event, listener, target); - return R_NilValue; -END_RCPP -} -// create_integer_variable -Rcpp::XPtr create_integer_variable(const std::vector& values); -RcppExport SEXP _individual_create_integer_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_integer_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values -const std::vector& integer_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_modulo_differences -individual_index_t integer_variable_get_modulo_differences(Rcpp::XPtr variable, const int value, const int difference); -RcppExport SEXP _individual_integer_variable_get_modulo_differences(SEXP variableSEXP, SEXP valueSEXP, SEXP differenceSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type value(valueSEXP); - Rcpp::traits::input_parameter< const int >::type difference(differenceSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_modulo_differences(variable, value, difference)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values_at_index -std::vector integer_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_values_at_index_vector -std::vector integer_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_set_vector -Rcpp::XPtr integer_variable_get_index_of_set_vector(Rcpp::XPtr variable, std::vector values_set); -RcppExport SEXP _individual_integer_variable_get_index_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_vector(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_set_scalar -Rcpp::XPtr integer_variable_get_index_of_set_scalar(Rcpp::XPtr variable, const int values_set); -RcppExport SEXP _individual_integer_variable_get_index_of_set_scalar(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_scalar(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_index_of_range -Rcpp::XPtr integer_variable_get_index_of_range(Rcpp::XPtr variable, const int a, const int b); -RcppExport SEXP _individual_integer_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type a(aSEXP); - Rcpp::traits::input_parameter< const int >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_set_vector -size_t integer_variable_get_size_of_set_vector(Rcpp::XPtr variable, const std::vector values_set); -RcppExport SEXP _individual_integer_variable_get_size_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector >::type values_set(values_setSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_vector(variable, values_set)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_set_scalar -size_t integer_variable_get_size_of_set_scalar(Rcpp::XPtr variable, const int value); -RcppExport SEXP _individual_integer_variable_get_size_of_set_scalar(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_scalar(variable, value)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_get_size_of_range -size_t integer_variable_get_size_of_range(Rcpp::XPtr variable, const int a, const int b); -RcppExport SEXP _individual_integer_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const int >::type a(aSEXP); - Rcpp::traits::input_parameter< const int >::type b(bSEXP); - rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_range(variable, a, b)); - return rcpp_result_gen; -END_RCPP -} -// integer_variable_queue_fill -void integer_variable_queue_fill(Rcpp::XPtr variable, std::vector value); -RcppExport SEXP _individual_integer_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - integer_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_update -void integer_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); -RcppExport SEXP _individual_integer_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_update_bitset -void integer_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_extend -void integer_variable_queue_extend(Rcpp::XPtr variable, std::vector values); -RcppExport SEXP _individual_integer_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); - integer_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_shrink -void integer_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// integer_variable_queue_shrink_bitset -void integer_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// fixed_probability_multinomial_process_internal -Rcpp::XPtr fixed_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const double rate, const std::vector destination_probabilities); -RcppExport SEXP _individual_fixed_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rateSEXP, SEXP destination_probabilitiesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); - Rcpp::traits::input_parameter< const double >::type rate(rateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); - rcpp_result_gen = Rcpp::wrap(fixed_probability_multinomial_process_internal(variable, source_state, destination_states, rate, destination_probabilities)); - return rcpp_result_gen; -END_RCPP -} -// multi_probability_multinomial_process_internal -Rcpp::XPtr multi_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const Rcpp::XPtr rate_variable, const std::vector destination_probabilities); -RcppExport SEXP _individual_multi_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rate_variableSEXP, SEXP destination_probabilitiesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); - Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); - rcpp_result_gen = Rcpp::wrap(multi_probability_multinomial_process_internal(variable, source_state, destination_states, rate_variable, destination_probabilities)); - return rcpp_result_gen; -END_RCPP -} -// multi_probability_bernoulli_process_internal -Rcpp::XPtr multi_probability_bernoulli_process_internal(Rcpp::XPtr variable, const std::string from, const std::string to, const Rcpp::XPtr rate_variable); -RcppExport SEXP _individual_multi_probability_bernoulli_process_internal(SEXP variableSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP rate_variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::string >::type from(fromSEXP); - Rcpp::traits::input_parameter< const std::string >::type to(toSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); - rcpp_result_gen = Rcpp::wrap(multi_probability_bernoulli_process_internal(variable, from, to, rate_variable)); - return rcpp_result_gen; -END_RCPP -} -// infection_age_process_internal -Rcpp::XPtr infection_age_process_internal(Rcpp::XPtr state, const std::string susceptible, const std::string exposed, const std::string infectious, const Rcpp::XPtr age, const int age_bins, const double p, const double dt, const Rcpp::NumericMatrix mixing); -RcppExport SEXP _individual_infection_age_process_internal(SEXP stateSEXP, SEXP susceptibleSEXP, SEXP exposedSEXP, SEXP infectiousSEXP, SEXP ageSEXP, SEXP age_binsSEXP, SEXP pSEXP, SEXP dtSEXP, SEXP mixingSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type state(stateSEXP); - Rcpp::traits::input_parameter< const std::string >::type susceptible(susceptibleSEXP); - Rcpp::traits::input_parameter< const std::string >::type exposed(exposedSEXP); - Rcpp::traits::input_parameter< const std::string >::type infectious(infectiousSEXP); - Rcpp::traits::input_parameter< const Rcpp::XPtr >::type age(ageSEXP); - Rcpp::traits::input_parameter< const int >::type age_bins(age_binsSEXP); - Rcpp::traits::input_parameter< const double >::type p(pSEXP); - Rcpp::traits::input_parameter< const double >::type dt(dtSEXP); - Rcpp::traits::input_parameter< const Rcpp::NumericMatrix >::type mixing(mixingSEXP); - rcpp_result_gen = Rcpp::wrap(infection_age_process_internal(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing)); - return rcpp_result_gen; -END_RCPP -} -// create_double_ragged_variable -Rcpp::XPtr create_double_ragged_variable(const std::vector>& values); -RcppExport SEXP _individual_create_double_ragged_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_double_ragged_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values -std::vector> double_ragged_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_ragged_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values_at_index_bitset -std::vector> double_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_values_at_index_vector -std::vector> double_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length -std::vector double_ragged_variable_get_length(Rcpp::XPtr variable); -RcppExport SEXP _individual_double_ragged_variable_get_length(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length(variable)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length_at_index_bitset -std::vector double_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_get_length_at_index_vector -std::vector double_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// double_ragged_variable_queue_fill -void double_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); -RcppExport SEXP _individual_double_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - double_ragged_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_update -void double_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); -RcppExport SEXP _individual_double_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - double_ragged_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_update_bitset -void double_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_ragged_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_extend -void double_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); -RcppExport SEXP _individual_double_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); - double_ragged_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_shrink -void double_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_double_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - double_ragged_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// double_ragged_variable_queue_shrink_bitset -void double_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_double_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - double_ragged_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_integer_ragged_variable -Rcpp::XPtr create_integer_ragged_variable(const std::vector>& values); -RcppExport SEXP _individual_create_integer_ragged_variable(SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); - rcpp_result_gen = Rcpp::wrap(create_integer_ragged_variable(values)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values -std::vector> integer_ragged_variable_get_values(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_ragged_variable_get_values(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values_at_index_bitset -std::vector> integer_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_values_at_index_vector -std::vector> integer_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length -std::vector integer_ragged_variable_get_length(Rcpp::XPtr variable); -RcppExport SEXP _individual_integer_ragged_variable_get_length(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length(variable)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length_at_index_bitset -std::vector integer_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_bitset(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_get_length_at_index_vector -std::vector integer_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_vector(variable, index)); - return rcpp_result_gen; -END_RCPP -} -// integer_ragged_variable_queue_fill -void integer_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); -RcppExport SEXP _individual_integer_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - integer_ragged_variable_queue_fill(variable, value); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_update -void integer_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); -RcppExport SEXP _individual_integer_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); - Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); - integer_ragged_variable_queue_update(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_update_bitset -void integer_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_ragged_variable_queue_update_bitset(variable, value, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_extend -void integer_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); -RcppExport SEXP _individual_integer_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); - integer_ragged_variable_queue_extend(variable, values); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_shrink -void integer_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); -RcppExport SEXP _individual_integer_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); - integer_ragged_variable_queue_shrink(variable, index); - return R_NilValue; -END_RCPP -} -// integer_ragged_variable_queue_shrink_bitset -void integer_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); -RcppExport SEXP _individual_integer_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); - integer_ragged_variable_queue_shrink_bitset(variable, index); - return R_NilValue; -END_RCPP -} -// create_render_vector -Rcpp::XPtr create_render_vector(std::vector data); -RcppExport SEXP _individual_create_render_vector(SEXP dataSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::vector >::type data(dataSEXP); - rcpp_result_gen = Rcpp::wrap(create_render_vector(data)); - return rcpp_result_gen; -END_RCPP -} -// render_vector_update -void render_vector_update(Rcpp::XPtr v, size_t index, double value); -RcppExport SEXP _individual_render_vector_update(SEXP vSEXP, SEXP indexSEXP, SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); - Rcpp::traits::input_parameter< size_t >::type index(indexSEXP); - Rcpp::traits::input_parameter< double >::type value(valueSEXP); - render_vector_update(v, index, value); - return R_NilValue; -END_RCPP -} -// render_vector_data -std::vector render_vector_data(Rcpp::XPtr v); -RcppExport SEXP _individual_render_vector_data(SEXP vSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); - rcpp_result_gen = Rcpp::wrap(render_vector_data(v)); - return rcpp_result_gen; -END_RCPP -} -// execute_process -void execute_process(Rcpp::XPtr process, size_t timestep); -RcppExport SEXP _individual_execute_process(SEXP processSEXP, SEXP timestepSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type process(processSEXP); - Rcpp::traits::input_parameter< size_t >::type timestep(timestepSEXP); - execute_process(process, timestep); - return R_NilValue; -END_RCPP -} -// variable_get_size -size_t variable_get_size(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_get_size(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - rcpp_result_gen = Rcpp::wrap(variable_get_size(variable)); - return rcpp_result_gen; -END_RCPP -} -// variable_update -void variable_update(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_update(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - variable_update(variable); - return R_NilValue; -END_RCPP -} -// variable_resize -void variable_resize(Rcpp::XPtr variable); -RcppExport SEXP _individual_variable_resize(SEXP variableSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); - variable_resize(variable); - return R_NilValue; -END_RCPP -} - -// validate (ensure exported C++ functions exist before calling them) -static int _individual_RcppExport_validate(const char* sig) { - static std::set signatures; - if (signatures.empty()) { - signatures.insert("void(*dummy)()"); - } - return signatures.find(sig) != signatures.end(); -} - -// registerCCallable (register entry points for exported C++ functions) -RcppExport SEXP _individual_RcppExport_registerCCallable() { - R_RegisterCCallable("individual", "_individual_dummy", (DL_FUNC)_individual_dummy_try); - R_RegisterCCallable("individual", "_individual_RcppExport_validate", (DL_FUNC)_individual_RcppExport_validate); - return R_NilValue; -} - -RcppExport SEXP run_testthat_tests(SEXP); - -static const R_CallMethodDef CallEntries[] = { - {"_individual_create_bitset", (DL_FUNC) &_individual_create_bitset, 1}, - {"_individual_bitset_copy", (DL_FUNC) &_individual_bitset_copy, 1}, - {"_individual_bitset_insert", (DL_FUNC) &_individual_bitset_insert, 2}, - {"_individual_bitset_remove", (DL_FUNC) &_individual_bitset_remove, 2}, - {"_individual_bitset_clear", (DL_FUNC) &_individual_bitset_clear, 1}, - {"_individual_bitset_size", (DL_FUNC) &_individual_bitset_size, 1}, - {"_individual_bitset_max_size", (DL_FUNC) &_individual_bitset_max_size, 1}, - {"_individual_bitset_and", (DL_FUNC) &_individual_bitset_and, 2}, - {"_individual_bitset_not", (DL_FUNC) &_individual_bitset_not, 2}, - {"_individual_bitset_or", (DL_FUNC) &_individual_bitset_or, 2}, - {"_individual_bitset_copy_from", (DL_FUNC) &_individual_bitset_copy_from, 2}, - {"_individual_bitset_xor", (DL_FUNC) &_individual_bitset_xor, 2}, - {"_individual_bitset_set_difference", (DL_FUNC) &_individual_bitset_set_difference, 2}, - {"_individual_bitset_sample", (DL_FUNC) &_individual_bitset_sample, 2}, - {"_individual_bitset_sample_vector", (DL_FUNC) &_individual_bitset_sample_vector, 2}, - {"_individual_bitset_to_vector", (DL_FUNC) &_individual_bitset_to_vector, 1}, - {"_individual_filter_bitset_integer", (DL_FUNC) &_individual_filter_bitset_integer, 2}, - {"_individual_filter_bitset_bitset", (DL_FUNC) &_individual_filter_bitset_bitset, 2}, - {"_individual_filter_bitset_logical", (DL_FUNC) &_individual_filter_bitset_logical, 2}, - {"_individual_bitset_choose", (DL_FUNC) &_individual_bitset_choose, 2}, - {"_individual_create_categorical_variable", (DL_FUNC) &_individual_create_categorical_variable, 2}, - {"_individual_categorical_variable_get_size", (DL_FUNC) &_individual_categorical_variable_get_size, 1}, - {"_individual_categorical_variable_queue_update", (DL_FUNC) &_individual_categorical_variable_queue_update, 3}, - {"_individual_categorical_variable_get_index_of", (DL_FUNC) &_individual_categorical_variable_get_index_of, 2}, - {"_individual_categorical_variable_get_size_of", (DL_FUNC) &_individual_categorical_variable_get_size_of, 2}, - {"_individual_categorical_variable_get_categories", (DL_FUNC) &_individual_categorical_variable_get_categories, 1}, - {"_individual_categorical_variable_queue_update_vector", (DL_FUNC) &_individual_categorical_variable_queue_update_vector, 3}, - {"_individual_categorical_variable_update", (DL_FUNC) &_individual_categorical_variable_update, 1}, - {"_individual_categorical_variable_queue_extend", (DL_FUNC) &_individual_categorical_variable_queue_extend, 2}, - {"_individual_categorical_variable_queue_shrink", (DL_FUNC) &_individual_categorical_variable_queue_shrink, 2}, - {"_individual_categorical_variable_queue_shrink_bitset", (DL_FUNC) &_individual_categorical_variable_queue_shrink_bitset, 2}, - {"_individual_categorical_variable_get_values", (DL_FUNC) &_individual_categorical_variable_get_values, 1}, - {"_individual_categorical_variable_get_values_with_index", (DL_FUNC) &_individual_categorical_variable_get_values_with_index, 2}, - {"_individual_dummy", (DL_FUNC) &_individual_dummy, 0}, - {"_individual_create_double_variable", (DL_FUNC) &_individual_create_double_variable, 1}, - {"_individual_double_variable_get_values", (DL_FUNC) &_individual_double_variable_get_values, 1}, - {"_individual_double_variable_get_values_at_index", (DL_FUNC) &_individual_double_variable_get_values_at_index, 2}, - {"_individual_double_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_variable_get_values_at_index_vector, 2}, - {"_individual_double_variable_get_index_of_range", (DL_FUNC) &_individual_double_variable_get_index_of_range, 3}, - {"_individual_double_variable_get_size_of_range", (DL_FUNC) &_individual_double_variable_get_size_of_range, 3}, - {"_individual_double_variable_queue_fill", (DL_FUNC) &_individual_double_variable_queue_fill, 2}, - {"_individual_double_variable_queue_update", (DL_FUNC) &_individual_double_variable_queue_update, 3}, - {"_individual_double_variable_queue_update_bitset", (DL_FUNC) &_individual_double_variable_queue_update_bitset, 3}, - {"_individual_double_variable_queue_extend", (DL_FUNC) &_individual_double_variable_queue_extend, 2}, - {"_individual_double_variable_queue_shrink", (DL_FUNC) &_individual_double_variable_queue_shrink, 2}, - {"_individual_double_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_variable_queue_shrink_bitset, 2}, - {"_individual_create_event", (DL_FUNC) &_individual_create_event, 0}, - {"_individual_create_targeted_event", (DL_FUNC) &_individual_create_targeted_event, 1}, - {"_individual_event_base_tick", (DL_FUNC) &_individual_event_base_tick, 1}, - {"_individual_event_base_get_timestep", (DL_FUNC) &_individual_event_base_get_timestep, 1}, - {"_individual_event_base_set_timestep", (DL_FUNC) &_individual_event_base_set_timestep, 2}, - {"_individual_event_base_should_trigger", (DL_FUNC) &_individual_event_base_should_trigger, 1}, - {"_individual_event_schedule", (DL_FUNC) &_individual_event_schedule, 2}, - {"_individual_event_clear_schedule", (DL_FUNC) &_individual_event_clear_schedule, 1}, - {"_individual_event_checkpoint", (DL_FUNC) &_individual_event_checkpoint, 1}, - {"_individual_event_restore", (DL_FUNC) &_individual_event_restore, 2}, - {"_individual_targeted_event_clear_schedule_vector", (DL_FUNC) &_individual_targeted_event_clear_schedule_vector, 2}, - {"_individual_targeted_event_clear_schedule", (DL_FUNC) &_individual_targeted_event_clear_schedule, 2}, - {"_individual_targeted_event_get_scheduled", (DL_FUNC) &_individual_targeted_event_get_scheduled, 1}, - {"_individual_targeted_event_schedule", (DL_FUNC) &_individual_targeted_event_schedule, 3}, - {"_individual_targeted_event_queue_shrink_bitset", (DL_FUNC) &_individual_targeted_event_queue_shrink_bitset, 2}, - {"_individual_targeted_event_queue_shrink", (DL_FUNC) &_individual_targeted_event_queue_shrink, 2}, - {"_individual_targeted_event_queue_extend", (DL_FUNC) &_individual_targeted_event_queue_extend, 2}, - {"_individual_targeted_event_queue_extend_with_schedule", (DL_FUNC) &_individual_targeted_event_queue_extend_with_schedule, 2}, - {"_individual_targeted_event_schedule_vector", (DL_FUNC) &_individual_targeted_event_schedule_vector, 3}, - {"_individual_targeted_event_schedule_multi_delay", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay, 3}, - {"_individual_targeted_event_schedule_multi_delay_vector", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay_vector, 3}, - {"_individual_targeted_event_get_target", (DL_FUNC) &_individual_targeted_event_get_target, 1}, - {"_individual_targeted_event_resize", (DL_FUNC) &_individual_targeted_event_resize, 1}, - {"_individual_targeted_event_checkpoint", (DL_FUNC) &_individual_targeted_event_checkpoint, 1}, - {"_individual_targeted_event_restore", (DL_FUNC) &_individual_targeted_event_restore, 2}, - {"_individual_process_listener", (DL_FUNC) &_individual_process_listener, 2}, - {"_individual_process_targeted_listener", (DL_FUNC) &_individual_process_targeted_listener, 3}, - {"_individual_create_integer_variable", (DL_FUNC) &_individual_create_integer_variable, 1}, - {"_individual_integer_variable_get_values", (DL_FUNC) &_individual_integer_variable_get_values, 1}, - {"_individual_integer_variable_get_modulo_differences", (DL_FUNC) &_individual_integer_variable_get_modulo_differences, 3}, - {"_individual_integer_variable_get_values_at_index", (DL_FUNC) &_individual_integer_variable_get_values_at_index, 2}, - {"_individual_integer_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_variable_get_values_at_index_vector, 2}, - {"_individual_integer_variable_get_index_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_index_of_set_vector, 2}, - {"_individual_integer_variable_get_index_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_index_of_set_scalar, 2}, - {"_individual_integer_variable_get_index_of_range", (DL_FUNC) &_individual_integer_variable_get_index_of_range, 3}, - {"_individual_integer_variable_get_size_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_size_of_set_vector, 2}, - {"_individual_integer_variable_get_size_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_size_of_set_scalar, 2}, - {"_individual_integer_variable_get_size_of_range", (DL_FUNC) &_individual_integer_variable_get_size_of_range, 3}, - {"_individual_integer_variable_queue_fill", (DL_FUNC) &_individual_integer_variable_queue_fill, 2}, - {"_individual_integer_variable_queue_update", (DL_FUNC) &_individual_integer_variable_queue_update, 3}, - {"_individual_integer_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_variable_queue_update_bitset, 3}, - {"_individual_integer_variable_queue_extend", (DL_FUNC) &_individual_integer_variable_queue_extend, 2}, - {"_individual_integer_variable_queue_shrink", (DL_FUNC) &_individual_integer_variable_queue_shrink, 2}, - {"_individual_integer_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_variable_queue_shrink_bitset, 2}, - {"_individual_fixed_probability_multinomial_process_internal", (DL_FUNC) &_individual_fixed_probability_multinomial_process_internal, 5}, - {"_individual_multi_probability_multinomial_process_internal", (DL_FUNC) &_individual_multi_probability_multinomial_process_internal, 5}, - {"_individual_multi_probability_bernoulli_process_internal", (DL_FUNC) &_individual_multi_probability_bernoulli_process_internal, 4}, - {"_individual_infection_age_process_internal", (DL_FUNC) &_individual_infection_age_process_internal, 9}, - {"_individual_create_double_ragged_variable", (DL_FUNC) &_individual_create_double_ragged_variable, 1}, - {"_individual_double_ragged_variable_get_values", (DL_FUNC) &_individual_double_ragged_variable_get_values, 1}, - {"_individual_double_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_bitset, 2}, - {"_individual_double_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_vector, 2}, - {"_individual_double_ragged_variable_get_length", (DL_FUNC) &_individual_double_ragged_variable_get_length, 1}, - {"_individual_double_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_bitset, 2}, - {"_individual_double_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_vector, 2}, - {"_individual_double_ragged_variable_queue_fill", (DL_FUNC) &_individual_double_ragged_variable_queue_fill, 2}, - {"_individual_double_ragged_variable_queue_update", (DL_FUNC) &_individual_double_ragged_variable_queue_update, 3}, - {"_individual_double_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_update_bitset, 3}, - {"_individual_double_ragged_variable_queue_extend", (DL_FUNC) &_individual_double_ragged_variable_queue_extend, 2}, - {"_individual_double_ragged_variable_queue_shrink", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink, 2}, - {"_individual_double_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink_bitset, 2}, - {"_individual_create_integer_ragged_variable", (DL_FUNC) &_individual_create_integer_ragged_variable, 1}, - {"_individual_integer_ragged_variable_get_values", (DL_FUNC) &_individual_integer_ragged_variable_get_values, 1}, - {"_individual_integer_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_bitset, 2}, - {"_individual_integer_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_vector, 2}, - {"_individual_integer_ragged_variable_get_length", (DL_FUNC) &_individual_integer_ragged_variable_get_length, 1}, - {"_individual_integer_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_bitset, 2}, - {"_individual_integer_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_vector, 2}, - {"_individual_integer_ragged_variable_queue_fill", (DL_FUNC) &_individual_integer_ragged_variable_queue_fill, 2}, - {"_individual_integer_ragged_variable_queue_update", (DL_FUNC) &_individual_integer_ragged_variable_queue_update, 3}, - {"_individual_integer_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_update_bitset, 3}, - {"_individual_integer_ragged_variable_queue_extend", (DL_FUNC) &_individual_integer_ragged_variable_queue_extend, 2}, - {"_individual_integer_ragged_variable_queue_shrink", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink, 2}, - {"_individual_integer_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink_bitset, 2}, - {"_individual_create_render_vector", (DL_FUNC) &_individual_create_render_vector, 1}, - {"_individual_render_vector_update", (DL_FUNC) &_individual_render_vector_update, 3}, - {"_individual_render_vector_data", (DL_FUNC) &_individual_render_vector_data, 1}, - {"_individual_execute_process", (DL_FUNC) &_individual_execute_process, 2}, - {"_individual_variable_get_size", (DL_FUNC) &_individual_variable_get_size, 1}, - {"_individual_variable_update", (DL_FUNC) &_individual_variable_update, 1}, - {"_individual_variable_resize", (DL_FUNC) &_individual_variable_resize, 1}, - {"_individual_RcppExport_registerCCallable", (DL_FUNC) &_individual_RcppExport_registerCCallable, 0}, - {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 1}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_individual(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} +// Generated by using Rcpp::compileAttributes() -> do not edit by hand +// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +#include "../inst/include/individual.h" +#include "../inst/include/individual_types.h" +#include +#include +#include + +using namespace Rcpp; + +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + +// create_bitset +Rcpp::XPtr create_bitset(size_t size); +RcppExport SEXP _individual_create_bitset(SEXP sizeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); + rcpp_result_gen = Rcpp::wrap(create_bitset(size)); + return rcpp_result_gen; +END_RCPP +} +// bitset_copy +Rcpp::XPtr bitset_copy(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_copy(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_copy(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_insert +void bitset_insert(const Rcpp::XPtr b, std::vector v); +RcppExport SEXP _individual_bitset_insert(SEXP bSEXP, SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); + bitset_insert(b, v); + return R_NilValue; +END_RCPP +} +// bitset_remove +void bitset_remove(const Rcpp::XPtr b, std::vector v); +RcppExport SEXP _individual_bitset_remove(SEXP bSEXP, SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type v(vSEXP); + bitset_remove(b, v); + return R_NilValue; +END_RCPP +} +// bitset_clear +void bitset_clear(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_clear(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_clear(b); + return R_NilValue; +END_RCPP +} +// bitset_size +size_t bitset_size(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_size(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_size(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_max_size +size_t bitset_max_size(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_max_size(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_max_size(b)); + return rcpp_result_gen; +END_RCPP +} +// bitset_and +void bitset_and(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_and(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_and(a, b); + return R_NilValue; +END_RCPP +} +// bitset_not +Rcpp::XPtr bitset_not(const Rcpp::XPtr b, const bool inplace); +RcppExport SEXP _individual_bitset_not(SEXP bSEXP, SEXP inplaceSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const bool >::type inplace(inplaceSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_not(b, inplace)); + return rcpp_result_gen; +END_RCPP +} +// bitset_or +void bitset_or(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_or(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_or(a, b); + return R_NilValue; +END_RCPP +} +// bitset_copy_from +void bitset_copy_from(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_copy_from(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_copy_from(a, b); + return R_NilValue; +END_RCPP +} +// bitset_xor +void bitset_xor(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_xor(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_xor(a, b); + return R_NilValue; +END_RCPP +} +// bitset_set_difference +void bitset_set_difference(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_set_difference(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + bitset_set_difference(a, b); + return R_NilValue; +END_RCPP +} +// bitset_sample +void bitset_sample(const Rcpp::XPtr b, double rate); +RcppExport SEXP _individual_bitset_sample(SEXP bSEXP, SEXP rateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< double >::type rate(rateSEXP); + bitset_sample(b, rate); + return R_NilValue; +END_RCPP +} +// bitset_sample_vector +void bitset_sample_vector(const Rcpp::XPtr b, std::vector rate); +RcppExport SEXP _individual_bitset_sample_vector(SEXP bSEXP, SEXP rateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type rate(rateSEXP); + bitset_sample_vector(b, rate); + return R_NilValue; +END_RCPP +} +// bitset_to_vector +std::vector bitset_to_vector(const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_to_vector(SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_to_vector(b)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_integer +Rcpp::XPtr filter_bitset_integer(const Rcpp::XPtr b, std::vector other); +RcppExport SEXP _individual_filter_bitset_integer(SEXP bSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< std::vector >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_integer(b, other)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_bitset +Rcpp::XPtr filter_bitset_bitset(const Rcpp::XPtr b, const Rcpp::XPtr other); +RcppExport SEXP _individual_filter_bitset_bitset(SEXP bSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_bitset(b, other)); + return rcpp_result_gen; +END_RCPP +} +// filter_bitset_logical +Rcpp::XPtr filter_bitset_logical(const Rcpp::XPtr bitset, Rcpp::LogicalVector other); +RcppExport SEXP _individual_filter_bitset_logical(SEXP bitsetSEXP, SEXP otherSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type bitset(bitsetSEXP); + Rcpp::traits::input_parameter< Rcpp::LogicalVector >::type other(otherSEXP); + rcpp_result_gen = Rcpp::wrap(filter_bitset_logical(bitset, other)); + return rcpp_result_gen; +END_RCPP +} +// bitset_choose +void bitset_choose(const Rcpp::XPtr b, const size_t k); +RcppExport SEXP _individual_bitset_choose(SEXP bSEXP, SEXP kSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + Rcpp::traits::input_parameter< const size_t >::type k(kSEXP); + bitset_choose(b, k); + return R_NilValue; +END_RCPP +} +// bitset_count_and_cpp +size_t bitset_count_and_cpp(const Rcpp::XPtr a, const Rcpp::XPtr b); +RcppExport SEXP _individual_bitset_count_and_cpp(SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type a(aSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(bitset_count_and_cpp(a, b)); + return rcpp_result_gen; +END_RCPP +} +// create_categorical_variable +Rcpp::XPtr create_categorical_variable(const std::vector& categories, const std::vector& values); +RcppExport SEXP _individual_create_categorical_variable(SEXP categoriesSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type categories(categoriesSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_categorical_variable(categories, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_size +size_t categorical_variable_get_size(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_size(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_queue_update +void categorical_variable_queue_update(Rcpp::XPtr variable, const std::string& value, Rcpp::XPtr index); +RcppExport SEXP _individual_categorical_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + categorical_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_get_index_of +Rcpp::XPtr categorical_variable_get_index_of(Rcpp::XPtr variable, const std::vector& values); +RcppExport SEXP _individual_categorical_variable_get_index_of(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_index_of(variable, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_size_of +int categorical_variable_get_size_of(Rcpp::XPtr variable, const std::vector& values); +RcppExport SEXP _individual_categorical_variable_get_size_of(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_size_of(variable, values)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_categories +std::vector categorical_variable_get_categories(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_categories(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_categories(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_queue_update_vector +void categorical_variable_queue_update_vector(Rcpp::XPtr variable, const std::string& value, std::vector& index); +RcppExport SEXP _individual_categorical_variable_queue_update_vector(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + categorical_variable_queue_update_vector(variable, value, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_update +void categorical_variable_update(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_update(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + categorical_variable_update(variable); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_extend +void categorical_variable_queue_extend(Rcpp::XPtr variable, std::vector& values); +RcppExport SEXP _individual_categorical_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type values(valuesSEXP); + categorical_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_shrink +void categorical_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_categorical_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + categorical_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_queue_shrink_bitset +void categorical_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_categorical_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + categorical_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// categorical_variable_get_values +std::vector categorical_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_categorical_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// categorical_variable_get_values_with_index +std::vector categorical_variable_get_values_with_index(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_categorical_variable_get_values_with_index(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(categorical_variable_get_values_with_index(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// dummy +void dummy(); +static SEXP _individual_dummy_try() { +BEGIN_RCPP + dummy(); + return R_NilValue; +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _individual_dummy() { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_individual_dummy_try()); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + Rf_error(CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; +} +// create_double_variable +Rcpp::XPtr create_double_variable(const std::vector& values); +RcppExport SEXP _individual_create_double_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_double_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values +const std::vector& double_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values_at_index +std::vector double_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_values_at_index_vector +std::vector double_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_index_of_range +Rcpp::XPtr double_variable_get_index_of_range(Rcpp::XPtr variable, const double a, const double b); +RcppExport SEXP _individual_double_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const double >::type a(aSEXP); + Rcpp::traits::input_parameter< const double >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_index_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_get_size_of_range +size_t double_variable_get_size_of_range(Rcpp::XPtr variable, const double a, const double b); +RcppExport SEXP _individual_double_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const double >::type a(aSEXP); + Rcpp::traits::input_parameter< const double >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(double_variable_get_size_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// double_variable_queue_fill +void double_variable_queue_fill(Rcpp::XPtr variable, std::vector value); +RcppExport SEXP _individual_double_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + double_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// double_variable_queue_update +void double_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); +RcppExport SEXP _individual_double_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_update_bitset +void double_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_extend +void double_variable_queue_extend(Rcpp::XPtr variable, std::vector values); +RcppExport SEXP _individual_double_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); + double_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// double_variable_queue_shrink +void double_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// double_variable_queue_shrink_bitset +void double_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_event +Rcpp::XPtr create_event(); +RcppExport SEXP _individual_create_event() { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = Rcpp::wrap(create_event()); + return rcpp_result_gen; +END_RCPP +} +// create_targeted_event +Rcpp::XPtr create_targeted_event(size_t size); +RcppExport SEXP _individual_create_targeted_event(SEXP sizeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< size_t >::type size(sizeSEXP); + rcpp_result_gen = Rcpp::wrap(create_targeted_event(size)); + return rcpp_result_gen; +END_RCPP +} +// event_base_tick +void event_base_tick(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_tick(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + event_base_tick(event); + return R_NilValue; +END_RCPP +} +// event_base_get_timestep +size_t event_base_get_timestep(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_get_timestep(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_base_get_timestep(event)); + return rcpp_result_gen; +END_RCPP +} +// event_base_set_timestep +void event_base_set_timestep(const Rcpp::XPtr event, size_t time); +RcppExport SEXP _individual_event_base_set_timestep(SEXP eventSEXP, SEXP timeSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< size_t >::type time(timeSEXP); + event_base_set_timestep(event, time); + return R_NilValue; +END_RCPP +} +// event_base_should_trigger +bool event_base_should_trigger(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_base_should_trigger(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_base_should_trigger(event)); + return rcpp_result_gen; +END_RCPP +} +// event_schedule +void event_schedule(const Rcpp::XPtr event, std::vector delays); +RcppExport SEXP _individual_event_schedule(SEXP eventSEXP, SEXP delaysSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type delays(delaysSEXP); + event_schedule(event, delays); + return R_NilValue; +END_RCPP +} +// event_clear_schedule +void event_clear_schedule(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_clear_schedule(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + event_clear_schedule(event); + return R_NilValue; +END_RCPP +} +// event_checkpoint +std::vector event_checkpoint(const Rcpp::XPtr event); +RcppExport SEXP _individual_event_checkpoint(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(event_checkpoint(event)); + return rcpp_result_gen; +END_RCPP +} +// event_restore +void event_restore(const Rcpp::XPtr event, std::vector schedule); +RcppExport SEXP _individual_event_restore(SEXP eventSEXP, SEXP scheduleSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type schedule(scheduleSEXP); + event_restore(event, schedule); + return R_NilValue; +END_RCPP +} +// targeted_event_clear_schedule_vector +void targeted_event_clear_schedule_vector(const Rcpp::XPtr event, std::vector target); +RcppExport SEXP _individual_targeted_event_clear_schedule_vector(SEXP eventSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + targeted_event_clear_schedule_vector(event, target); + return R_NilValue; +END_RCPP +} +// targeted_event_clear_schedule +void targeted_event_clear_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target); +RcppExport SEXP _individual_targeted_event_clear_schedule(SEXP eventSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + targeted_event_clear_schedule(event, target); + return R_NilValue; +END_RCPP +} +// targeted_event_get_scheduled +Rcpp::XPtr targeted_event_get_scheduled(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_get_scheduled(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_get_scheduled(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_schedule +void targeted_event_schedule(const Rcpp::XPtr event, const Rcpp::XPtr target, double delay); +RcppExport SEXP _individual_targeted_event_schedule(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + Rcpp::traits::input_parameter< double >::type delay(delaySEXP); + targeted_event_schedule(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_shrink_bitset +void targeted_event_queue_shrink_bitset(const Rcpp::XPtr event, const Rcpp::XPtr index); +RcppExport SEXP _individual_targeted_event_queue_shrink_bitset(SEXP eventSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type index(indexSEXP); + targeted_event_queue_shrink_bitset(event, index); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_shrink +void targeted_event_queue_shrink(const Rcpp::XPtr event, std::vector& index); +RcppExport SEXP _individual_targeted_event_queue_shrink(SEXP eventSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + targeted_event_queue_shrink(event, index); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_extend +void targeted_event_queue_extend(const Rcpp::XPtr event, size_t n); +RcppExport SEXP _individual_targeted_event_queue_extend(SEXP eventSEXP, SEXP nSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< size_t >::type n(nSEXP); + targeted_event_queue_extend(event, n); + return R_NilValue; +END_RCPP +} +// targeted_event_queue_extend_with_schedule +void targeted_event_queue_extend_with_schedule(const Rcpp::XPtr event, const std::vector& delays); +RcppExport SEXP _individual_targeted_event_queue_extend_with_schedule(SEXP eventSEXP, SEXP delaysSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const std::vector& >::type delays(delaysSEXP); + targeted_event_queue_extend_with_schedule(event, delays); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_vector +void targeted_event_schedule_vector(const Rcpp::XPtr event, std::vector target, double delay); +RcppExport SEXP _individual_targeted_event_schedule_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + Rcpp::traits::input_parameter< double >::type delay(delaySEXP); + targeted_event_schedule_vector(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_multi_delay +void targeted_event_schedule_multi_delay(const Rcpp::XPtr event, const Rcpp::XPtr target, const std::vector delay); +RcppExport SEXP _individual_targeted_event_schedule_multi_delay(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); + targeted_event_schedule_multi_delay(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_schedule_multi_delay_vector +void targeted_event_schedule_multi_delay_vector(const Rcpp::XPtr event, std::vector target, const std::vector delay); +RcppExport SEXP _individual_targeted_event_schedule_multi_delay_vector(SEXP eventSEXP, SEXP targetSEXP, SEXP delaySEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< std::vector >::type target(targetSEXP); + Rcpp::traits::input_parameter< const std::vector >::type delay(delaySEXP); + targeted_event_schedule_multi_delay_vector(event, target, delay); + return R_NilValue; +END_RCPP +} +// targeted_event_get_target +Rcpp::XPtr targeted_event_get_target(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_get_target(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_get_target(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_resize +void targeted_event_resize(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_resize(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + targeted_event_resize(event); + return R_NilValue; +END_RCPP +} +// targeted_event_checkpoint +Rcpp::List targeted_event_checkpoint(const Rcpp::XPtr event); +RcppExport SEXP _individual_targeted_event_checkpoint(SEXP eventSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + rcpp_result_gen = Rcpp::wrap(targeted_event_checkpoint(event)); + return rcpp_result_gen; +END_RCPP +} +// targeted_event_restore +void targeted_event_restore(const Rcpp::XPtr event, Rcpp::List state); +RcppExport SEXP _individual_targeted_event_restore(SEXP eventSEXP, SEXP stateSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type state(stateSEXP); + targeted_event_restore(event, state); + return R_NilValue; +END_RCPP +} +// process_listener +void process_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener); +RcppExport SEXP _individual_process_listener(SEXP eventSEXP, SEXP listenerSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); + process_listener(event, listener); + return R_NilValue; +END_RCPP +} +// process_targeted_listener +void process_targeted_listener(const Rcpp::XPtr event, const Rcpp::XPtr listener, const Rcpp::XPtr target); +RcppExport SEXP _individual_process_targeted_listener(SEXP eventSEXP, SEXP listenerSEXP, SEXP targetSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type event(eventSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type listener(listenerSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type target(targetSEXP); + process_targeted_listener(event, listener, target); + return R_NilValue; +END_RCPP +} +// create_integer_variable +Rcpp::XPtr create_integer_variable(const std::vector& values); +RcppExport SEXP _individual_create_integer_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_integer_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values +const std::vector& integer_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_modulo_differences +individual_index_t integer_variable_get_modulo_differences(Rcpp::XPtr variable, const int value, const int difference); +RcppExport SEXP _individual_integer_variable_get_modulo_differences(SEXP variableSEXP, SEXP valueSEXP, SEXP differenceSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type value(valueSEXP); + Rcpp::traits::input_parameter< const int >::type difference(differenceSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_modulo_differences(variable, value, difference)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values_at_index +std::vector integer_variable_get_values_at_index(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_get_values_at_index(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_values_at_index_vector +std::vector integer_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_set_vector +Rcpp::XPtr integer_variable_get_index_of_set_vector(Rcpp::XPtr variable, std::vector values_set); +RcppExport SEXP _individual_integer_variable_get_index_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_vector(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_set_scalar +Rcpp::XPtr integer_variable_get_index_of_set_scalar(Rcpp::XPtr variable, const int values_set); +RcppExport SEXP _individual_integer_variable_get_index_of_set_scalar(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_set_scalar(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_index_of_range +Rcpp::XPtr integer_variable_get_index_of_range(Rcpp::XPtr variable, const int a, const int b); +RcppExport SEXP _individual_integer_variable_get_index_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type a(aSEXP); + Rcpp::traits::input_parameter< const int >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_index_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_set_vector +size_t integer_variable_get_size_of_set_vector(Rcpp::XPtr variable, const std::vector values_set); +RcppExport SEXP _individual_integer_variable_get_size_of_set_vector(SEXP variableSEXP, SEXP values_setSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector >::type values_set(values_setSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_vector(variable, values_set)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_set_scalar +size_t integer_variable_get_size_of_set_scalar(Rcpp::XPtr variable, const int value); +RcppExport SEXP _individual_integer_variable_get_size_of_set_scalar(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type value(valueSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_set_scalar(variable, value)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_get_size_of_range +size_t integer_variable_get_size_of_range(Rcpp::XPtr variable, const int a, const int b); +RcppExport SEXP _individual_integer_variable_get_size_of_range(SEXP variableSEXP, SEXP aSEXP, SEXP bSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const int >::type a(aSEXP); + Rcpp::traits::input_parameter< const int >::type b(bSEXP); + rcpp_result_gen = Rcpp::wrap(integer_variable_get_size_of_range(variable, a, b)); + return rcpp_result_gen; +END_RCPP +} +// integer_variable_queue_fill +void integer_variable_queue_fill(Rcpp::XPtr variable, std::vector value); +RcppExport SEXP _individual_integer_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + integer_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_update +void integer_variable_queue_update(Rcpp::XPtr variable, std::vector value, std::vector index); +RcppExport SEXP _individual_integer_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_update_bitset +void integer_variable_queue_update_bitset(Rcpp::XPtr variable, std::vector value, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_extend +void integer_variable_queue_extend(Rcpp::XPtr variable, std::vector values); +RcppExport SEXP _individual_integer_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type values(valuesSEXP); + integer_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_shrink +void integer_variable_queue_shrink(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// integer_variable_queue_shrink_bitset +void integer_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// fixed_probability_multinomial_process_internal +Rcpp::XPtr fixed_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const double rate, const std::vector destination_probabilities); +RcppExport SEXP _individual_fixed_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rateSEXP, SEXP destination_probabilitiesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); + Rcpp::traits::input_parameter< const double >::type rate(rateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); + rcpp_result_gen = Rcpp::wrap(fixed_probability_multinomial_process_internal(variable, source_state, destination_states, rate, destination_probabilities)); + return rcpp_result_gen; +END_RCPP +} +// multi_probability_multinomial_process_internal +Rcpp::XPtr multi_probability_multinomial_process_internal(Rcpp::XPtr variable, const std::string source_state, const std::vector destination_states, const Rcpp::XPtr rate_variable, const std::vector destination_probabilities); +RcppExport SEXP _individual_multi_probability_multinomial_process_internal(SEXP variableSEXP, SEXP source_stateSEXP, SEXP destination_statesSEXP, SEXP rate_variableSEXP, SEXP destination_probabilitiesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type source_state(source_stateSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_states(destination_statesSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); + Rcpp::traits::input_parameter< const std::vector >::type destination_probabilities(destination_probabilitiesSEXP); + rcpp_result_gen = Rcpp::wrap(multi_probability_multinomial_process_internal(variable, source_state, destination_states, rate_variable, destination_probabilities)); + return rcpp_result_gen; +END_RCPP +} +// multi_probability_bernoulli_process_internal +Rcpp::XPtr multi_probability_bernoulli_process_internal(Rcpp::XPtr variable, const std::string from, const std::string to, const Rcpp::XPtr rate_variable); +RcppExport SEXP _individual_multi_probability_bernoulli_process_internal(SEXP variableSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP rate_variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::string >::type from(fromSEXP); + Rcpp::traits::input_parameter< const std::string >::type to(toSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type rate_variable(rate_variableSEXP); + rcpp_result_gen = Rcpp::wrap(multi_probability_bernoulli_process_internal(variable, from, to, rate_variable)); + return rcpp_result_gen; +END_RCPP +} +// infection_age_process_internal +Rcpp::XPtr infection_age_process_internal(Rcpp::XPtr state, const std::string susceptible, const std::string exposed, const std::string infectious, const Rcpp::XPtr age, const int age_bins, const double p, const double dt, const Rcpp::NumericMatrix mixing); +RcppExport SEXP _individual_infection_age_process_internal(SEXP stateSEXP, SEXP susceptibleSEXP, SEXP exposedSEXP, SEXP infectiousSEXP, SEXP ageSEXP, SEXP age_binsSEXP, SEXP pSEXP, SEXP dtSEXP, SEXP mixingSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type state(stateSEXP); + Rcpp::traits::input_parameter< const std::string >::type susceptible(susceptibleSEXP); + Rcpp::traits::input_parameter< const std::string >::type exposed(exposedSEXP); + Rcpp::traits::input_parameter< const std::string >::type infectious(infectiousSEXP); + Rcpp::traits::input_parameter< const Rcpp::XPtr >::type age(ageSEXP); + Rcpp::traits::input_parameter< const int >::type age_bins(age_binsSEXP); + Rcpp::traits::input_parameter< const double >::type p(pSEXP); + Rcpp::traits::input_parameter< const double >::type dt(dtSEXP); + Rcpp::traits::input_parameter< const Rcpp::NumericMatrix >::type mixing(mixingSEXP); + rcpp_result_gen = Rcpp::wrap(infection_age_process_internal(state, susceptible, exposed, infectious, age, age_bins, p, dt, mixing)); + return rcpp_result_gen; +END_RCPP +} +// create_double_ragged_variable +Rcpp::XPtr create_double_ragged_variable(const std::vector>& values); +RcppExport SEXP _individual_create_double_ragged_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_double_ragged_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values +std::vector> double_ragged_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_ragged_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values_at_index_bitset +std::vector> double_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_values_at_index_vector +std::vector> double_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length +std::vector double_ragged_variable_get_length(Rcpp::XPtr variable); +RcppExport SEXP _individual_double_ragged_variable_get_length(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length(variable)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length_at_index_bitset +std::vector double_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_get_length_at_index_vector +std::vector double_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(double_ragged_variable_get_length_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// double_ragged_variable_queue_fill +void double_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); +RcppExport SEXP _individual_double_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + double_ragged_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_update +void double_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); +RcppExport SEXP _individual_double_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + double_ragged_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_update_bitset +void double_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_ragged_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_extend +void double_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); +RcppExport SEXP _individual_double_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); + double_ragged_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_shrink +void double_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_double_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + double_ragged_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// double_ragged_variable_queue_shrink_bitset +void double_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_double_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + double_ragged_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_integer_ragged_variable +Rcpp::XPtr create_integer_ragged_variable(const std::vector>& values); +RcppExport SEXP _individual_create_integer_ragged_variable(SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::vector>& >::type values(valuesSEXP); + rcpp_result_gen = Rcpp::wrap(create_integer_ragged_variable(values)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values +std::vector> integer_ragged_variable_get_values(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_ragged_variable_get_values(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values_at_index_bitset +std::vector> integer_ragged_variable_get_values_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_values_at_index_vector +std::vector> integer_ragged_variable_get_values_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_get_values_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_values_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length +std::vector integer_ragged_variable_get_length(Rcpp::XPtr variable); +RcppExport SEXP _individual_integer_ragged_variable_get_length(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length(variable)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length_at_index_bitset +std::vector integer_ragged_variable_get_length_at_index_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_bitset(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_get_length_at_index_vector +std::vector integer_ragged_variable_get_length_at_index_vector(Rcpp::XPtr variable, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_get_length_at_index_vector(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + rcpp_result_gen = Rcpp::wrap(integer_ragged_variable_get_length_at_index_vector(variable, index)); + return rcpp_result_gen; +END_RCPP +} +// integer_ragged_variable_queue_fill +void integer_ragged_variable_queue_fill(Rcpp::XPtr variable, const std::vector>& value); +RcppExport SEXP _individual_integer_ragged_variable_queue_fill(SEXP variableSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + integer_ragged_variable_queue_fill(variable, value); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_update +void integer_ragged_variable_queue_update(Rcpp::XPtr variable, const std::vector>& value, std::vector index); +RcppExport SEXP _individual_integer_ragged_variable_queue_update(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector>& >::type value(valueSEXP); + Rcpp::traits::input_parameter< std::vector >::type index(indexSEXP); + integer_ragged_variable_queue_update(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_update_bitset +void integer_ragged_variable_queue_update_bitset(Rcpp::XPtr variable, const std::vector> value, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_queue_update_bitset(SEXP variableSEXP, SEXP valueSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< const std::vector> >::type value(valueSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_ragged_variable_queue_update_bitset(variable, value, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_extend +void integer_ragged_variable_queue_extend(Rcpp::XPtr variable, std::vector>& values); +RcppExport SEXP _individual_integer_ragged_variable_queue_extend(SEXP variableSEXP, SEXP valuesSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector>& >::type values(valuesSEXP); + integer_ragged_variable_queue_extend(variable, values); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_shrink +void integer_ragged_variable_queue_shrink(Rcpp::XPtr variable, std::vector& index); +RcppExport SEXP _individual_integer_ragged_variable_queue_shrink(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< std::vector& >::type index(indexSEXP); + integer_ragged_variable_queue_shrink(variable, index); + return R_NilValue; +END_RCPP +} +// integer_ragged_variable_queue_shrink_bitset +void integer_ragged_variable_queue_shrink_bitset(Rcpp::XPtr variable, Rcpp::XPtr index); +RcppExport SEXP _individual_integer_ragged_variable_queue_shrink_bitset(SEXP variableSEXP, SEXP indexSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type index(indexSEXP); + integer_ragged_variable_queue_shrink_bitset(variable, index); + return R_NilValue; +END_RCPP +} +// create_render_vector +Rcpp::XPtr create_render_vector(std::vector data); +RcppExport SEXP _individual_create_render_vector(SEXP dataSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< std::vector >::type data(dataSEXP); + rcpp_result_gen = Rcpp::wrap(create_render_vector(data)); + return rcpp_result_gen; +END_RCPP +} +// render_vector_update +void render_vector_update(Rcpp::XPtr v, size_t index, double value); +RcppExport SEXP _individual_render_vector_update(SEXP vSEXP, SEXP indexSEXP, SEXP valueSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); + Rcpp::traits::input_parameter< size_t >::type index(indexSEXP); + Rcpp::traits::input_parameter< double >::type value(valueSEXP); + render_vector_update(v, index, value); + return R_NilValue; +END_RCPP +} +// render_vector_data +std::vector render_vector_data(Rcpp::XPtr v); +RcppExport SEXP _individual_render_vector_data(SEXP vSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type v(vSEXP); + rcpp_result_gen = Rcpp::wrap(render_vector_data(v)); + return rcpp_result_gen; +END_RCPP +} +// execute_process +void execute_process(Rcpp::XPtr process, size_t timestep); +RcppExport SEXP _individual_execute_process(SEXP processSEXP, SEXP timestepSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type process(processSEXP); + Rcpp::traits::input_parameter< size_t >::type timestep(timestepSEXP); + execute_process(process, timestep); + return R_NilValue; +END_RCPP +} +// variable_get_size +size_t variable_get_size(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_get_size(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + rcpp_result_gen = Rcpp::wrap(variable_get_size(variable)); + return rcpp_result_gen; +END_RCPP +} +// variable_update +void variable_update(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_update(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + variable_update(variable); + return R_NilValue; +END_RCPP +} +// variable_resize +void variable_resize(Rcpp::XPtr variable); +RcppExport SEXP _individual_variable_resize(SEXP variableSEXP) { +BEGIN_RCPP + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type variable(variableSEXP); + variable_resize(variable); + return R_NilValue; +END_RCPP +} + +// validate (ensure exported C++ functions exist before calling them) +static int _individual_RcppExport_validate(const char* sig) { + static std::set signatures; + if (signatures.empty()) { + signatures.insert("void(*dummy)()"); + } + return signatures.find(sig) != signatures.end(); +} + +// registerCCallable (register entry points for exported C++ functions) +RcppExport SEXP _individual_RcppExport_registerCCallable() { + R_RegisterCCallable("individual", "_individual_dummy", (DL_FUNC)_individual_dummy_try); + R_RegisterCCallable("individual", "_individual_RcppExport_validate", (DL_FUNC)_individual_RcppExport_validate); + return R_NilValue; +} + +RcppExport SEXP run_testthat_tests(SEXP); + +static const R_CallMethodDef CallEntries[] = { + {"_individual_create_bitset", (DL_FUNC) &_individual_create_bitset, 1}, + {"_individual_bitset_copy", (DL_FUNC) &_individual_bitset_copy, 1}, + {"_individual_bitset_insert", (DL_FUNC) &_individual_bitset_insert, 2}, + {"_individual_bitset_remove", (DL_FUNC) &_individual_bitset_remove, 2}, + {"_individual_bitset_clear", (DL_FUNC) &_individual_bitset_clear, 1}, + {"_individual_bitset_size", (DL_FUNC) &_individual_bitset_size, 1}, + {"_individual_bitset_max_size", (DL_FUNC) &_individual_bitset_max_size, 1}, + {"_individual_bitset_and", (DL_FUNC) &_individual_bitset_and, 2}, + {"_individual_bitset_not", (DL_FUNC) &_individual_bitset_not, 2}, + {"_individual_bitset_or", (DL_FUNC) &_individual_bitset_or, 2}, + {"_individual_bitset_copy_from", (DL_FUNC) &_individual_bitset_copy_from, 2}, + {"_individual_bitset_xor", (DL_FUNC) &_individual_bitset_xor, 2}, + {"_individual_bitset_set_difference", (DL_FUNC) &_individual_bitset_set_difference, 2}, + {"_individual_bitset_sample", (DL_FUNC) &_individual_bitset_sample, 2}, + {"_individual_bitset_sample_vector", (DL_FUNC) &_individual_bitset_sample_vector, 2}, + {"_individual_bitset_to_vector", (DL_FUNC) &_individual_bitset_to_vector, 1}, + {"_individual_filter_bitset_integer", (DL_FUNC) &_individual_filter_bitset_integer, 2}, + {"_individual_filter_bitset_bitset", (DL_FUNC) &_individual_filter_bitset_bitset, 2}, + {"_individual_filter_bitset_logical", (DL_FUNC) &_individual_filter_bitset_logical, 2}, + {"_individual_bitset_choose", (DL_FUNC) &_individual_bitset_choose, 2}, + {"_individual_bitset_count_and_cpp", (DL_FUNC) &_individual_bitset_count_and_cpp, 2}, + {"_individual_create_categorical_variable", (DL_FUNC) &_individual_create_categorical_variable, 2}, + {"_individual_categorical_variable_get_size", (DL_FUNC) &_individual_categorical_variable_get_size, 1}, + {"_individual_categorical_variable_queue_update", (DL_FUNC) &_individual_categorical_variable_queue_update, 3}, + {"_individual_categorical_variable_get_index_of", (DL_FUNC) &_individual_categorical_variable_get_index_of, 2}, + {"_individual_categorical_variable_get_size_of", (DL_FUNC) &_individual_categorical_variable_get_size_of, 2}, + {"_individual_categorical_variable_get_categories", (DL_FUNC) &_individual_categorical_variable_get_categories, 1}, + {"_individual_categorical_variable_queue_update_vector", (DL_FUNC) &_individual_categorical_variable_queue_update_vector, 3}, + {"_individual_categorical_variable_update", (DL_FUNC) &_individual_categorical_variable_update, 1}, + {"_individual_categorical_variable_queue_extend", (DL_FUNC) &_individual_categorical_variable_queue_extend, 2}, + {"_individual_categorical_variable_queue_shrink", (DL_FUNC) &_individual_categorical_variable_queue_shrink, 2}, + {"_individual_categorical_variable_queue_shrink_bitset", (DL_FUNC) &_individual_categorical_variable_queue_shrink_bitset, 2}, + {"_individual_categorical_variable_get_values", (DL_FUNC) &_individual_categorical_variable_get_values, 1}, + {"_individual_categorical_variable_get_values_with_index", (DL_FUNC) &_individual_categorical_variable_get_values_with_index, 2}, + {"_individual_dummy", (DL_FUNC) &_individual_dummy, 0}, + {"_individual_create_double_variable", (DL_FUNC) &_individual_create_double_variable, 1}, + {"_individual_double_variable_get_values", (DL_FUNC) &_individual_double_variable_get_values, 1}, + {"_individual_double_variable_get_values_at_index", (DL_FUNC) &_individual_double_variable_get_values_at_index, 2}, + {"_individual_double_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_variable_get_values_at_index_vector, 2}, + {"_individual_double_variable_get_index_of_range", (DL_FUNC) &_individual_double_variable_get_index_of_range, 3}, + {"_individual_double_variable_get_size_of_range", (DL_FUNC) &_individual_double_variable_get_size_of_range, 3}, + {"_individual_double_variable_queue_fill", (DL_FUNC) &_individual_double_variable_queue_fill, 2}, + {"_individual_double_variable_queue_update", (DL_FUNC) &_individual_double_variable_queue_update, 3}, + {"_individual_double_variable_queue_update_bitset", (DL_FUNC) &_individual_double_variable_queue_update_bitset, 3}, + {"_individual_double_variable_queue_extend", (DL_FUNC) &_individual_double_variable_queue_extend, 2}, + {"_individual_double_variable_queue_shrink", (DL_FUNC) &_individual_double_variable_queue_shrink, 2}, + {"_individual_double_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_variable_queue_shrink_bitset, 2}, + {"_individual_create_event", (DL_FUNC) &_individual_create_event, 0}, + {"_individual_create_targeted_event", (DL_FUNC) &_individual_create_targeted_event, 1}, + {"_individual_event_base_tick", (DL_FUNC) &_individual_event_base_tick, 1}, + {"_individual_event_base_get_timestep", (DL_FUNC) &_individual_event_base_get_timestep, 1}, + {"_individual_event_base_set_timestep", (DL_FUNC) &_individual_event_base_set_timestep, 2}, + {"_individual_event_base_should_trigger", (DL_FUNC) &_individual_event_base_should_trigger, 1}, + {"_individual_event_schedule", (DL_FUNC) &_individual_event_schedule, 2}, + {"_individual_event_clear_schedule", (DL_FUNC) &_individual_event_clear_schedule, 1}, + {"_individual_event_checkpoint", (DL_FUNC) &_individual_event_checkpoint, 1}, + {"_individual_event_restore", (DL_FUNC) &_individual_event_restore, 2}, + {"_individual_targeted_event_clear_schedule_vector", (DL_FUNC) &_individual_targeted_event_clear_schedule_vector, 2}, + {"_individual_targeted_event_clear_schedule", (DL_FUNC) &_individual_targeted_event_clear_schedule, 2}, + {"_individual_targeted_event_get_scheduled", (DL_FUNC) &_individual_targeted_event_get_scheduled, 1}, + {"_individual_targeted_event_schedule", (DL_FUNC) &_individual_targeted_event_schedule, 3}, + {"_individual_targeted_event_queue_shrink_bitset", (DL_FUNC) &_individual_targeted_event_queue_shrink_bitset, 2}, + {"_individual_targeted_event_queue_shrink", (DL_FUNC) &_individual_targeted_event_queue_shrink, 2}, + {"_individual_targeted_event_queue_extend", (DL_FUNC) &_individual_targeted_event_queue_extend, 2}, + {"_individual_targeted_event_queue_extend_with_schedule", (DL_FUNC) &_individual_targeted_event_queue_extend_with_schedule, 2}, + {"_individual_targeted_event_schedule_vector", (DL_FUNC) &_individual_targeted_event_schedule_vector, 3}, + {"_individual_targeted_event_schedule_multi_delay", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay, 3}, + {"_individual_targeted_event_schedule_multi_delay_vector", (DL_FUNC) &_individual_targeted_event_schedule_multi_delay_vector, 3}, + {"_individual_targeted_event_get_target", (DL_FUNC) &_individual_targeted_event_get_target, 1}, + {"_individual_targeted_event_resize", (DL_FUNC) &_individual_targeted_event_resize, 1}, + {"_individual_targeted_event_checkpoint", (DL_FUNC) &_individual_targeted_event_checkpoint, 1}, + {"_individual_targeted_event_restore", (DL_FUNC) &_individual_targeted_event_restore, 2}, + {"_individual_process_listener", (DL_FUNC) &_individual_process_listener, 2}, + {"_individual_process_targeted_listener", (DL_FUNC) &_individual_process_targeted_listener, 3}, + {"_individual_create_integer_variable", (DL_FUNC) &_individual_create_integer_variable, 1}, + {"_individual_integer_variable_get_values", (DL_FUNC) &_individual_integer_variable_get_values, 1}, + {"_individual_integer_variable_get_modulo_differences", (DL_FUNC) &_individual_integer_variable_get_modulo_differences, 3}, + {"_individual_integer_variable_get_values_at_index", (DL_FUNC) &_individual_integer_variable_get_values_at_index, 2}, + {"_individual_integer_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_variable_get_values_at_index_vector, 2}, + {"_individual_integer_variable_get_index_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_index_of_set_vector, 2}, + {"_individual_integer_variable_get_index_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_index_of_set_scalar, 2}, + {"_individual_integer_variable_get_index_of_range", (DL_FUNC) &_individual_integer_variable_get_index_of_range, 3}, + {"_individual_integer_variable_get_size_of_set_vector", (DL_FUNC) &_individual_integer_variable_get_size_of_set_vector, 2}, + {"_individual_integer_variable_get_size_of_set_scalar", (DL_FUNC) &_individual_integer_variable_get_size_of_set_scalar, 2}, + {"_individual_integer_variable_get_size_of_range", (DL_FUNC) &_individual_integer_variable_get_size_of_range, 3}, + {"_individual_integer_variable_queue_fill", (DL_FUNC) &_individual_integer_variable_queue_fill, 2}, + {"_individual_integer_variable_queue_update", (DL_FUNC) &_individual_integer_variable_queue_update, 3}, + {"_individual_integer_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_variable_queue_update_bitset, 3}, + {"_individual_integer_variable_queue_extend", (DL_FUNC) &_individual_integer_variable_queue_extend, 2}, + {"_individual_integer_variable_queue_shrink", (DL_FUNC) &_individual_integer_variable_queue_shrink, 2}, + {"_individual_integer_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_variable_queue_shrink_bitset, 2}, + {"_individual_fixed_probability_multinomial_process_internal", (DL_FUNC) &_individual_fixed_probability_multinomial_process_internal, 5}, + {"_individual_multi_probability_multinomial_process_internal", (DL_FUNC) &_individual_multi_probability_multinomial_process_internal, 5}, + {"_individual_multi_probability_bernoulli_process_internal", (DL_FUNC) &_individual_multi_probability_bernoulli_process_internal, 4}, + {"_individual_infection_age_process_internal", (DL_FUNC) &_individual_infection_age_process_internal, 9}, + {"_individual_create_double_ragged_variable", (DL_FUNC) &_individual_create_double_ragged_variable, 1}, + {"_individual_double_ragged_variable_get_values", (DL_FUNC) &_individual_double_ragged_variable_get_values, 1}, + {"_individual_double_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_bitset, 2}, + {"_individual_double_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_values_at_index_vector, 2}, + {"_individual_double_ragged_variable_get_length", (DL_FUNC) &_individual_double_ragged_variable_get_length, 1}, + {"_individual_double_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_bitset, 2}, + {"_individual_double_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_double_ragged_variable_get_length_at_index_vector, 2}, + {"_individual_double_ragged_variable_queue_fill", (DL_FUNC) &_individual_double_ragged_variable_queue_fill, 2}, + {"_individual_double_ragged_variable_queue_update", (DL_FUNC) &_individual_double_ragged_variable_queue_update, 3}, + {"_individual_double_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_update_bitset, 3}, + {"_individual_double_ragged_variable_queue_extend", (DL_FUNC) &_individual_double_ragged_variable_queue_extend, 2}, + {"_individual_double_ragged_variable_queue_shrink", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink, 2}, + {"_individual_double_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_double_ragged_variable_queue_shrink_bitset, 2}, + {"_individual_create_integer_ragged_variable", (DL_FUNC) &_individual_create_integer_ragged_variable, 1}, + {"_individual_integer_ragged_variable_get_values", (DL_FUNC) &_individual_integer_ragged_variable_get_values, 1}, + {"_individual_integer_ragged_variable_get_values_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_bitset, 2}, + {"_individual_integer_ragged_variable_get_values_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_values_at_index_vector, 2}, + {"_individual_integer_ragged_variable_get_length", (DL_FUNC) &_individual_integer_ragged_variable_get_length, 1}, + {"_individual_integer_ragged_variable_get_length_at_index_bitset", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_bitset, 2}, + {"_individual_integer_ragged_variable_get_length_at_index_vector", (DL_FUNC) &_individual_integer_ragged_variable_get_length_at_index_vector, 2}, + {"_individual_integer_ragged_variable_queue_fill", (DL_FUNC) &_individual_integer_ragged_variable_queue_fill, 2}, + {"_individual_integer_ragged_variable_queue_update", (DL_FUNC) &_individual_integer_ragged_variable_queue_update, 3}, + {"_individual_integer_ragged_variable_queue_update_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_update_bitset, 3}, + {"_individual_integer_ragged_variable_queue_extend", (DL_FUNC) &_individual_integer_ragged_variable_queue_extend, 2}, + {"_individual_integer_ragged_variable_queue_shrink", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink, 2}, + {"_individual_integer_ragged_variable_queue_shrink_bitset", (DL_FUNC) &_individual_integer_ragged_variable_queue_shrink_bitset, 2}, + {"_individual_create_render_vector", (DL_FUNC) &_individual_create_render_vector, 1}, + {"_individual_render_vector_update", (DL_FUNC) &_individual_render_vector_update, 3}, + {"_individual_render_vector_data", (DL_FUNC) &_individual_render_vector_data, 1}, + {"_individual_execute_process", (DL_FUNC) &_individual_execute_process, 2}, + {"_individual_variable_get_size", (DL_FUNC) &_individual_variable_get_size, 1}, + {"_individual_variable_update", (DL_FUNC) &_individual_variable_update, 1}, + {"_individual_variable_resize", (DL_FUNC) &_individual_variable_resize, 1}, + {"_individual_RcppExport_registerCCallable", (DL_FUNC) &_individual_RcppExport_registerCCallable, 0}, + {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 1}, + {NULL, NULL, 0} +}; + +RcppExport void R_init_individual(DllInfo *dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); +} diff --git a/src/bitset.cpp b/src/bitset.cpp index aec4f9b..a539c7d 100644 --- a/src/bitset.cpp +++ b/src/bitset.cpp @@ -203,3 +203,11 @@ void bitset_choose( ) { bitset_choose_internal(*b, k); } + +//[[Rcpp::export]] +size_t bitset_count_and_cpp( + const Rcpp::XPtr a, + const Rcpp::XPtr b +) { + return a->count_and(*b); +} diff --git a/tests/testthat/test-bitset.R b/tests/testthat/test-bitset.R index 888bdce..b5f6a08 100644 --- a/tests/testthat/test-bitset.R +++ b/tests/testthat/test-bitset.R @@ -438,3 +438,41 @@ test_that("bitset is not equal to other types", { a$insert(c(1,4,5)) expect_equal(all.equal(a, c(1,4,5)), "'current' is not a Bitset") }) + +test_that("bitset_count_and can return the the count of overlapping betsets", { + a <- Bitset$new(10)$insert(c(1,4,5)) + b <- Bitset$new(10)$insert(c(4,6,9)) + c <- Bitset$new(10)$insert(c(4,5,9)) + d <- Bitset$new(10)$insert(c(1,4,5,9)) + expect_equal(bitset_count_and(a, b), 1) + expect_equal(bitset_count_and(a, c), 2) + expect_equal(bitset_count_and(a, d), 3) +}) + +test_that("bitset_count_and returns 0 for non-overlapping betsets", { + a <- Bitset$new(10)$insert(c(1,4,5)) + b <- Bitset$new(10)$insert(c(2,6,9)) + expect_equal(bitset_count_and(a, b), 0) +}) + +test_that("bitset_count_and doesn't mutate", { + a <- Bitset$new(10)$insert(c(1,4,5)) + b <- Bitset$new(10)$insert(c(4,6,9)) + c <- a$copy() + d <- b$copy() + bitset_count_and(a, b) + expect_equal(a, c) + expect_equal(b, d) +}) + +test_that("bitset_count_and doesn't work for differing sizes", { + a <- Bitset$new(10)$insert(c(1,4,5)) + b <- Bitset$new(15)$insert(c(4,6,9)) + c <- a$copy() + d <- b$copy() + expect_error( + bitset_count_and(a, b), + 'Incompatible bitmap sizes' + ) +}) + From 4289227848a6792c89896fa573409ee351553498 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Tue, 12 Aug 2025 10:25:15 +0100 Subject: [PATCH 10/13] Fix Rcpp bug --- R/RcppExports.R | 2 +- src/RcppExports.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index 354ab8f..f0788dc 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -511,5 +511,5 @@ variable_resize <- function(variable) { # Register entry points for exported C++ functions methods::setLoadAction(function(ns) { - .Call('_individual_RcppExport_registerCCallable', PACKAGE = 'individual') + .Call(`_individual_RcppExport_registerCCallable`) }) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 4c34b84..63a7f8c 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -424,7 +424,7 @@ RcppExport SEXP _individual_dummy() { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error(CHAR(rcpp_msgSEXP_gen)); + Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; From 1cd669a629e7397e3b1c6e5417eecf8e3513d746 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Tue, 12 Aug 2025 10:27:17 +0100 Subject: [PATCH 11/13] Update documentation and namespace --- NAMESPACE | 1 + man/bitset_count_and.Rd | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 man/bitset_count_and.Rd diff --git a/NAMESPACE b/NAMESPACE index 687b7c4..8017a4d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -11,6 +11,7 @@ export(RaggedInteger) export(Render) export(TargetedEvent) export(bernoulli_process) +export(bitset_count_and) export(categorical_count_renderer_process) export(filter_bitset) export(fixed_probability_multinomial_process) diff --git a/man/bitset_count_and.Rd b/man/bitset_count_and.Rd new file mode 100644 index 0000000..58165b6 --- /dev/null +++ b/man/bitset_count_and.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bitset.R +\name{bitset_count_and} +\alias{bitset_count_and} +\title{Count bitset and} +\usage{ +bitset_count_and(a, b) +} +\arguments{ +\item{a}{a \code{\link{Bitset}}} + +\item{b}{another \code{\link{Bitset}}} +} +\description{ +This non-modifying function returns the number of intersecting +elements between two bitsets \code{a} and \code{b}. This should be faster than +writing \code{a$copy()$and(b)$size()} as it avoids the memory allocations of $copy(). +} From 088730e2740e4ab8dfd4e33c6d1eaacfe39b4e18 Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Tue, 12 Aug 2025 10:31:42 +0100 Subject: [PATCH 12/13] Update pkgdown --- _pkgdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index 1283d2a..b889b3a 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -12,6 +12,7 @@ reference: - RaggedDouble - Bitset - filter_bitset + - bitset_count_and - title: "Events & Rendering" desc: "Classes for events and rendering output." - contents: From 79acafd344aa08819890b3243c30bfdbd2fef7df Mon Sep 17 00:00:00 2001 From: Giovanni Charles Date: Tue, 12 Aug 2025 10:42:13 +0100 Subject: [PATCH 13/13] Bump version and update news for 0.1.18 --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 05ef975..c21f32d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: individual Title: Framework for Specifying and Simulating Individual Based Models -Version: 0.1.17 +Version: 0.1.18 Authors@R: c( person( given = "Giovanni", diff --git a/NEWS.md b/NEWS.md index 8763718..04baa27 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# individual 0.1.18 + + * add $get_values to CategoricalVariable + * add $get_modulo_differences to IntegerVariable + * add bitset_count_and for quick intersection counts + # individual 0.1.17 * Add a `copy_from` method to the `Bitset` class.