Arguments
- a
real or complex square matrix
Details
Computes the eigenvalues of a square matrix of real or complex numbers,
using the R routine eigen without computing the eigenvectors.
Value
Vector of eigenvalues
Examples
eig(matrix(c(1,-1,-1,1), 2, 2)) #=> 2 0
#> [1] 2 0
eig(matrix(c(1,1,-1,1), 2, 2)) # complex values
#> [1] 1+1i 1-1i
eig(matrix(c(0,1i,-1i,0), 2, 2)) # real values
#> [1] 1 -1