All Classes, Interfaces, Objects and Records

Name Unit Description
primesieve_iterator primesieve

primesieve_iterator allows to easily iterate over primes both forwards and backwards. Generating the first prime has a complexity of O(r log log r) operations with r = nˆ0.5, after that any additional prime is generated in amortized O(log n log log n) operations. The memory usage is about PrimePi(nˆ0.5) * 8 bytes.

The primesieve_iterator.pas example shows how to use primesieve_iterator. If any error occurs primesieve_next_prime and primesieve_prev_prime return _PRIMESIEVE_ERROR. Furthermore primesieve_iterator.is_error is initialized to 0 and set to 1 if any error occurs.

tuplets_iterator primesieve

tuplets_iterator allows to iterate over prime tuplets. Functions tuplets_next_twin, tuplets_next_triplet, ..., tuplets_next_sextuplet can be called in any order. Each successful call to tuplets_next_* stores prime tuplet sequence into array tuplets_iterator.tail and returns last element of tuplet.

The printlets_it.pas example shows how to use tuplets_iterator. If any error occurs tuplets_next_* functions return _PRIMESIEVE_ERROR. Furthermore tuplets_iterator.iterator.is_error is initialized to 0 and set to 1 if any error occurs.


Generated by PasDoc 0.16.0.