|
Project Euler Solutions
|
#include <primes.h>


Public Member Functions | |
| prime_sieve | prime_sieve0 () |
| The constructor for the prime number sieve. More... | |
Public Attributes | |
| prime_counter | source |
| The source of new reference prime numbers. More... | |
| uintmax_t | prime_squared |
| The reference prime squared. More... | |
| uintmax_t | prime: (sizeof(uintmax_t) * 4) |
| The current reference prime. More... | |
| size_t | sieve_len: (sizeof(size_t) * 8 - 1) |
| The length of the sieve state (divided by 2) More... | |
| uintmax_t * | sieve |
| The sieve state used to generate new primes stored as pairs of [value, step]. More... | |
| uintmax_t | candidate |
| The current candidate prime number. More... | |
Public Attributes inherited from c::include::iterator::Iterator | |
| bool | exhausted: 1 |
| An indicator that the iterator has stopped. More... | |
| bool | started: 1 |
| An indicator that the iterator has started. More... | |
| bool | phase: 1 |
| An indicator that changes each time the iterator moves. More... | |
Private Member Functions | |
| void | free_prime_sieve (prime_sieve *ps) |
| The destructor for the prime number sieve. More... | |
| uintmax_t | advance_prime_sieve (prime_sieve *ps) |
| The function to advance a prime sieve iterator. More... | |
Private Attributes | |
| uintmax_t(*const | iterator_function )(prime_sieve *it) |
| The pointer to the iteration function. More... | |
| void(*const | destructor )(void *it) |
| The pointer to the destructor function. More... | |
Additional Inherited Members | |
Related Functions inherited from c::include::iterator::Iterator | |
| #define | IteratorTail(return_type, struct_type) |
| The base definition macro for all iterators in this project. More... | |
| #define | IterationHead(it) |
| The base macro for all iteration functions in this project. More... | |
| #define | IteratorInitHead(advance, ...) {.iterator_function = &advance, AddDestructor(no_destructor), __VA_ARGS__} |
| The base macro for all iterator initialization functions in this project. More... | |
| #define | AddDestructor(func) ExtendInit(destructor, (void (*const)(void *)) &func) |
| The extension macro for initializing Iterators with a destructor. More... | |
| #define | ExtendInit(name, value) .name = value |
| The extension macro for initializing more complicated Iterators. More... | |
| #define | next(state) (*(state.iterator_function))(&state) |
| The macro to advance generic iterators. More... | |
| #define | next_p(state) (*(state->iterator_function))(state) |
| The macro to advance generic iterator pointers. More... | |
| #define | free_iterator(it) (*(it.destructor))(&it) |
| The generic destructor for iterators. More... | |
| #define | free_iterator_p(it) (*(it->destructor))(it) |
| The generic destructor for iterator pointers. More... | |
The iterator that implements a modified sieve of eratosthenes
|
private |
The function to advance a prime sieve iterator.
| ps | the sieve you want to advance |
|
private |
The destructor for the prime number sieve.
| prime_sieve prime_sieve0 | ( | ) |
The constructor for the prime number sieve.

| uintmax_t c::include::primes::prime_sieve::candidate |
The current candidate prime number.
|
private |
The pointer to the destructor function.
|
private |
The pointer to the iteration function.
| uintmax_t c::include::primes::prime_sieve::prime |
The current reference prime.
| uintmax_t c::include::primes::prime_sieve::prime_squared |
The reference prime squared.
| uintmax_t* c::include::primes::prime_sieve::sieve |
The sieve state used to generate new primes stored as pairs of [value, step].
| size_t c::include::primes::prime_sieve::sieve_len |
The length of the sieve state (divided by 2)
| prime_counter c::include::primes::prime_sieve::source |
The source of new reference prime numbers.
1.8.11