Crate algebraic_equation_over_finite_prime_field

Source
Expand description

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);

Structs§

Traits§

Functions§