openGPMP
Open Source Mathematics Package
|
#include <prime_test.hpp>
Public Member Functions | |
bool | is_prime (uint64_t n) |
Determine if an integer is prime. More... | |
bool | compute_miller_rabin (uint64_t d, uint64_t n) |
Algorithm determining liklihood a number is prime. More... | |
bool | miller_rabin_prime (uint64_t n, uint64_t iters) |
Modified primes algorithm. More... | |
void | miller_rabin (uint64_t iters, uint64_t min_val, uint64_t max_val) |
Miller-Rabin driver, prints values that satisfy conditions. More... | |
bool | witness (uint64_t n, uint64_t d, uint64_t a, uint64_t s) |
bool | AKS (uint64_t n) |
uint64_t | jacobian_number (uint64_t a, uint64_t n) |
bool | solovoy_strassen (uint64_t p, uint64_t iters) |
uint64_t | mod_mul (uint64_t a, uint64_t b, uint64_t m) |
uint64_t | mod_pow (uint64_t a, uint64_t b, uint64_t m) |
bool | carmichael_num (uint64_t n) |
uint64_t | ETF (uint64_t n) |
Primality Class dealing with prime number manipulations
Definition at line 50 of file prime_test.hpp.
bool gpmp::PrimalityTest::AKS | ( | uint64_t | n | ) |
Definition at line 226 of file prime_test.cpp.
bool gpmp::PrimalityTest::carmichael_num | ( | uint64_t | n | ) |
Definition at line 349 of file prime_test.cpp.
References ba, and gpmp::Basics::op_gcd().
Referenced by main().
bool gpmp::PrimalityTest::compute_miller_rabin | ( | uint64_t | d, |
uint64_t | n | ||
) |
Algorithm determining liklihood a number is prime.
[in] | d | : target number (uint64_t) |
[in] | n | : target - 1 (uint64_t) |
Definition at line 119 of file prime_test.cpp.
uint64_t gpmp::PrimalityTest::ETF | ( | uint64_t | n | ) |
bool gpmp::PrimalityTest::is_prime | ( | uint64_t | n | ) |
Determine if an integer is prime.
[in] | n | : any number (uint64_t) |
Definition at line 102 of file prime_test.cpp.
Referenced by main().
uint64_t gpmp::PrimalityTest::jacobian_number | ( | uint64_t | a, |
uint64_t | n | ||
) |
Definition at line 275 of file prime_test.cpp.
void gpmp::PrimalityTest::miller_rabin | ( | uint64_t | iters, |
uint64_t | min_val, | ||
uint64_t | max_val | ||
) |
Miller-Rabin driver, prints values that satisfy conditions.
[in] | iters | : iterations determine accuracy (uint64_t) |
[in] | min_val | : bottom end of range (uint64_t) |
[in] | max_val | : top end of range (uint64_t) |
[out] | result | : values within range that satisfy |
Definition at line 207 of file prime_test.cpp.
Referenced by main().
bool gpmp::PrimalityTest::miller_rabin_prime | ( | uint64_t | n, |
uint64_t | iters = 10 |
||
) |
Modified primes algorithm.
[in] | n | : target number (uint64_t) |
[in] | iters | : iterations determine accuracy (uint64_t) |
return true/false (bool)
Definition at line 183 of file prime_test.cpp.
Referenced by main(), testing_miller(), and testing_new_miller().
uint64_t gpmp::PrimalityTest::mod_mul | ( | uint64_t | a, |
uint64_t | b, | ||
uint64_t | m | ||
) |
uint64_t gpmp::PrimalityTest::mod_pow | ( | uint64_t | a, |
uint64_t | b, | ||
uint64_t | m | ||
) |
Definition at line 72 of file prime_test.cpp.
References python.linalg::res.
Referenced by gpmp::Logarithms::BSGS(), main(), and gpmp::Factorization::pollard_rho().
bool gpmp::PrimalityTest::solovoy_strassen | ( | uint64_t | p, |
uint64_t | iters | ||
) |
Definition at line 325 of file prime_test.cpp.
Referenced by main().
bool gpmp::PrimalityTest::witness | ( | uint64_t | n, |
uint64_t | d, | ||
uint64_t | a, | ||
uint64_t | s | ||
) |
Definition at line 166 of file prime_test.cpp.