arithmoi icon indicating copy to clipboard operation
arithmoi copied to clipboard

WIP Atkin sieve

Open Bodigrim opened this issue 6 years ago • 4 comments

Closes #157

It is already competitive with the existing sieve and is 10 times simpler, but I need to merge more performance patches into https://github.com/Bodigrim/bitvec to make this code really shine.

Bodigrim avatar Sep 24 '19 22:09 Bodigrim

This is more or less ready per se. But unfortunately prime counting is so intimately (and impenetrably) connected to the existing Eratosthenes sieve, that I cannot decomission the latter. That said, this PR is on hold until I disentangle this knot.

Bodigrim avatar Feb 22 '20 19:02 Bodigrim

Hey @Bodigrim,

unfortunately prime counting is so intimately (and impenetrably) connected to the existing Eratosthenes sieve, that I cannot decomission the latter.

I understand that merging this as is without removing the earlier sieve code would just clutter the codebase (even further), but if it's already working with good performance, wouldn't merging it now and making a new PR that proceeds with decoupling the Math.NumberTheory.Primes.Counting API from Math.NumberTheory.Primes.Sieve.Eratosthenes also work?

rockbmb avatar Mar 12 '20 17:03 rockbmb

My main goal here is to make source code more maintainable. I can even agree to worsen performance mildly.

It might happen that I'd never untangle Math.NumberTheory.Primes.Counting. Having two implementations of sieves side-by-side is not something future maintainers would be thankful for ;)

Bodigrim avatar Mar 13 '20 21:03 Bodigrim

@Bodigrim can't say I don't understand. It's already difficult enough maintaining the package as it is - I remember trying to migrate from array to vector, that was challenging.

rockbmb avatar Mar 14 '20 19:03 rockbmb