MatLab eig vs LAPACK
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lennart Sinjorgo
am 24 Nov. 2022
Bearbeitet: John D'Errico
am 24 Nov. 2022
It appears that there exist some LAPACK function 'syevd' for computing the eigenvalue decomposition of dense symmetric matrices.
According to this (old) source, the syevd algorithm seems to be 5x times as fast as MatLab's eig.
When I tried to install this for myself, I ran into errors. It seems that this is rather outdated. Does anyone know if this speed difference is still this big? Or can anyone help me with getting the 'syevd' function to run in mex format?
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 24 Nov. 2022
Bearbeitet: John D'Errico
am 24 Nov. 2022
If I had to guess, you don't need to use it.
A = randn(500);
timeit(@() eig(A))
ans =
0.0800828164545
B = A + A';
timeit(@() eig(B))
ans =
0.0064739664545
Do you see that eig ALREADY runs roughly 12 times faster on a symmetric matrix of the same size?
So I would bet the MATLAB eig checks for symmetry, and then uses an appropriate call to LAPACK. (The above test was performed using R2022b, update 1.) So your old source was just that - old, and out of date as long as you are using a current MATLAB release.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!