Implements utilities shared by all integrators, for example:
integrator
interfaceImplements utilities shared by all integrators, for example: - code to wrap a sequence of progressively better estimates in a common `integrator` interface - data structures implementing various integration intervals.
(closed? x)
Returns true if the argument represents an explicit closed
interval, false
otherwise.
Returns true if the argument represents an explicit `closed` interval, false otherwise.
(defintegrator sym & body)
Helper macro for defining integrators.
Helper macro for defining integrators.
(interval opts)
Extracts the interval (or open
as a default) from the supplied integration
options dict.
Extracts the interval (or `open` as a default) from the supplied integration options dict.
(make-integrator-fn area-fn seq-fn)
Generates an integrator
function from two functions with the following
signatures and descriptions:
(area-fn f a b)
estimates the integral of f
over the interval (a, b)
with no subdivision, nothing clever at all.
(seq-fn f a b opts)
returns a sequence of successively refined estimates
of the integral of f
over (a, b)
. opts
can contain kv pairs that
configure the behavior of the sequence function (a sequence of the number of
integration slices to use, for example.)
The returned function has the signature:
(f a b opts)
All opts
are passed on to seq-fn
, /and/ to us/seq-limit
internally,
where the options configure the checks on sequence convergence.
Generates an `integrator` function from two functions with the following signatures and descriptions: - `(area-fn f a b)` estimates the integral of `f` over the interval `(a, b)` with no subdivision, nothing clever at all. - `(seq-fn f a b opts)` returns a sequence of successively refined estimates of the integral of `f` over `(a, b)`. `opts` can contain kv pairs that configure the behavior of the sequence function (a sequence of the number of integration slices to use, for example.) The returned function has the signature: `(f a b opts)` All `opts` are passed on to `seq-fn`, /and/ to `us/seq-limit` internally, where the options configure the checks on sequence convergence.
(update-interval opts f)
Accepts:
and returns a dict of options with f
applied to the contained interval (or
open
if no interval is set).
Accepts: - a dictionary of arbitrary options - one of the 4 interval modification functions and returns a dict of options with `f` applied to the contained interval (or `open` if no interval is set).
(with-interval opts interval)
Sets the specified interval to a key inside the suppled opts
map of arbitrary
integration options.
Sets the specified interval to a key inside the suppled `opts` map of arbitrary integration options.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close