diff options
author | kwantam <kwantam@gmail.com> | 2015-04-29 19:24:20 -0400 |
---|---|---|
committer | kwantam <kwantam@gmail.com> | 2015-05-07 18:12:32 -0400 |
commit | 6c4e967fc666a7b40000c7cb271b5b3b448c3e0c (patch) | |
tree | 8fbf4e7fe90b3034471961cd9495e0322d85c6d4 /.gitignore | |
parent | 06b70877db5d48c919c31d8e4238fe1c64740c26 (diff) |
fix and slight optimization for `factor`
This commit builds upon @wikol's Pollard rho implementation.
It adds the following:
1. A generator for prime inverse tables. With these, we can do
very fast divisibility tests (a single multiply and comparison)
for small primes (presently, the first 1000 primes are in the
table, which means all numbers of ~26 bits or less can be
factored very quickly.
2. Always try prime inverse tables before jumping into Pollard's
rho method or using trial division.
3. Since we have eliminated all small factors by the time we're
done with the table division, only use slow trial division when
the number is big enough to cause overflow issues in Pollard's
rho, and jump out of trial division and into Pollard's rho as
soon as the number is small enough.
4. Updates the Makefile to regenerate the prime table if it's not
up-to-date.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index a2f1da53e..c40dace37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/src/*/gen_table /build/ /target/ /tmp/ |