Crates.io | algebraic-equation-over-finite-prime-field |
lib.rs | algebraic-equation-over-finite-prime-field |
version | 0.2.1 |
source | src |
created_at | 2021-05-05 12:10:21.367762 |
updated_at | 2021-08-04 16:18:15.152084 |
description | solve algebraic equation over finite prime field |
homepage | |
repository | https://gitlab.com/Toru3/algebraic-equation-over-finite-prime-field |
max_upload_size | |
id | 393422 |
size | 23,115 |
Find roots of polynomial in modulo prime.
use algebraic_equation_over_finite_prime_field::{find_all_roots_over_mod_p, PolynomialOverP};
// (x^2+2)(x-1)(x-3)≡x^4+x^3+2x+1 (mod 5)
let p = PolynomialOverP::<i32>::new(vec![1, 2, 0, 1, 1], 5);
let mut v = find_all_roots_over_mod_p::<i32>(p);
v.sort();
assert_eq!(vec![1, 3], v);
AGPL-3.0-or-later