Create a companion matrix.
Create the companion matrix [R47] associated with the polynomial whose coefficients are given in a.
Parameters : | a : (N,) array_like
|
---|---|
Returns : | c : (N-1, N-1) ndarray
|
Raises : | ValueError :
|
Notes
New in version 0.8.0.
References
[R47] | (1, 2) R. A. Horn & C. R. Johnson, Matrix Analysis. Cambridge, UK: Cambridge University Press, 1999, pp. 146-7. |
Examples
>>> from scipy.linalg import companion
>>> companion([1, -10, 31, -30])
array([[ 10., -31., 30.],
[ 1., 0., 0.],
[ 0., 1., 0.]])