Class euler_sieve_sqrt

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class euler_sieve_sqrt : public madlib::primes_interface<euler_sieve_sqrt>

The core Euler Sieve implementation.

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

Subclassed by madlib::primes< euler_sieve_sqrt >, madlib::primes< PRIMES_IMPLEMENTATION >

Public Functions

inline euler_sieve_sqrt()

Just default initialize members.

inline explicit euler_sieve_sqrt(const unsigned_integral auto &initially_through)

Construct primes object pre-calculating at least through initially_through.

inline euler_sieve_sqrt &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.