# 直接求解器

直接求解器是一种数值线性代数方法，通过将矩阵分解为三角因子来求解线性系统 \( Ax = b \)，在有限且固定的步数内得到解，在没有舍入误差的情况下是精确的。<sup>[1](http://scholarpedia.org/article/Direct_methods_for_sparse_matrix_solution)</sup> 这与迭代方法形成对比，后者通常仅在直接方法无效时才使用。<sup>[2](https://www.cs.ubc.ca/~ascher/ag_2012/ag_slides/chap5.pdf)</sup> 在浮点运算中，计算得到的解是略微扰动问题的精确解，其质量取决于矩阵的条件数 \( \kappa(A) \)。<sup>[2](https://www.cs.ubc.ca/~ascher/ag_2012/ag_slides/chap5.pdf)</sup> 稀疏直接方法利用稀疏性，比存储和操作所有元素更快地求解问题，且内存消耗远少。<sup>[3](https://www.cambridge.org/core/journals/acta-numerica/article/abs/survey-of-direct-methods-for-sparse-linear-systems/8AE7AC55909389F7EA1F027855AC4044)</sup>

| 关键事实 | 数值 |
|---|---|
| 解的特征 | 有限、固定步数；精确到舍入误差<sup>[1](http://scholarpedia.org/article/Direct_methods_for_sparse_matrix_solution)</sup> |
| 稠密高斯消元开销 | \( A = LU \) 需 \( (2/3)n^3 + O(n^2) \) 次浮点运算<sup>[4](https://personal.maths.manchester.ac.uk/higham/papers/high11g.pdf)</sup> |
| Cholesky 与 LU 对比（SPD 矩阵） | 计算量约减半；无需选主元即可保证稳定性<sup>[5](https://arxiv.org/pdf/2504.11716)</sup> |
| 三维网格问题，\( n \) 个未知量 | LU 需 \( O(n^2) \) 次浮点运算；因子占用 \( O(n^{4/3}) \) 内存<sup>[6](https://mumps-solver.org/doc/EMS_ECMI_LanczosPrize_MUMPS.pdf)</sup> |
| 稀疏求解器工作流程 | 排序、符号分解、数值分解、三角求解<sup>[7](https://portal.nersc.gov/project/sparse/superlu/SparseDirectSurvey.pdf)</sup> |
| 最坏情况填充 | 几乎所有随机矩阵需 \( O(n^2) \) 内存和 \( O(n^3) \) 时间<sup>[8](https://people.engr.tamu.edu/davis/publications_files/survey_tech_report.pdf)</sup> |
| 现代基准规模 | 阶数为 \( 10^6 \) 的对称系统在 16 核上 3 分钟内求解<sup>[9](https://mdpi-res.com/d_attachment/algorithms/algorithms-06-00702/article_deploy/algorithms-06-00702.pdf?version=1383301060)</sup> |

## 工作原理

核心原理是消元。高斯消元将 \( A \) 约化为 LU 分解，即 \( A = LU \)，其中 \( L \) 为下三角、\( U \) 为上三角，代价为 \( (2/3)n^3 + O(n^2) \) 次浮点运算；当所有顺序主子矩阵非奇异时，LU 分解唯一存在。<sup>[4](https://personal.maths.manchester.ac.uk/higham/papers/high11g.pdf)</sup> 采用部分选主元时，对任意非奇异 \( A \)，存在置换 \( P \) 使得 \( PA = LU \)，其中 \( L \) 为单位下三角矩阵。<sup>[10](https://gerard-meurant.fr/handbook_2000.pdf)</sup> 一旦完成分解，\( Ax = b \) 就化为两个三角系统，通过前代和回代求解。<sup>[11](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2025-1/direct-method.html)</sup>

分解方法需与矩阵类型匹配。对于对称正定（SPD）矩阵，适用 Cholesky 分解 \( A = LL^T \)，或无平方根形式 \( A = LDL^T \)（其中 \( \operatorname{diag}(D) > 0 \)），后者避免了开方运算；Cholesky 的计算量约为 LU 的一半，且无需选主元即可保证稳定性。<sup>[10](https://gerard-meurant.fr/handbook_2000.pdf)</sup><sup> • </sup><sup>[5](https://arxiv.org/pdf/2504.11716)</sup> 对称不定矩阵使用 \( D \) 中含 1×1 和 2×2 块的 \( LDL^T \) 分解；非对称矩阵使用 LU 分解；\( m \ge n \) 的矩形 \( m \times n \) 系统使用 QR 分解。<sup>[1](http://scholarpedia.org/article/Direct_methods_for_sparse_matrix_solution)</sup>

## 实现方法

稀疏直接求解器运行四个不同步骤，而稠密情形只有两个：排序步骤、分析或符号分解步骤、计算 \( L \) 和 \( U \) 的数值分解，以及带前代和回代的求解步骤。数值分解通常是最耗时的部分；求解步骤约快一个数量级。<sup>[7](https://portal.nersc.gov/project/sparse/superlu/SparseDirectSurvey.pdf)</sup> 具体而言，矩阵通过最小度、近似最小度（AMD）或嵌套剖分等图启发式方法重排序为 \( PAP^T \)；符号分解仅利用稀疏模式，通过消元树和超节点构建静态数据结构；数值分解随后利用已知模式计算因子；最后求解 \( Ly = b \) 和 \( L^T x = y \)。<sup>[12](https://classpages.cselabs.umn.edu/Spring-2023/csci8314/FILES/LecN8_R.pdf)</sup>

排序是该方法的组合核心。寻找使内存或浮点运算次数最小化的置换 \( P \) 和 \( Q \) 是 NP 难的，因此使用启发式方法。<sup>[8](https://people.engr.tamu.edu/davis/publications_files/survey_tech_report.pdf)</sup> 存在三种基本的填充最小化策略，有时会组合使用：最小度及其变体、嵌套剖分（递归图划分）和带宽缩减。<sup>[13](https://epubs.siam.org/doi/book/10.1137/1.9780898718881)</sup> 近似最小度（AMD）排序算法由 Patrick R. Amestoy、Timothy A. Davis 和 Iain S. Duff 提出，于 1996 年发表在《SIAM 矩阵分析与应用杂志》上。<sup>[14](https://doi.org/10.1137/s0895479894278952)</sup> 一些求解器合并了阶段：SuperLU 将符号分解和数值分解合并，UMFPACK 将排序与两者合并，因此数值会影响消元顺序。<sup>[7](https://portal.nersc.gov/project/sparse/superlu/SparseDirectSurvey.pdf)</sup>

## 起源

消元法历史悠久：汉代的《九章算术》第八章包含高斯消元的描述和 18 个例题。<sup>[15](https://ed-thelen.org/ABC/QuestLinearSolvers-.html)</sup> 现代分解视角归功于 Herman Chernoff 和 Paul Dwyer 的《线性计算》，1952 年发表于《Econometrica》；到 20 世纪 60 年代中期，分解方法已全面兴起。<sup>[16](https://web.stanford.edu/class/archive/cs/cs339/cs339.2002/decomp.pdf)</sup><sup> • </sup><sup>[17](https://doi.org/10.2307/1907420)</sup> 一个带部分选主元的高斯消元早期计算机程序还实现了迭代精化。<sup>[4](https://personal.maths.manchester.ac.uk/higham/papers/high11g.pdf)</sup>

稀疏消元在 20 世纪 70 和 80 年代成熟。Alan George 1973 年的论文《规则有限元网格的嵌套剖分》，发表于《SIAM 数值分析杂志》，引入了嵌套剖分算法。<sup>[18](https://doi.org/10.1137/0710032)</sup> I. S. Duff 和 J. K. Reid 于 1984 年在《SIAM 科学与统计计算杂志》上报告了非对称系统的多波前方法。<sup>[19](https://doi.org/10.1137/0905045)</sup> 第一篇聚焦并行方法的综述是 Michael T. Heath、Esmond Ng 和 Barry W. Peyton 1991 年发表于《SIAM 评论》的综述。<sup>[20](https://doi.org/10.1137/1033099)</sup>

## 变体

基本的分解算法有上视、左视和右视方法。对于填充很少的极稀疏矩阵，上视算法更可取；否则超节点方法（高效的左视形式）和多波前方法（高效的右视形式）更受青睐。<sup>[1](http://scholarpedia.org/article/Direct_methods_for_sparse_matrix_solution)</sup> 在多波前方法中，每个消元树节点携带一个方形稠密波前矩阵；处理节点时组装波前，部分分解，并计算贡献块 \( F_{22} \leftarrow F_{22} - F_{21} F_{11}^{-1} F_{12} \)。多波前求解器通过 BLAS-3 运算达到良好的浮点运算速率，且通信简单，代价是活跃内存较大。<sup>[21](https://inria.hal.science/hal-01060301v1/file/paper3.pdf)</sup>

选主元策略在稳定性与填充和并行性之间权衡。阈值选主元仅当对角主元的绝对值至少为所在列最大元素的 \( u \) 倍时才接受该主元，其中 \( 0 < u \le 1 \) 由用户设定；接近零的值分解更快、因子条目更少，接近 0.5 的值分解更稳定。<sup>[22](https://www.numerical.rl.ac.uk/media/reports/ghsRAL200505.pdf)</sup> 低秩压缩变体利用椭圆偏微分方程矩阵非对角 Schur 补块的低秩性质；块低秩（BLR）多波前分解形式化了这一点，其复杂度由 Patrick Amestoy 及其同事于 2017 年在《SIAM 科学计算杂志》上分析。<sup>[21](https://inria.hal.science/hal-01060301v1/file/paper3.pdf)</sup><sup> • </sup><sup>[23](https://doi.org/10.1137/16m1077192)</sup>

主要软件包包括 SuperLU 和 SuperLU_DIST、MUMPS、UMFPACK、PARDISO、CHOLMOD、KLU、SuiteSparseQR 以及 HSL 代码；没有单一算法或软件对所有类型的线性系统都是最优的。<sup>[7](https://portal.nersc.gov/project/sparse/superlu/SparseDirectSurvey.pdf)</sup><sup> • </sup><sup>[3](https://www.cambridge.org/core/journals/acta-numerica/article/abs/survey-of-direct-methods-for-sparse-linear-systems/8AE7AC55909389F7EA1F027855AC4044)</sup> SuperLU 是 James W. Demmel 及其同事提出的超节点稀疏部分选主元 LU 分解，于 1999 年发表在《SIAM 矩阵分析与应用杂志》上。<sup>[24](https://doi.org/10.1137/s0895479895291765)</sup> 静态选主元由 Xiaoye Sherry Li 和 James Demmel 于 1998 年提出，预先固定主元位置，从而可以事先确定数据结构和通信模式；它用于 SuperLU_DIST，这是 Xiaoye S. Li 和 James W. Demmel 开发的可扩展分布式内存稀疏直接求解器，用于非对称线性系统。<sup>[25](https://dl.acm.org/doi/10.1145/779359.779361)</sup> MUMPS 是一个用于对称和非对称系统的多波前并行分布式求解器，由 P. R. Amestoy、I. S. Duff 和 J.-Y. L'Excellent 创建，于 2000 年发表在《应用力学与工程中的计算机方法》上。<sup>[26](https://doi.org/10.1016/s0045-7825%2899%2900242-x)</sup> PARDISO 源自 O. Schenk、K. Gärtner 和 W. Fichtner 于 2000 年发表在《BIT 数值数学》上的左右视共享内存稀疏 LU 分解。<sup>[27](https://doi.org/10.1023/a:1022326604210)</sup> CHOLMOD 是 Yanqing Chen、Timothy A. Davis 和 William W. Hager 提出的带加性更新/减性更新的超节点稀疏 Cholesky 分解，于 2008 年发表。

## 应用

复杂度强烈依赖于维数。稠密 Cholesky 需 \( (1/3)n^3 + O(n^2) \) 次浮点运算，而高斯消元需 \( (2/3)n^3 + O(n^2) \) 次，两者均需 \( O(n^2) \) 内存。<sup>[28](https://people.inf.ethz.ch/arbenz/FEM17/pdfs/lecture6.pdf)</sup> 对于 \( k \times k \) 方形网格图上的稀疏问题，George 的嵌套剖分在 \( O(n^{3/2}) \) 时间和 \( O(n \log n) \) 空间内求解，利用的是从 \( k \times k \) 网格中移除 \( 2k-1 \) 个顶点会留下四个约 \( k/2 \times k/2 \) 的网格。<sup>[29](https://www.cs.cmu.edu/~glmiller/Publications/CMU-CS-92-106R.pdf)</sup> 对于三维网格，LU 需 \( O(n^2) \) 次浮点运算，因子内存为 \( O(n^{4/3}) \)。<sup>[6](https://mumps-solver.org/doc/EMS_ECMI_LanczosPrize_MUMPS.pdf)</sup>

稀疏系统源于偏微分方程的有限差分、有限元和谱离散化，以及电力网络和化学问题。<sup>[10](https://gerard-meurant.fr/handbook_2000.pdf)</sup> 在电路仿真中，直接求解器是传统 SPICE 仿真的标准方法，\( N \) 可达约 \( 10^6 \) 至 \( 10^7 \)；在带寄生参数的后布局仿真中，线性直接求解通常占总时间的 60% 到 90%；电路矩阵极度稀疏、非对称且常常病态，因此选主元很重要。<sup>[5](https://arxiv.org/pdf/2504.11716)</sup><sup> • </sup><sup>[30](https://www.aspdac.com/aspdac2024/archive/pdf/1E-4.pdf)</sup><sup> • </sup><sup>[31](https://ar5iv.labs.arxiv.org/html/1907.05309)</sup> 直接方法也是不存在可靠预条件子的“困难”系统的首选方法，以及求解同一矩阵但不同右端项的多个系统的首选方法，因为分解只需执行一次。<sup>[32](https://www.numerical.rl.ac.uk/media/people/nick-gould/ghsNAGIR20051r2.pdf)</sup>

## 局限与替代方案

填充是主要的失效模式：它可能是灾难性的，对几乎所有随机矩阵需要 \( O(n^2) \) 内存和 \( O(n^3) \) 时间，尽管对来自实际应用的矩阵几乎从不如此；最坏情况的内存和时间可扩展为 \( O(N^2) \) 和 \( O(N^3) \)，对于排序良好的问题，实践中通常为 \( O(N^{1.5}) \) 到 \( O(N^2) \)。<sup>[8](https://people.engr.tamu.edu/davis/publications_files/survey_tech_report.pdf)</sup><sup> • </sup><sup>[5](https://arxiv.org/pdf/2504.11716)</sup> 对于大型三维应用，必须采用迭代方法，因为直接方法的内存需求随问题规模快速增长，尽管核外技术可以扩展可处理的规模。<sup>[9](https://mdpi-res.com/d_attachment/algorithms/algorithms-06-00702/article_deploy/algorithms-06-00702.pdf?version=1383301060)</sup> 当 \( A \) 病态时，计算 \( A^{-1} \) 而非分解在数值上不稳定，且在稀疏情形下代价极高，因为逆通常没有零元素。<sup>[13](https://epubs.siam.org/doi/book/10.1137/1.9780898718881)</sup> 如果矩阵 \( A \) 发生变化，如在非线性迭代或瞬态仿真中，通常必须重复整个分解。<sup>[5](https://arxiv.org/pdf/2504.11716)</sup>

直接分解方法非常稳定，但可扩展性有限，最多可达数百或数千个核心。<sup>[33](https://people.eecs.berkeley.edu/~demmel/cs267_Spr15/Lectures/lecture15_SparseDirectSolvers_short_Grigori.pdf)</sup> 近期工作针对 GPU 和混合精度。GPU 多波前稀疏直接求解器建立在 Pieter Ghysels 和 Ryan Synk 的方法之上，该方法于 2022 年发表在《并行计算》上。<sup>[34](https://doi.org/10.1016/j.parco.2022.102897)</sup> 在混合精度方面，将稀疏近似分解与迭代精化相结合的方法由 Patrick Amestoy 及其同事于 2023 年在《ACM 数学软件汇刊》上分析。<sup>[35](https://doi.org/10.1145/3582493)</sup>

## References

1. [Direct methods for sparse matrix solution (Scholarpedia)](http://scholarpedia.org/article/Direct_methods_for_sparse_matrix_solution)
2. [Chapter 5: Direct Methods (Ascher & Greif, UBC course slides)](https://www.cs.ubc.ca/~ascher/ag_2012/ag_slides/chap5.pdf)
3. [A survey of direct methods for sparse linear systems (Acta Numerica)](https://www.cambridge.org/core/journals/acta-numerica/article/abs/survey-of-direct-methods-for-sparse-linear-systems/8AE7AC55909389F7EA1F027855AC4044)
4. [Gaussian elimination (Higham, WIREs Comp Stat 2011, DOI: 10.1002/wics.164)](https://personal.maths.manchester.ac.uk/higham/papers/high11g.pdf)
5. [Sparse linear solvers in EDA: direct, iterative, and multigrid (arXiv 2504.11716, 2025)](https://arxiv.org/pdf/2504.11716)
6. [MUMPS: MUltifrontal Massively Parallel Solver (EMS/ECMI Lanczos Prize lecture, 2024)](https://mumps-solver.org/doc/EMS_ECMI_LanczosPrize_MUMPS.pdf)
7. [Direct Solvers for Sparse Matrices (X. S. Li, April 2022)](https://portal.nersc.gov/project/sparse/superlu/SparseDirectSurvey.pdf)
8. [Survey of direct methods for sparse linear systems (Davis technical report)](https://people.engr.tamu.edu/davis/publications_files/survey_tech_report.pdf)
9. [New Parallel Sparse Direct Solvers for Multicore Architectures (HSL MA77/MA86/MA87/MA97, Algorithms 2013)](https://mdpi-res.com/d_attachment/algorithms/algorithms-06-00702/article_deploy/algorithms-06-00702.pdf?version=1383301060)
10. [Gaussian elimination for the solution of linear systems of equations on distributed memory computers (Meurant handbook chapter, 2000)](https://gerard-meurant.fr/handbook_2000.pdf)
11. [Direct Method (Intel oneMKL Developer Reference, 2025)](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2025-1/direct-method.html)
12. [Direct Sparse Matrix Methods (UMN CSci 8314 lecture notes)](https://classpages.cselabs.umn.edu/Spring-2023/csci8314/FILES/LecN8_R.pdf)
13. [Direct Methods for Sparse Linear Systems (Davis, SIAM)](https://epubs.siam.org/doi/book/10.1137/1.9780898718881)
14. [Patrick R. Amestoy, Timothy A. Davis, Iain S. Duff (1996). An Approximate Minimum Degree Ordering Algorithm. SIAM Journal on Matrix Analysis and Applications.](https://doi.org/10.1137/s0895479894278952)
15. [The Quest for Linear Equation Solvers (historical essay)](https://ed-thelen.org/ABC/QuestLinearSolvers-.html)
16. [The Decompositional Approach to Matrix Computation (Stewart)](https://web.stanford.edu/class/archive/cs/cs339/cs339.2002/decomp.pdf)
17. [Herman Chernoff, Paul Dwyer (1952). Linear Computations. Econometrica.](https://doi.org/10.2307/1907420)
18. [Alan George (1973). Nested Dissection of a Regular Finite Element Mesh. SIAM Journal on Numerical Analysis.](https://doi.org/10.1137/0710032)
19. [I. S. Duff, J. K. Reid (1984). The Multifrontal Solution of Unsymmetric Sets of Linear Equations. SIAM Journal on Scientific and Statistical Computing.](https://doi.org/10.1137/0905045)
20. [Michael T. Heath, Esmond Ng, Barry W. Peyton (1991). Parallel Algorithms for Sparse Linear Systems. SIAM Review.](https://doi.org/10.1137/1033099)
21. [Recent research directions in sparse direct solvers (INRIA/HAL)](https://inria.hal.science/hal-01060301v1/file/paper3.pdf)
22. [A numerical evaluation of sparse direct solvers for large sparse symmetric linear systems (RAL technical report)](https://www.numerical.rl.ac.uk/media/reports/ghsRAL200505.pdf)
23. [Patrick Amestoy and colleagues (2017). On the Complexity of the Block Low-Rank Multifrontal Factorization. SIAM Journal on Scientific Computing.](https://doi.org/10.1137/16m1077192)
24. [James W. Demmel and colleagues (1999). A Supernodal Approach to Sparse Partial Pivoting. SIAM Journal on Matrix Analysis and Applications.](https://doi.org/10.1137/s0895479895291765)
25. [SuperLU_DIST: A scalable distributed-memory sparse direct solver for unsymmetric linear systems (ACM TOMS 29(2), 2003)](https://dl.acm.org/doi/10.1145/779359.779361)
26. [Multifrontal parallel distributed symmetric and unsymmetric solvers (Computer Methods in Applied Mechanics and Engineering, 2000)](https://doi.org/10.1016/s0045-7825%2899%2900242-x)
27. [O. Schenk, K. Gärtner, W. Fichtner (2000). Efficient Sparse LU Factorization with Left-Right Looking Strategy on Shared Memory Multiprocessors. BIT Numerical Mathematics.](https://doi.org/10.1023/a:1022326604210)
28. [FEM and Sparse Linear System Solving, Lecture 6 (P. Arbenz, ETH Zürich)](https://people.inf.ethz.ch/arbenz/FEM17/pdfs/lecture6.pdf)
29. [Nested Dissection: A survey and comparison of various nested dissection algorithms (CMU-CS-92-106R)](https://www.cs.cmu.edu/~glmiller/Publications/CMU-CS-92-106R.pdf)
30. [Machine Learning and GPU Accelerated Sparse Linear Solvers for Transistor-Level Circuit Simulation (ASP-DAC 2024)](https://www.aspdac.com/aspdac2024/archive/pdf/1E-4.pdf)
31. [State-of-The-Art Sparse Direct Solvers (Schenk, Gärtner, et al., arXiv:1907.05309)](https://ar5iv.labs.arxiv.org/html/1907.05309)
32. [Complete results from a numerical evaluation of sparse direct solvers (RAL report)](https://www.numerical.rl.ac.uk/media/people/nick-gould/ghsNAGIR20051r2.pdf)
33. [CS267 Lecture 15: Sparse Direct Solvers (Demmel/Grigori, UC Berkeley)](https://people.eecs.berkeley.edu/~demmel/cs267_Spr15/Lectures/lecture15_SparseDirectSolvers_short_Grigori.pdf)
34. [Pieter Ghysels, Ryan Synk (2022). High performance sparse multifrontal solvers on modern GPUs. Parallel Computing.](https://doi.org/10.1016/j.parco.2022.102897)
35. [Patrick Amestoy and colleagues (2023). Combining Sparse Approximate Factorizations with Mixed-precision Iterative Refinement. ACM Transactions on Mathematical Software.](https://doi.org/10.1145/3582493)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Numerical linear algebra › Direct solvers for linear systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/direct-solver

English original: https://www.edgepedia.org/direct-solver
