primesieve-0.1.0.1: FFI bindings for the primesieve library.

Math.Prime.FastSieve

Synopsis

Documentation

Arguments

 :: Prime ty => Word64 start -> Word64 end -> IO (UArray ty)

Get an array with the primes inside the interval [start, stop].

Arguments

 :: Prime ty => Word64 n -> Word64 start -> IO (UArray ty)

Get an array with the first n primes >= start.

Arguments

 :: Int64 n -> Word64 start -> Word64

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).

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the primes within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the twins within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the triplets within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the quadruplets within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the quintuplets within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> Word64

Count the sextuplets within the interval [start, stop].

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the primes within the interval [start, stop] to the standard output.

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the prime twins within the interval [start, stop] to the standard output.

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the prime triplets within the interval [start, stop] to the standard output.

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the prime quadruplets within the interval [start, stop] to the standard output.

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the prime quintuplets within the interval [start, stop] to the standard output.

Arguments

 :: Word64 start -> Word64 end -> IO ()

Print the prime sextuplets within the interval [start, stop] to the standard output.

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).

Set the number of threads for use in primesieve_count_*() and primesieve_nth_prime(). By default all CPU cores are used.

Get the primesieve version number, in the form "i.j".