poly_root

Function poly_root 

Source
pub fn poly_root<P>(poly_ring: P, f: &El<P>, k: usize) -> Option<El<P>>
Available on crate feature unstable-enable only.
Expand description

Checks whether there exists a polynomial g such that g^k = f, and if yes, returns g.

§Example

let poly_ring = DensePolyRing::new(StaticRing::<i64>::RING, "X");
let [f, f_sqrt] = poly_ring.with_wrapped_indeterminate(|X| [X.pow_ref(2) + 2 * X + 1, X + 1]);
assert_el_eq!(&poly_ring, f_sqrt, poly_root(&poly_ring, &f, 2).unwrap());

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.