libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::dyn Namespace Reference

Namespaces

namespace  basic
 
namespace  builtin
 
namespace  lookup
 
namespace  private_
 
namespace  unroll
 

Classes

struct  fibonacci
 

Typedefs

typedef std::vector< unsigned long long > primes_colln
 

Functions

primes_colln sieve_of_eratosthenes (primes_colln::size_type max_num) noexcept(false)
 Find all of the prime numbers in the range [2...max_num) using the Sieve of Eratosthenes. More...
 

Typedef Documentation

◆ primes_colln

typedef std::vector<unsigned long long> jmmcg::LIBJMMCG_VER_NAMESPACE::dyn::primes_colln

Definition at line 28 of file prime_numbers.hpp.

Function Documentation

◆ sieve_of_eratosthenes()

primes_colln jmmcg::LIBJMMCG_VER_NAMESPACE::dyn::sieve_of_eratosthenes ( primes_colln::size_type  max_num)
inlinenoexcept

Find all of the prime numbers in the range [2...max_num) using the Sieve of Eratosthenes.

Complexity: time: O(n(log(log(n))))

Parameters
max_numThe largest number in the range up to which the primes should be found.
Returns
The primes within the range [2...max_num).

Definition at line 38 of file prime_numbers.hpp.