185 SUBROUTINE sgbbrd( VECT, M, N, NCC, KL, KU, AB, LDAB, D, E, Q,
186 $ LDQ, PT, LDPT, C, LDC, WORK, INFO )
194 INTEGER INFO, KL, KU, LDAB, LDC, LDPT, LDQ, M, N, NCC
197 REAL AB( LDAB, * ), C( LDC, * ), D( * ), E( * ),
198 $ pt( ldpt, * ), q( ldq, * ), work( * )
205 parameter( zero = 0.0e+0, one = 1.0e+0 )
208 LOGICAL WANTB, WANTC, WANTPT, WANTQ
209 INTEGER I, INCA, J, J1, J2, KB, KB1, KK, KLM, KLU1,
210 $ kun, l, minmn, ml, ml0, mn, mu, mu0, nr, nrt
227 wantb = lsame( vect,
'B' )
228 wantq = lsame( vect,
'Q' ) .OR. wantb
229 wantpt = lsame( vect,
'P' ) .OR. wantb
233 IF( .NOT.wantq .AND. .NOT.wantpt .AND. .NOT.lsame( vect,
'N' ) )
236 ELSE IF( m.LT.0 )
THEN
238 ELSE IF( n.LT.0 )
THEN
240 ELSE IF( ncc.LT.0 )
THEN
242 ELSE IF( kl.LT.0 )
THEN
244 ELSE IF( ku.LT.0 )
THEN
246 ELSE IF( ldab.LT.klu1 )
THEN
248 ELSE IF( ldq.LT.1 .OR. wantq .AND. ldq.LT.max( 1, m ) )
THEN
250 ELSE IF( ldpt.LT.1 .OR. wantpt .AND. ldpt.LT.max( 1, n ) )
THEN
252 ELSE IF( ldc.LT.1 .OR. wantc .AND. ldc.LT.max( 1, m ) )
THEN
256 CALL xerbla(
'SGBBRD', -info )
263 $
CALL slaset(
'Full', m, m, zero, one, q, ldq )
265 $
CALL slaset(
'Full', n, n, zero, one, pt, ldpt )
269 IF( m.EQ.0 .OR. n.EQ.0 )
274 IF( kl+ku.GT.1 )
THEN
318 $
CALL slargv( nr, ab( klu1, j1-klm-1 ), inca,
319 $ work( j1 ), kb1, work( mn+j1 ), kb1 )
324 IF( j2-klm+l-1.GT.n )
THEN
330 $
CALL slartv( nrt, ab( klu1-l, j1-klm+l-1 ), inca,
331 $ ab( klu1-l+1, j1-klm+l-1 ), inca,
332 $ work( mn+j1 ), work( j1 ), kb1 )
336 IF( ml.LE.m-i+1 )
THEN
341 CALL slartg( ab( ku+ml-1, i ), ab( ku+ml, i ),
342 $ work( mn+i+ml-1 ), work( i+ml-1 ),
344 ab( ku+ml-1, i ) = ra
346 $
CALL srot( min( ku+ml-2, n-i ),
347 $ ab( ku+ml-2, i+1 ), ldab-1,
348 $ ab( ku+ml-1, i+1 ), ldab-1,
349 $ work( mn+i+ml-1 ), work( i+ml-1 ) )
359 DO 20 j = j1, j2, kb1
360 CALL srot( m, q( 1, j-1 ), 1, q( 1, j ), 1,
361 $ work( mn+j ), work( j ) )
369 DO 30 j = j1, j2, kb1
370 CALL srot( ncc, c( j-1, 1 ), ldc, c( j, 1 ), ldc,
371 $ work( mn+j ), work( j ) )
375 IF( j2+kun.GT.n )
THEN
383 DO 40 j = j1, j2, kb1
388 work( j+kun ) = work( j )*ab( 1, j+kun )
389 ab( 1, j+kun ) = work( mn+j )*ab( 1, j+kun )
396 $
CALL slargv( nr, ab( 1, j1+kun-1 ), inca,
397 $ work( j1+kun ), kb1, work( mn+j1+kun ),
403 IF( j2+l-1.GT.m )
THEN
409 $
CALL slartv( nrt, ab( l+1, j1+kun-1 ), inca,
410 $ ab( l, j1+kun ), inca,
411 $ work( mn+j1+kun ), work( j1+kun ),
415 IF( ml.EQ.ml0 .AND. mu.GT.mu0 )
THEN
416 IF( mu.LE.n-i+1 )
THEN
421 CALL slartg( ab( ku-mu+3, i+mu-2 ),
422 $ ab( ku-mu+2, i+mu-1 ),
423 $ work( mn+i+mu-1 ), work( i+mu-1 ),
425 ab( ku-mu+3, i+mu-2 ) = ra
426 CALL srot( min( kl+mu-2, m-i ),
427 $ ab( ku-mu+4, i+mu-2 ), 1,
428 $ ab( ku-mu+3, i+mu-1 ), 1,
429 $ work( mn+i+mu-1 ), work( i+mu-1 ) )
439 DO 60 j = j1, j2, kb1
440 CALL srot( n, pt( j+kun-1, 1 ), ldpt,
441 $ pt( j+kun, 1 ), ldpt, work( mn+j+kun ),
446 IF( j2+kb.GT.m )
THEN
454 DO 70 j = j1, j2, kb1
459 work( j+kb ) = work( j+kun )*ab( klu1, j+kun )
460 ab( klu1, j+kun ) = work( mn+j+kun )*ab( klu1, j+kun )
472 IF( ku.EQ.0 .AND. kl.GT.0 )
THEN
480 DO 100 i = 1, min( m-1, n )
481 CALL slartg( ab( 1, i ), ab( 2, i ), rc, rs, ra )
484 e( i ) = rs*ab( 1, i+1 )
485 ab( 1, i+1 ) = rc*ab( 1, i+1 )
488 $
CALL srot( m, q( 1, i ), 1, q( 1, i+1 ), 1, rc, rs )
490 $
CALL srot( ncc, c( i, 1 ), ldc, c( i+1, 1 ), ldc, rc,
494 $ d( m ) = ab( 1, m )
495 ELSE IF( ku.GT.0 )
THEN
507 CALL slartg( ab( ku+1, i ), rb, rc, rs, ra )
511 e( i-1 ) = rc*ab( ku, i )
514 $
CALL srot( n, pt( i, 1 ), ldpt, pt( m+1, 1 ), ldpt,
521 DO 120 i = 1, minmn - 1
522 e( i ) = ab( ku, i+1 )
525 d( i ) = ab( ku+1, i )
533 DO 140 i = 1, minmn - 1
subroutine xerbla(srname, info)
subroutine sgbbrd(vect, m, n, ncc, kl, ku, ab, ldab, d, e, q, ldq, pt, ldpt, c, ldc, work, info)
SGBBRD
subroutine slargv(n, x, incx, y, incy, c, incc)
SLARGV generates a vector of plane rotations with real cosines and real sines.
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine slartv(n, x, incx, y, incy, c, s, incc)
SLARTV applies a vector of plane rotations with real cosines and real sines to the elements of a pair...
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT