Doug Coleman
892c62e1dc
factor: second stab at [ ] [ ] unit-test -> { } [ ] unit-test
2015-07-03 09:39:59 -07:00
Doug Coleman
59f3b1ea57
Revert "factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!"
...
Needs a bit more work.
This reverts commit 7e54cc2824
.
2015-07-02 13:47:06 -07:00
Doug Coleman
7e54cc2824
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
2015-07-02 11:36:08 -07:00
Doug Coleman
999aa7c897
factor: clean up spaces in -tests files
2015-07-02 10:34:01 -07:00
John Benediktsson
fda90b2beb
math.primes.erato: add some comments at the top.
2015-06-17 10:19:00 -07:00
John Benediktsson
8b6c743e02
math.primes.erato.fast: use literals to show how the wheel is calculated.
2015-06-16 18:44:08 -07:00
John Benediktsson
64db5c5bb4
math.primes.erato: faster compressed sieve by two improvements:
...
1) fixnum math in unmark-multiples
2) 3 upper sqrt 2 <range> in sieve
2015-06-16 08:26:48 -07:00
John Benediktsson
7e23c12c0f
math.primes.erato.fast: some bignum fixes and more tests.
2015-06-16 08:20:32 -07:00
John Benediktsson
db42e12853
math.primes.erato.fast: adding fast Sieve of Eratosthenes.
2015-06-15 19:51:02 -07:00
John Benediktsson
34160212d1
math.primes.erato: fix reference to "arr".
2014-12-04 11:52:56 -08:00
John Benediktsson
d5b8f3d3b9
math.primes.erato: fix help-lint.
2014-12-04 11:48:12 -08:00
John Benediktsson
ad71f79be3
math.primes: speedup sieve.
2014-12-04 10:11:32 -08:00
John Benediktsson
eaa19eb36f
math.primes.erato: minor performance improvements.
2012-10-23 10:49:45 -07:00
John Benediktsson
dd2a5729a7
math.primes.erato: bit faster by inlining.
2012-08-23 09:35:09 -07:00
Jon Harper
f60f13c675
math.primes.erato doc fixes.
2010-11-02 17:34:28 +01:00
Rupert Swarbrick
cd28c7a219
math.primes.erato: Fix off-by-one error
...
The sieve bit vector deals with numbers in chunks of 30. Therefore,
the number 90 (say) is the 91st 'element' of the vector. Each byte
deals with some range {0,1,...,29}+30n so to have the number 90, you
need four bytes.
Rather pleasingly, I bumped into this bug and it reduced to the
incantation:
2010 2010 sieve marked-prime?
2010-11-02 17:34:24 +01:00
Slava Pestov
ee1520f683
math.primes.erato: fix typo in docs
2010-10-22 18:26:08 -07:00
Doug Coleman
1d12a6707d
sigma -> map-sum
2009-10-29 14:34:04 -05:00
Doug Coleman
4a3d63e00a
use if-zero in a few more places
2009-08-11 18:15:53 -05:00
Samuel Tardieu
41d804ddbd
Pack primes numbers by slices of 30
...
In any given 30 successive integers greater than 5, there are at most
8 prime numbers. Use this to tightly pack the result of the Eratostene
sieve. This lets us store more prime numbers than before in less space.
2009-06-24 13:15:12 +02:00
Samuel Tardieu
594bd3aee8
Move math.primes from extra to basis
2009-01-07 21:12:48 +01:00