Safe Haskell | None |
---|
Documentation
class (Ring r, DecidableZero r, DecidableUnits r, Domain r) => Euclidean r whereSource
splitUnit :: r -> (r, r)Source
splitUnit r
calculates its leading unit and normal form.
let (u, n) = splitUnit r in r == u * n && fst (splitUnit n) == one && isUnit u
degree :: r -> Maybe NaturalSource
Euclidean (degree) function on r
.
:: r | elements divided by |
-> r | divisor |
-> (r, r) | quotient and remin |
Division algorithm. a
calculates
quotient and reminder of divide
ba
divided by b
.
let (q, r) = divide a p in p*q + r == a && degree r < degree q
calculates greatest common divisor of gcd
a ba
and b
.
euclid :: r -> r -> [(r, r, r)]Source
Extended euclidean algorithm.
euclid f g == xs ==> all (\(r, s, t) -> r == f * s + g * t) xs
leadingUnit :: Euclidean r => r -> rSource
:: Euclidean r | |
=> [(r, r)] | List of |
-> r |
|