Flint2-0.1.0.5: Haskell bindings for the flint library for number theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Number.Flint.UFD

Description

Unique factorization domain

Specifically, a UFD is an integral domain (a nontrivial commutative ring in which the product of any two non-zero elements is non-zero) in which every non-zero non-unit element can be written as a product of prime elements (or irreducible elements), uniquely up to order and units.

Documentation

class Num a => UFD a where Source #

Minimal complete definition

factor

Methods

factor :: a -> [(a, Int)] Source #

factor x

Factor x into prime factors \(x = p_1^{e_1}\ldots p_n^{e_n}\) with the representation \([(p_1, e_1) \ldots (p_n, e_n)]\)

unfactor :: [(a, Int)] -> a Source #

unfactor f

Find x which has the unique factorization f.

Instances

Instances details
UFD Fmpz Source # 
Instance details

Defined in Data.Number.Flint.Fmpz.Instances

Methods

factor :: Fmpz -> [(Fmpz, Int)] Source #

unfactor :: [(Fmpz, Int)] -> Fmpz Source #

UFD FmpzPoly Source # 
Instance details

Defined in Data.Number.Flint.Fmpz.Poly.Instances

UFD NModPoly Source # 
Instance details

Defined in Data.Number.Flint.NMod.Poly.Instances