开发者

Eigenvector (Spectral) Decomposition

开发者 https://www.devze.com 2023-01-08 14:55 出处:网络
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

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开发者_如何学Python 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!


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


See the book "Numerical recipes in C"


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

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

does not help?

0

精彩评论

暂无评论...
验证码 换一张
取 消