What is the algorithm used for lu built-in MATLAB matrix decomposition function?

I would to know which algorith is used for lu MATLAB built-in function. Also, if I wanna find the algorithm used for building any function in MATLAB where do you advise me to look and search?
Thanks

回答(2 个)

1. READ THE HELP. In general most tools should give SOME idea of what algorithm was employed. Look for references if available.
2. SOME tools are m-files. You can look at the code. Use the type command here to look at code, not edit. He who edits TMW supplied code risks inserting an accidental typo into the code, and then saving it accidentally. So edit is a risky way to view code.
3. Much of the code in MATLAB is compiled. Sorry, but if you want to look at the code behind those tools, plan on getting a job at The MathWorks as your only way to do so.
As far as the LU code goes, I expect this is a moderately basic pivoted LU code, the algorithm for which can be found in dozens of texts. Of course, things like the BLAS factor in, so the code will not be that trivial. And of course, if the matrix is sparse, there are other issues to worry about.
If your goal is to exactly reproduce the results from LU, by writing your own C code, DON'T BOTHER. You will NEVER be able to do so in general.

1 个评论

Thank you for the detailed answer.
I am doing some comparisons which require from me to look into the algorithms. The problem now is I have checked MATLAB help and some other related online resources and never got any confirmation on the exact used algorithm for lu built-in function; however, I need to be totally sure in order to properly conduct my study. As of now, the complexity of the code is not really an issue.
Thank you again.

请先登录,再进行评论。

Well, seems it is solved. I found this "MATLAB uses partial pivoting when determining the factorization." in (NUMERICAL METHODS FOR ENGINEERS AND SCIENTISTS:An Introduction with Appliications Using MATLAB- V. Gilat and V. Subramaniam).
Thank you again.

类别

在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by