Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

rotg and rot example


Can anyone point me to examples for using BLAS rotg together with rot? I think I understand rotg but not rot (applying the transformation) so well.

Basically I have a matrix A and its QR in compact LAPACK form. Now I add a row of ones to A and need to eliminate them. So the R would be e.g. 4x4 -> 5x4

x x x x
0 x x x
0 0 x x
0 0 0 x
1 1 1 1

use rotg to rotate x_11 with 1, get r1, z1, c1, s1
use rotg to rotate x_22 with 1, get r2, z2, c2, s2
use rotg to rotate x_33 with 1, get r3, z3, c3, s3
use rotg to rotate x_44 with 1, get r4, z4, c4, s4

At this point I need to apply the rotation transformation on a new vector c of dimension e.g. 5x1 using rot and this is what is not clear to me. The vector c is in the context of solving an overdetermined linear system Ax=b process where I do:

1) dormqr apply previously existing QR to b i.e. Q'*b=c
2) apply rotations using rot to c and get H1*H2*H3*H4*c=c' ... how to do this? any way to bundle them all together?
3) do the usual right substitution R*x = c'

Thanks in advance,
Best regards,

0 Kudos
0 Replies