Safe Haskell | None |
---|---|
Language | Haskell98 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Generates the constant bounded list of prime-numbers, using the Sieve of Atkin; http://en.wikipedia.org/wiki/Sieve_of_Atkin.
- cr.yp.to/papers/primesieves-19990826.pdf.
- The implementation;
has been optimised using a wheel of static, but parameterised, size;
has been parallelized;
is polymorphic, but with a specialisation for type
Int
.
CAVEAT
- The
Int
-specialisation is implemented by a rewrite-rule, which is very fragile.
- sieveOfAtkin :: (NFData i, Ix i, Integral i) => NPrimes -> i -> [i]
Types
Data-types
Constants
Functions
:: (NFData i, Ix i, Integral i) | |
=> NPrimes | Other implementations effectively use a hard-coded value either 2 or 3, but 6 seems better. |
-> i | The maximum prime required. |
-> [i] | The bounded list of primes. |
- Generates the constant bounded list of prime-numbers.
- http://cr.yp.to/papers/primesieves-19990826.pdf