From 682737a4d9eaee896a51b25d48a6d4b30061897e Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Dec 2024 11:55:38 +0000 Subject: [PATCH] Revert "177: use `num_elements` instead of `size` (#178)" This reverts commit 2cfa80242e406533f41eba9c1f33472e2af3ff82. --- NEWS.md | 1 - inst/stan/functions/primarycensored.stan | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 63e5ba5..03dfe1c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,7 +11,6 @@ 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. # primarycensored 1.0.0 diff --git a/inst/stan/functions/primarycensored.stan b/inst/stan/functions/primarycensored.stan index 5534b7a..c424dde 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[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)}; + 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)}; vector[1] y0 = rep_vector(0.0, 1); result = ode_rk45(primarycensored_ode, y0, lower_bound, {d}, theta, {d, pwindow}, ids)[1, 1];