This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Solving Eigenvalue problem with GSL Structures

Tags: None
(comma "," separated)
henriquemiranda
Registered Member
Posts
1
Karma
0
Hi everyone!

I have a program in C using the GSL Library to do some matrix operations.
The most time consuming part of all the code is a call to a function to solve a generalized eigenvalue problem with hermitian matrices implemented in the GSL library:

gsl_eigen_genhermv(ham, over, eival, eivec, w);

with:
gsl_matrix_complex *ham, *over, *eivec;
gsl_vector *eival;

is there a simple way to use eigen instead of GSL?
Is there any advantage (performance) in doing so?

Thanks in advance to everyone! :D
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Use:

Map<MatrixXd> A(dataA,size,size);
Map<MatrixXd> A(dataB,size,size);
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> eig(A,B);
eig.eigenvalues(); // returns a VectorXd
eig.eigenvectors(); // returns a MatrixXd

where dataA is a call to your GSL matrix to get the address of the first element.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]