math.extras: adding moving sum/supremum/infimum.
parent
088dfa4861
commit
60e3fc9341
|
@ -96,6 +96,15 @@ PRIVATE>
|
||||||
: moving-median ( u n -- v )
|
: moving-median ( u n -- v )
|
||||||
<clumps> [ median ] map ;
|
<clumps> [ median ] map ;
|
||||||
|
|
||||||
|
: moving-supremum ( u n -- v )
|
||||||
|
<clumps> [ supremum ] map ;
|
||||||
|
|
||||||
|
: moving-infimum ( u n -- v )
|
||||||
|
<clumps> [ infimum ] map ;
|
||||||
|
|
||||||
|
: moving-sum ( u n -- v )
|
||||||
|
<clumps> [ sum ] map ;
|
||||||
|
|
||||||
: nonzero ( seq -- seq' )
|
: nonzero ( seq -- seq' )
|
||||||
[ zero? not ] filter ;
|
[ zero? not ] filter ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue