IntegerFactorization objects#

class sage.structure.factorization_integer.IntegerFactorization(x, unit=None, cr=False, sort=True, simplify=True, unsafe=False)#

Bases: Factorization

A lightweight class for an IntegerFactorization object, inheriting from the more general Factorization class.

In the Factorization class the user has to create a list containing the factorization data, which is then passed to the actual Factorization object upon initialization.

However, for the typical use of integer factorization via the Integer.factor() method in sage.rings.integer this is noticeably too much overhead, slowing down the factorization of integers of up to about 40 bits by a factor of around 10. Moreover, the initialization done in the Factorization class is typically unnecessary: the caller can guarantee that the list contains pairs of an Integer and an int, as well as that the list is sorted.


  • Sebastian Pancratz (2010-01-10)