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 generalFactorization
class.In the
Factorization
class the user has to create a list containing the factorization data, which is then passed to the actualFactorization
object upon initialization.However, for the typical use of integer factorization via the
Integer.factor()
method insage.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 theFactorization
class is typically unnecessary: the caller can guarantee that the list contains pairs of anInteger
and anint
, as well as that the list is sorted.AUTHOR:
Sebastian Pancratz (2010-01-10)