4

How to do transpose for trtrs (or tptrs) in blas?

I want to solve:

XA = B

But it seems that trtrs only lets me solve:

AX = B

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

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 two manual transposes?

Note that I've read through solve $xA=b$ for $x$ using LAPACK and BLAS , but it doesn't seem to explain how to avoid the two manual transposes, as far as I can tell? Or maybe I'm missing something somehow?

Hugh Perkins
  • 373
  • 1
  • 13

1 Answers1

4

Since basically all that xTRTRS does is call xTRSM (from BLAS), why not just call that directly? xTRSM contains a SIDE parameter which lets you specify exactly what you want.

Victor Liu
  • 4,480
  • 18
  • 28