Safe Haskell | None |
---|---|
Language | Haskell2010 |
Classes and helper methods for the Chinese remainder transform and ring extensions.
Documentation
class (Monad mon, Ring r) => CRTrans mon r where Source
A ring that (possibly) supports invertible Chinese remainder transformations of various indices.
The values of crtInfo
for different indices m
should be
consistent, in the sense that if omega
, omega'
are respectively
the roots of unity used for m
, m'
where m
divides m'
, then
it should be the case that omega'^(m'/m)=omega
.
crtInfo :: Reflects m Int => TaggedT m mon (CRTInfo r) Source
CRTInfo
for a given index m
. The method itself may be
slow, but the function it returns should be fast, e.g., via
internal memoization.
CRTrans Maybe Double Source | Returns |
CRTrans Maybe Int Source | Returns |
CRTrans Maybe Int64 Source | Returns |
CRTrans Maybe Integer Source | Returns |
(Monad mon, Transcendental a) => CRTrans mon (Complex a) Source | Complex numbers have |
(CRTrans mon a, CRTrans mon b) => CRTrans mon (a, b) Source | Product ring |
GFCtx k fp d => CRTrans Maybe (GF k fp d) Source | |
(Reflects k q z, ToInteger z, PID z, Enumerable (ZqBasic k q z)) => CRTrans Maybe (ZqBasic k q z) Source |
class (Ring r, Ring (CRTExt r)) => CRTEmbed r where Source
A ring with a ring embedding into some ring CRTExt r
that has
an invertible CRT transformation for every positive index m
.
CRTEmbed Double Source | Embeds into complex numbers |
CRTEmbed Int Source | Embeds into complex numbers |
CRTEmbed Int64 Source | Embeds into complex numbers |
CRTEmbed Integer Source | Embeds into complex numbers. (May not have sufficient precision.) |
Transcendental a => CRTEmbed (Complex a) Source | Self-embed |
(CRTEmbed a, CRTEmbed b) => CRTEmbed (a, b) Source | Product ring |
(Reflects k q z, ToInteger z, Ring (ZqBasic k q z)) => CRTEmbed (ZqBasic k q z) Source | Embeds into complex numbers |