199 SUBROUTINE zunbdb3( M, P, Q, X11, LDX11, X21, LDX21, THETA, PHI,
200 $ TAUP1, TAUP2, TAUQ1, WORK, LWORK, INFO )
207 INTEGER INFO, LWORK, M, P, Q, LDX11, LDX21
210 DOUBLE PRECISION PHI(*), THETA(*)
211 COMPLEX*16 TAUP1(*), TAUP2(*), TAUQ1(*), WORK(*),
212 $ x11(ldx11,*), x21(ldx21,*)
219 parameter( one = (1.0d0,0.0d0) )
222 DOUBLE PRECISION C, S
223 INTEGER CHILDINFO, I, ILARF, IORBDB5, LLARF, LORBDB5,
231 DOUBLE PRECISION DZNRM2
235 INTRINSIC atan2, cos, max, sin, sqrt
242 lquery = lwork .EQ. -1
246 ELSE IF( 2*p .LT. m .OR. p .GT. m )
THEN
248 ELSE IF( q .LT. m-p .OR. m-q .LT. m-p )
THEN
250 ELSE IF( ldx11 .LT. max( 1, p ) )
THEN
252 ELSE IF( ldx21 .LT. max( 1, m-p ) )
THEN
258 IF( info .EQ. 0 )
THEN
260 llarf = max( p, m-p-1, q-1 )
263 lworkopt = max( ilarf+llarf-1, iorbdb5+lorbdb5-1 )
266 IF( lwork .LT. lworkmin .AND. .NOT.lquery )
THEN
270 IF( info .NE. 0 )
THEN
271 CALL xerbla(
'ZUNBDB3', -info )
273 ELSE IF( lquery )
THEN
282 CALL zdrot( q-i+1, x11(i-1,i), ldx11, x21(i,i), ldx11, c,
286 CALL zlacgv( q-i+1, x21(i,i), ldx21 )
287 CALL zlarfgp( q-i+1, x21(i,i), x21(i,i+1), ldx21, tauq1(i) )
290 CALL zlarf(
'R', p-i+1, q-i+1, x21(i,i), ldx21, tauq1(i),
291 $ x11(i,i), ldx11, work(ilarf) )
292 CALL zlarf(
'R', m-p-i, q-i+1, x21(i,i), ldx21, tauq1(i),
293 $ x21(i+1,i), ldx21, work(ilarf) )
294 CALL zlacgv( q-i+1, x21(i,i), ldx21 )
295 c = sqrt( dznrm2( p-i+1, x11(i,i), 1 )**2
296 $ + dznrm2( m-p-i, x21(i+1,i), 1 )**2 )
297 theta(i) = atan2( s, c )
299 CALL zunbdb5( p-i+1, m-p-i, q-i, x11(i,i), 1, x21(i+1,i), 1,
300 $ x11(i,i+1), ldx11, x21(i+1,i+1), ldx21,
301 $ work(iorbdb5), lorbdb5, childinfo )
302 CALL zlarfgp( p-i+1, x11(i,i), x11(i+1,i), 1, taup1(i) )
303 IF( i .LT. m-p )
THEN
304 CALL zlarfgp( m-p-i, x21(i+1,i), x21(i+2,i), 1, taup2(i) )
305 phi(i) = atan2( dble( x21(i+1,i) ), dble( x11(i,i) ) )
309 CALL zlarf(
'L', m-p-i, q-i, x21(i+1,i), 1,
310 $ dconjg(taup2(i)), x21(i+1,i+1), ldx21,
314 CALL zlarf(
'L', p-i+1, q-i, x11(i,i), 1, dconjg(taup1(i)),
315 $ x11(i,i+1), ldx11, work(ilarf) )
322 CALL zlarfgp( p-i+1, x11(i,i), x11(i+1,i), 1, taup1(i) )
324 CALL zlarf(
'L', p-i+1, q-i, x11(i,i), 1, dconjg(taup1(i)),
325 $ x11(i,i+1), ldx11, work(ilarf) )
subroutine xerbla(srname, info)
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlarf(side, m, n, v, incv, tau, c, ldc, work)
ZLARF applies an elementary reflector to a general rectangular matrix.
subroutine zlarfgp(n, alpha, x, incx, tau)
ZLARFGP generates an elementary reflector (Householder matrix) with non-negative beta.
subroutine zdrot(n, zx, incx, zy, incy, c, s)
ZDROT
subroutine zunbdb3(m, p, q, x11, ldx11, x21, ldx21, theta, phi, taup1, taup2, tauq1, work, lwork, info)
ZUNBDB3
subroutine zunbdb5(m1, m2, n, x1, incx1, x2, incx2, q1, ldq1, q2, ldq2, work, lwork, info)
ZUNBDB5