Skip to main content

IntPoly

Struct IntPoly 

Source
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

Source

pub fn new(coeffs: Vec<BigInt>) -> Self

From coefficients, lowest degree first. Trailing zeros are dropped.

Source

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.

Source

pub fn coeffs(&self) -> &[BigInt]

Coefficients, lowest degree first.

Source

pub fn degree(&self) -> Option<usize>

Degree, or None for the zero polynomial.

Source

pub fn is_zero(&self) -> bool

Whether this is the zero polynomial.

Source

pub fn eval(&self, x: &Dyadic) -> Dyadic

Exact value at a dyadic point.

Source

pub fn sign_at(&self, x: &Dyadic) -> Sign

Exact sign at a dyadic point.

Source

pub fn derivative(&self) -> Self

The derivative.

Source

pub fn primitive(&self) -> Self

Divided by the gcd of its coefficients, leading coefficient positive. Keeps coefficient growth in Sturm chains in check.

Source

pub fn square_free(&self) -> Self

The square-free part: same real roots, each with multiplicity one.

Source

pub fn gcd(&self, other: &Self) -> Self

Greatest common divisor, primitive with positive leading coefficient.

Source

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.

Trait Implementations§

Source§

impl Clone for IntPoly

Source§

fn clone(&self) -> IntPoly

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntPoly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for IntPoly

Source§

impl Hash for IntPoly

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for IntPoly

Source§

fn eq(&self, other: &IntPoly) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IntPoly

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.