nzmath.poly.formalsum

FormalSumContainerInterface

Interface of formal sum container. Do not instanciate.

methods

iterterms, iterbases, itercoefficients

Iterators over the container. iterterms() is equivalent to zip(iterbases(), itercoefficient()).

terms, bases, coefficients

Return a list containing all content of the container. terms() is equivalent to list(iterterms()) or zip(bases(), coefficients()).

terms_map(func), bases_map(func), coefficients_map(func)

Create a new formal sum container by applying func to each term (base or coefficients, resp.).

operators

s + taddition
s - tsubtraction
+ssame content
-snegation
s * a, a * sscalar multiplication by a
s == tequality
s != tinequality
s[b]get coeeficient corresponding to a base b
b in sreturn whether base b is in s
len(s)number of terms
hash(s)hash