@@ -94,7 +94,6 @@ test(6000.019, frollmean(x, TRUE), error="n must be integer")
9494test(6000.020, frollmean(x, list(1:10)), error="n must be integer, list is accepted for adaptive TRUE")
9595test(6000.021, frollmean(x, list(NA), adaptive=TRUE), error="n must be an integer vector or list of an integer vectors")
9696test(6000.022, frollmean(x, list(c(1:5,1:5), NA), adaptive=TRUE), error="n must be an integer vector or list of an integer vectors")
97- test(6000.0221, frollmean(1:2, list(c(0L, 0L)), adaptive=TRUE), error="n must be positive integer values")
9897
9998#### various length list vectors
10099l = list(1:6/2, 3:10/4)
@@ -369,9 +368,8 @@ test(6000.084, frollmean(list(1:3, numeric()), 2), list(c(NA_real_, 1.5, 2.5), n
369368#### length(n)==0
370369test(6000.085, frollmean(1:3, integer()), error="n must be non 0 length")
371370test(6000.086, frollmean(list(1:3, 2:4), integer()), error="n must be non 0 length")
372- #### n==0
373- test(6000.087, frollmean(1:3, c(2,0)), error="n must be positive integer values")
374- test(6000.088, frollmean(list(1:3, 2:4), 0), error="n must be positive integer values")
371+ #### n==0 (k==0, k[i]==0)
372+ ##moved to 6001.
375373#### n<0
376374test(6000.089, frollmean(1:3, -2), error="n must be positive integer values")
377375#### n[[1L]]>0 && n[[2L]]<0
@@ -1006,6 +1004,91 @@ test(6000.502, frollmax(c(5,NaN,1), 1L), c(5,NaN,1))
10061004test(6000.503, frollmax(c(5,1,1,NaN,1,1,1), 2L), c(NA,5,1,NaN,NaN,1,1))
10071005test(6000.504, frollmax(c(5,1,NA,NaN,1,1,1), 2L), c(NA,5,NA,NA,NaN,1,1))
10081006
1007+ # n==0, k==0, k[i]==0
1008+ test(6001.111, frollmean(1:3, 0), c(NaN,NaN,NaN), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1009+ test(6001.112, frollmean(1:3, 0, fill=99), c(NaN,NaN,NaN))
1010+ test(6001.113, frollmean(c(1:2,NA), 0), c(NaN,NaN,NaN))
1011+ test(6001.114, frollmean(c(1:2,NA), 0, na.rm=TRUE), c(NaN,NaN,NaN))
1012+ test(6001.115, frollmean(1:3, 0, algo="exact"), c(NaN,NaN,NaN), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1013+ test(6001.116, frollmean(c(1:2,NA), 0, algo="exact"), c(NaN,NaN,NaN))
1014+ test(6001.117, frollmean(c(1:2,NA), 0, algo="exact", na.rm=TRUE), c(NaN,NaN,NaN))
1015+ test(6001.121, frollmean(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NaN,2.5))
1016+ test(6001.122, frollmean(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NaN,2.5))
1017+ test(6001.123, frollmean(adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA,NaN,NA))
1018+ test(6001.124, frollmean(adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA,NaN,2))
1019+ test(6001.125, frollmean(adaptive=TRUE, 1:3, c(2,0,2), algo="exact"), c(NA,NaN,2.5))
1020+ test(6001.126, frollmean(adaptive=TRUE, 1:3, c(2,0,2), fill=99, algo="exact"), c(99,NaN,2.5))
1021+ test(6001.127, frollmean(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact"), c(NA,NaN,NA))
1022+ test(6001.128, frollmean(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact", na.rm=TRUE), c(NA,NaN,2))
1023+ test(6001.129, frollmean(adaptive=TRUE, c(1:2,NA), c(2,0,2), fill=99, algo="exact", na.rm=TRUE), c(99,NaN,2))
1024+ test(6001.181, frollapply(FUN=mean, 1:3, 0), c(NaN,NaN,NaN))
1025+ test(6001.182, frollapply(FUN=mean, 1:3, 0, fill=99), c(NaN,NaN,NaN))
1026+ test(6001.183, frollapply(FUN=mean, c(1:2,NA), 0), c(NaN,NaN,NaN))
1027+ test(6001.184, frollapply(FUN=mean, c(1:2,NA), 0, na.rm=TRUE), c(NaN,NaN,NaN))
1028+ test(6001.1910, frollapply(FUN=mean, adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NaN,2.5))
1029+ 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)))
1030+ 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)))
1031+ 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)))
1032+ test(6001.192, frollapply(FUN=mean, adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NaN,2.5))
1033+ test(6001.193, frollapply(FUN=mean, adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA,NaN,NA))
1034+ test(6001.194, frollapply(FUN=mean, adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA,NaN,2))
1035+
1036+ test(6001.211, frollsum(1:3, 0), c(0,0,0), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1037+ test(6001.212, frollsum(1:3, 0, fill=99), c(0,0,0))
1038+ test(6001.213, frollsum(c(1:2,NA), 0), c(0,0,0))
1039+ test(6001.214, frollsum(c(1:2,NA), 0, na.rm=TRUE), c(0,0,0))
1040+ test(6001.215, frollsum(1:3, 0, algo="exact"), c(0,0,0), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1041+ test(6001.216, frollsum(c(1:2,NA), 0, algo="exact"), c(0,0,0))
1042+ test(6001.217, frollsum(c(1:2,NA), 0, algo="exact", na.rm=TRUE), c(0,0,0))
1043+ test(6001.221, frollsum(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,0,5))
1044+ test(6001.222, frollsum(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,0,5))
1045+ test(6001.223, frollsum(adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA,0,NA))
1046+ test(6001.224, frollsum(adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA,0,2))
1047+ test(6001.225, frollsum(adaptive=TRUE, 1:3, c(2,0,2), algo="exact"), c(NA,0,5))
1048+ test(6001.226, frollsum(adaptive=TRUE, 1:3, c(2,0,2), fill=99, algo="exact"), c(99,0,5))
1049+ test(6001.227, frollsum(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact"), c(NA,0,NA))
1050+ test(6001.228, frollsum(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact", na.rm=TRUE), c(NA,0,2))
1051+ test(6001.229, frollsum(adaptive=TRUE, c(1:2,NA), c(2,0,2), fill=99, algo="exact", na.rm=TRUE), c(99,0,2))
1052+ test(6001.281, frollapply(FUN=sum, as.numeric(1:3), 0), c(0,0,0))
1053+ test(6001.282, frollapply(FUN=sum, as.numeric(1:3), 0, fill=99), c(0,0,0))
1054+ test(6001.283, frollapply(FUN=sum, c(1:2,NA_real_), 0), c(0,0,0))
1055+ test(6001.284, frollapply(FUN=sum, c(1:2,NA_real_), 0, na.rm=TRUE), c(0,0,0))
1056+ test(6001.2910, frollapply(FUN=sum, adaptive=TRUE, as.numeric(1:3), c(2,0,2)), c(NA,0,5))
1057+ 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)))
1058+ 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)))
1059+ 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)))
1060+ test(6001.292, frollapply(FUN=sum, adaptive=TRUE, as.numeric(1:3), c(2,0,2), fill=99), c(99,0,5))
1061+ test(6001.293, frollapply(FUN=sum, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2)), c(NA,0,NA))
1062+ test(6001.294, frollapply(FUN=sum, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2), na.rm=TRUE), c(NA,0,2))
1063+
1064+ test(6001.311, frollmax(1:3, 0), c(-Inf,-Inf,-Inf), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1065+ test(6001.312, frollmax(1:3, 0, fill=99), c(-Inf,-Inf,-Inf))
1066+ test(6001.313, frollmax(c(1:2,NA), 0), c(-Inf,-Inf,-Inf))
1067+ test(6001.314, frollmax(c(1:2,NA), 0, na.rm=TRUE), c(-Inf,-Inf,-Inf))
1068+ test(6001.315, frollmax(1:3, 0, algo="exact"), c(-Inf,-Inf,-Inf), options=c("datatable.verbose"=TRUE), output="window width of size 0")
1069+ test(6001.316, frollmax(c(1:2,NA), 0, algo="exact"), c(-Inf,-Inf,-Inf))
1070+ test(6001.317, frollmax(c(1:2,NA), 0, algo="exact", na.rm=TRUE), c(-Inf,-Inf,-Inf))
1071+ test(6001.321, frollmax(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,-Inf,3))
1072+ test(6001.322, frollmax(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,-Inf,3))
1073+ test(6001.323, frollmax(adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA,-Inf,NA))
1074+ test(6001.324, frollmax(adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA,-Inf,2))
1075+ test(6001.325, frollmax(adaptive=TRUE, 1:3, c(2,0,2), algo="exact"), c(NA,-Inf,3))
1076+ test(6001.326, frollmax(adaptive=TRUE, 1:3, c(2,0,2), fill=99, algo="exact"), c(99,-Inf,3))
1077+ test(6001.327, frollmax(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact"), c(NA,-Inf,NA))
1078+ test(6001.328, frollmax(adaptive=TRUE, c(1:2,NA), c(2,0,2), algo="exact", na.rm=TRUE), c(NA,-Inf,2))
1079+ test(6001.329, frollmax(adaptive=TRUE, c(1:2,NA), c(2,0,2), fill=99, algo="exact", na.rm=TRUE), c(99,-Inf,2))
1080+ test(6001.381, frollapply(FUN=max, 1:3, 0), c(-Inf,-Inf,-Inf))
1081+ test(6001.382, frollapply(FUN=max, 1:3, 0, fill=99), c(-Inf,-Inf,-Inf))
1082+ test(6001.383, frollapply(FUN=max, c(1:2,NA_real_), 0), c(-Inf,-Inf,-Inf))
1083+ test(6001.384, frollapply(FUN=max, c(1:2,NA_real_), 0, na.rm=TRUE), c(-Inf,-Inf,-Inf))
1084+ test(6001.3910, frollapply(FUN = max, adaptive = TRUE, as.numeric(1:3), c(2,0,2)), c(NA, -Inf, 3))
1085+ test(6001.3911, frollapply(FUN=max, adaptive=TRUE, list(as.numeric(1:3), as.numeric(2:4)), c(2,0,2)), list(c(NA,-Inf,3), c(NA,-Inf,4)))
1086+ test(6001.3912, frollapply(FUN=max, adaptive=TRUE, as.numeric(1:3), list(c(2,0,2), c(0,2,0))), list(c(NA,-Inf,3), c(-Inf,2,-Inf)))
1087+ test(6001.3913, frollapply(FUN=max, adaptive=TRUE, list(as.numeric(1:3), as.numeric(2:4)), list(c(2,0,2), c(0,2,0))), list(c(NA,-Inf,3), c(-Inf,2,-Inf), c(NA,-Inf,4), c(-Inf,3,-Inf)))
1088+ test(6001.392, frollapply(FUN=max, adaptive=TRUE, as.numeric(1:3), c(2,0,2), fill=99), c(99,-Inf,3))
1089+ test(6001.393, frollapply(FUN=max, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2)), c(NA,-Inf,NA))
1090+ test(6001.394, frollapply(FUN=max, adaptive=TRUE, c(1:2,NA_real_), c(2,0,2), na.rm=TRUE), c(NA,-Inf,2))
1091+
10091092## partial
10101093x = 1:6/2
10111094n = 3
0 commit comments