How does MATLAB 2016b eig function compute all eigenvalues and eigenvectors?

10 visualizzazioni (ultimi 30 giorni)
Dear all,
I know the source code of certain built-in functions like 'eig' is confidential and property of Mathworks. However, I could not find in the documentation a clear explanation of which methods are used by 'eig' to compute ALL eigenvalues AND eigenvectors of a (let's say dense) symmetric matrix. Does 'eig' rely on some LAPACK (and/or ARPACK?) routines (as it did in R2011b, for example)? Which ones?

Risposte (1)

Jan
Jan il 25 Gen 2017
As long as the source code is confidential and a reverse engineering is forbidden by the license agreement, all we know is what you find in the documentation.
You could provide a LAPACK library compiled by your own including debugging information, but I'm afraid this is a kind of reverse engineering already.
You can call the LAPACK routines through Mex functions directly, see e.g. https://www.mathworks.com/matlabcentral/fileexchange/16777-lapack an some other FileExchange submissions. Then you might find out what happens internally by comparing the results. But this is sophisticated guessing only. Therefore I suggest to solve the problem from another direction: Why do you want to know this? The solution might be to solve the actual problem without knowing, how Matlab does it.
  5 Commenti
Jan
Jan il 27 Gen 2017
Modificato: Jan il 27 Gen 2017
@Douglas: Matlab selects a suiting method based on smart but automatic assumptions about the nature of the matrix. If the properties of the matrix are known already, calling the best LAPACK or sparse function can be much more efficient. I've seen many scientists without a deep knowledge of numerics, who used an inadequate method - with the argument: "I've taken the routine from a well known and stable library!" Matlab's eig() prevents such mistakes. But your students can learn, when to apply which method intentionally.
Steven Lord
Steven Lord il 27 Gen 2017
@Jan: that's a conference room -- note the orange "whiteboard" to the left. The monitor is on the wall she's facing, just outside the limits of the picture.
And if you're interested in running MATLAB on a device without a monitor to do number crunching, start a cluster of workers using Parallel Computing Toolbox. Alternately, if you have the correct type of license take a look at MATLAB Online.

Accedi per commentare.

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by