| Copyright | (c) Ross Paterson 2011 |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | R.Paterson@city.ac.uk |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.YAP.Quadratic.Dirichlet
Contents
Description
An example instance of the algebraic classes: Dirichlet integers (a real quadratic integer ring).
Synopsis
- data Dirichlet a = D a a
- inject :: AdditiveMonoid a => a -> Dirichlet a
- phi :: Semiring a => Dirichlet a
- phiPower :: (Ring a, Integral n) => n -> Dirichlet a
- sqrt5 :: Ring a => Dirichlet a
- stdUnitParts :: (Ord a, Ring a) => Dirichlet a -> (Bool, Int)
- toReal :: Floating a => Dirichlet a -> a
- norm :: Ring a => Dirichlet a -> a
- conjugate :: AbelianGroup a => Dirichlet a -> Dirichlet a
Documentation
D a b represents \(a + b\phi\), where \(\phi = {1 + \sqrt 5 \over 2}\) (the golden ratio). When \(a\) and \(b\) are integers, this is equivalent to the ring \({\Bbb Z}(\phi)\) of algebraic integers of the real quadratic field \({\Bbb Q}(\sqrt 5)\).
Constructors
| D a a |
Instances
Construction
inject :: AdditiveMonoid a => a -> Dirichlet a Source #
Inject the rational part.
phi :: Semiring a => Dirichlet a Source #
The golden ratio \(\phi = {1 + \sqrt 5 \over 2}\), which is the fundamental unit of \({\Bbb Z}(\phi)\).
phiPower :: (Ring a, Integral n) => n -> Dirichlet a Source #
The \(n\)th power of \(\phi\), satisfying \( \phi^n = F_{n-1} + F_n \phi \), where \(F_n\) is the \(n\)th Fibonacci number.
sqrt5 :: Ring a => Dirichlet a Source #
The Dirichlet integer representing \( \sqrt 5 = 2\phi - 1 \).