StreamTaylorSeriesOperationsCategory(R, M)¶
sttaylor.spad line 1 [edit on github]
R: Ring
M: LeftModule R
This is category specifying operations for Taylor series arithmetic, where a Taylor series is represented by a stream of its coefficients. Relevant operations satisfy usual axioms like Ring and LeftModule. This category was extracted and generalized from StreamTaylorSeriesOperations to factor out common interface.
*: (M, Stream R) -> Stream M if M has RightModule R
- *: (R, Stream M) -> Stream M
r * a
returns the power series scalar multiplication ofr
bya
:r * [a0, a1, ...] = [r * a0, r * a1, ...]
- *: (Stream M, R) -> Stream M if M has RightModule R
a * r
returns the power series scalar multiplication ofa
byr:
[a0, a1, ...] * r = [a0 * r, a1 * r, ...]
- *: (Stream R, Stream M) -> Stream M
a * b
returns the power series (Cauchy) product ofa
andb:
[a0, a1, ...] * [b0, b1, ...] = [c0, c1, ...]
whereck = sum(i + j = k, ai * bk)
.
- +: (Stream M, Stream M) -> Stream M
a + b
returns the power series sum ofa
andb
:[a0, a1, ..] + [b0, b1, ..] = [a0 + b0, a1 + b1, ..]
- -: (Stream M, Stream M) -> Stream M
a - b
returns the power series difference ofa
andb
:[a0, a1, ..] - [b0, b1, ..] = [a0 - b0, a1 - b1, ..]
- -: Stream M -> Stream M
- a
returns the power series negative ofa
:- [a0, a1, ...] = [- a0, - a1, ...]
- addiag: Stream Stream M -> Stream M
addiag(x)
performs diagonal addition of a stream of streams. ifx = [[a<0, 0>, a<0, 1>, ..], [a<1, 0>, a<1, 1>, ..], [a<2, 0>, a<2, 1>, ..], ..]
andaddiag(x) = [b<0, b<1>, ...]
, thenb<k> = sum(i+j=k, a<i, j>)
.
- coerce: M -> Stream M
coerce(r)
converts a module elementr
to a stream with one element.
- compose: (Stream M, Stream R) -> Stream M if M has RightModule R
compose(a, b)
composes the power seriesa
with the power seriesb
.
- deriv: Stream M -> Stream M
deriv(a)
returns the derivative of the power series with respect to the power series variable. Thusderiv([a0, a1, a2, ...])
returns[a1, 2 a2, 3 a3, ...]
.
- eval: (Stream M, R) -> Stream M if M has RightModule R
eval(a, r)
returns a stream of partial sums of the power seriesa
evaluated at the power series variable equal tor
.
- gderiv: (Integer -> R, Stream M) -> Stream M
gderiv(f, [a0, a1, a2, ..])
returns[f(0)*a0, f(1)*a1, f(2)*a2, ..]
.
- int: R -> Stream R
int(r)
returns [r
,r+1
,r+2
, …], wherer
is a ring element.
- integrate: (M, Stream M) -> Stream M if R has Algebra Fraction Integer
integrate(r, a)
returns the integral of the power seriesa
with respect to the power series variable wherer
denotes the constant of integration. Thusintegrate(a, [a0, a1, a2, ...]) = [a, a0, a1/2, a2/3, ...]
.
- invmultisect: (Integer, Integer, Stream M) -> Stream M
invmultisect(a, b, st)
substitutesx^((a+b)*n)
forx^n
and multiplies byx^b
.
- lazyIntegrate: (M, () -> Stream M) -> Stream M if R has Algebra Fraction Integer
lazyIntegrate(r, f)
is a version of integrate used for fixed point computations.
- mapmult: (Stream M, Stream R) -> Stream M if M has RightModule R
mapmult([a0, a1, ..], [b0, b1, ..])
returns[a0*b0, a1*b1, ..]
.
- mapmult: (Stream R, Stream M) -> Stream M
mapmult([a0, a1, ..], [b0, b1, ..])
returns[a0*b0, a1*b1, ..]
.