@@ -308,36 +308,36 @@ test(6000.0671, frollmean(c(1:2,NA,4:10), 4), c(rep(NA_real_, 6), 5.5, 6.5, 7.5,
308308 "frollfunR: 1:",
309309 "frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
310310 "frollmeanFast: non-finite values are present in input, skip non-finite unaware attempt and run with extra care for NFs straighaway",
311- "frollfun: processing fun 0 algo 0 took.*",
311+ "frollfun: processing fun MEAN algo fast took.*",
312312 "frollfunR: processing.*took.*"
313- ))
313+ )) #7021
314314test(6000.0672, frollmean(c(1:2,NA,4:10), 4, has.nf=FALSE), c(rep(NA_real_, 6), 5.5, 6.5, 7.5, 8.5), output=c(
315315 "frollfunR: allocating memory for results 1x1",
316316 "frollfunR: .*sequentially.*single rolling computation.*",
317317 "frollfunR: 1:",
318318 "frollmeanFast: running for input length 10, window 4, hasnf -1, narm 0",
319319 "frollmeanFast: non-finite values are present in input, skip non-finite unaware attempt and run with extra care for NFs straighaway",
320- "frollfun: processing fun 0 algo 0 took.*",
320+ "frollfun: processing fun MEAN algo fast took.*",
321321 "frollfunR: processing.*took.*"
322- ), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning")
322+ ), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") #7021
323323test(6000.0673, frollmean(c(1:2,NA,4:10), 2, has.nf=FALSE), c(NA, 1.5, NA, NA, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), output=c(
324324 "frollfunR: allocating memory for results 1x1",
325325 "frollfunR: .*sequentially.*single rolling computation.*",
326326 "frollfunR: 1:",
327327 "frollmeanFast: running for input length 10, window 2, hasnf -1, narm 0",
328328 "frollmeanFast: non-finite values are present in input, re-running with extra care for NFs",
329- "frollfun: processing fun 0 algo 0 took.*",
329+ "frollfun: processing fun MEAN algo fast took.*",
330330 "frollfunR: processing.*took.*"
331- ), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning")
331+ ), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") #7021
332332test(6000.0674, frollmean(c(1:2,NA,4:10), 4, align="center"), c(rep(NA_real_, 4), 5.5, 6.5, 7.5, 8.5, NA, NA), output=c(
333333 "frollfunR: allocating memory for results 1x1",
334334 "frollfunR: .*sequentially.*single rolling computation.*",
335335 "frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
336336 "frollmeanFast: non-finite values are present in input, skip non-finite unaware attempt and run with extra care for NFs straighaway",
337337 "frollfun: align 0, shift answer by -2",
338- "frollfun: processing fun 0 algo 0 took.*",
338+ "frollfun: processing fun MEAN algo fast took.*",
339339 "frollfunR: processing.*took.*"
340- ))
340+ )) #7021
341341options(datatable.verbose=FALSE)
342342
343343#### fill constant
@@ -436,17 +436,17 @@ test(6000.1196, frollmean(c(1:5,NA), 1:6, algo="exact", na.rm=TRUE, adaptive=TRU
436436 "frollfunR: 1:",
437437 "frolladaptivemeanExact: running in parallel for input length 6, hasnf 0, narm 1",
438438 "frolladaptivemeanExact: non-finite values are present in input, re-running with extra care for NFs",
439- "frolladaptivefun: processing fun 0 algo 1 took.*",
439+ "frolladaptivefun: processing fun MEAN algo exact took.*",
440440 "frollfunR: processing.*took.*"
441- ))
441+ )) #7021
442442#### exact na.rm=TRUE verbose=TRUE
443443test(6000.1197, frollmean(c(1:5,NA), 2, algo="exact", na.rm=TRUE), output=c(
444444 "frollfunR: allocating memory for results 1x1",
445445 "frollfunR: .*algo='exact' is already parallelised.*",
446446 "frollfunR: 1:",
447447 "frollmeanExact: running in parallel for input length 6, window 2, hasnf 0, narm 1",
448448 "frollmeanExact: non-finite values are present in input, re-running with extra care for NFs",
449- "frollfun: processing fun 0 algo 1 took.*",
449+ "frollfun: processing fun MEAN algo exact took.*",
450450 "frollfunR: processing.*took.*"
451451))
452452options(datatable.verbose=FALSE)
@@ -675,82 +675,82 @@ test(6000.171, frollmean(x, n), output=c(
675675 "frollfunR: .*sequentially.*single rolling computation.*",
676676 "frollfunR: 1:",
677677 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
678- "frollfun: processing fun 0 algo 0 took.*",
679- "frollfunR: processing.*took.*"))
678+ "frollfun: processing fun MEAN algo fast took.*",
679+ "frollfunR: processing.*took.*")) #7021
680680test(6000.172, frollmean(list(x, x+1), n), output=c(
681681 "frollfunR: allocating memory for results 2x1",
682682 "frollfunR: .*in parallel.*",
683683 "frollfunR: 1:",
684684 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
685- "frollfun: processing fun 0 algo 0 took.*",
685+ "frollfun: processing fun MEAN algo fast took.*",
686686 "frollfunR: 2:",
687687 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
688- "frollfun: processing fun 0 algo 0 took.*",
689- "frollfunR: processing.*took.*"))
688+ "frollfun: processing fun MEAN algo fast took.*",
689+ "frollfunR: processing.*took.*")) #7021
690690test(6000.173, frollmean(x, c(n, n+1)), output=c(
691691 "frollfunR: allocating memory for results 1x2",
692692 "frollfunR: .*in parallel.*",
693693 "frollfunR: 1:",
694694 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
695- "frollfun: processing fun 0 algo 0 took.*",
695+ "frollfun: processing fun MEAN algo fast took.*",
696696 "frollfunR: 2:",
697697 "frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
698- "frollfun: processing fun 0 algo 0 took.*",
699- "frollfunR: processing.*took.*"))
698+ "frollfun: processing fun MEAN algo fast took.*",
699+ "frollfunR: processing.*took.*")) #7021
700700test(6000.174, frollmean(list(x, x+1), c(n, n+1)), output=c(
701701 "frollfunR: allocating memory for results 2x2",
702702 "frollfunR: .*in parallel.*",
703703 "frollfunR: 1:",
704704 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
705- "frollfun: processing fun 0 algo 0 took.*",
705+ "frollfun: processing fun MEAN algo fast took.*",
706706 "frollfunR: 2:",
707707 "frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
708- "frollfun: processing fun 0 algo 0 took.*",
708+ "frollfun: processing fun MEAN algo fast took.*",
709709 "frollfunR: 3:",
710710 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
711- "frollfun: processing fun 0 algo 0 took.*",
711+ "frollfun: processing fun MEAN algo fast took.*",
712712 "frollfunR: 4:",
713713 "frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
714- "frollfun: processing fun 0 algo 0 took.*",
715- "frollfunR: processing.*took.*"))
714+ "frollfun: processing fun MEAN algo fast took.*",
715+ "frollfunR: processing.*took.*")) #7021
716716test(6000.175, frollmean(x, n, algo="exact"), output=c(
717717 "frollfunR: allocating memory for results 1x1",
718718 "frollfunR: .*algo='exact' is already parallelised.*",
719719 "frollfunR: 1:",
720720 "frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
721- "frollfun: processing fun 0 algo 1 took.*",
722- "frollfunR: processing.*took.*"))
721+ "frollfun: processing fun MEAN algo exact took.*",
722+ "frollfunR: processing.*took.*")) #7021
723723test(6000.176, frollmean(x, n, align="center"), output=c(
724724 "frollfunR: allocating memory for results 1x1",
725725 "frollfunR: .*sequentially.*single rolling computation.*",
726726 "frollfunR: 1:",
727727 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
728728 "frollfun: align 0, shift answer by -1",
729- "frollfun: processing fun 0 algo 0 took.*",
730- "frollfunR: processing.*took.*"))
729+ "frollfun: processing fun MEAN algo fast took.*",
730+ "frollfunR: processing.*took.*")) #7021
731731test(6000.177, frollmean(x, n, align="left"), output=c(
732732 "frollfunR: allocating memory for results 1x1",
733733 "frollfunR: .*sequentially.*single rolling computation.*",
734734 "frollfunR: 1:",
735735 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
736736 "frollfun: align -1, shift answer by -2",
737- "frollfun: processing fun 0 algo 0 took.*",
738- "frollfunR: processing.*took.*"))
737+ "frollfun: processing fun MEAN algo fast took.*",
738+ "frollfunR: processing.*took.*")) #7021
739739nn = c(1:4,2:3,1:4)
740740test(6000.178, frollmean(x, nn, adaptive=TRUE), output=c(
741741 "frollfunR: allocating memory for results 1x1",
742742 "frollfunR: .*sequentially because adaptive.*",
743743 "frollfunR: 1:",
744744 "frolladaptivemeanFast: running for input length 10, hasnf 0, narm 0",
745- "frolladaptivefun: processing fun 0 algo 0 took.*",
746- "frollfunR: processing.*took.*"))
745+ "frolladaptivefun: processing fun MEAN algo fast took.*",
746+ "frollfunR: processing.*took.*")) #7021
747747test(6000.179, frollmean(x, nn, algo="exact", adaptive=TRUE), output=c(
748748 "frollfunR: allocating memory for results 1x1",
749749 "frollfunR: .*algo='exact' is already parallelised.*",
750750 "frollfunR: 1:",
751751 "frolladaptivemeanExact: running in parallel for input length 10, hasnf 0, narm 0",
752- "frolladaptivefun: processing fun 0 algo 1 took.*",
753- "frollfunR: processing.*took.*"))
752+ "frolladaptivefun: processing fun MEAN algo exact took.*",
753+ "frollfunR: processing.*took.*")) #7021
754754
755755x[8] = NA
756756test(6000.180, frollmean(x, n), output=c(
@@ -759,59 +759,59 @@ test(6000.180, frollmean(x, n), output=c(
759759 "frollfunR: 1:",
760760 "frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
761761 "frollmeanFast: non-finite values are present in input, re-running with extra care for NFs",
762- "frollfun: processing fun 0 algo 0 took.*",
763- "frollfunR: processing.*took.*"))
762+ "frollfun: processing fun MEAN algo fast took.*",
763+ "frollfunR: processing.*took.*")) #7021
764764test(6000.181, frollmean(x, n, algo="exact"), output=c(
765765 "frollfunR: allocating memory for results 1x1",
766766 "frollfunR: .*algo='exact' is already parallelised.*",
767767 "frollfunR: 1:",
768768 "frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
769769 "frollmeanExact: non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run",
770- "frollfun: processing fun 0 algo 1 took.*",
771- "frollfunR: processing.*took.*"))
770+ "frollfun: processing fun MEAN algo exact took.*",
771+ "frollfunR: processing.*took.*")) #7021
772772test(6000.182, frollmean(x, nn, adaptive=TRUE), output=c(
773773 "frollfunR: allocating memory for results 1x1",
774774 "frollfunR: .*sequentially because adaptive.*",
775775 "frollfunR: 1:",
776776 "frolladaptivemeanFast: running for input length 10, hasnf 0, narm 0",
777777 "frolladaptivemeanFast: non-finite values are present in input, re-running with extra care for NFs",
778- "frolladaptivefun: processing fun 0 algo 0 took.*",
779- "frollfunR: processing.*took.*"))
778+ "frolladaptivefun: processing fun MEAN algo fast took.*",
779+ "frollfunR: processing.*took.*")) #7021
780780test(6000.183, frollmean(x, nn, algo="exact", adaptive=TRUE), output=c(
781781 "frollfunR: allocating memory for results 1x1",
782782 "frollfunR: .*algo='exact' is already parallelised.*",
783783 "frollfunR: 1:",
784784 "frolladaptivemeanExact: running in parallel for input length 10, hasnf 0, narm 0",
785785 "frolladaptivemeanExact: non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run",
786- "frolladaptivefun: processing fun 0 algo 1 took.*",
787- "frollfunR: processing.*took.*"))
786+ "frolladaptivefun: processing fun MEAN algo exact took.*",
787+ "frollfunR: processing.*took.*")) #7021
788788
789789d = as.data.table(list(1:10/2, 10:1/4))
790790test(6000.184, frollmean(d[,1], 3, algo="exact"), output=c(
791791 "frollfunR: allocating memory for results 1x1",
792792 "frollfunR: .*algo='exact' is already parallelised.*",
793793 "frollfunR: 1:",
794794 "frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
795- "frollfun: processing fun 0 algo 1 took.*",
795+ "frollfun: processing fun MEAN algo exact took.*",
796796 "frollfunR: processing.*took.*"
797- ))
797+ )) #7021
798798test(6000.185, frollmean(d, 3:4, algo="exact"), output=c(
799799 "frollfunR: allocating memory for results 2x2",
800800 "frollfunR: .*sequentially.*algo='exact'.*already parallelised.*",
801801 "frollfunR: 1:",
802802 "frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
803- "frollfun: processing fun 0 algo 1 took.*",
803+ "frollfun: processing fun MEAN algo exact took.*",
804804 "frollfunR: 2:",
805805 "frollmeanExact: running in parallel for input length 10, window 4, hasnf 0, narm 0",
806- "frollfun: processing fun 0 algo 1 took.*",
806+ "frollfun: processing fun MEAN algo exact took.*",
807807 "frollfunR: 3:",
808808 "frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
809- "frollfun: processing fun 0 algo 1 took.*",
809+ "frollfun: processing fun MEAN algo exact took.*",
810810 "frollfunR: 4:",
811811 "frollmeanExact: running in parallel for input length 10, window 4, hasnf 0, narm 0",
812- "frollfun: processing fun 0 algo 1 took.*",
812+ "frollfun: processing fun MEAN algo exact took.*",
813813 "frollfunR: processing.*took.*"
814- ))
814+ )) #7021
815815options(datatable.verbose=FALSE)
816816
817817## test warnings
@@ -861,9 +861,9 @@ options(datatable.verbose=FALSE)
861861
862862## frollmax adaptive
863863options(datatable.verbose=TRUE) ## adaptive frollmax no fast algo
864- test(6000.3, frollmax(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo 0 not implemented, fall back to 1")
865- test(6000.3001, frollmax(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo 0 not implemented, fall back to 1")
866- test(6000.3002, frollmax(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo 0 not implemented, fall back to 1")
864+ test(6000.3, frollmax(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
865+ test(6000.3001, frollmax(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
866+ test(6000.3002, frollmax(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
867867options(datatable.verbose=FALSE)
868868n = c(3,2,2,4,2,1,4,8)
869869x = c(7,2,3,6,3,2,6,6) # no NA
@@ -1022,9 +1022,9 @@ test(6000.564, frollapply(FUN=mean, 1:3, list(c(0,-1,1)), adaptive=TRUE), error=
10221022
10231023## frollmin adaptive
10241024options(datatable.verbose=TRUE) ## adaptive frollmin no fast algo
1025- test(6000.6, frollmin(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo 0 not implemented, fall back to 1")
1026- test(6000.6001, frollmin(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo 0 not implemented, fall back to 1")
1027- test(6000.6002, frollmin(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo 0 not implemented, fall back to 1")
1025+ test(6000.6, frollmin(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1026+ test(6000.6001, frollmin(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1027+ test(6000.6002, frollmin(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
10281028options(datatable.verbose=FALSE)
10291029n = c(3,2,2,4,2,1,4,8)
10301030x = c(7,2,3,6,3,2,6,6) # no NA
@@ -1200,7 +1200,7 @@ test(6000.931, frollprod(1:3, 2), c(NA, 2, 6), output="frollprodFast: running fo
12001200test(6000.932, frollprod(1:3, 2, align="left"), c(2, 6, NA), output="frollfun: align")
12011201test(6000.933, frollprod(c(1,2,NA), 2), c(NA, 2, NA), output="non-finite values are present in input, re-running with extra care for NFs")
12021202test(6000.934, frollprod(c(NA,2,3), 2), c(NA, NA, 6), output="non-finite values are present in input, skip non-finite inaware attempt and run with extra care for NFs straighaway")
1203- test(6000.935, frollprod(1:3, c(2,2,2), adaptive=TRUE), c(NA, 2, 6), output="algo 0 not implemented, fall back to 1")
1203+ test(6000.935, frollprod(1:3, c(2,2,2), adaptive=TRUE), c(NA, 2, 6), output="algo fast not implemented, fall back to exact") #7021
12041204test(6000.936, frollprod(c(NA,2,3), c(2,2,2), adaptive=TRUE), c(NA, NA, 6), output="non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run")
12051205options(datatable.verbose=FALSE)
12061206# floating point overflow
@@ -1433,7 +1433,7 @@ test(6001.715, frollvar(1:3, 0, algo="exact"), c(NA_real_,NA_real_,NA_real_), op
14331433test(6001.716, frollvar(c(1:2,NA), 0, algo="exact"), c(NA_real_,NA_real_,NA_real_))
14341434test(6001.717, frollvar(c(1:2,NA), 0, algo="exact", na.rm=TRUE), c(NA_real_,NA_real_,NA_real_))
14351435test(6001.718, frollvar(c(1:2,NA), 2), c(NA,0.5,NA), options=c("datatable.verbose"=TRUE), output="redirecting to frollvarExact")
1436- test(6001.721, frollvar(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,0.5), options=c("datatable.verbose"=TRUE), output="not implemented, fall back to")
1436+ test(6001.721, frollvar(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,0.5), options=c("datatable.verbose"=TRUE), output="algo fast not implemented, fall back to exact") #7021
14371437test(6001.722, frollvar(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NA,0.5))
14381438test(6001.723, frollvar(adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA_real_,NA_real_,NA_real_))
14391439test(6001.724, frollvar(adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA_real_,NA_real_,NA_real_))
@@ -1492,7 +1492,7 @@ test(6001.8194, frollsd(c(NA,2:3), 2, has.nf=FALSE), c(NA,NA,sqrt(0.5)), warning
14921492test(6001.8195, frollsd(c(NA,2:3), 2), c(NA,NA,sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="skip non-finite inaware attempt and run with extra care")
14931493test(6001.8196, frollsd(c(NA,2:3), 2, has.nf=FALSE, algo="exact"), c(NA,NA,sqrt(0.5)), warning="used but non-finite values are present in input")
14941494test(6001.8197, frollsd(c(NA,2:3), 2, algo="exact", na.rm=TRUE), c(NA,NA,sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="re-running with extra care for NF")
1495- test(6001.8201, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivefun: algo 0 not implemented, fall back to 1")
1495+ test(6001.8201, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
14961496test(6001.8202, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivesdExact: calling sqrt(frolladaptivevarExact(...))")
14971497test(6001.821, frollsd(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,sqrt(0.5)))
14981498test(6001.822, frollsd(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NA,sqrt(0.5)))
0 commit comments