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.formalsum.ListFormalSum Class Reference
Inheritance diagram for nzmath.poly.formalsum.ListFormalSum:
[legend]
Collaboration diagram for nzmath.poly.formalsum.ListFormalSum:
[legend]

Public Member Functions

def __init__ (self, args, defaultvalue=None)
 
def __mul__ (self, other)
 
def scalar_mul (self, scale)
 
def __rmul__ (self, other)
 
def rscalar_mul (self, scale)
 
def __neg__ (self)
 
def __pos__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def __getitem__ (self, base)
 
def iterterms (self)
 
def itercoefficients (self)
 
def iterbases (self)
 
def __len__ (self)
 
def __repr__ (self)
 
def construct_with_default (self, maindata)
 
- Public Member Functions inherited from nzmath.poly.formalsum.FormalSumContainerInterface
def __iter__ (self)
 
def __contains__ (self, base)
 
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)
 

Private Attributes

 _data
 
 _defaultvalue
 

Detailed Description

formalsum implementation based on List.

Definition at line 373 of file formalsum.py.

Constructor & Destructor Documentation

◆ __init__()

def nzmath.poly.formalsum.ListFormalSum.__init__ (   self,
  args,
  defaultvalue = None 
)
ListFormalSum(args)

args can be sequence of tuples of (base, coefficient) pair.
It makes a mapping from bases to coefficients.

Definition at line 377 of file formalsum.py.

Member Function Documentation

◆ __eq__()

◆ __getitem__()

def nzmath.poly.formalsum.ListFormalSum.__getitem__ (   self,
  base 
)
self[base]

no KeyError will be raised. Insteads, it returns defaultvalue
specified on time of initialization.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 448 of file formalsum.py.

References nzmath.poly.formalsum.DictFormalSum._defaultvalue, and nzmath.poly.formalsum.ListFormalSum._defaultvalue.

◆ __hash__()

def nzmath.poly.formalsum.ListFormalSum.__hash__ (   self)

◆ __len__()

def nzmath.poly.formalsum.ListFormalSum.__len__ (   self)
len(self)

Return the number of terms.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 480 of file formalsum.py.

References nzmath.poly.formalsum.DictFormalSum._data, and nzmath.poly.formalsum.ListFormalSum._data.

◆ __mul__()

def nzmath.poly.formalsum.ListFormalSum.__mul__ (   self,
  other 
)

◆ __neg__()

def nzmath.poly.formalsum.ListFormalSum.__neg__ (   self)

◆ __pos__()

◆ __repr__()

◆ __rmul__()

def nzmath.poly.formalsum.ListFormalSum.__rmul__ (   self,
  other 
)
other * self

This method is invoked only when type of other does not
support multiplication with FormalSum.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 403 of file formalsum.py.

References nzmath.poly.formalsum.DictFormalSum.rscalar_mul(), and nzmath.poly.formalsum.ListFormalSum.rscalar_mul().

◆ construct_with_default()

def nzmath.poly.formalsum.ListFormalSum.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 from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 491 of file formalsum.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.formalsum.DictFormalSum._defaultvalue, and nzmath.poly.formalsum.ListFormalSum._defaultvalue.

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().

◆ iterbases()

def nzmath.poly.formalsum.ListFormalSum.iterbases (   self)

◆ itercoefficients()

◆ iterterms()

def nzmath.poly.formalsum.ListFormalSum.iterterms (   self)
iterator for (base, coefficient) pairs.

Reimplemented from nzmath.poly.formalsum.FormalSumContainerInterface.

Definition at line 460 of file formalsum.py.

References nzmath.poly.formalsum.DictFormalSum._data, and nzmath.poly.formalsum.ListFormalSum._data.

◆ rscalar_mul()

def nzmath.poly.formalsum.ListFormalSum.rscalar_mul (   self,
  scale 
)
scalar multiplication.

scale * sum

Definition at line 412 of file formalsum.py.

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

Referenced by nzmath.poly.formalsum.ListFormalSum.__rmul__().

◆ scalar_mul()

Member Data Documentation

◆ _data

◆ _defaultvalue

nzmath.poly.formalsum.ListFormalSum._defaultvalue
private

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