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

apply DLARF to a vector?

Azua_Garcia__Giovann
296 Views
Hello,

I would like to use dlarf to apply an elementary Householder reflector to a vector rather than to a matrix, how can I do that?

My context is that of updating a QR decomposition after deleting columns. I'm reusing the Fortran routines from the links:
http://www.maths.manchester.ac.uk/~cluc ... /delcols.f
http://www.maths.manchester.ac.uk/~cluc ... delcolsq.f

I can apply and test the delcols QR update correctly using delcols.f, I then use a modified version of delcolsq.f as test to apply the update to the Q_B'*C i.e. Q_delcols*Q_B'*C and this works fine I get my new R upper triangular. I don't know why the authors of those functions decided to provide a delcolsq.f that requires generating explicitly the Q since no one in practice ever expensively generate the Q explicitly but well ... my version of their delcolsq to be able to apply it to my Q_B'*C is included below and this works fine ... I can test that it annihilates the offending non zero terms under the diagonal. However, when I try to apply the same transformation to my vector c solving an overdetermined system (the c of the solve Ax=b, c=Q_B'*b and I need to do c=Q_delcols*c on top) it doesn't work. I have tried modifying the Fortran code below to take Q as a vector rather than a matrix but it doesn't produce the correct results. I have also tried to fool the DLARF setting the ldc=1 (or LDQ below) but doesn't work either. Can anyone shed some light into how to do this?

Many thanks in advance,
Best regards,
Giovanni

LAST = MIN( M-1, N )
*
DO 10 J = K, LAST
*
LENH = MIN( P+1, M-J+1 )
*
* Apply H(J) to trailing matrix from left
*
AJJ = A( J, J )
A( J, J ) = ONE
CALL DLARF( 'L', LENH, M-J, A( J, J ), 1, TAU( J-K+1 ),
$ Q( J, J ), LDQ, WORK )
*
A( J, J ) = AJJ
*
10 CONTINUE
0 Kudos
1 Reply
Azua_Garcia__Giovann
296 Views
Please ignore, I made a mistake, it works now.
0 Kudos
Reply