NZMATH  1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
  Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

nzmath.poly.multivar.BasicPolynomial Class Reference
Inheritance diagram for nzmath.poly.multivar.BasicPolynomial:
[legend]
Collaboration diagram for nzmath.poly.multivar.BasicPolynomial:
[legend]

Public Member Functions

def __init__ (self, coefficients, **kwds)
 
def __mul__ (self, other)
 
def __rmul__ (self, other)
 
def ring_mul (self, other)
 
def scalar_mul (self, scale)
 
def term_mul (self, term)
 
def __pow__ (self, index)
 
def square (self)
 
def __hash__ (self)
 
def __call__ (self, target, value)
 
def __len__ (self)
 
def __getitem__ (self, index)
 
def iterterms (self)
 
def itercoefficients (self)
 
def iterbases (self)
 
def partial_differentiate (self, target)
 
def erase_variable (self, target=0)
 
def combine_similar_terms (self, target)
 
def __repr__ (self)
 
def construct_with_default (self, maindata)
 
- Public Member Functions inherited from nzmath.poly.multivar.PolynomialInterface
def total_degree (self)
 
def __neg__ (self)
 
def __pos__ (self)
 
- Public Member Functions inherited from nzmath.poly.formalsum.FormalSumContainerInterface
def __iter__ (self)
 
def __contains__ (self, base)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __nonzero__ (self)
 
def __add__ (self, other)
 
def __sub__ (self, other)
 
def terms (self)
 
def coefficients (self)
 
def bases (self)
 
def terms_map (self, func)
 
def coefficients_map (self, func)
 
def bases_map (self, func)
 

Public Attributes

 number_of_variables
 

Private Attributes

 _coefficients
 
 _init_kwds
 

Detailed Description

The class for basic multivariate polynomials.

Definition at line 179 of file multivar.py.

Constructor & Destructor Documentation

◆ __init__()

def nzmath.poly.multivar.BasicPolynomial.__init__ (   self,
  coefficients,
**  kwds 
)
BasicPolynomial(coefficients [, keyword_arguments...])

coefficients can be any dict initial values.

Reimplemented in nzmath.poly.multiutil.UniqueFactorizationDomainPolynomial, nzmath.poly.multiutil.DomainPolynomial, and nzmath.poly.multiutil.RingPolynomial.

Definition at line 184 of file multivar.py.

Member Function Documentation

◆ __call__()

def nzmath.poly.multivar.BasicPolynomial.__call__ (   self,
  target,
  value 
)
Substitute 'value' to 'target' index variable.
If 'target' is a tuple of indices, it has to be sorted and
'value' also has to be a tuple of the same length.

Note that the result will not be a univar polynomial nor a
scalar.

Definition at line 340 of file multivar.py.

References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, and nzmath.poly.multivar.BasicPolynomial._init_kwds.

◆ __getitem__()

def nzmath.poly.multivar.BasicPolynomial.__getitem__ (   self,
  index 
)
Return the coefficient of specified index (tuple of degrees).
If there is no term of index, return 0.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 372 of file multivar.py.

References nzmath.poly.multivar.BasicPolynomial._coefficients.

◆ __hash__()

def nzmath.poly.multivar.BasicPolynomial.__hash__ (   self)

◆ __len__()

def nzmath.poly.multivar.BasicPolynomial.__len__ (   self)
Return the number of data entries.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 366 of file multivar.py.

References nzmath.poly.multivar.BasicPolynomial._coefficients.

◆ __mul__()

def nzmath.poly.multivar.BasicPolynomial.__mul__ (   self,
  other 
)

◆ __pow__()

def nzmath.poly.multivar.BasicPolynomial.__pow__ (   self,
  index 
)
self ** index

pow with three arguments is not supported by default.

Definition at line 259 of file multivar.py.

References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default(), and nzmath.poly.multivar.BasicPolynomial.square().

◆ __repr__()

def nzmath.poly.multivar.BasicPolynomial.__repr__ (   self)

◆ __rmul__()

