Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top