Why is 'eig' slower for tridiagonalized matrices ?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Douglas Gonçalves
am 1 Mär. 2016
Kommentiert: Douglas Gonçalves
am 1 Mär. 2016
Consider the list of commands below:
>> A = gallery('poisson', 60);
>>
>> tic; [V,D] = eig(full(A)); toc
Elapsed time is 16.074685 seconds.
>>
>> B = hess(full(A)); tic; [V,D] = eig(B); toc
Elapsed time is 28.709543 seconds.
>>
>>
Why does 'eig' take longer on the tridiagonalized version of A ?
This behaviour occurs with other matrices. I'm running MATLAB R2011b.
0 Kommentare
Akzeptierte Antwort
Cam Salzberger
am 1 Mär. 2016
Hello Douglas,
The brief answer is that it isn't anymore. In R2013a, there was an improvement in the handling of tridiagonalized matrices in "eig". Testing on my computer in R2011b and R2015b, I get:
R2011b:
eig(full(A)) - ~9 seconds
eig(B) - ~14.5 seconds
R2015b:
eig(full(A)) - ~3.7 seconds
eig(B) - ~0.6 seconds
I would recommend upgrading to the latest version of MATLAB, if you are able to.
-Cam
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!