pub trait ComputeResultantRing: RingBase {
// Required method
fn resultant<P>(poly_ring: P, f: El<P>, g: El<P>) -> Self::Element
where P: RingStore + Copy,
P::Type: PolyRing,
<P::Type as RingExtension>::BaseRing: RingStore<Type = Self>;
}
Available on crate feature
unstable-enable
only.Expand description
Trait for rings that support computing resultants of polynomials over the ring.
§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.
Required Methods§
Sourcefn resultant<P>(poly_ring: P, f: El<P>, g: El<P>) -> Self::Element
fn resultant<P>(poly_ring: P, f: El<P>, g: El<P>) -> Self::Element
Computes the resultant of f
and g
over the base ring.
The resultant is the determinant of the linear map
R[X]_deg(g) x R[X]_deg(f) -> R[X]_deg(fg),
a , b -> af + bg
where R[X]_d
refers to the vector space of polynomials in R[X]
of degree
less than d
.
§Example
use feanor_math::assert_el_eq;
use feanor_math::ring::*;
use feanor_math::integer::*;
use feanor_math::rings::poly::dense_poly::DensePolyRing;
use feanor_math::rings::poly::*;
use feanor_math::algorithms::resultant::*;
let ZZ = BigIntRing::RING;
let ZZX = DensePolyRing::new(ZZ, "X");
let [f] = ZZX.with_wrapped_indeterminate(|X| [X.pow_ref(2) - 2 * X + 1]);
// the discrimiant is the resultant of f and f'
let discriminant = <_ as ComputeResultantRing>::resultant(&ZZX, ZZX.clone_el(&f), derive_poly(&ZZX, &f));
assert_el_eq!(ZZ, ZZ.zero(), discriminant);
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.