Registered Member
|
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! |
Moderator
|
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. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]