Fast solution of dense linear system of fixed dimension (N=9), symmetric, positive-semidefinite

后端 未结 6 463
旧巷少年郎
旧巷少年郎 2021-01-18 04:10

Which algorithm you would recommend for fast solution of dense linear system of fixed dimension (N=9) (matrix is symmetric, positive-semidefinite)?

  • Gaussian el
6条回答
  •  旧时难觅i
    2021-01-18 04:52

    The matrix being symmetric, positive-semidefinite, the Cholesky decomposition is strictly superior to the LU decomposition. (roughly twice faster than LU, whatever the size of the matrix. Source : "Numerical Linear Algebra" by Trefethen and Bau)

    It is also de facto the standard for small dense matrices (source : I do a PhD in computational mathematics) Iterative methods are less efficient than direct methods unless the system becomes large enough (quick rule of thumb that means nothing, but that is always nice to have : on any modern computer, any matrix smaller than 100*100 is definitely a small matrix that needs direct methods, rather than iterative ones)

    Now, I do not recommend to do it yourself. There are tons of good libraries out there that have been thoroughly tested. But if I have to recommend you one, it would be Eigen :

    • No installation required (header only library, so no library to link, only #include<>)
    • Robust and efficient (they have a lot of benchmarks on the main page, and the results are nice)
    • Easy to use and well documented

    By the way, here in the documentation, you have the various pros and cons of their 7 direct linear solvers in a nice, concise table. It seems that in your case, LDLT (a variation of Cholesky) wins

提交回复
热议问题