pub struct ResultantComputer { /* private fields */ }Expand description
Resultant computation engine.
Implementations§
Source§impl ResultantComputer
impl ResultantComputer
Sourcepub fn new(config: ResultantConfig) -> Self
pub fn new(config: ResultantConfig) -> Self
Create a new resultant computer.
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration.
Sourcepub fn resultant(
&mut self,
p: &Polynomial,
q: &Polynomial,
var: Var,
) -> Polynomial
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.
Sourcepub fn discriminant(&mut self, p: &Polynomial, var: Var) -> Polynomial
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.
Sourcepub fn discriminant_normalized(
&mut self,
p: &Polynomial,
var: Var,
) -> Polynomial
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.
Sourcepub fn have_common_root(
&mut self,
p: &Polynomial,
q: &Polynomial,
var: Var,
) -> bool
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.
Sourcepub fn stats(&self) -> &ResultantStats
pub fn stats(&self) -> &ResultantStats
Get statistics.
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics.