199 SUBROUTINE sorbdb2( 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 REAL PHI(*), THETA(*)
211 REAL TAUP1(*), TAUP2(*), TAUQ1(*), WORK(*),
212 $ x11(ldx11,*), x21(ldx21,*)
219 parameter( negone = -1.0e0, one = 1.0e0 )
223 INTEGER CHILDINFO, I, ILARF, IORBDB5, LLARF, LORBDB5,
235 INTRINSIC atan2, cos, max, sin, sqrt
242 lquery = lwork .EQ. -1
246 ELSE IF( p .LT. 0 .OR. p .GT. m-p )
THEN
248 ELSE IF( q .LT. 0 .OR. q .LT. p .OR. m-q .LT. 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-1, m-p, 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(
'SORBDB2', -info )
273 ELSE IF( lquery )
THEN
282 CALL srot( q-i+1, x11(i,i), ldx11, x21(i-1,i), ldx21, c, s )
284 CALL slarfgp( q-i+1, x11(i,i), x11(i,i+1), ldx11, tauq1(i) )
287 CALL slarf(
'R', p-i, q-i+1, x11(i,i), ldx11, tauq1(i),
288 $ x11(i+1,i), ldx11, work(ilarf) )
289 CALL slarf(
'R', m-p-i+1, q-i+1, x11(i,i), ldx11, tauq1(i),
290 $ x21(i,i), ldx21, work(ilarf) )
291 s = sqrt( snrm2( p-i, x11(i+1,i), 1 )**2
292 $ + snrm2( m-p-i+1, x21(i,i), 1 )**2 )
293 theta(i) = atan2( s, c )
295 CALL sorbdb5( p-i, m-p-i+1, q-i, x11(i+1,i), 1, x21(i,i), 1,
296 $ x11(i+1,i+1), ldx11, x21(i,i+1), ldx21,
297 $ work(iorbdb5), lorbdb5, childinfo )
298 CALL sscal( p-i, negone, x11(i+1,i), 1 )
299 CALL slarfgp( m-p-i+1, x21(i,i), x21(i+1,i), 1, taup2(i) )
301 CALL slarfgp( p-i, x11(i+1,i), x11(i+2,i), 1, taup1(i) )
302 phi(i) = atan2( x11(i+1,i), x21(i,i) )
306 CALL slarf(
'L', p-i, q-i, x11(i+1,i), 1, taup1(i),
307 $ x11(i+1,i+1), ldx11, work(ilarf) )
310 CALL slarf(
'L', m-p-i+1, q-i, x21(i,i), 1, taup2(i),
311 $ x21(i,i+1), ldx21, work(ilarf) )
318 CALL slarfgp( m-p-i+1, x21(i,i), x21(i+1,i), 1, taup2(i) )
320 CALL slarf(
'L', m-p-i+1, q-i, x21(i,i), 1, taup2(i),
321 $ x21(i,i+1), ldx21, work(ilarf) )
subroutine xerbla(srname, info)
subroutine slarf(side, m, n, v, incv, tau, c, ldc, work)
SLARF applies an elementary reflector to a general rectangular matrix.
subroutine slarfgp(n, alpha, x, incx, tau)
SLARFGP generates an elementary reflector (Householder matrix) with non-negative beta.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sorbdb2(m, p, q, x11, ldx11, x21, ldx21, theta, phi, taup1, taup2, tauq1, work, lwork, info)
SORBDB2
subroutine sorbdb5(m1, m2, n, x1, incx1, x2, incx2, q1, ldq1, q2, ldq2, work, lwork, info)
SORBDB5