Skip to content

Commit

Permalink
Don't offset sparse parts by -1L
Browse files Browse the repository at this point in the history
Copy behaviour from this commit 3c08d53
  • Loading branch information
sambrilleman committed Oct 31, 2023
1 parent 67478d4 commit 4320268
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions R/stan_surv.R
Original file line number Diff line number Diff line change
Expand Up @@ -882,17 +882,17 @@ stan_surv <- function(formula,
w_icens = if (has_quadrature || !has_bars || nicens == 0) double(0) else parts_icens$w,
w_delay = if (has_quadrature || !has_bars || ndelay == 0) double(0) else parts_delay$w,

v_event = if (has_quadrature || !has_bars || nevent == 0) integer(0) else parts_event$v - 1L,
v_lcens = if (has_quadrature || !has_bars || nlcens == 0) integer(0) else parts_lcens$v - 1L,
v_rcens = if (has_quadrature || !has_bars || nrcens == 0) integer(0) else parts_rcens$v - 1L,
v_icens = if (has_quadrature || !has_bars || nicens == 0) integer(0) else parts_icens$v - 1L,
v_delay = if (has_quadrature || !has_bars || ndelay == 0) integer(0) else parts_delay$v - 1L,

u_event = if (has_quadrature || !has_bars || nevent == 0) integer(0) else parts_event$u - 1L,
u_lcens = if (has_quadrature || !has_bars || nlcens == 0) integer(0) else parts_lcens$u - 1L,
u_rcens = if (has_quadrature || !has_bars || nrcens == 0) integer(0) else parts_rcens$u - 1L,
u_icens = if (has_quadrature || !has_bars || nicens == 0) integer(0) else parts_icens$u - 1L,
u_delay = if (has_quadrature || !has_bars || ndelay == 0) integer(0) else parts_delay$u - 1L,
v_event = if (has_quadrature || !has_bars || nevent == 0) integer(0) else parts_event$v,
v_lcens = if (has_quadrature || !has_bars || nlcens == 0) integer(0) else parts_lcens$v,
v_rcens = if (has_quadrature || !has_bars || nrcens == 0) integer(0) else parts_rcens$v,
v_icens = if (has_quadrature || !has_bars || nicens == 0) integer(0) else parts_icens$v,
v_delay = if (has_quadrature || !has_bars || ndelay == 0) integer(0) else parts_delay$v,

u_event = if (has_quadrature || !has_bars || nevent == 0) integer(0) else parts_event$u,
u_lcens = if (has_quadrature || !has_bars || nlcens == 0) integer(0) else parts_lcens$u,
u_rcens = if (has_quadrature || !has_bars || nrcens == 0) integer(0) else parts_rcens$u,
u_icens = if (has_quadrature || !has_bars || nicens == 0) integer(0) else parts_icens$u,
u_delay = if (has_quadrature || !has_bars || ndelay == 0) integer(0) else parts_delay$u,

nnz_event = if (has_quadrature || !has_bars || nevent == 0) 0L else length(parts_event$w),
nnz_lcens = if (has_quadrature || !has_bars || nlcens == 0) 0L else length(parts_lcens$w),
Expand Down Expand Up @@ -959,19 +959,19 @@ stan_surv <- function(formula,
w_qpts_icens = if (!has_quadrature || !has_bars || qicens == 0) double(0) else parts_qpts_icens$w,
w_qpts_delay = if (!has_quadrature || !has_bars || qdelay == 0) double(0) else parts_qpts_delay$w,

v_epts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_epts_event$v - 1L,
v_qpts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_qpts_event$v - 1L,
v_qpts_lcens = if (!has_quadrature || !has_bars || qlcens == 0) integer(0) else parts_qpts_lcens$v - 1L,
v_qpts_rcens = if (!has_quadrature || !has_bars || qrcens == 0) integer(0) else parts_qpts_rcens$v - 1L,
v_qpts_icens = if (!has_quadrature || !has_bars || qicens == 0) integer(0) else parts_qpts_icens$v - 1L,
v_qpts_delay = if (!has_quadrature || !has_bars || qdelay == 0) integer(0) else parts_qpts_delay$v - 1L,

u_epts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_epts_event$u - 1L,
u_qpts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_qpts_event$u - 1L,
u_qpts_lcens = if (!has_quadrature || !has_bars || qlcens == 0) integer(0) else parts_qpts_lcens$u - 1L,
u_qpts_rcens = if (!has_quadrature || !has_bars || qrcens == 0) integer(0) else parts_qpts_rcens$u - 1L,
u_qpts_icens = if (!has_quadrature || !has_bars || qicens == 0) integer(0) else parts_qpts_icens$u - 1L,
u_qpts_delay = if (!has_quadrature || !has_bars || qdelay == 0) integer(0) else parts_qpts_delay$u - 1L,
v_epts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_epts_event$v,
v_qpts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_qpts_event$v,
v_qpts_lcens = if (!has_quadrature || !has_bars || qlcens == 0) integer(0) else parts_qpts_lcens$v,
v_qpts_rcens = if (!has_quadrature || !has_bars || qrcens == 0) integer(0) else parts_qpts_rcens$v,
v_qpts_icens = if (!has_quadrature || !has_bars || qicens == 0) integer(0) else parts_qpts_icens$v,
v_qpts_delay = if (!has_quadrature || !has_bars || qdelay == 0) integer(0) else parts_qpts_delay$v,

u_epts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_epts_event$u,
u_qpts_event = if (!has_quadrature || !has_bars || qevent == 0) integer(0) else parts_qpts_event$u,
u_qpts_lcens = if (!has_quadrature || !has_bars || qlcens == 0) integer(0) else parts_qpts_lcens$u,
u_qpts_rcens = if (!has_quadrature || !has_bars || qrcens == 0) integer(0) else parts_qpts_rcens$u,
u_qpts_icens = if (!has_quadrature || !has_bars || qicens == 0) integer(0) else parts_qpts_icens$u,
u_qpts_delay = if (!has_quadrature || !has_bars || qdelay == 0) integer(0) else parts_qpts_delay$u,

nnz_epts_event = if (!has_quadrature || !has_bars || qevent == 0) 0L else length(parts_epts_event$w),
nnz_qpts_event = if (!has_quadrature || !has_bars || qevent == 0) 0L else length(parts_qpts_event$w),
Expand Down

0 comments on commit 4320268

Please sign in to comment.