16
16
namespace boost { namespace math {
17
17
18
18
template <class Policy >
19
- BOOST_MATH_CONSTEXPR_TABLE_FUNCTION std::uint32_t prime (unsigned n, const Policy& pol)
19
+ inline std::uint32_t prime (unsigned n, const Policy& pol)
20
20
{
21
21
//
22
22
// This is basically three big tables which together
@@ -26,29 +26,20 @@ namespace boost{ namespace math{
26
26
// That gives us the first 10000 primes with the largest
27
27
// being 104729:
28
28
//
29
- # ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES
29
+
30
30
constexpr unsigned b1 = 53 ;
31
31
constexpr unsigned b2 = 6541 ;
32
32
constexpr unsigned b3 = 10000 ;
33
- constexpr std::array<unsigned char , 54 > a1 = {{
34
- #else
35
- static const unsigned b1 = 53 ;
36
- static const unsigned b2 = 6541 ;
37
- static const unsigned b3 = 10000 ;
38
33
static const std::array<unsigned char , 54 > a1 = {{
39
- #endif
40
34
2u , 3u , 5u , 7u , 11u , 13u , 17u , 19u , 23u , 29u , 31u ,
41
35
37u , 41u , 43u , 47u , 53u , 59u , 61u , 67u , 71u , 73u ,
42
36
79u , 83u , 89u , 97u , 101u , 103u , 107u , 109u , 113u ,
43
37
127u , 131u , 137u , 139u , 149u , 151u , 157u , 163u ,
44
38
167u , 173u , 179u , 181u , 191u , 193u , 197u , 199u ,
45
39
211u , 223u , 227u , 229u , 233u , 239u , 241u , 251u
46
40
}};
47
- #ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES
48
- constexpr std::array<std::uint16_t , 6488 > a2 = {{
49
- #else
41
+
50
42
static const std::array<std::uint16_t , 6488 > a2 = {{
51
- #endif
52
43
257u , 263u , 269u , 271u , 277u , 281u , 283u , 293u ,
53
44
307u , 311u , 313u , 317u , 331u , 337u , 347u , 349u , 353u ,
54
45
359u , 367u , 373u , 379u , 383u , 389u , 397u , 401u , 409u ,
@@ -771,11 +762,8 @@ namespace boost{ namespace math{
771
762
65323u , 65327u , 65353u , 65357u , 65371u , 65381u , 65393u , 65407u , 65413u ,
772
763
65419u , 65423u , 65437u , 65447u , 65449u , 65479u , 65497u , 65519u , 65521u
773
764
}};
774
- #ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES
775
- constexpr std::array<std::uint16_t , 3458 > a3 = {{
776
- #else
765
+
777
766
static const std::array<std::uint16_t , 3458 > a3 = {{
778
- #endif
779
767
2u , 4u , 8u , 16u , 22u , 28u , 44u ,
780
768
46u , 52u , 64u , 74u , 82u , 94u , 98u , 112u ,
781
769
116u , 122u , 142u , 152u , 164u , 166u , 172u , 178u ,
@@ -1223,12 +1211,12 @@ namespace boost{ namespace math{
1223
1211
return static_cast <std::uint32_t >(a3[n - b2 - 1 ]) + 0xFFFFu ;
1224
1212
}
1225
1213
1226
- inline BOOST_MATH_CONSTEXPR_TABLE_FUNCTION std::uint32_t prime (unsigned n)
1214
+ inline std::uint32_t prime (unsigned n)
1227
1215
{
1228
1216
return boost::math::prime (n, boost::math::policies::policy<>());
1229
1217
}
1230
1218
1231
- static const unsigned max_prime = 9999 ;
1219
+ constexpr unsigned max_prime = 9999 ;
1232
1220
1233
1221
}} // namespace boost and math
1234
1222
0 commit comments