Skip to main content

companion

Function companion 

Source
pub fn companion<T: Scalar>(a: &[T]) -> Result<Array2<T>>
Expand description

The companion matrix of the polynomial a[0] xⁿ + a[1] xⁿ⁻¹ + … + a[n] (SciPy’s companion): first row −a[1..]/a[0], ones on the subdiagonal. Its eigenvalues are the polynomial’s roots.