7

我正在寻找一些三角求解器,我遇到了两个求解器。BLAS 中的一个:dtrsm 和 LAPACK 中的另一个:dtrtrs。从外观上看,两者似乎都具有共同的功能,而 dtrsm 具有更多功能(在解决系统之前缩放右侧)。

我想知道
1)这些功能还有什么不同?
2)当执行相同的操作时,哪个更快?
3) 如果 (2) 的答案不明显,什么时候建议 dtrsm 优于 dtrtrs,反之亦然?

4

1 回答 1

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

于 2011-06-29T01:02:27.470 回答