Liking cljdoc? Tell your friends :D

sicmutils.util.aggregate

Utilities for aggregating sequences.

Utilities for aggregating sequences.
raw docstring

generic-sumclj/s

(generic-sum xs)
(generic-sum f low high)

Sums either:

  • a series xs of numbers, or
  • the result of mapping function f to (range low high)

Using the generic sicmutils.generic/+ function.

Sums either:

- a series `xs` of numbers, or
- the result of mapping function `f` to `(range low high)`

Using the generic [[sicmutils.generic/+]] function.
sourceraw docstring

halt-atclj/s

(halt-at pred)

Returns a transducer that ends transduction when pred (applied to the aggregation in progress) returns true for an aggregation step.

NOTE: This transducer should come first in a chain of transducers; it only inspects the aggregate, never the value, so putting it first will prevent unnecessary transformations of values if the aggregate signals completion.

Returns a transducer that ends transduction when `pred` (applied to the
aggregation in progress) returns true for an aggregation step.

NOTE: This transducer should come first in a chain of transducers; it only
inspects the aggregate, never the value, so putting it first will prevent
unnecessary transformations of values if the aggregate signals completion.
sourceraw docstring

kahan-sumclj/s

(kahan-sum)
(kahan-sum [sum c] x)

Implements a fold that tracks the summation of a sequence of floating point numbers, using Kahan's trick for maintaining stability in the face of accumulating floating point errors.

Implements a fold that tracks the summation of a sequence of floating point
numbers, using Kahan's trick for maintaining stability in the face of
accumulating floating point errors.
sourceraw docstring

scanning-sumclj/s

(scanning-sum xs)
(scanning-sum f low high)

Returns every intermediate summation from summing either:

  • a series xs of numbers, or
  • the result of mapping function f to (range low high)

Using Kahan's summation trick behind the scenes to keep floating point errors under control.

Returns every intermediate summation from summing either:

- a series `xs` of numbers, or
- the result of mapping function `f` to `(range low high)`

Using Kahan's summation trick behind the scenes to keep floating point errors
under control.
sourceraw docstring

sumclj/s

(sum xs)
(sum f low high)

Sums either:

  • a series xs of numbers, or
  • the result of mapping function f to (range low high)

Using Kahan's summation trick behind the scenes to keep floating point errors under control.

Sums either:

- a series `xs` of numbers, or
- the result of mapping function `f` to `(range low high)`

Using Kahan's summation trick behind the scenes to keep floating point errors
under control.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close