matlab如何求解大型、对称和稀疏线性系统

发布于 2024-12-15 06:18:58 字数 66 浏览 2 评论 0原文

也就是说,当我对一个非常大、对称且稀疏的 A 进行 A\b 时,matlab 使用什么算法?

That is, when I do A\b for a very large, symmetric and sparse A, what algorithm does matlab use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱娆 2024-12-22 06:18:58

如果矩阵是稀疏且对称正定的,但带非常很窄,则使用专门的带求解器。大多数矩阵没有足够窄的带来触发这种情况。通常,它会在样条工具箱中提供一维样条。二维问题有一个大的“带”(它们不是真正的带状矩阵)。

更典型的是,MATLAB 使用 CHOLMOD 来表示稀疏对称正定矩阵。如果矩阵是稀疏、对称且不定的,则使用 Iain Duff 的 MA49。

您可以使用此选项让 MATLAB 告诉您它在 A\b 内执行的操作:

spparms ('spumoni',3)

再次将其关闭

spparms ('spumoni',0)

然后使用“对于稀疏方阵,它使用 UMFPACK” 。对于稀疏矩形矩阵,它使用 SuiteSparseQR(或简称 spqr)。

对于下三角或上三角的稀疏矩阵,或者可以排列成这样的稀疏矩阵,它使用利用这些属性的前向/后向求解器。

MATLAB 根本不在反斜杠中使用单纯形法。如果矩阵是矩形的(又短又粗,列多于行),则 A\b 返回基本解决方案。如果您想要最小 2 范数解,则需要分解 A'。这可以在 spqr MATLAB 界面中完成,但该选项在 MATLAB 发行版中不可用。您需要从 suitesparse.com 的源代码安装 spqr。

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. If the matrix is sparse, symmetric, and indefinite, then it uses MA49 by Iain Duff.

You can get MATLAB to tell you what it is doing inside A\b with this option:

spparms ('spumoni',3)

then turn it off again with

spparms ('spumoni',0)

For sparse square matrices it uses UMFPACK. For sparse rectangular matrices it uses SuiteSparseQR (or spqr for short).

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. If the matrix is rectangular (and short and fat, with more columns than rows) the A\b returns a basic solution. If you want a minimum 2-norm solution, you need to factorize A'. That can be done in the spqr MATLAB interface but that option is not available in the MATLAB distribution. You would need to install spqr from the source code at suitesparse.com.

小耗子 2024-12-22 06:18:58

答案取决于 A 的某些属性(对角线/方形/带状?等)。 CHOLMOD、UMFPACK 和 qr 分解是其中一些选项。

文档对此进行了解释。
以下是文档在线快照的链接。这可能已经过时了。
- http://amath.colorado.edu/computing/Matlab/OldTechDocs/参考/arithmeticoperators.html
- http://www.maths.lth.se/ na/courses/NUM115/NUM115-11/backslash.html

The answer depends on the some properties of A (diagonal/square/banded? etc.). CHOLMOD, UMFPACK and qr factorization are some of the options.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文