문제

How to do transpose for tptrs in blas?

I want to solve:

XA = B

But it seems that tptrs only lets me solve:

AX = B

Or, using the 'transpose' flag, in tptrs:

A'X = B

which, rearranging is:

(A'X)' = B'
X'A = B'

So, I can use it to solve XA = B, but I have to first transpose B manually myself, and then, again, transpose the answer. Am I missing some trick to avoid having to do the transpose?

도움이 되었습니까?

해결책

TPTRS isn't a BLAS routine; it's an LAPACK routine.

If A is relatively small compared to B and X, then a good option to unpack it into a "normal" triangular matrix and use the BLAS routine TRSM which takes a "side" argument allowing you to specify XA = B. If A is mxm and B is nxm, the unpacking adds m^2 operations which will be a small amount of overhead compared to the O(nm^2) operations to do the solve.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top