Skip to content

Commit 48b7367

Browse files
committed
minor change
1 parent 7394680 commit 48b7367

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: phylopomp
22
Type: Package
33
Title: Phylodynamic Inference for POMP Models
4-
Version: 0.14.6.2
5-
Date: 2024-10-27
4+
Version: 0.14.6.3
5+
Date: 2024-10-28
66
Authors@R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="[email protected]",comment=c(ORCID="0000-0001-6159-3207")),
77
person(given=c("Qianying"),family="Lin",role=c("aut"),comment=c(ORCID="0000-0001-8620-9910"))
88
)

src/seirs_pomp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "pomplink.h"
22
#include "internal.h"
33

4+
static const int nrate = 7;
5+
46
static inline int random_choice (double n) {
57
return floor(R_unif_index(n));
68
}
@@ -245,7 +247,7 @@ void seirs_gill
245247

246248
// continuous portion of filter equation:
247249
// take Gillespie steps to the end of the interval
248-
double rate[7], logpi[7];
250+
double rate[nrate], logpi[nrate];
249251
int event;
250252
double event_rate = 0;
251253
double penalty = 0;
@@ -254,7 +256,7 @@ void seirs_gill
254256
tstep = exp_rand()/event_rate;
255257

256258
while (t + tstep < tmax) {
257-
event = rcateg(event_rate,rate,7);
259+
event = rcateg(event_rate,rate,nrate);
258260
ll -= penalty*tstep + logpi[event];
259261
switch (event) {
260262
case 0: // transmission, s=(0,0)

0 commit comments

Comments
 (0)