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.factor.misc.FactoredInteger Class Reference
Inheritance diagram for nzmath.factor.misc.FactoredInteger:
[legend]
Collaboration diagram for nzmath.factor.misc.FactoredInteger:
[legend]

Public Member Functions

def __init__ (self, integer, factors=None)
 
def from_partial_factorization (cls, integer, partial)
 
def __iter__ (self)
 
def __mul__ (self, other)
 
def __pow__ (self, other)
 
def __pos__ (self)
 
def __str__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def __ne__ (self, other)
 
def __long__ (self)
 
def copy (self)
 
def __mod__ (self, other)
 
def is_divisible_by (self, other)
 
def exact_division (self, other)
 
def divisors (self)
 
def proper_divisors (self)
 
def prime_divisors (self)
 
def square_part (self, asfactored=False)
 
def squarefree_part (self, asfactored=False)
 

Public Attributes

 integer
 
 factors
 

Static Private Attributes

def __rmul__ = __mul__
 
def __int__ = __long__
 
def __floordiv__ = exact_division
 

Detailed Description

Integers with factorization information.

Definition at line 42 of file misc.py.

Constructor & Destructor Documentation

◆ __init__()

def nzmath.factor.misc.FactoredInteger.__init__ (   self,
  integer,
  factors = None 
)
FactoredInteger(integer [, factors])

If factors is given, it is a dict of type {prime:exponent}
and the product of prime**exponent is equal to the integer.
Otherwise, factorization is carried out in initialization.

Definition at line 46 of file misc.py.

Member Function Documentation

◆ __eq__()

◆ __hash__()

def nzmath.factor.misc.FactoredInteger.__hash__ (   self)

Definition at line 107 of file misc.py.

References nzmath.factor.misc.FactoredInteger.integer.

◆ __iter__()

def nzmath.factor.misc.FactoredInteger.__iter__ (   self)
Default iterator

Definition at line 73 of file misc.py.

References nzmath.factor.misc.FactoredInteger.factors.

◆ __long__()

def nzmath.factor.misc.FactoredInteger.__long__ (   self)

Definition at line 113 of file misc.py.

References nzmath.factor.misc.FactoredInteger.integer.

◆ __mod__()

def nzmath.factor.misc.FactoredInteger.__mod__ (   self,
  other 
)

◆ __mul__()

◆ __ne__()

def nzmath.factor.misc.FactoredInteger.__ne__ (   self,
  other 
)

Definition at line 110 of file misc.py.

References nzmath.factor.misc.FactoredInteger.integer.

◆ __pos__()

def nzmath.factor.misc.FactoredInteger.__pos__ (   self)

Definition at line 98 of file misc.py.

References nzmath.factor.misc.FactoredInteger.copy().

◆ __pow__()

◆ __str__()

def nzmath.factor.misc.FactoredInteger.__str__ (   self)

Definition at line 101 of file misc.py.

References nzmath.factor.misc.FactoredInteger.integer.

◆ copy()

def nzmath.factor.misc.FactoredInteger.copy (   self)

Definition at line 118 of file misc.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.factor.misc.FactoredInteger.factors, and nzmath.factor.misc.FactoredInteger.integer.

Referenced by nzmath.factor.misc.FactoredInteger.__mul__(), nzmath.factor.misc.FactoredInteger.__pos__(), nzmath.matrix.RingMatrix.__pos__(), nzmath.prime.FactoredInteger.__pos__(), nzmath.module.Module.__pow__(), nzmath.module.Ideal_with_generator.__pow__(), nzmath.matrix.RingSquareMatrix.__pow__(), nzmath.matrix.FieldMatrix._cohensSimplify(), nzmath.module.Module._module_mul(), nzmath.matrix.RingMatrix._SimplifyHNF(), nzmath.matrix.FieldMatrix.columnEchelonForm(), nzmath.matrix.RingSquareMatrix.determinant(), nzmath.factor.misc.FactoredInteger.exact_division(), nzmath.prime.FactoredInteger.exact_division(), nzmath.matrix.RingSquareMatrix.extsmithNormalForm(), nzmath.matrix.RingMatrix.hermiteNormalForm(), nzmath.matrix.FieldSquareMatrix.hessenbergForm(), nzmath.module.Module.intersect(), nzmath.module.Submodule.intersectionOfSubmodules(), nzmath.matrix.Subspace.intersectionOfSubspaces(), nzmath.matrix.FieldSquareMatrix.inverse(), nzmath.matrix.FieldMatrix.inverseImage(), nzmath.matrix.FieldSquareMatrix.LUDecomposition(), nzmath.matrix.RingSquareMatrix.smithNormalForm(), nzmath.matrix.FieldMatrix.solve(), nzmath.matrix.Matrix.subMatrix(), nzmath.module.Submodule.sumOfSubmodules(), nzmath.matrix.Subspace.sumOfSubspaces(), nzmath.matrix.Subspace.supplementBasis(), and nzmath.matrix.FieldSquareMatrix.triangulate().

◆ divisors()

def nzmath.factor.misc.FactoredInteger.divisors (   self)

◆ exact_division()

def nzmath.factor.misc.FactoredInteger.exact_division (   self,
  other 
)
Divide by a factor.

Definition at line 136 of file misc.py.

References nzmath.factor.misc.FactoredInteger.copy(), and nzmath.factor.misc.FactoredInteger.factors.

◆ from_partial_factorization()

def nzmath.factor.misc.FactoredInteger.from_partial_factorization (   cls,
  integer,
  partial 
)
Construct a new FactoredInteger object from partial
factorization information given as dict of type
{prime:exponent}.

Definition at line 61 of file misc.py.

◆ is_divisible_by()

def nzmath.factor.misc.FactoredInteger.is_divisible_by (   self,
  other 
)
Return True if other divides self.

Definition at line 127 of file misc.py.

References nzmath.factor.misc.FactoredInteger.factors, and nzmath.factor.misc.FactoredInteger.integer.

◆ prime_divisors()

def nzmath.factor.misc.FactoredInteger.prime_divisors (   self)
Return the list of primes that divides the number.

Definition at line 190 of file misc.py.

References nzmath.factor.misc.FactoredInteger.factors.

◆ proper_divisors()

def nzmath.factor.misc.FactoredInteger.proper_divisors (   self)
Return the proper divisors (divisors of n excluding 1 and n).

Definition at line 184 of file misc.py.

References nzmath.factor.misc.FactoredInteger.divisors().

◆ square_part()

def nzmath.factor.misc.FactoredInteger.square_part (   self,
  asfactored = False 
)
Return the largest integer whose square divides the number.

If an optional argument asfactored is true, then the result is
also a FactoredInteger object. (default is False)

Definition at line 196 of file misc.py.

References nzmath.factor.misc.FactoredInteger.factors.

◆ squarefree_part()

def nzmath.factor.misc.FactoredInteger.squarefree_part (   self,
  asfactored = False 
)
Return the largest divisor of the number which is squarefree.

If an optional argument asfactored is true, then the result is
also a FactoredInteger object. (default is False)

Definition at line 212 of file misc.py.

References nzmath.factor.misc.FactoredInteger.factors.

Member Data Documentation

◆ __floordiv__

def nzmath.factor.misc.FactoredInteger.__floordiv__ = exact_division
staticprivate

Definition at line 171 of file misc.py.

◆ __int__

def nzmath.factor.misc.FactoredInteger.__int__ = __long__
staticprivate

Definition at line 116 of file misc.py.

◆ __rmul__

def nzmath.factor.misc.FactoredInteger.__rmul__ = __mul__
staticprivate

Definition at line 89 of file misc.py.

◆ factors

◆ integer


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