I am trying to solve a linear system Ax=b
where A
is 3x3
symmetric positive definite.
Though it is low in scale, I will have to repeat it for different A
s millions of times. So efficiency is still important.
There are many solvers for linear systems (C++, via Eigen).
I personally prefer: HouseholderQr().solve()
, and llt().solve()
, ldlt().solve()
.
I know that when n
is very large, solvers based on Cholesky decomposition are faster than that of Householder's. But for my case when n
is only 3, how can I compare their relative efficiency? Is there any formula for the exact float operation
analysis?
thanks
Yes, Cholesky will still be faster. It will be about n^3/3 flops. The only reason to use QR would be if your matrix was very ill-conditioned.
If you need to solve these systems a million times and efficiency is important, I'd recommend calling LAPACK directly. You want the
DPOSV
function.http://www.netlib.org/lapack/lug/node26.html#1272
http://www.netlib.org/clapack/what/double/dposv.c