Class euler_sieve_mult

Inheritance Relationships

Base Type

Class Documentation

class euler_sieve_mult : public madlib::primes_interface<euler_sieve_mult>

The core Euler Sieve implementation.

https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Euler’s_sieve

Public Functions

euler_sieve_mult() = default

Just default initialize members.

inline explicit euler_sieve_mult(const unsigned_integral auto &initially_through)

Construct primes object pre-calculating at least through initially_through.

inline euler_sieve_mult &calculate_primes_through_impl(const unsigned_integral auto &through_value)

Ensure primes in [0,through_value) are calculated.

inline bool is_prime_impl(const unsigned_integral auto &number)

Derermine if number is prime or not.

inline prime_type get_nth_prime_impl(const unsigned_integral auto &n)

Get the nth prime.

inline size_t number_of_mapped_primes_impl()

Return the number of primes currently mapped.

inline prime_type highest_odd_number_mapped_impl()

Return the highest number odd that is mapped for primality.

inline void auto_expand_mapped_primes_impl()

Automatically expand the number of primes mapped by a geometric factor.

inline void map_next_prime_impl()

Map just the next prime.