IntegerFactorization objects¶
- class sage.structure.factorization_integer.IntegerFactorization(x, unit=None, cr=False, sort=True, simplify=True, unsafe=False)[source]¶
Bases:
FactorizationA lightweight class for an
IntegerFactorizationobject, inheriting from the more generalFactorizationclass.In the
Factorizationclass the user has to create a list containing the factorization data, which is then passed to the actualFactorizationobject upon initialization.However, for the typical use of integer factorization via the
Integer.factor()method insage.rings.integerthis 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 theFactorizationclass is typically unnecessary: the caller can guarantee that the list contains pairs of anIntegerand anint, as well as that the list is sorted.AUTHOR:
Sebastian Pancratz (2010-01-10)