求解带对角矩阵的最佳算法是什么?
我试图找出解决五对角矩阵的最佳方法。有没有比高斯消去法更快的东西?
I'm trying to figure out the best way to solve a pentadiagonal matrix. Is there something faster than gaussian elimination?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该对矩阵进行 LU 或 Cholesky 分解,具体取决于您的矩阵是否是 Hermitian 正定矩阵,然后用因子进行回代。这本质上只是高斯消元法,但往往具有更好的数值特性。我建议使用 LAPACK,因为这些实现往往是最快且最稳健的。看_GBSV例程,其中空格是s、d、c之一、z,具体取决于您的号码类型。
编辑:如果您询问是否有一种算法比因子/求解(高斯消除)方法更快,那么没有。带状矩阵的专门因式分解例程大约需要 4n*k^2 次操作(k 是带宽),而向后替换大约需要 6*n*k 次操作。因此,对于固定带宽,您无法比 n 中的线性时间做得更好。
You should do an LU or Cholesky decomposition of the matrix, depending on if your matrix is Hermitian positive definite or not, and then do back substitution with the factors. This is essentially just Gaussian elimination, but tends to have better numerical properties. I recommend using LAPACK since those implementations tend to be the fastest and the most robust. Look at the _GBSV routines, where the blank is one of s, d, c, z, depending on your number type.
Edit: In case you're asking if there is an algorithm faster than the factor/solve (Gaussian elimination) method, no there is not. A specialized factorization routine for a banded matrix takes about 4n*k^2 operations (k is the bandwidth), while the backward substitution takes about 6*n*k operations. Thus, for fixed bandwidth, you cannot do better than linear time in n.