diff --git a/NEWS.md b/NEWS.md index 46a0b5c..b51023f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ Development release. ## Bug fixes - Added a missing `@family` tag to the `pcens` functions. This omission resulted in the Weibull analytical solution not being visible in the package documentation. +- Changed a call to `size()` to use `num_elements()` instead as an underlying type conversion was causing issues on some platforms. - Changed `D` to be of type real in order to support infinite `relative_obs_time`. # primarycensored 1.0.0 diff --git a/inst/stan/functions/primarycensored.stan b/inst/stan/functions/primarycensored.stan index c424dde..5534b7a 100644 --- a/inst/stan/functions/primarycensored.stan +++ b/inst/stan/functions/primarycensored.stan @@ -37,8 +37,8 @@ real primarycensored_cdf(data real d, int dist_id, array[] real params, } else { // Use numerical integration for other cases real lower_bound = max({d - pwindow, 1e-6}); - array[size(params) + size(primary_params)] real theta = append_array(params, primary_params); - array[4] int ids = {dist_id, primary_id, size(params), size(primary_params)}; + array[num_elements(params) + num_elements(primary_params)] real theta = append_array(params, primary_params); + array[4] int ids = {dist_id, primary_id, num_elements(params), num_elements(primary_params)}; vector[1] y0 = rep_vector(0.0, 1); result = ode_rk45(primarycensored_ode, y0, lower_bound, {d}, theta, {d, pwindow}, ids)[1, 1];