From 618fd3d6ba27f041fbba780111923578d4c84de9 Mon Sep 17 00:00:00 2001 From: Kim Walisch Date: Sat, 9 Nov 2024 09:42:48 +0100 Subject: [PATCH] Update doc --- include/primesieve/PreSieve_Tables.hpp | 2 +- src/README.md | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/primesieve/PreSieve_Tables.hpp b/include/primesieve/PreSieve_Tables.hpp index de6eaf96a..0496d0398 100644 --- a/include/primesieve/PreSieve_Tables.hpp +++ b/include/primesieve/PreSieve_Tables.hpp @@ -1,5 +1,5 @@ /// -/// @file PreSieve_Table.hpp +/// @file PreSieve_Tables.hpp /// @brief Pre-sieve multiples of small primes < 100 to speed up the /// sieve of Eratosthenes. The idea is to allocate several /// arrays (buffers_) and remove the multiples of small primes diff --git a/src/README.md b/src/README.md index 7bf036b52..72720be33 100644 --- a/src/README.md +++ b/src/README.md @@ -52,12 +52,14 @@ buckets and only when there are no more buckets in the stock the MemoryPool will allocate new buckets. -* **PreSieve** is used to pre-sieve multiples of small primes < 100 - to speed up the sieve of Eratosthenes. Upon creation the - multiples of small primes are removed from multiple buffers. Then - whilst sieving, we perform a bitwise AND on the buffer arrays - and store the result in the sieve array. Pre-sieving provides a - speedup of up to 30% when sieving the primes < 10^10. +* **PreSieve** is used to pre-sieve multiples of small primes < 100 to speed + up the sieve of Eratosthenes. The ```PreSieve_Tables.hpp``` header contains + 8 static lookup tables which have been sieved using the primes < 100. Each + of these lookup tables has a size of about 32 kilobytes and the total size + of all pre-sieve lookup tables is about 200 kilobytes. Whilst sieving, we + perform a bitwise AND of the pre-sieve lookup tables and store the result in + the sieve array. Pre-sieving provides a speedup of up to 30% when sieving + the primes < 10^10. * **SievingPrimes** is used to generate the sieving primes ≤ sqrt(stop). SievingPrimes is used by the CountPrintPrimes and PrimeGenerator classes.