All Functions and Procedures

Name Unit Description
primesieve_count_primes primesieve

Count the primes within the interval [start, stop]. By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

Note that each call to primesieve_count_primes incurs an initialization overhead of O(sqrt(stop)) even if the interval [start, stop] is tiny. Hence if you have written an algorithm that makes many calls to primesieve_count_primes it may be preferable to use a primesieve_iterator which needs to be initialized only once.

primesieve_count_quadruplets primesieve

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

By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

primesieve_count_quintuplets primesieve

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

By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

primesieve_count_sextuplets primesieve

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

By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

primesieve_count_triplets primesieve

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

By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

primesieve_count_twins primesieve

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

By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

primesieve_free primesieve

Deallocate a primes array created using the primesieve_generate_primes or primesieve_generate_n_primes functions.

primesieve_free_iterator primesieve

Free all iterator memory.

primesieve_generate_n_primes primesieve

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

primesieve_generate_primes primesieve

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

primesieve_get_max_stop primesieve

Returns the largest valid stop number for primesieve.

2ˆ64-1 (UINT64_MAX)

primesieve_get_num_threads primesieve

Get the current set number of threads.

primesieve_get_sieve_size primesieve

Get the current set sieve size in KiB.

primesieve_init primesieve

Initialize the primesieve iterator before first using it.

primesieve_next_prime primesieve

Get the next prime.

Returns UINT64_MAX if next prime prime > 2ˆ64.

primesieve_nth_prime primesieve

Find the nth prime. By default all CPU cores are used, use primesieve_set_num_threads to change the number of threads.

Note that each call to primesieve_nth_prime incurs an initialization overhead of O(sqrt(start)) even if n is tiny. Hence it is not a good idea to use primesieve_nth_prime repeatedly in a loop to get the next (or previous) prime. For this use case it is better to use a primesieve_iterator which needs to be initialized only once.

primesieve_prev_prime primesieve

Get the previous prime.

primesieve_prev_prime returns 0 for n <= 2. Note that primesieve_next_prime runs up to 2x faster than primesieve_prev_prime. Hence if the same algorithm can be written using either primesieve_prev_prime or primesieve_next_prime it is preferable to use primesieve_next_prime.

primesieve_print_primes primesieve

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

primesieve_print_quadruplets primesieve

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

primesieve_print_quintuplets primesieve

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

primesieve_print_sextuplets primesieve

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

primesieve_print_triplets primesieve

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

primesieve_print_twins primesieve

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

primesieve_set_num_threads primesieve

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

primesieve_set_sieve_size primesieve

Set the sieve size in KiB (kibibyte). The best sieving performance is achieved with a sieve size of your CPU's L1 or L2 cache size (per core). sieve_size >= 16 and <= 4096

primesieve_skipto primesieve

Reset the primesieve iterator to start.

primesieve_version primesieve

Get the primesieve version number, in the form “i.j”

tuplets_free primesieve

Free all prime tuplets iterator memory.

tuplets_init primesieve

Initialize the prime tuplets iterator before first using it.

tuplets_next_quadruplet primesieve

Get next sequence of four primes of the form (p, p+2, p+6, p+8)

tuplets_next_quintuplet primesieve

Get next sequence of five primes of the form (p, p+2, p+6, p+8, p+12) or (p, p+4, p+6, p+10, p+12)

tuplets_next_sextuplet primesieve

Get next sequence of six primes of the form (p, p+4, p+6, p+10, p+12, p+16)

tuplets_next_triplet primesieve

Get next sequence of three primes of the form (p, p + 2, p + 6) or (p, p + 4, p + 6)

tuplets_next_twin primesieve

Get next sequence of two primes of the form (p, p+2)

tuplets_skipto primesieve

Reset the prime tuplets iterator to start.


Generated by PasDoc 0.16.0.