Methods for constructing companion matrices of an n-degree polynomial.
companion(coef, type = "matrix", ..., bldim = .pbd_env$BLDIM,
ICTXT = .pbd_env$ICTXT)
Vector of polynomial coefficients, listed in increasing order (by index; see details below).
"matrix" or "ddmatrix".
Additional arguments.
blocking dimension.
BLACS context number.
Returns a matrix or a distributed matrix.
For a degree n polynomial,
\(x^n + a_{n-1}x^{n-1} + \dots + a_1x + a_0\)
its associated companion matrix is a matrix of the form
\(\left[\begin{array}{cccccc} 0 & 0 & 0 & \dots & 0 & -a_0\\ 1 & 0 & 0 & \dots & 0 & -a_1\\ 0 & 1 & 0 & \dots & 0 & -a_2\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 & \dots & 1 & -a_{n-1} \end{array}\right]\)
In the function call, we assume that the argument 'coef
' is ordered
from \(a_0\) to \(a_{n-1}\).
NOTE that we assume that the leading coefficient is 1.