pub struct RealRoot { /* private fields */ }Expand description
One real root of a square-free integer polynomial.
Either an exact dyadic point (lo == hi), or the unique root in the
open interval (lo, hi) with the polynomial non-zero at both ends.
Implementations§
Source§impl RealRoot
impl RealRoot
Sourcepub fn refine_to_width(&mut self, width: &Dyadic)
pub fn refine_to_width(&mut self, width: &Dyadic)
Refine until the interval is no wider than width, or the root is
exact.
Sourcepub fn cmp_dyadic(&self, x: &Dyadic) -> Sign
pub fn cmp_dyadic(&self, x: &Dyadic) -> Sign
Exact sign of root - x for a dyadic x.
Sourcepub fn sign_of(&self, q: &IntPoly) -> Sign
pub fn sign_of(&self, q: &IntPoly) -> Sign
Exact sign of the polynomial q at this root.
Zero is decided through gcd(poly, q): q vanishes at the root iff
the gcd has a root in the isolating interval, which holds no other
root of poly. Otherwise the interval is refined until q has no
root in it, and q’s sign there is its sign at the root.
Sourcepub fn cmp_root(&self, other: &Self) -> Sign
pub fn cmp_root(&self, other: &Self) -> Sign
Exact sign of self - other.
Distinct roots are separated by refinement, which terminates because
they differ. Equality is decided exactly first: g = gcd of the two
polynomials. A root of g in the overlap of the two isolating
intervals is a root of each polynomial in each interval, and each
interval holds only one, so it is both roots. No such root means
they differ.