NZMATH
1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
![]() ![]() |
Public Member Functions | |
def | __iter__ (self) |
def | __getitem__ (self, base) |
def | __contains__ (self, base) |
def | __len__ (self) |
def | __eq__ (self, other) |
def | __hash__ (self) |
def | __ne__ (self, other) |
def | __nonzero__ (self) |
def | __hash__ (self) |
def | __add__ (self, other) |
def | __sub__ (self, other) |
def | __neg__ (self) |
def | __pos__ (self) |
def | __mul__ (self, other) |
def | __rmul__ (self, other) |
def | iterterms (self) |
def | itercoefficients (self) |
def | iterbases (self) |
def | terms (self) |
def | coefficients (self) |
def | bases (self) |
def | terms_map (self, func) |
def | coefficients_map (self, func) |
def | bases_map (self, func) |
def | construct_with_default (self, maindata) |
Interface of formal sum container. Do not instantiate.
Definition at line 39 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__add__ | ( | self, | |
other | |||
) |
self + other
Reimplemented in nzmath.poly.uniutil.RingPolynomial, nzmath.poly.univar.SortedPolynomial, nzmath.poly.multiutil.RingPolynomial, and nzmath.poly.univar.BasicPolynomial.
Definition at line 121 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default(), and nzmath.poly.formalsum.FormalSumContainerInterface.iterterms().
def nzmath.poly.formalsum.FormalSumContainerInterface.__contains__ | ( | self, | |
base | |||
) |
base in self membership test.
Reimplemented in nzmath.poly.univar.SortedPolynomial, and nzmath.poly.univar.BasicPolynomial.
Definition at line 58 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.bases().
def nzmath.poly.formalsum.FormalSumContainerInterface.__eq__ | ( | self, | |
other | |||
) |
self == other This implementaion is not optimal for more structured descendants.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.univar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.PolynomialInterface.
Definition at line 72 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.iterbases().
Referenced by nzmath.poly.multivar.TermIndices.__ne__(), nzmath.poly.ring.PolynomialRing.__ne__(), nzmath.quad.ReducedQuadraticForm.__ne__(), nzmath.ring.Ring.__ne__(), nzmath.poly.formalsum.FormalSumContainerInterface.__ne__(), nzmath.real.RealField.__ne__(), nzmath.ring.Ideal.__ne__(), and nzmath.prime.FactoredInteger.__ne__().
def nzmath.poly.formalsum.FormalSumContainerInterface.__getitem__ | ( | self, | |
base | |||
) |
Return the coefficient of specified base. If there is no term of the base, return 0.
Reimplemented in nzmath.poly.multivar.BasicPolynomial, nzmath.poly.uniutil.RingPolynomial, nzmath.poly.univar.SortedPolynomial, nzmath.poly.univar.BasicPolynomial, nzmath.poly.formalsum.ListFormalSum, and nzmath.poly.formalsum.DictFormalSum.
Definition at line 51 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__hash__ | ( | self | ) |
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.univar.BasicPolynomial, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.PolynomialInterface.
Definition at line 92 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.iterbases().
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__hash__().
def nzmath.poly.formalsum.FormalSumContainerInterface.__hash__ | ( | self | ) |
hash(self)
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.univar.BasicPolynomial, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.PolynomialInterface.
Definition at line 112 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.__hash__().
def nzmath.poly.formalsum.FormalSumContainerInterface.__iter__ | ( | self | ) |
Return the iterator. It is an alias of iterterms.
Definition at line 44 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.iterterms().
def nzmath.poly.formalsum.FormalSumContainerInterface.__len__ | ( | self | ) |
Return the number of data entries.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.BasicPolynomial.
Definition at line 66 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__mul__ | ( | self, | |
other | |||
) |
self * other Only scalar multiplication is defined.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.formalsum.DictFormalSum, nzmath.poly.multivar.BasicPolynomial, and nzmath.poly.univar.BasicPolynomial.
Definition at line 157 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__ne__ | ( | self, | |
other | |||
) |
self != other
Definition at line 96 of file formalsum.py.
References nzmath.group.Group.__eq__(), nzmath.poly.formalsum.FormalSumContainerInterface.__eq__(), nzmath.factor.misc.FactoredInteger.__eq__(), nzmath.imaginary.Complex.__eq__(), nzmath.poly.array.ArrayPoly.__eq__(), nzmath.group.GroupElement.__eq__(), nzmath.matrix.Matrix.__eq__(), nzmath.intresidue.IntegerResidueClass.__eq__(), nzmath.finitefield.FinitePrimeField.__eq__(), nzmath.imaginary.ComplexField.__eq__(), nzmath.poly.array.ArrayPolyMod.__eq__(), nzmath.module.Module.__eq__(), nzmath.permute.Permute.__eq__(), nzmath.intresidue.IntegerResidueClassRing.__eq__(), nzmath.algfield.NumberField.__eq__(), nzmath.finitefield.ExtendedFieldElement.__eq__(), nzmath.permute.ExPermute.__eq__(), nzmath.permute.PermGroup.__eq__(), nzmath.finitefield.ExtendedField.__eq__(), and nzmath.matrix.MatrixRing.__eq__().
def nzmath.poly.formalsum.FormalSumContainerInterface.__neg__ | ( | self | ) |
-self
Reimplemented in nzmath.poly.formalsum.ListFormalSum, nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.DictFormalSum, nzmath.poly.univar.BasicPolynomial, and nzmath.poly.multivar.PolynomialInterface.
Definition at line 145 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__nonzero__ | ( | self | ) |
Return True, if self has some nonzero coefficients. False, otherwise.
Definition at line 102 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.itercoefficients().
def nzmath.poly.formalsum.FormalSumContainerInterface.__pos__ | ( | self | ) |
+self
Reimplemented in nzmath.poly.formalsum.ListFormalSum, nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.DictFormalSum, nzmath.poly.univar.BasicPolynomial, and nzmath.poly.multivar.PolynomialInterface.
Definition at line 151 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__rmul__ | ( | self, | |
other | |||
) |
other * self This method is invoked only when type of other does not support multiplication with FormalSumContainerInterface
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.formalsum.DictFormalSum, nzmath.poly.multivar.BasicPolynomial, and nzmath.poly.univar.BasicPolynomial.
Definition at line 165 of file formalsum.py.
def nzmath.poly.formalsum.FormalSumContainerInterface.__sub__ | ( | self, | |
other | |||
) |
self - other
Reimplemented in nzmath.poly.uniutil.RingPolynomial, nzmath.poly.univar.SortedPolynomial, nzmath.poly.multiutil.RingPolynomial, and nzmath.poly.univar.BasicPolynomial.
Definition at line 133 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default(), and nzmath.poly.formalsum.FormalSumContainerInterface.iterterms().
def nzmath.poly.formalsum.FormalSumContainerInterface.bases | ( | self | ) |
Return a list of all bases.
Definition at line 204 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.iterbases().
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__contains__().
def nzmath.poly.formalsum.FormalSumContainerInterface.bases_map | ( | self, | |
func | |||
) |
Create a new formal sum container by applying func to each base.
Definition at line 229 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.terms_map().
Referenced by nzmath.poly.univar.PolynomialInterface.downshift_degree(), and nzmath.poly.univar.PolynomialInterface.upshift_degree().
def nzmath.poly.formalsum.FormalSumContainerInterface.coefficients | ( | self | ) |
Return a list of all coefficients.
Definition at line 198 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.itercoefficients().
def nzmath.poly.formalsum.FormalSumContainerInterface.coefficients_map | ( | self, | |
func | |||
) |
Create a new formal sum container by applying func to each coefficient.
Definition at line 222 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.terms_map().
Referenced by nzmath.poly.formalsum.DictFormalSum.rscalar_mul(), nzmath.poly.formalsum.ListFormalSum.rscalar_mul(), nzmath.poly.uniutil.DivisionProvider.scalar_exact_division(), nzmath.poly.uniutil.PseudoDivisionProvider.scalar_exact_division(), nzmath.poly.formalsum.DictFormalSum.scalar_mul(), and nzmath.poly.formalsum.ListFormalSum.scalar_mul().
def nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default | ( | self, | |
maindata | |||
) |
Create a new formal sum container of the same class with self, with given only the maindata and use copy of self's data if necessary.
Reimplemented in nzmath.poly.univar.PolynomialInterface, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.multivar.BasicPolynomial, and nzmath.poly.formalsum.DictFormalSum.
Definition at line 236 of file formalsum.py.
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__add__(), nzmath.poly.univar.BasicPolynomial.__add__(), nzmath.poly.univar.SortedPolynomial.__add__(), nzmath.poly.uniutil.DivisionProvider.__divmod__(), nzmath.poly.uniutil.DivisionProvider.__floordiv__(), nzmath.poly.multivar.PolynomialInterface.__neg__(), nzmath.poly.univar.BasicPolynomial.__neg__(), nzmath.poly.formalsum.DictFormalSum.__neg__(), nzmath.poly.univar.SortedPolynomial.__neg__(), nzmath.poly.formalsum.ListFormalSum.__neg__(), nzmath.poly.multivar.PolynomialInterface.__pos__(), nzmath.poly.univar.BasicPolynomial.__pos__(), nzmath.poly.formalsum.DictFormalSum.__pos__(), nzmath.poly.univar.SortedPolynomial.__pos__(), nzmath.poly.formalsum.ListFormalSum.__pos__(), nzmath.poly.univar.BasicPolynomial.__pow__(), nzmath.poly.multivar.BasicPolynomial.__pow__(), nzmath.poly.univar.SortedPolynomial.__pow__(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.__pow__(), nzmath.poly.formalsum.FormalSumContainerInterface.__sub__(), nzmath.poly.univar.BasicPolynomial.__sub__(), nzmath.poly.univar.SortedPolynomial.__sub__(), nzmath.poly.uniutil.DivisionProvider._populate_reduced(), nzmath.poly.multivar.BasicPolynomial.combine_similar_terms(), nzmath.poly.univar.PolynomialInterface.differentiate(), nzmath.poly.uniutil.DivisionProvider.mod(), nzmath.poly.uniutil.DivisionProvider.mod_pow(), nzmath.poly.uniutil.PseudoDivisionProvider.monic_divmod(), nzmath.poly.uniutil.PseudoDivisionProvider.monic_floordiv(), nzmath.poly.uniutil.PseudoDivisionProvider.monic_mod(), nzmath.poly.multivar.BasicPolynomial.partial_differentiate(), nzmath.poly.uniutil.PseudoDivisionProvider.pseudo_divmod(), nzmath.poly.uniutil.PseudoDivisionProvider.pseudo_floordiv(), nzmath.poly.uniutil.PseudoDivisionProvider.pseudo_mod(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.pthroot(), nzmath.poly.univar.PolynomialInterface.ring_mul(), nzmath.poly.multivar.BasicPolynomial.ring_mul(), nzmath.poly.uniutil.FinitePrimeFieldPolynomial.ring_mul(), nzmath.poly.univar.SortedPolynomial.ring_mul_karatsuba(), nzmath.poly.uniutil.KaratsubaProvider.ring_mul_karatsuba(), nzmath.poly.univar.PolynomialInterface.scalar_mul(), nzmath.poly.multivar.BasicPolynomial.scalar_mul(), nzmath.poly.univar.SortedPolynomial.scalar_mul(), nzmath.poly.uniutil.OrderProvider.shift_degree_to(), nzmath.poly.uniutil.OrderProvider.split_at(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.split_same_degrees(), nzmath.poly.univar.BasicPolynomial.square(), nzmath.poly.multivar.BasicPolynomial.square(), nzmath.poly.univar.SortedPolynomial.square(), nzmath.poly.uniutil.FinitePrimeFieldPolynomial.square(), nzmath.poly.uniutil.KaratsubaProvider.square_karatsuba(), nzmath.poly.univar.PolynomialInterface.term_mul(), nzmath.poly.multivar.BasicPolynomial.term_mul(), nzmath.poly.univar.PolynomialInterface.terms_map(), and nzmath.poly.formalsum.FormalSumContainerInterface.terms_map().
def nzmath.poly.formalsum.FormalSumContainerInterface.iterbases | ( | self | ) |
iterator for degrees.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.BasicPolynomial.
Definition at line 186 of file formalsum.py.
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__eq__(), nzmath.poly.formalsum.FormalSumContainerInterface.__hash__(), nzmath.poly.formalsum.FormalSumContainerInterface.bases(), and nzmath.poly.multivar.PolynomialInterface.total_degree().
def nzmath.poly.formalsum.FormalSumContainerInterface.itercoefficients | ( | self | ) |
iterator for coefficients.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.BasicPolynomial.
Definition at line 180 of file formalsum.py.
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__nonzero__(), nzmath.poly.univar.BasicPolynomial.__pow__(), nzmath.poly.univar.SortedPolynomial.__pow__(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.__pow__(), nzmath.poly.uniutil.DivisionProvider._populate_reduced(), nzmath.poly.formalsum.FormalSumContainerInterface.coefficients(), nzmath.poly.uniutil.ContentProvider.content(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.distinct_degree_factorization(), nzmath.poly.multiutil.RingElementProvider.getRing(), nzmath.poly.uniutil.RingElementProvider.getRing(), and nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.split_same_degrees().
def nzmath.poly.formalsum.FormalSumContainerInterface.iterterms | ( | self | ) |
iterator for (degree, coefficient) pairs.
Reimplemented in nzmath.poly.univar.SortedPolynomial, nzmath.poly.formalsum.ListFormalSum, nzmath.poly.multivar.BasicPolynomial, nzmath.poly.formalsum.DictFormalSum, and nzmath.poly.univar.BasicPolynomial.
Definition at line 174 of file formalsum.py.
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.__add__(), nzmath.poly.univar.PolynomialInterface.__eq__(), nzmath.poly.univar.PolynomialInterface.__hash__(), nzmath.poly.formalsum.FormalSumContainerInterface.__iter__(), nzmath.poly.formalsum.FormalSumContainerInterface.__sub__(), nzmath.poly.formalsum.FormalSumContainerInterface.terms(), and nzmath.poly.uniutil.DomainPolynomial.to_field_polynomial().
def nzmath.poly.formalsum.FormalSumContainerInterface.terms | ( | self | ) |
Return a list of terms as (base, coefficient) pairs.
Definition at line 192 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.iterterms().
Referenced by nzmath.poly.uniutil.RingPolynomial.__repr__(), and nzmath.poly.univar.BasicPolynomial.square().
def nzmath.poly.formalsum.FormalSumContainerInterface.terms_map | ( | self, | |
func | |||
) |
Create a new formal sum container by applying func to each term. func must be a function taking 2 arguments.
Reimplemented in nzmath.poly.univar.PolynomialInterface.
Definition at line 210 of file formalsum.py.
References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default().
Referenced by nzmath.poly.formalsum.FormalSumContainerInterface.bases_map(), and nzmath.poly.formalsum.FormalSumContainerInterface.coefficients_map().