Skip to content

Commit 59ea4b9

Browse files
committed
compatibility with gcc 14.2
1 parent 5239fba commit 59ea4b9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cp-algo/math/sieve.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
CP_ALGO_BIT_PRAGMA_PUSH
1515
namespace cp_algo::math {
1616
using cp_algo::structures::dynamic_bit_array;
17+
using cp_algo::structures::bit_array;
1718

1819
constexpr size_t base_threshold = 1 << 21;
1920

@@ -39,7 +40,7 @@ namespace cp_algo::math {
3940
}();
4041

4142
const auto base_primes = []() {
42-
cp_algo::big_vector<uint32_t> primes;
43+
big_vector<uint32_t> primes;
4344
for(uint32_t i = 3; to_ord(i) < base_threshold; i += 2) {
4445
if (base_prime_bits[to_ord(i)]) {
4546
primes.push_back(i);
@@ -50,7 +51,7 @@ namespace cp_algo::math {
5051

5152
constexpr size_t sqrt_threshold = 1 << 16;
5253
const auto sqrt_primes = std::span(
53-
begin(base_primes),
54+
base_primes.begin(),
5455
std::ranges::upper_bound(base_primes, sqrt_threshold)
5556
);
5657

@@ -60,7 +61,7 @@ namespace cp_algo::math {
6061
uint32_t product;
6162
};
6263

63-
auto make_wheel(std::vector<uint32_t> primes, uint32_t product) {
64+
auto make_wheel(big_vector<uint32_t> primes, uint32_t product) {
6465
assert(product % (2 * dynamic_bit_array::width) == 0);
6566
wheel_t wheel;
6667
wheel.product = product;
@@ -77,8 +78,8 @@ namespace cp_algo::math {
7778
auto medium_primes = sqrt_primes;
7879
const auto wheels = []() {
7980
uint32_t product = 2 * dynamic_bit_array::width;
80-
std::vector<uint32_t> current;
81-
std::vector<wheel_t> wheels;
81+
big_vector<uint32_t> current;
82+
big_vector<wheel_t> wheels;
8283
for(size_t i = 0; i < size(sqrt_primes); i++) {
8384
uint32_t p = sqrt_primes[i];
8485
if (product * p > max_wheel_size) {

0 commit comments

Comments
 (0)