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 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, whereas dtrtrs
checks for this condition and reports an error.
In a "typical" LAPACK distribution, dtrtrs
is just a wrapper that checks for singularity and then calls dtrsm
. dtrsm
is therefore slightly faster, but that difference is insignificant for matrices of any reasonable size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With