Safe Haskell | None |
---|---|
Language | Haskell2010 |
Small Galois fields via precomputed tables of Zech's logarithms.
https://en.wikipedia.org/wiki/Zech%27s_logarithm
When "creating" a field, we precompute the Zech logarithm table. After that, computations should be fast.
This is practical up to fields of size 10^5 -- 10^6
TODO: also export the tables to C, and write C implementation of of the field operations.
Synopsis
- data ZechTable
- makeZechTable :: forall p m. WitnessGF p m -> ZechTable
- newtype WitnessZech (p :: Nat) (m :: Nat) = WitnessZech {}
- data SomeWitnessZech = forall p m. SomeWitnessZech (WitnessZech p m)
- mkZechField :: Int -> Int -> Maybe SomeWitnessZech
- unsafeZechField :: Int -> Int -> SomeWitnessZech
- data Zech (p :: Nat) (m :: Nat)
Tables of Zech logarithms
makeZechTable :: forall p m. WitnessGF p m -> ZechTable Source #
Witness for the existence of the field
newtype WitnessZech (p :: Nat) (m :: Nat) Source #
Instances
Show (WitnessZech p m) Source # | |
Defined in Math.FiniteField.GaloisField.Zech showsPrec :: Int -> WitnessZech p m -> ShowS # show :: WitnessZech p m -> String # showList :: [WitnessZech p m] -> ShowS # |
data SomeWitnessZech Source #
forall p m. SomeWitnessZech (WitnessZech p m) |
Instances
Show SomeWitnessZech Source # | |
Defined in Math.FiniteField.GaloisField.Zech showsPrec :: Int -> SomeWitnessZech -> ShowS # show :: SomeWitnessZech -> String # showList :: [SomeWitnessZech] -> ShowS # |
mkZechField :: Int -> Int -> Maybe SomeWitnessZech Source #
unsafeZechField :: Int -> Int -> SomeWitnessZech Source #
Field elements
data Zech (p :: Nat) (m :: Nat) Source #