Eigenvector (Spectral) Decomposition

2019-05-19 23:46发布

I am trying to find a program in C code that will allow me to compute a eigenvalue (spectral) decomposition for a square matrix. I am specifically trying to find code where the highest eigenvalue (and therefore its associated eigenvalue) are located int the first column.

The reason I need the output to be in this order is because I am trying to compute eigenvector centrality and therefore I only really need to calculate the eigenvector associated with the highest eigenvalue. Thanks in advance!

3条回答
再贱就再见
2楼-- · 2019-05-19 23:52

And the #1 google hit (search: eigenvalue decomposition code C#)

http://crsouza.blogspot.com/2010/06/generalized-eigenvalue-decomposition-in.html

does not help?

查看更多
趁早两清
3楼-- · 2019-05-20 00:01
时光不老,我们不散
4楼-- · 2019-05-20 00:14

In any case I would recommend to use a dedicated linear algebra package like Lapack (Fortran but can be called from C) or CLapack. Both are free and offer routines for almost any eigenvalue problem. If the matrix is large it might be preferable to exploit its sparseness e.g. by using Arpack. All of these libraries tend to sort the eigenvectors according to the eigenvalues if they can (real or purely imaginary eigenvalues).

查看更多
登录 后发表回答