(->function s)
Accepts a Series
or PowerSeries
and coerces the input to a PowerSeries
without any application. Returns the coerced PowerSeries
instance.
Supplying a non-series will throw.
Accepts a `Series` or `PowerSeries` and coerces the input to a `PowerSeries` without any application. Returns the coerced `PowerSeries` instance. Supplying a non-series will throw.
(binomial-series alpha)
Returns a PowerSeries
instance representing a
Binomial series, ie, the
taylor series of the function $f$ given by
$$f(x) = (1 + x)^\alpha$$
Returns a `PowerSeries` instance representing a [Binomial series](https://en.wikipedia.org/wiki/Binomial_series), ie, the taylor series of the function $f$ given by $$f(x) = (1 + x)^\alpha$$
(compose s t)
Returns a new PowerSeries
$U$ that represents the composition of the two
input power series $S$ and $T$, where $U$ evaluates like:
$$U(x) = S(T(x))$$
Returns a new `PowerSeries` $U$ that represents the composition of the two input power series $S$ and $T$, where $U$ evaluates like: $$U(x) = S(T(x))$$
(constant c)
(constant c kind)
Returns a PowerSeries
representing the supplied constant term.
Optionally, pass kind
of either ::series
or ::power-series
to specify
the type of series returned.
Returns a `PowerSeries` representing the supplied constant term. Optionally, pass `kind` of either `::series` or `::power-series` to specify the type of series returned.
(fmap f s)
Returns a new series generated by applying the supplied f
to each element in
the input series s
. The returned series will be the same type as the input
series, either Series
or PowerSeries
.
NOTE scmutils calls this series:elementwise
.
Returns a new series generated by applying the supplied `f` to each element in the input series `s`. The returned series will be the same type as the input series, either `Series` or `PowerSeries`. NOTE scmutils calls this `series:elementwise`.
(generate f)
(generate f kind)
Returns a PowerSeries
generated by (f i) for i in 0, 1, ...
Optionally, pass kind
of either ::series
or ::power-series
to specify
the type of series returned.
Returns a `PowerSeries` generated by (f i) for i in 0, 1, ... Optionally, pass `kind` of either `::series` or `::power-series` to specify the type of series returned.
(inflate s n)
Accepts an input series s
and an exponent n
, and expands the series in the
n
th power of its argument. Every term i
maps to position i*n
, with zeros
padded in the new missing slots.
For example:
(inflate identity 3) ;; => (series 0 0 0 1)
(take 6 (inflate (generate inc) 3)) ;; => (1 0 2 0 3 0)
NOTE this operation makes sense as described for a PowerSeries
, where each
entry represents the coefficient of some power of x
; functionally it still
works with Series
objects.
Accepts an input series `s` and an exponent `n`, and expands the series in the `n`th power of its argument. Every term `i` maps to position `i*n`, with zeros padded in the new missing slots. For example: (inflate identity 3) ;; => (series 0 0 0 1) (take 6 (inflate (generate inc) 3)) ;; => (1 0 2 0 3 0) NOTE this operation makes sense as described for a `PowerSeries`, where each entry represents the coefficient of some power of `x`; functionally it still works with `Series` objects.
(integral s)
(integral s constant)
Returns a PowerSeries
$U$ that represents the definite integral of the input
power series $S$ with constant term $c$:
$$U = c + \int_0^{\infty} S$$
Returns a `PowerSeries` $U$ that represents the definite integral of the input power series $S$ with constant term $c$: $$U = c + \int_0^{\infty} S$$
(partial-sums s)
Returns a series (of the same type as the input) of partial sums of the terms
in the supplied series s
.
Returns a series (of the same type as the input) of partial sums of the terms in the supplied series `s`.
(power-series & prefix)
Return a PowerSeries
starting with the supplied values. The remainder of the
series will be filled with the zero-value corresponding to the first of the
given values.
If you have a sequence already, prefer power-series*
Return a `PowerSeries` starting with the supplied values. The remainder of the series will be filled with the zero-value corresponding to the first of the given values. If you have a sequence already, prefer `power-series*`
(power-series* prefix)
Given a sequence, returns a new PowerSeries
object that wraps that
sequence (potentially padding its tail with zeros if it's finite).
Given a sequence, returns a new `PowerSeries` object that wraps that sequence (potentially padding its tail with zeros if it's finite).
(power-series? s)
Returns true if s
is specifically a PowerSeries
, false otherwise.
Returns true if `s` is specifically a `PowerSeries`, false otherwise.
(revert s)
Returns a new PowerSeries
$U$ that represents the compositional inverse (the
'reversion') of the input power series $S$, satisfying:
$$S(U(x)) = x$$
Returns a new `PowerSeries` $U$ that represents the compositional inverse (the 'reversion') of the input power series $S$, satisfying: $$S(U(x)) = x$$
(series & prefix)
Return a Series
starting with the supplied values. The remainder of the
series will be filled with the zero-value corresponding to the first of the
given values.
If you have a sequence already, prefer series*
Return a `Series` starting with the supplied values. The remainder of the series will be filled with the zero-value corresponding to the first of the given values. If you have a sequence already, prefer `series*`
(series* prefix)
Given a sequence, returns a new Series
object that wraps that
sequence (potentially padding its tail with zeros if it's finite).
Given a sequence, returns a new `Series` object that wraps that sequence (potentially padding its tail with zeros if it's finite).
(series? s)
Returns true if s
is either a Series
or a PowerSeries
, false otherwise.
Returns true if `s` is either a `Series` or a `PowerSeries`, false otherwise.
(sum s n)
Returns the sum of all elements in the input series s
up to order
n
(inclusive). For example:
(sum (series 1 1 1 1 1 1 1) 3) ;; => 4
NOTE that sum
sums the first n + 1
terms, since series starts with an
order 0 term.
Returns the sum of all elements in the input series `s` up to order `n` (inclusive). For example: (sum (series 1 1 1 1 1 1 1) 3) ;; => 4 NOTE that `sum` sums the first `n + 1` terms, since series starts with an order 0 term.
(value s xs)
Returns the value of the supplied Series
or PowerSeries
applied to xs
.
If a PowerSeries
is supplied, xs
(despite its name) must be a single
value. Returns a Series
generated by multiplying each i
th term in s
by
$x^i$, where $x$ is the xs
argument.
If a Series
is supplied:
Assumes that S is a series of applicables of arity equal to the count of xs
.
If, in fact, S is a series of series-valued applicables, then the result will
be a sort of layered sum of the values.
Concretely, suppose that S has the form:
[x => [A1 A2 A3...], x => [B1 B2 B3...], x => [C1 C2 C3...], ...]
Then, this series applied to x will yield the new series:
[A1 (+ A2 B1) (+ A3 B2 C1) ...]
The way to think about this is, that if a power series has some other series as the coefficient of the $x^n$ term, the series must shift by $n$ positions before being added into the final total.
Returns the value of the supplied `Series` or `PowerSeries` applied to `xs`. If a `PowerSeries` is supplied, `xs` (despite its name) must be a single value. Returns a `Series` generated by multiplying each `i`th term in `s` by $x^i$, where $x$ is the `xs` argument. If a `Series` is supplied: Assumes that S is a series of applicables of arity equal to the count of `xs`. If, in fact, S is a series of series-valued applicables, then the result will be a sort of layered sum of the values. Concretely, suppose that S has the form: [x => [A1 A2 A3...], x => [B1 B2 B3...], x => [C1 C2 C3...], ...] Then, this series applied to x will yield the new series: [A1 (+ A2 B1) (+ A3 B2 C1) ...] The way to think about this is, that if a power series has some other series as the coefficient of the $x^n$ term, the series must shift by $n$ positions before being added into the final total.
(xpow n)
Returns a PowerSeries
instance representing $x^n$.
Returns a `PowerSeries` instance representing $x^n$.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close