Loading [MathJax]/extensions/tex2jax.js
Parallel numerical verification of the σ_odd problem  October 6, 2018
All Classes Namespaces Files Functions Variables Typedefs Macros
primes__inline.hpp
Go to the documentation of this file.
1 /* -*- coding: latin-1 -*- */
2 /** \file common/sigmaodd/primes__inline.hpp (December 11, 2017)
3  *
4  * GPLv3 --- Copyright (C) 2017 Olivier Pirson
5  * http://www.opimedia.be/
6  */
7 
8 #ifndef PROGS_SRC_COMMON_SIGMAODD_PRIMES__INLINE_HPP_
9 #define PROGS_SRC_COMMON_SIGMAODD_PRIMES__INLINE_HPP_
10 
11 
12 namespace sigmaodd {
13 
14  /* *********************
15  * constexpr functions *
16  ***********************/
17 
18  constexpr
19  unsigned int
21  return array_odd_primes_nb_;
22  }
23 
24 
25 #ifdef PRIME16
26  constexpr
27  nat_type
28  potential_prime_offsets_table_modulo() {
29  return array_potential_prime_offsets_modulo_;
30  }
31 #endif
32 
33 
34 #ifdef PRIME16
35  constexpr
36  unsigned int
37  potential_prime_offsets_table_nb() {
38  return array_potential_prime_offsets_nb_;
39  }
40 #endif
41 
42 
43 
44  /* ******************
45  * inline functions *
46  ********************/
47 
48  inline
50  odd_primes_table_by_index(unsigned int i) {
51  assert(i < odd_primes_table_nb());
52 
53  return array_odd_primes_[i];
54  }
55 
56 
57  inline
61  }
62 
63 
64  inline
65  const prime_type*
67  return array_odd_primes_;
68  }
69 
70 
71 #ifdef PRIME16
72  inline
73  nat_type
74  potential_prime_offsets_table_by_index(unsigned int i) {
75  assert(i < potential_prime_offsets_table_nb());
76 
77  return array_potential_prime_offsets_[i];
78  }
79 #endif
80 
81 } // namespace sigmaodd
82 
83 #endif // PROGS_SRC_COMMON_SIGMAODD_PRIMES__INLINE_HPP_
uint64_t nat_type
Type for natural number used in all code, on 64 bits.
Definition: helper.hpp:33
prime_type odd_primes_table_last()
Return the last odd prime number in the precalculated table.
uint32_t prime_type
Type for prime number, particularly for the table of primes.
Definition: primes.hpp:49
A lot of functions and stuffs to deal the sigma_odd problem and related stuffs.
Definition: divisors.cpp:22
const prime_type * odd_primes_table_ptr()
Return a pointer to the first number in the precalculated table.
prime_type odd_primes_table_by_index(unsigned int i)
Return the (i + 1)th odd prime number from the precalculated table.
constexpr unsigned int array_odd_primes_nb_
Number of odd prime numbers in the table array_odd_primes_.
Definition: primes.hpp:85
constexpr unsigned int odd_primes_table_nb()
Return the number of odd prime numbers in the precalculated table.
prime_type * array_odd_primes_
Array of all odd prime numbers < 2^28 with a final 0. (Or < 2^16 if the macro PRIME16 is defined...
Definition: primes.cpp:48