Safe Haskell | None |
---|---|
Language | Haskell2010 |
Math.Prime.FastSieve
- generatePrimes :: forall ty. Prime ty => Word64 -> Word64 -> IO (UArray ty)
- generateNPrimes :: forall ty. Prime ty => Word64 -> Word64 -> IO (UArray ty)
- nthPrime :: Int64 -> Word64 -> Word64
- countPrimes :: Word64 -> Word64 -> Word64
- countTwins :: Word64 -> Word64 -> Word64
- countTriplets :: Word64 -> Word64 -> Word64
- countQuadruplets :: Word64 -> Word64 -> Word64
- countQuintuplets :: Word64 -> Word64 -> Word64
- countSextuplets :: Word64 -> Word64 -> Word64
- printPrimes :: Word64 -> Word64 -> IO ()
- printTwins :: Word64 -> Word64 -> IO ()
- printTriplets :: Word64 -> Word64 -> IO ()
- printQuadruplets :: Word64 -> Word64 -> IO ()
- printQuintuplets :: Word64 -> Word64 -> IO ()
- printSextuplets :: Word64 -> Word64 -> IO ()
- getMaxStop :: Word64
- setSieveSize :: Int -> IO ()
- setNumThreads :: Int -> IO ()
- primesieveVersion :: IO String
Documentation
Get an array with the primes inside the interval [start, stop].
Get an array with the first n primes >= start.
Find the nth prime.
- if n = 0 finds the 1st prime >= start,
- if n > 0 finds the nth prime > start,
- if n < 0 finds the nth prime < start (backwards).
Count the primes within the interval [start, stop].
Count the twins within the interval [start, stop].
Count the triplets within the interval [start, stop].
Count the quadruplets within the interval [start, stop].
Count the quintuplets within the interval [start, stop].
Count the sextuplets within the interval [start, stop].
Print the primes within the interval [start, stop] to the standard output.
Print the prime twins within the interval [start, stop] to the standard output.
Print the prime triplets within the interval [start, stop] to the standard output.
Print the prime quadruplets within the interval [start, stop] to the standard output.
Print the prime quintuplets within the interval [start, stop] to the standard output.
Print the prime sextuplets within the interval [start, stop] to the standard output.
getMaxStop :: Word64 Source #
Returns the largest valid stop number for primesieve, 2^64-1 (UINT64_MAX).
setSieveSize :: Int -> IO () Source #
Set the sieve size in kilobytes. The best sieving performance is achieved with a sieve size of your CPU's L1 or L2 cache size (per core).
setNumThreads :: Int -> IO () Source #
Set the number of threads for use in primesieve_count_*() and primesieve_nth_prime(). By default all CPU cores are used.
primesieveVersion :: IO String Source #
Get the primesieve version number, in the form "i.j".