Skip to main content

ResultantComputer

Struct ResultantComputer 

Source
pub struct ResultantComputer { /* private fields */ }
Expand description

Resultant computation engine.

Implementations§

Source§

impl ResultantComputer

Source

pub fn new(config: ResultantConfig) -> Self

Create a new resultant computer.

Source

pub fn default_config() -> Self

Create with default configuration.

Source

pub fn resultant( &mut self, p: &Polynomial, q: &Polynomial, var: Var, ) -> Polynomial

Compute the resultant of two polynomials.

res(p, q, x) eliminates x from the system {p(x) = 0, q(x) = 0}.

Returns a polynomial in the remaining variables.

Source

pub fn discriminant(&mut self, p: &Polynomial, var: Var) -> Polynomial

Compute the discriminant of a polynomial.

disc(p, x) = (-1)^(n(n-1)/2) / lc(p) * res(p, p’, x)

where p’ is the derivative of p with respect to x.

Source

pub fn discriminant_normalized( &mut self, p: &Polynomial, var: Var, ) -> Polynomial

Compute the discriminant with leading coefficient normalization.

Returns disc(p) / lc(p) where lc(p) is the leading coefficient of p with respect to var. When lc(p) is a non-zero rational constant we scale by its reciprocal; when it is a polynomial in other variables we perform exact polynomial pseudo-division.

Source

pub fn have_common_root( &mut self, p: &Polynomial, q: &Polynomial, var: Var, ) -> bool

Check if two polynomials have a common root.

Returns true if resultant is zero.

Source

pub fn stats(&self) -> &ResultantStats

Get statistics.

Source

pub fn reset_stats(&mut self)

Reset statistics.

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> 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, 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.