#include <factorization.hpp>
- Examples
- factors.cpp.
Definition at line 46 of file factorization.hpp.
◆ pollard_rho()
uint64_t gpmp::Factorization::pollard_rho |
( |
uint64_t |
n | ) |
|
- Examples
- factors.cpp.
Definition at line 78 of file factorization.cpp.
81 std::chrono::steady_clock::now().time_since_epoch().count());
94 std::uniform_int_distribution<uint64_t> unif_dist(2, n - 1);
95 uint64_t x = unif_dist(rng);
101 std::uniform_int_distribution<uint64_t> c_dist(1, n - 1);
102 uint64_t c = c_dist(rng);
105 uint64_t divisor = 1;
109 while (divisor == 1) {
127 divisor = std::gcd(std::llabs(x - y), n);
uint64_t pollard_rho(uint64_t n)
uint64_t mod_pow(uint64_t a, uint64_t b, uint64_t m)
gpmp::PrimalityTest __FACT_PRIMES__
References __FACT_PRIMES__, and gpmp::PrimalityTest::mod_pow().
Referenced by main().
The documentation for this class was generated from the following files: