companionMatrix f
For a monic univariate polynomial $f$ of degree $d$, this method returns the companion matrix $C(f)$, which is a $d\times d$ matrix whose characteristic polynomial is $f$. Explicitly, $C(f)$ has entries $1$ on the first subdiagonal (the diagonal below the main diagonal), negative coefficients of $f$ in the last column (other than the leading coefficient of $1$), and $0$ elsewhere.
If $f$ is not monic, then this method returns the companion matrix of the normalized monic polynomial $(1/a_n)f$, where $a_n$ is the leading coefficient of $f$.
|
|
|
|
|
|
The object companionMatrix is a method function.
The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/DeterminantalRepresentations.m2:1220:0.