◆ combine_similar_terms()

def nzmath.poly.multivar.BasicPolynomial.combine_similar_terms (   self,
  target 
)
Combine similar terms and return the resulting univariate
polynomial with polynomial coefficients in the form of list of
(degree, coefficient) pairs.  The target variable is specified
by the position in indices.

Definition at line 432 of file multivar.py.

References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, nzmath.poly.multivar.BasicPolynomial._init_kwds, and nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default().

◆ construct_with_default()

def nzmath.poly.multivar.BasicPolynomial.construct_with_default (   self,
  maindata 
)
Create a new multivar polynomial of the same class with self,
with given only the maindata and use copy of self's data if
necessary.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 450 of file multivar.py.

References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, and nzmath.poly.multivar.BasicPolynomial._init_kwds.

Referenced by nzmath.poly.uniutil.DivisionProvider.__divmod__(), nzmath.poly.uniutil.DivisionProvider.__floordiv__(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.__pow__(), nzmath.poly.uniutil.DivisionProvider._populate_reduced(), 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.uniutil.PseudoDivisionProvider.pseudo_divmod(), nzmath.poly.uniutil.PseudoDivisionProvider.pseudo_floordiv(), nzmath.poly.uniutil.PseudoDivisionProvider.pseudo_mod(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.pthroot(), nzmath.poly.uniutil.KaratsubaProvider.ring_mul_karatsuba(), nzmath.poly.uniutil.OrderProvider.shift_degree_to(), nzmath.poly.uniutil.OrderProvider.split_at(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.split_same_degrees(), and nzmath.poly.uniutil.KaratsubaProvider.square_karatsuba().

◆ erase_variable()

def nzmath.poly.multivar.BasicPolynomial.erase_variable (   self,
  target = 0 
)
Erase a variable from the polynomial.  The target variable is
specified by the position in indices.

The method takes no care about resulting polynomial type, i.e.
the result remains as the same type even if their indices have
length less than 2.

Definition at line 411 of file multivar.py.

References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, nzmath.poly.multivar.BasicPolynomial._init_kwds, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.

◆ iterbases()

def nzmath.poly.multivar.BasicPolynomial.iterbases (   self)
iterator for degrees.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 391 of file multivar.py.

References nzmath.poly.multivar.BasicPolynomial._coefficients.

◆ itercoefficients()

◆ iterterms()

def nzmath.poly.multivar.BasicPolynomial.iterterms (   self)
iterator for (degree, coefficient) pairs.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 379 of file multivar.py.

References nzmath.poly.multivar.BasicPolynomial._coefficients.

◆ partial_differentiate()

def nzmath.poly.multivar.BasicPolynomial.partial_differentiate (   self,
  target 
)
Return the polynomial obtained by partial differentiation with
the 'target' index variable.

Definition at line 397 of file multivar.py.

References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default().

◆ ring_mul()

def nzmath.poly.multivar.BasicPolynomial.ring_mul (   self,
  other 
)
self * other

Both self and other must have the same length tuples of
indices for every term.

Definition at line 219 of file multivar.py.

References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default().

Referenced by nzmath.poly.univar.BasicPolynomial.__mul__(), nzmath.poly.multivar.BasicPolynomial.__mul__(), and nzmath.poly.univar.SortedPolynomial.__mul__().

◆ scalar_mul()

◆ square()

◆ term_mul()

def nzmath.poly.multivar.BasicPolynomial.term_mul (   self,
  term 
)
Return the result of multiplication with the given term.
The term can be given as a tuple (degree indices, coeff)
or as a Polynomial instance.

Definition at line 247 of file multivar.py.

References nzmath.poly.formalsum.FormalSumContainerInterface.construct_with_default().

Referenced by nzmath.poly.univar.SortedPolynomial.ring_mul_karatsuba(), and nzmath.poly.uniutil.KaratsubaProvider.ring_mul_karatsuba().

Member Data Documentation

◆ _coefficients

◆ _init_kwds

◆ number_of_variables


The documentation for this class was generated from the following file: