| Safe Haskell | Safe |
|---|---|
| Language | Haskell98 |
Numeric.Domain.Euclidean
Documentation
class PID d => Euclidean d where Source #
Methods
degree :: d -> Maybe Natural Source #
Euclidean (degree) function on r.
degree :: Division d => d -> Maybe Natural Source #
Euclidean (degree) function on r.
Arguments
| :: d | elements divided by |
| -> d | divisor |
| -> (d, d) | quotient and remainder |
Division algorithm. a calculates
quotient and remainder of divide ba divided by b.
let (q, r) = divide a p in p*q + r == a && degree r < degree q
Arguments
| :: Division d | |
| => d | elements divided by |
| -> d | divisor |
| -> (d, d) | quotient and remainder |
Division algorithm. a calculates
quotient and remainder of divide ba divided by b.
let (q, r) = divide a p in p*q + r == a && degree r < degree q
euclid :: Euclidean d => d -> d -> [(d, d, d)] Source #
Extended euclidean algorithm.
euclid f g == xs ==> all (\(r, s, t) -> r == f * s + g * t) xs
Arguments
| :: Euclidean r | |
| => [(r, r)] | List of |
| -> r |
|