pub struct IntPoly { /* private fields */ }Expand description
A polynomial with integer coefficients, lowest degree first, no trailing zeros (the zero polynomial is empty).
Implementations§
Source§impl IntPoly
impl IntPoly
Sourcepub fn new(coeffs: Vec<BigInt>) -> Self
pub fn new(coeffs: Vec<BigInt>) -> Self
From coefficients, lowest degree first. Trailing zeros are dropped.
Sourcepub fn from_dyadic(coeffs: &[Dyadic]) -> Self
pub fn from_dyadic(coeffs: &[Dyadic]) -> Self
From dyadic coefficients, lowest degree first, scaled by a power of two to integers. The roots are those of the dyadic polynomial.
Sourcepub fn derivative(&self) -> Self
pub fn derivative(&self) -> Self
The derivative.
Sourcepub fn primitive(&self) -> Self
pub fn primitive(&self) -> Self
Divided by the gcd of its coefficients, leading coefficient positive. Keeps coefficient growth in Sturm chains in check.
Sourcepub fn square_free(&self) -> Self
pub fn square_free(&self) -> Self
The square-free part: same real roots, each with multiplicity one.
Sourcepub fn gcd(&self, other: &Self) -> Self
pub fn gcd(&self, other: &Self) -> Self
Greatest common divisor, primitive with positive leading coefficient.
Sourcepub fn real_roots(&self) -> Vec<RealRoot>
pub fn real_roots(&self) -> Vec<RealRoot>
Isolate every real root of this polynomial.
Returns roots in increasing order, each as a RealRoot whose
interval contains exactly that root. Multiple roots are reported
once. The zero polynomial has no isolated roots (it vanishes
everywhere); callers must handle it before asking.