primesieve  6.1
Namespaces | Macros | Functions
primesieve.hpp File Reference

primesieve C++ API. More...

#include <primesieve/PrimeSieve.hpp>
#include <primesieve/primesieve_error.hpp>
#include <primesieve/iterator.hpp>
#include <primesieve/StorePrimes.hpp>
#include <stdint.h>
#include <vector>
#include <string>
Include dependency graph for primesieve.hpp:

Namespaces

 primesieve
 Contains primesieve's C++ functions and classes.
 

Macros

#define PRIMESIEVE_VERSION   "6.1"
 
#define PRIMESIEVE_VERSION_MAJOR   6
 
#define PRIMESIEVE_VERSION_MINOR   1
 

Functions

template<typename T >
void primesieve::generate_primes (uint64_t stop, std::vector< T > *primes)
 Store the primes <= stop in the primes vector.
 
template<typename T >
void primesieve::generate_primes (uint64_t start, uint64_t stop, std::vector< T > *primes)
 Store the primes within the interval [start, stop] in the primes vector.
 
template<typename T >
void primesieve::generate_n_primes (uint64_t n, std::vector< T > *primes)
 Store the first n primes in the primes vector.
 
template<typename T >
void primesieve::generate_n_primes (uint64_t n, uint64_t start, std::vector< T > *primes)
 Store the first n primes >= start in the primes vector.
 
uint64_t primesieve::nth_prime (int64_t n, uint64_t start=0)
 Find the nth prime. More...
 
uint64_t primesieve::count_primes (uint64_t start, uint64_t stop)
 Count the primes within the interval [start, stop]. More...
 
uint64_t primesieve::count_twins (uint64_t start, uint64_t stop)
 Count the twin primes within the interval [start, stop]. More...
 
uint64_t primesieve::count_triplets (uint64_t start, uint64_t stop)
 Count the prime triplets within the interval [start, stop]. More...
 
uint64_t primesieve::count_quadruplets (uint64_t start, uint64_t stop)
 Count the prime quadruplets within the interval [start, stop]. More...
 
uint64_t primesieve::count_quintuplets (uint64_t start, uint64_t stop)
 Count the prime quintuplets within the interval [start, stop]. More...
 
uint64_t primesieve::count_sextuplets (uint64_t start, uint64_t stop)
 Count the prime sextuplets within the interval [start, stop]. More...
 
void primesieve::print_primes (uint64_t start, uint64_t stop)
 Print the primes within the interval [start, stop] to the standard output.
 
void primesieve::print_twins (uint64_t start, uint64_t stop)
 Print the twin primes within the interval [start, stop] to the standard output.
 
void primesieve::print_triplets (uint64_t start, uint64_t stop)
 Print the prime triplets within the interval [start, stop] to the standard output.
 
void primesieve::print_quadruplets (uint64_t start, uint64_t stop)
 Print the prime quadruplets within the interval [start, stop] to the standard output.
 
void primesieve::print_quintuplets (uint64_t start, uint64_t stop)
 Print the prime quintuplets within the interval [start, stop] to the standard output.
 
void primesieve::print_sextuplets (uint64_t start, uint64_t stop)
 Print the prime sextuplets within the interval [start, stop] to the standard output.
 
uint64_t primesieve::get_max_stop ()
 Returns the largest valid stop number for primesieve. More...
 
int primesieve::get_sieve_size ()
 Get the current set sieve size in kilobytes.
 
int primesieve::get_num_threads ()
 Get the current set number of threads.
 
void primesieve::set_sieve_size (int sieve_size)
 Set the sieve size in kilobytes. More...
 
void primesieve::set_num_threads (int num_threads)
 Set the number of threads for use in primesieve::count_*() and primesieve::nth_prime(). More...
 
std::string primesieve::primesieve_version ()
 Get the primesieve version number, in the form “i.j”.
 

Detailed Description

primesieve C++ API.

primesieve is a library for fast prime number generation, in case an error occurs a primesieve::primesieve_error exception (derived form std::runtime_error) will be thrown.

Copyright (C) 2017 Kim Walisch, kim.w.nosp@m.alis.nosp@m.ch@gm.nosp@m.ail..nosp@m.com

This file is distributed under the BSD License.