265 SUBROUTINE zlalsa( ICOMPQ, SMLSIZ, N, NRHS, B, LDB, BX, LDBX, U,
266 $ LDU, VT, K, DIFL, DIFR, Z, POLES, GIVPTR,
267 $ GIVCOL, LDGCOL, PERM, GIVNUM, C, S, RWORK,
276 INTEGER ICOMPQ, INFO, LDB, LDBX, LDGCOL, LDU, N, NRHS,
280 INTEGER GIVCOL( ldgcol, * ), GIVPTR( * ), IWORK( * ),
281 $ k( * ), perm( ldgcol, * )
282 DOUBLE PRECISION C( * ), DIFL( ldu, * ), DIFR( ldu, * ),
283 $ givnum( ldu, * ), poles( ldu, * ), rwork( * ),
284 $ s( * ), u( ldu, * ), vt( ldu, * ), z( ldu, * )
285 COMPLEX*16 B( ldb, * ), BX( ldbx, * )
291 DOUBLE PRECISION ZERO, ONE
292 parameter( zero = 0.0d0, one = 1.0d0 )
295 INTEGER I, I1, IC, IM1, INODE, J, JCOL, JIMAG, JREAL,
296 $ jrow, lf, ll, lvl, lvl2, nd, ndb1, ndiml,
297 $ ndimr, nl, nlf, nlp1, nlvl, nr, nrf, nrp1, sqre
303 INTRINSIC dble, dcmplx, dimag
311 IF( ( icompq.LT.0 ) .OR. ( icompq.GT.1 ) )
THEN 313 ELSE IF( smlsiz.LT.3 )
THEN 315 ELSE IF( n.LT.smlsiz )
THEN 317 ELSE IF( nrhs.LT.1 )
THEN 319 ELSE IF( ldb.LT.n )
THEN 321 ELSE IF( ldbx.LT.n )
THEN 323 ELSE IF( ldu.LT.n )
THEN 325 ELSE IF( ldgcol.LT.n )
THEN 329 CALL xerbla(
'ZLALSA', -info )
339 CALL dlasdt( n, nlvl, nd, iwork( inode ), iwork( ndiml ),
340 $ iwork( ndimr ), smlsiz )
345 IF( icompq.EQ.1 )
THEN 364 ic = iwork( inode+i1 )
365 nl = iwork( ndiml+i1 )
366 nr = iwork( ndimr+i1 )
378 DO 10 jrow = nlf, nlf + nl - 1
380 rwork( j ) = dble( b( jrow, jcol ) )
383 CALL dgemm(
'T',
'N', nl, nrhs, nl, one, u( nlf, 1 ), ldu,
384 $ rwork( 1+nl*nrhs*2 ), nl, zero, rwork( 1 ), nl )
387 DO 30 jrow = nlf, nlf + nl - 1
389 rwork( j ) = dimag( b( jrow, jcol ) )
392 CALL dgemm(
'T',
'N', nl, nrhs, nl, one, u( nlf, 1 ), ldu,
393 $ rwork( 1+nl*nrhs*2 ), nl, zero, rwork( 1+nl*nrhs ),
398 DO 50 jrow = nlf, nlf + nl - 1
401 bx( jrow, jcol ) = dcmplx( rwork( jreal ),
414 DO 70 jrow = nrf, nrf + nr - 1
416 rwork( j ) = dble( b( jrow, jcol ) )
419 CALL dgemm(
'T',
'N', nr, nrhs, nr, one, u( nrf, 1 ), ldu,
420 $ rwork( 1+nr*nrhs*2 ), nr, zero, rwork( 1 ), nr )
422 DO 100 jcol = 1, nrhs
423 DO 90 jrow = nrf, nrf + nr - 1
425 rwork( j ) = dimag( b( jrow, jcol ) )
428 CALL dgemm(
'T',
'N', nr, nrhs, nr, one, u( nrf, 1 ), ldu,
429 $ rwork( 1+nr*nrhs*2 ), nr, zero, rwork( 1+nr*nrhs ),
433 DO 120 jcol = 1, nrhs
434 DO 110 jrow = nrf, nrf + nr - 1
437 bx( jrow, jcol ) = dcmplx( rwork( jreal ),
448 ic = iwork( inode+i-1 )
449 CALL zcopy( nrhs, b( ic, 1 ), ldb, bx( ic, 1 ), ldbx )
458 DO 160 lvl = nlvl, 1, -1
473 ic = iwork( inode+im1 )
474 nl = iwork( ndiml+im1 )
475 nr = iwork( ndimr+im1 )
479 CALL zlals0( icompq, nl, nr, sqre, nrhs, bx( nlf, 1 ), ldbx,
480 $ b( nlf, 1 ), ldb, perm( nlf, lvl ),
481 $ givptr( j ), givcol( nlf, lvl2 ), ldgcol,
482 $ givnum( nlf, lvl2 ), ldu, poles( nlf, lvl2 ),
483 $ difl( nlf, lvl ), difr( nlf, lvl2 ),
484 $ z( nlf, lvl ), k( j ), c( j ), s( j ), rwork,
511 DO 180 i = ll, lf, -1
513 ic = iwork( inode+im1 )
514 nl = iwork( ndiml+im1 )
515 nr = iwork( ndimr+im1 )
524 CALL zlals0( icompq, nl, nr, sqre, nrhs, b( nlf, 1 ), ldb,
525 $ bx( nlf, 1 ), ldbx, perm( nlf, lvl ),
526 $ givptr( j ), givcol( nlf, lvl2 ), ldgcol,
527 $ givnum( nlf, lvl2 ), ldu, poles( nlf, lvl2 ),
528 $ difl( nlf, lvl ), difr( nlf, lvl2 ),
529 $ z( nlf, lvl ), k( j ), c( j ), s( j ), rwork,
541 ic = iwork( inode+i1 )
542 nl = iwork( ndiml+i1 )
543 nr = iwork( ndimr+i1 )
560 DO 210 jcol = 1, nrhs
561 DO 200 jrow = nlf, nlf + nlp1 - 1
563 rwork( j ) = dble( b( jrow, jcol ) )
566 CALL dgemm(
'T',
'N', nlp1, nrhs, nlp1, one, vt( nlf, 1 ), ldu,
567 $ rwork( 1+nlp1*nrhs*2 ), nlp1, zero, rwork( 1 ),
570 DO 230 jcol = 1, nrhs
571 DO 220 jrow = nlf, nlf + nlp1 - 1
573 rwork( j ) = dimag( b( jrow, jcol ) )
576 CALL dgemm(
'T',
'N', nlp1, nrhs, nlp1, one, vt( nlf, 1 ), ldu,
577 $ rwork( 1+nlp1*nrhs*2 ), nlp1, zero,
578 $ rwork( 1+nlp1*nrhs ), nlp1 )
581 DO 250 jcol = 1, nrhs
582 DO 240 jrow = nlf, nlf + nlp1 - 1
585 bx( jrow, jcol ) = dcmplx( rwork( jreal ),
597 DO 270 jcol = 1, nrhs
598 DO 260 jrow = nrf, nrf + nrp1 - 1
600 rwork( j ) = dble( b( jrow, jcol ) )
603 CALL dgemm(
'T',
'N', nrp1, nrhs, nrp1, one, vt( nrf, 1 ), ldu,
604 $ rwork( 1+nrp1*nrhs*2 ), nrp1, zero, rwork( 1 ),
607 DO 290 jcol = 1, nrhs
608 DO 280 jrow = nrf, nrf + nrp1 - 1
610 rwork( j ) = dimag( b( jrow, jcol ) )
613 CALL dgemm(
'T',
'N', nrp1, nrhs, nrp1, one, vt( nrf, 1 ), ldu,
614 $ rwork( 1+nrp1*nrhs*2 ), nrp1, zero,
615 $ rwork( 1+nrp1*nrhs ), nrp1 )
618 DO 310 jcol = 1, nrhs
619 DO 300 jrow = nrf, nrf + nrp1 - 1
622 bx( jrow, jcol ) = dcmplx( rwork( jreal ),
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
subroutine dlasdt(N, LVL, ND, INODE, NDIML, NDIMR, MSUB)
DLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc.
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zlals0(ICOMPQ, NL, NR, SQRE, NRHS, B, LDB, BX, LDBX, PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM, POLES, DIFL, DIFR, Z, K, C, S, RWORK, INFO)
ZLALS0 applies back multiplying factors in solving the least squares problem using divide and conquer...
subroutine zlalsa(ICOMPQ, SMLSIZ, N, NRHS, B, LDB, BX, LDBX, U, LDU, VT, K, DIFL, DIFR, Z, POLES, GIVPTR, GIVCOL, LDGCOL, PERM, GIVNUM, C, S, RWORK, IWORK, INFO)
ZLALSA computes the SVD of the coefficient matrix in compact form. Used by sgelsd.