Handbook
Glossary
partial-sums ( seq -- seq' )
Vocabulary
math
.
extras
.
private
Inputs
seq
an
object
Outputs
seq'
an
object
Definition
USING:
kernel
math
sequences
;
IN:
math.extras.private
::
partial-sums
( seq -- seq' )
V{
}
clone
:>
partials seq
[
0 partials
[
swapd
sort-partial
partial+
swapd
[
over
partials
set-nth
1
+
]
unless-zero
]
each
:>
i i partials
shorten
[
i partials
set-nth
]
unless-zero
]
each
partials
;