From c2a02712b1ce8b1f92c974a8d8f8ca5964f97a70 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 22 Dec 2025 23:33:44 +0000 Subject: [PATCH 1/2] include LGLSXP --- src/frollapply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frollapply.c b/src/frollapply.c index b423c7a49..e4ccf2864 100644 --- a/src/frollapply.c +++ b/src/frollapply.c @@ -2,7 +2,7 @@ static inline void memcpy_sexp(SEXP dest, size_t offset, SEXP src, int count) { switch (TYPEOF(dest)) { - case INTSXP: { + case LGLSXP: case INTSXP: { memcpy(INTEGER(dest), INTEGER_RO(src) + offset, count * sizeof(int)); } break; case REALSXP: { From b3104e4e1ebb96f8cdee6c253708e03e8b918dfb Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 22 Dec 2025 23:42:18 +0000 Subject: [PATCH 2/2] some tests --- inst/tests/froll.Rraw | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inst/tests/froll.Rraw b/inst/tests/froll.Rraw index 04398aaee..489afcdad 100644 --- a/inst/tests/froll.Rraw +++ b/inst/tests/froll.Rraw @@ -1254,14 +1254,17 @@ test(6001.181, frollapply(FUN=mean, 1:3, 0), c(NaN,NaN,NaN)) test(6001.182, frollapply(FUN=mean, 1:3, 0, fill=99), c(NaN,NaN,NaN)) test(6001.183, frollapply(FUN=mean, c(1:2,NA), 0), c(NaN,NaN,NaN)) test(6001.184, frollapply(FUN=mean, c(1:2,NA), 0, na.rm=TRUE), c(NaN,NaN,NaN)) +test(6001.185, frollapply(FUN=mean, c(FALSE, TRUE, TRUE), 0), c(NaN,NaN,NaN)) test(6001.1910, frollapply(FUN=mean, adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NaN,2.5)) test(6001.1911, frollapply(FUN=mean, adaptive=TRUE, list(1:3,2:4), c(2,0,2)), list(c(NA, NaN, 2.5), c(NA, NaN, 3.5))) test(6001.1912, frollapply(FUN=mean, adaptive=TRUE, 1:3, list(c(2,0,2), c(0,2,0))), list(c(NA,NaN,2.5), c(NaN,1.5,NaN))) test(6001.1913, frollapply(FUN=mean, adaptive=TRUE, list(1:3,2:4), list(c(2,0,2), c(0,2,0))), list(c(NA,NaN,2.5), c(NaN,1.5,NaN), c(NA,NaN,3.5), c(NaN,2.5,NaN))) +test(6001.1915, frollapply(FUN=mean, adaptive=TRUE, c(FALSE, TRUE, TRUE), c(2,0,2)), c(NA,NaN,1)) test(6001.192, frollapply(FUN=mean, adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NaN,2.5)) test(6001.193, frollapply(FUN=mean, adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA,NaN,NA)) test(6001.194, frollapply(FUN=mean, adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA,NaN,2)) test(6001.195, frollapply(FUN=mean, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2), na.rm=TRUE, partial=TRUE), c(1,NaN,2)) +test(6001.196, frollapply(FUN=mean, adaptive=TRUE, c(FALSE, TRUE, TRUE), c(2,0,2), fill=99), c(99,NaN,1)) test(6001.211, frollsum(1:3, 0), c(0,0,0), options=c("datatable.verbose"=TRUE), output="window width of size 0") test(6001.212, frollsum(1:3, 0, fill=99), c(0,0,0)) @@ -1284,14 +1287,20 @@ test(6001.281, frollapply(FUN=sum, as.numeric(1:3), 0), c(0,0,0)) test(6001.282, frollapply(FUN=sum, as.numeric(1:3), 0, fill=99), c(0,0,0)) test(6001.283, frollapply(FUN=sum, c(1:2,NA_real_), 0), c(0,0,0)) test(6001.284, frollapply(FUN=sum, c(1:2,NA_real_), 0, na.rm=TRUE), c(0,0,0)) +test(6001.285, frollapply(FUN=sum, c(FALSE, TRUE, TRUE), 0), c(0L,0L,0L)) +test(6001.286, frollapply(FUN=sum, 1:3, 0), c(0L,0L,0L)) test(6001.2910, frollapply(FUN=sum, adaptive=TRUE, as.numeric(1:3), c(2,0,2)), c(NA,0,5)) test(6001.2911, frollapply(FUN=sum, adaptive=TRUE, list(as.numeric(1:3), as.numeric(2:4)), c(2,0,2)), list(c(NA,0,5), c(NA,0,7))) test(6001.2912, frollapply(FUN=sum, adaptive=TRUE, as.numeric(1:3), list(c(2,0,2), c(0,2,0))), list(c(NA,0,5), c(0,3,0))) test(6001.2913, frollapply(FUN=sum, adaptive=TRUE, list(as.numeric(1:3), as.numeric(2:4)), list(c(2,0,2), c(0,2,0))), list(c(NA,0,5), c(0,3,0), c(NA,0,7), c(0,5,0))) +test(6001.2914, frollapply(FUN=sum, adaptive=TRUE, c(FALSE, TRUE, TRUE), c(2,0,2)), c(NA,0L,2L)) +test(6001.2915, frollapply(FUN=sum, adaptive=TRUE, 1:3, c(2,0,2)), c(NA,0L,5L)) test(6001.292, frollapply(FUN=sum, adaptive=TRUE, as.numeric(1:3), c(2,0,2), fill=99), c(99,0,5)) test(6001.293, frollapply(FUN=sum, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2)), c(NA,0,NA)) test(6001.294, frollapply(FUN=sum, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2), na.rm=TRUE), c(NA,0,2)) test(6001.295, frollapply(FUN=sum, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2), na.rm=TRUE, partial=TRUE), c(1,0,2)) +test(6001.296, frollapply(FUN=sum, adaptive=TRUE, c(FALSE, TRUE, TRUE), c(2,0,2), fill=1L), c(1L,0L,2L)) +test(6001.297, frollapply(FUN=sum, adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99L,0L,5L)) test(6001.311, frollmax(1:3, 0), c(-Inf,-Inf,-Inf), options=c("datatable.verbose"=TRUE), output="window width of size 0") test(6001.312, frollmax(1:3, 0, fill=99), c(-Inf,-Inf,-Inf))