The eigen decomposition of a multi-companion matrix
mc_eigen.RdGive the eigenvalues or the entire eigen decomposition of a multi-companion matrix
Details
Both functions first check if the decomposition is stored in
  x and, if that is the case, return the result without
  computations. This is particularly useful when the matrix is created
  from its spectral decomposition in the first place. The only
  restrictions on the result in this case come from the structure of
  multi-companion matrices.
Otherwise they use eigen to do the main computation. In
  addition, if the top of the matrix has structural columns of zeroes,
  mc_eigen takes care to call eigen with a sub-matrix
  whose last column is not zero, and handles the zero eigenvalues
  separately.
Note that x@mo.col is the last column containing nonzero
  elements in the top of the matrix. By calling eigen on the top
  left x@mo.col square block, rather than on the entire matrix,
  we achieve several things. Firstly, this block may turn out to be
  non-singular. In that case, the chains corresponding to zero
  eigenvalues, if any, are structural and straightforward. Secondly, if
  this block turns out to be singular, we know that by reducing the
  dimension we have left out only elements corresponding to zero
  eigenvalues. The vectors associated with zero eigenvalues are somewhat
  tricky in this case, but manageable.
The net effect is that the only restriction comes from the use of
  eigen, which does not handle Jordan chains of length larger
  than one.  In general, this is not a problem, since chains with more
  than one vector are not likely to occur numerically. In particular, it
  is relatively safe to assume that the space spanned by the non-zero
  eigenvalues of the multicompanion matrix has a basis of
  eigenvectors. However, when x@mo.col is smaller than the
  dimension of the matrix, eigenchains associated with the zero value
  can easily occur, due to the structure of the matrix.  That is why we
  pay special attention to them.
In mc_eigen the handling of the zero eigenvalues is based on
  mc_chain_extend.  The latter takes care also of zero
  eigenvalues whose Jordan blocks are of size larger than one.
Value
For mc_eigenvalues, the eigenvalues as a vector.
For mc_eigen, the eigenvalues and eigenvectors as a list with
  components values and vectors. In addition the list
  contains a component len.block with the lengths of the Jordan
  chains.
References
Boshnakov GN (2002). “Multi-companion matrices.” Linear Algebra Appl., 354, 53–83. ISSN 0024-3795, doi:10.1016/S0024-3795(01)00475-X .
Note
mc_eigenvalues currently simply calls eigen if the
  eigenvalues are not stored in the object. It is probably mostly useful
  when the interest is in the nonzero eigenvalues.
Examples
x <- sim_mc(6,4,mo.col=2)
x
#> $eigval
#> [1] -0.02280969-0.6870692i -0.02280969+0.6870692i  0.00000000+0.0000000i
#> [4]  0.00000000+0.0000000i  0.00000000+0.0000000i  0.00000000+0.0000000i
#> 
#> $len.block
#> [1] 1 1 1 1 1 1
#> 
#> $mo
#> [1] 4
#> 
#> $eigvec
#>                         [,1]                    [,2] [,3] [,4] [,5] [,6]
#> [1,]  0.01517791+0.04615826i  0.01517791-0.04615826i 0+0i 0+0i 0+0i 0+0i
#> [2,]  0.05781937-0.68286734i  0.05781937+0.68286734i 0+0i 0+0i 0+0i 0+0i
#> [3,] -0.01535757+0.04189076i -0.01535757-0.04189076i 1+0i 0+0i 0+0i 0+0i
#> [4,]  0.77940157+0.46943425i  0.77940157-0.46943425i 0+0i 1+0i 0+0i 0+0i
#> [5,] -0.06783999+0.01983861i -0.06783999-0.01983861i 0+0i 0+0i 1+0i 0+0i
#> [6,]  0.98999944+0.11702015i  0.98999944-0.11702015i 0+0i 0+0i 0+0i 1+0i
#> 
#> $co
#>                         [,1]                    [,2]
#> [1,] -0.01535757+0.04189076i -0.01535757-0.04189076i
#> [2,]  0.77940157+0.46943425i  0.77940157-0.46943425i
#> [3,] -0.06783999+0.01983861i -0.06783999-0.01983861i
#> [4,]  0.98999944+0.11702015i  0.98999944-0.11702015i
#> 
#> $mo.col
#> [1] 2
#> 
#> $mat
#>               [,1]          [,2] [,3] [,4] [,5] [,6]
#> [1,]  1.592544e+00  1.244607e-01    0    0    0    0
#> [2,] -2.475825e+01 -1.638163e+00    0    0    0    0
#> [3,]  1.568918e+00  9.199788e-02    0    0    0    0
#> [4,]  1.354422e+01  1.715396e+00    0    0    0    0
#> [5,]  1.000000e+00  3.071808e-18    0    0    0    0
#> [6,]  2.230410e-16  1.000000e+00    0    0    0    0
#> 
y <- mCompanion(x,detect="gen")
y
#> 6 x 6 Matrix of class "MultiCompanion"
#>            [,1]        [,2] [,3] [,4] [,5] [,6]
#> [1,]   1.592544  0.12446072    0    0    0    0
#> [2,] -24.758254 -1.63816293    0    0    0    0
#> [3,]   1.568918  0.09199788    0    0    0    0
#> [4,]  13.544215  1.71539592    0    0    0    0
#> [5,]   1.000000  0.00000000    0    0    0    0
#> [6,]   0.000000  1.00000000    0    0    0    0
z <- as.matrix(y)
xx <- mCompanion(x=z,mo.col=2)
mc_eigen(xx)
#> $values
#> [1] -0.02280969+0.6870692i -0.02280969-0.6870692i  0.00000000+0.0000000i
#> [4]  0.00000000+0.0000000i  0.00000000+0.0000000i  0.00000000+0.0000000i
#> 
#> $vectors
#>                         [,1]                    [,2] [,3] [,4] [,5] [,6]
#> [1,] -0.06508166-0.02768163i -0.06508166+0.02768163i 0+0i 0+0i 0+0i 0+0i
#> [2,]  0.99749592+0.00000000i  0.99749592+0.00000000i 0+0i 0+0i 0+0i 0+0i
#> [3,] -0.06264215+0.01712951i -0.06264215-0.01712951i 1+0i 0+0i 0+0i 0+0i
#> [4,] -0.58513026-1.18805175i -0.58513026+1.18805175i 0+0i 1+0i 0+0i 0+0i
#> [5,] -0.03710385+0.09595538i -0.03710385-0.09595538i 0+0i 0+0i 1+0i 0+0i
#> [6,] -0.04814499-1.45021449i -0.04814499+1.45021449i 0+0i 0+0i 0+0i 1+0i
#> 
#> $len.block
#> [1] 1 1 1 1 1 1
#>