Functions
sum'Source
- Sums a list of numbers of arbitrary type.
- Sparks the summation of
(list-length / chunk-size)
chunks from the list, each of the specified size (thought the last chunk may be smaller),
then recursively sums the list of results from each spark.
- CAVEAT: unless the numbers are large,
Rational
(requiring cross-multiplication), or the list long,
sum
is too light-weight for sparking to be productive,
therefore it is more likely to be the parallelised deep evaluation of list-elements which saves time.
sumRSource
- Sums a list of rational numbers.
- Sparks the summation of
(list-length / chunk-length)
chunks from the list, each of the specified size (thought the last chunk may be smaller),
then recursively sums the list of results from each spark.
- CAVEAT: memory-use is proportional to chunk-size.