pub struct Pol<T> { /* private fields */ }Expand description
polynomial, coefficients are listed from lowest to highest power
Implementations§
Source§impl<T> Pol<T>
impl<T> Pol<T>
Sourcepub fn integrate(&self, c: Complex<T>) -> Pol<T>
pub fn integrate(&self, c: Complex<T>) -> Pol<T>
the general antiderivative of the polynomial, symbolic, with constant term c
Sourcepub fn roots(&self, n: usize, m: usize, r_coef: T, eps: T) -> Vec<Complex<T>>
pub fn roots(&self, n: usize, m: usize, r_coef: T, eps: T) -> Vec<Complex<T>>
attempt to find all the complex roots of the polynomial with radii n * its degree, maximum iterations of newton’s method m, coefficient of rounding for eliminating identical solutions r_coef, and eps, passed to sampling and newton’s method, and used for rounding
a degree k polynomial will have k roots (although they may be the same) and is not trivially solved
differentiating this a times will yield a polynomial with k - a roots
if k - a = 1 or 2, this can be trivially solved for its zeros
the zeros of the derivative of a polynomial lie inside the convex hull of its zeros by the Gauss-Lucas theorem
therefore, we begin newton’s method at the points of the derivative’s zeros radiating out
to attempt to land initial points in the basins of convergence of every root