Skip to content

Commit

Permalink
Update to latest libprimesieve
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Feb 11, 2024
1 parent 251abd3 commit f09f617
Show file tree
Hide file tree
Showing 18 changed files with 757 additions and 811 deletions.
6 changes: 3 additions & 3 deletions lib/primesieve/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.4...3.27)
project(primesieve CXX)
set(PRIMESIEVE_VERSION "11.2")
set(PRIMESIEVE_SOVERSION "11.2.0")
set(PRIMESIEVE_VERSION "11.3")
set(PRIMESIEVE_SOVERSION "11.3.0")

# Build options ######################################################

Expand Down Expand Up @@ -70,11 +70,11 @@ set(LIB_SRC src/api-c.cpp
src/MemoryPool.cpp
src/PrimeGenerator.cpp
src/nthPrime.cpp
src/nthPrimeApprox.cpp
src/ParallelSieve.cpp
src/popcount.cpp
src/PreSieve.cpp
src/PrimeSieve.cpp
src/RiemannR.cpp
src/SievingPrimes.cpp)

# Required includes ##################################################
Expand Down
8 changes: 8 additions & 0 deletions lib/primesieve/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Changes in version 11.3, 10/02/2024
===================================

* Faster Riemann R function implementation #144.
* New -R && --RiemannR command line options.
* New --R-inverse command line option.
* main.cpp: Improve command-line option handling.

Changes in version 11.2, 08/01/2024
===================================

Expand Down
14 changes: 12 additions & 2 deletions lib/primesieve/doc/primesieve.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: primesieve
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 12/02/2022
.\" Date: 02/10/2024
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "PRIMESIEVE" "1" "12/02/2022" "\ \&" "\ \&"
.TH "PRIMESIEVE" "1" "02/10/2024" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -108,6 +108,16 @@ Print primes or prime k\-tuplets, 1 <=
Quiet mode, prints less output\&.
.RE
.PP
\fB\-R, \-\-RiemannR\fR
.RS 4
Approximate PrimePi(x) using the Riemann R function: R(x)\&.
.RE
.PP
\fB\-\-R\-inverse\fR
.RS 4
Approximate the nth prime using the inverse Riemann R function: R^\-1(x)\&.
.RE
.PP
\fB\-s, \-\-size\fR=\fISIZE\fR
.RS 4
Set the size of the sieve array in KiB, 16 <=
Expand Down
6 changes: 6 additions & 0 deletions lib/primesieve/doc/primesieve.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ OPTIONS
*-q, --quiet*::
Quiet mode, prints less output.

*-R, --RiemannR*::
Approximate PrimePi(x) using the Riemann R function: R(x).

*--R-inverse*::
Approximate the nth prime using the inverse Riemann R function: R^-1(x).

*-s, --size*='SIZE'::
Set the size of the sieve array in KiB, 16 \<= 'SIZE' \<= 8192. By default
primesieve uses a sieve size that matches your CPU's L1 cache size (per
Expand Down
4 changes: 2 additions & 2 deletions lib/primesieve/include/primesieve.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef PRIMESIEVE_H
#define PRIMESIEVE_H

#define PRIMESIEVE_VERSION "11.2"
#define PRIMESIEVE_VERSION "11.3"
#define PRIMESIEVE_VERSION_MAJOR 11
#define PRIMESIEVE_VERSION_MINOR 2
#define PRIMESIEVE_VERSION_MINOR 3

#include <primesieve/iterator.h>

Expand Down
4 changes: 2 additions & 2 deletions lib/primesieve/include/primesieve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#ifndef PRIMESIEVE_HPP
#define PRIMESIEVE_HPP

#define PRIMESIEVE_VERSION "11.2"
#define PRIMESIEVE_VERSION "11.3"
#define PRIMESIEVE_VERSION_MAJOR 11
#define PRIMESIEVE_VERSION_MINOR 2
#define PRIMESIEVE_VERSION_MINOR 3

#include <primesieve/iterator.hpp>
#include <primesieve/primesieve_error.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
///
/// @file nthPrimeApprox.hpp
/// @file RiemannR.hpp
///
/// Copyright (C) 2024 Kim Walisch, <[email protected]>
///
/// This file is distributed under the BSD License. See the COPYING
/// file in the top level directory.
///

#include <primesieve/Vector.hpp>
#include <stdint.h>

namespace primesieve {

Vector<int32_t> generate_moebius(int64_t max);
uint64_t Li(uint64_t x);
uint64_t Li_inverse(uint64_t x);
uint64_t Ri(uint64_t x);
uint64_t Ri_inverse(uint64_t x);
long double RiemannR(long double x);
long double RiemannR_inverse(long double x);

uint64_t primePiApprox(uint64_t x);
uint64_t nthPrimeApprox(uint64_t n);

Expand Down
Loading

0 comments on commit f09f617

Please sign in to comment.