views:

93

answers:

3

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!

A: 

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

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

does not help?

Tobiasopdenbrouw
I am specifically trying to find code where the highest eigenvalue (and therefore its associated eigenvalue) are located int the first column. Would this be true for this program?
Spencer
A: 

See the book "Numerical recipes in C"

Mitch Wheat
+1  A: 

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

FFox