Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data GF' p n f
- class (KnownNat n, KnownNat p, Reifies f (Unipol (F p))) => IsGF' p n f
- modPoly :: forall p n f. (KnownNat n, Reifies p Integer) => Unipol (F p) -> GF' p n f
- modVec :: Sized n (F p) -> GF' p n f
- withIrreducible :: forall p a. KnownNat p => Unipol (F p) -> (forall f n. Reifies f (Unipol (F p)) => Proxy (GF' p n f) -> a) -> a
- linearRepGF :: GF' p n f -> Vector (F p)
- linearRepGF' :: GF' p n f -> Vector Integer
- reifyGF' :: MonadRandom m => Natural -> Natural -> (forall p f n. (Reifies p Integer, Reifies f (Unipol (F p))) => Proxy (GF' p n f) -> a) -> m a
- generateIrreducible :: (MonadRandom m, FiniteField k, Eq k) => proxy k -> Natural -> m (Unipol k)
- withGF' :: MonadRandom m => Natural -> Natural -> (forall p f n. (Reifies p Integer, Reifies f (Unipol (F p))) => GF' p n f) -> m (Vector Integer)
- type GF p n = GF' p n (Conway p n)
- class ConwayPolynomial p n where
- data Conway p n
- primitive :: forall p n f. IsGF' p n f => GF' p (n + 1) f
- conway :: forall p n. ConwayPolynomial p n => SNat p -> SNat n -> Unipol (F p)
- conwayFile :: FilePath -> DecsQ
- addConwayPolynomials :: [(Integer, Integer, [Integer])] -> DecsQ
Documentation
Galois field of order p^n
.
f
stands for the irreducible polynomial over F_p
of degree n
.
class (KnownNat n, KnownNat p, Reifies f (Unipol (F p))) => IsGF' p n f Source #
Type-constraint synonym to work with Galois field.
withIrreducible :: forall p a. KnownNat p => Unipol (F p) -> (forall f n. Reifies f (Unipol (F p)) => Proxy (GF' p n f) -> a) -> a Source #
reifyGF' :: MonadRandom m => Natural -> Natural -> (forall p f n. (Reifies p Integer, Reifies f (Unipol (F p))) => Proxy (GF' p n f) -> a) -> m a Source #
generateIrreducible :: (MonadRandom m, FiniteField k, Eq k) => proxy k -> Natural -> m (Unipol k) Source #
generateIrreducible p n
generates irreducible polynomial over F_p
of degree n
.
withGF' :: MonadRandom m => Natural -> Natural -> (forall p f n. (Reifies p Integer, Reifies f (Unipol (F p))) => GF' p n f) -> m (Vector Integer) Source #
type GF p n = GF' p n (Conway p n) Source #
Galois Field of order p^n
. This uses conway polynomials
as canonical minimal polynomial and it should be known at
compile-time (i.e. Reifies (Conway p n) (Unipol (F n))
instances should be defined to use field operations).
class ConwayPolynomial p n where Source #
Type-class to provide the dictionary for Conway polynomials
conwayPolynomial :: proxy p -> proxy n -> Unipol (F p) Source #
Empty tag to reify Conway polynomial to type-level
conway :: forall p n. ConwayPolynomial p n => SNat p -> SNat n -> Unipol (F p) Source #
Conway polynomial (if definition is known).
conwayFile :: FilePath -> DecsQ Source #
Parse conway polynomial file and define instances for them. File-format must be the same as Lueback's file.