Skip to content

Commit

Permalink
Adding ModelSIRD
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmeyer37 committed Jul 25, 2023
1 parent a8d11ed commit 7b7ab20
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/epimodels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,33 @@ SEXP ModelSIR_cpp(

#undef WrapSIR

#define WrapSIRD(a) \
cpp11::external_pointer<epiworld::epimodels::ModelSIRD<>> (a)

[[cpp11::register]]
SEXP ModelSIR_cpp(
std::string name,
double prevalence,
double transmission_rate,
double recovery_rate,
double death_rate
) {

// Creating a pointer to a ModelSIR model
WrapSIRD(ptr)(
new epiworld::epimodels::ModelSIRD<>(
name,
prevalence,
transmission_rate,
recovery_rate,
death_rate
)
);

return ptr;
}

#undef WrapSIRD

#define WrapSEIRCONN(a) \
cpp11::external_pointer<epiworld::epimodels::ModelSEIRCONN<>> (a)
Expand Down

0 comments on commit 7b7ab20

Please sign in to comment.