This chapter describes the routines used to calculate the eigenvalues and the eigenvectors of a matrix. There are routines for real symmetric, real nonsymmetric and complex hermitian eigensystems. Eigenvalues can be computed with or without eigenvectors. The hermitian and real symmetric matrix algorithms are symmetric bidiagonalization followed by QR reduction. The nonsymmetric algorithm is the Francis QR double-shift.
Gives a real symmetrix matrix m returns a real vector with the eigenvalues and a real matrix with the corresponding eigenvectors arranged by columns. It is left to the user to ensure that the matrix is symmetric.
Example:
m = new(4, 4, |i,j| 1/(i+j-1))
e, v = eigsv(m)
-- the following expression will give a diagonal matrix with
-- the eigenvalues along the diagonal
print(prod(v,mul(m,v)))