|
| uint64_t | LMCAS::modular_detail::abs_to_u64 (int64_t value) |
| bool | LMCAS::modular_detail::checked_positive_product (int64_t a, int64_t b, int64_t &out) |
| std::pair< int64_t, int64_t > | LMCAS::crt (int64_t r1, int64_t m1, int64_t r2, int64_t m2) |
| | 中国剩余定理(两模数),返回规范余数与模数乘积。
|
| CrtResult | LMCAS::crt_checked (int64_t r1, int64_t m1, int64_t r2, int64_t m2) |
| CrtResult | LMCAS::crt_checked (int64_t r1, int64_t m1, int64_t r2, int64_t m2, ComputationContext &context) |
| | Checked Chinese remainder theorem for two positive coprime moduli.
|
| int64_t | LMCAS::extended_gcd (int64_t a, int64_t b, int64_t &s, int64_t &t) |
| | 用扩展欧几里得算法求 gcd(a,b) 及 Bezout 系数。
|
| std::vector< int64_t > | LMCAS::generate_good_primes (int count, const std::vector< BigInt > &leading_coeffs, uint64_t start_from=UINT64_C(1000000000)) |
| | 生成指定数量的好素数
|
| bool | LMCAS::is_good_prime (int64_t p, const std::vector< BigInt > &leading_coeffs) |
| | 判断素数 p 是否为"好素数"(不整除任何首项系数)
|
| uint64_t | LMCAS::lammp_gcd (uint64_t a, uint64_t b) |
| | 计算两个无符号整数的最大公约数(调用 LMMP)
|
| bool | LMCAS::lammp_is_prime (uint64_t n) |
| | 判断无符号整数是否为素数
|
| uint64_t | LMCAS::lammp_next_prime (uint64_t n) |
| | 求大于 n 的下一个素数
|
| std::pair< int64_t, int64_t > | LMCAS::multi_crt (const std::vector< int64_t > &residues, const std::vector< int64_t > &primes) |
| | 多模数中国剩余定理
|
| CrtResult | LMCAS::multi_crt_checked (const std::vector< int64_t > &residues, const std::vector< int64_t > &primes) |
| CrtResult | LMCAS::multi_crt_checked (const std::vector< int64_t > &residues, const std::vector< int64_t > &primes, ComputationContext &context) |
| | Checked CRT for a non-empty list of pairwise coprime positive moduli.
|
| RationalReconstructionResult | LMCAS::rational_reconstruction_checked (int64_t x, int64_t m) |
| RationalReconstructionResult | LMCAS::rational_reconstruction_checked (int64_t x, int64_t m, ComputationContext &context) |
| | Checked rational reconstruction.
|
模运算工具:ModInt 类、扩展欧几里得、CRT、有理重构。
在文件 modular_arithmetic.hpp 中定义.