I am looking for some triangular solvers, and I have come across two solvers. One in BLAS: dtrsm and another in LAPACK: dtrtrs. From the looks of it both seem to have common functionality, with dtrsm having a little bit more functionality (scaling the right hand side before solving the system).
I would like to know
1) How else do开发者_JAVA百科 these functions differ ? 2) When performing the same operation, which is faster ? 3) If the answer to (2) is not obvious, When is dtrsm suggested over dtrtrs and vice versa ?Besides scaling,
dtrsm
can also solve systems in which the triangular matrix is right-multiplied into the unknown matrix (i.e., it can solve XA = B as well as AX = B). On the other hand,dtrsm
can silently fail if A is singular, whereasdtrtrs
checks for this condition and reports an error.In a "typical" LAPACK distribution,
dtrtrs
is just a wrapper that checks for singularity and then callsdtrsm
.dtrsm
is therefore slightly faster, but that difference is insignificant for matrices of any reasonable size.
精彩评论