Interface of formal sum container. Do not instanciate.
Iterators over the container. iterterms() is equivalent to zip(iterbases(), itercoefficient()).
Return a list containing all content of the container. terms() is equivalent to list(iterterms()) or zip(bases(), coefficients()).
Create a new formal sum container by applying func to each term (base or coefficients, resp.).
s + t | addition |
s - t | subtraction |
+s | same content |
-s | negation |
s * a, a * s | scalar multiplication by a |
s == t | equality |
s != t | inequality |
s[b] | get coeeficient corresponding to a base b |
b in s | return whether base b is in s |
len(s) | number of terms |
hash(s) | hash |