Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between dtrtrs and dtrsm

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 ?

like image 974
Pavan Yalamanchili Avatar asked Jun 29 '11 00:06

Pavan Yalamanchili


1 Answers

  1. 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.

  2. 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.

like image 200
Stephen Canon Avatar answered Nov 07 '22 12:11

Stephen Canon