简体   繁体   English

Matlab如何解决大型,对称和稀疏线性系统

[英]how does matlab solve large, symmetric and sparse linear systems

也就是说,当我对一个非常大,对称且稀疏的A执行A\\b ,matlab使用哪种算法?

If the matrix is sparse and symmetric positive definite, but has a very narrow band, then a specialized band solver is used. 如果矩阵稀疏且对称正定,但具有非常窄的频带,则使用专用的频带求解器。 Most matrices do not have a narrow enough band to trigger this condition. 大多数矩阵的带宽不足以触发此条件。 Typically, this comes up with 1-D splines in the Spline Toolbox. 通常,在样条线工具箱中会附带一维样条线。 2-D problems have a large "band" (they are not truly banded matrices). 二维问题具有较大的“带”(它们不是真正的带状矩阵)。

More typically, MATLAB uses CHOLMOD for sparse symmetric positive definite matrices. 更典型地,MATLAB将CHOLMOD用于稀疏对称正定矩阵。 If the matrix is sparse, symmetric, and indefinite, then it uses MA49 by Iain Duff. 如果矩阵稀疏,对称且不确定,则使用Iain Duff的MA49。

You can get MATLAB to tell you what it is doing inside A\\b with this option: 您可以使用以下选项让MATLAB告诉您在A\\b正在做什么:

spparms ('spumoni',3)

then turn it off again with 然后用

spparms ('spumoni',0)

For sparse square matrices it uses UMFPACK. 对于稀疏平方矩阵,它使用UMFPACK。 For sparse rectangular matrices it uses SuiteSparseQR (or spqr for short). 对于稀疏矩形矩阵,它使用SuiteSparseQR(或简称spqr)。

For sparse matrices that are lower or upper triangular, or can be permuted into such, it uses a forward/back solver that exploits these properties. 对于较低或较高三角形的稀疏矩阵,或者可以将其置换成这样的稀疏矩阵,它使用利用这些属性的前向/后向求解器。

MATLAB does not use the simplex method in backslash at all. MATLAB根本不在反斜杠中使用单纯形方法。 If the matrix is rectangular (and short and fat, with more columns than rows) the A\\b returns a basic solution. 如果矩阵是矩形(又短又胖,列多于行),则A\\b返回基本解。 If you want a minimum 2-norm solution, you need to factorize A' . 如果需要最小二范数解,则需要分解A' That can be done in the spqr MATLAB interface but that option is not available in the MATLAB distribution. 这可以在spqr MATLAB界面中完成,但是该选项在MATLAB发行版中不可用。 You would need to install spqr from the source code at suitesparse.com . 您需要从suitesparse.com的源代码安装spqr

The answer depends on the some properties of A (diagonal/square/banded? etc.). 答案取决于A的某些属性(对角线/正方形/带状?等)。 CHOLMOD, UMFPACK and qr factorization are some of the options. CHOLMOD,UMFPACK和qr因式分解是一些选项。

The documentation explains it. 文档对此进行了说明。 Here are links to online snapshots of the docs. 这里是文档在线快照的链接。 This may be outdated. 这可能已经过时了。 - http://amath.colorado.edu/computing/Matlab/OldTechDocs/ref/arithmeticoperators.html - http://www.maths.lth.se/na/courses/NUM115/NUM115-11/backslash.html -http://amath.colorado.edu/computing/Matlab/OldTechDocs/ref/arithmeticoperators.html-http : //www.maths.lth.se/na/courses/NUM115/NUM115-11/backslash.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM