Eigenvector (Spectral) Decomposition

此生再无相见时 提交于 2019-12-10 11:29:52

问题


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!


回答1:


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).




回答2:


See the book "Numerical recipes in C"




回答3:


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

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

does not help?



来源:https://stackoverflow.com/questions/3291155/eigenvector-spectral-decomposition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!