1 SUBROUTINE dgesvd( JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT,
11 INTEGER INFO, LDA, LDU, LDVT, LWORK, M, N
14 DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ),
15 $ vt( ldvt, * ), work( * )
137 DOUBLE PRECISION ZERO, ONE
138 parameter( zero = 0.0d0, one = 1.0d0 )
141 LOGICAL LQUERY, WNTUA, WNTUAS, WNTUN, WNTUO, WNTUS,
142 $ wntva, wntvas, wntvn, wntvo, wntvs
143 INTEGER BDSPAC, BLK, CHUNK, I, IE, IERR, IR, ISCL,
144 $ itau, itaup, itauq, iu, iwork, ldwrkr, ldwrku,
145 $ maxwrk, minmn, minwrk, mnthr, ncu, ncvt, nru,
147 DOUBLE PRECISION ANRM, BIGNUM, EPS, SMLNUM
150 DOUBLE PRECISION DUM( 1 )
160 DOUBLE PRECISION DLAMCH, DLANGE
161 EXTERNAL lsame, ilaenv, dlamch, dlange
164 INTRINSIC max, min, sqrt
172 mnthr = ilaenv( 6,
'DGESVD', jobu // jobvt, m, n, 0, 0 )
173 wntua = lsame( jobu,
'A' )
174 wntus = lsame( jobu,
'S' )
175 wntuas = wntua .OR. wntus
176 wntuo = lsame( jobu,
'O' )
177 wntun = lsame( jobu,
'N' )
178 wntva = lsame( jobvt,
'A' )
179 wntvs = lsame( jobvt,
'S' )
180 wntvas = wntva .OR. wntvs
181 wntvo = lsame( jobvt,
'O' )
182 wntvn = lsame( jobvt,
'N' )
184 lquery = ( lwork.EQ.-1 )
186 IF( .NOT.( wntua .OR. wntus .OR. wntuo .OR. wntun ) )
THEN
188 ELSE IF( .NOT.( wntva .OR. wntvs .OR. wntvo .OR. wntvn ) .OR.
189 $ ( wntvo .AND. wntuo ) )
THEN
191 ELSE IF( m.LT.0 )
THEN
193 ELSE IF( n.LT.0 )
THEN
195 ELSE IF( lda.LT.max( 1, m ) )
THEN
197 ELSE IF( ldu.LT.1 .OR. ( wntuas .AND. ldu.LT.m ) )
THEN
199 ELSE IF( ldvt.LT.1 .OR. ( wntva .AND. ldvt.LT.n ) .OR.
200 $ ( wntvs .AND. ldvt.LT.minmn ) )
THEN
211 IF( info.EQ.0 .AND. ( lwork.GE.1 .OR. lquery ) .AND. m.GT.0 .AND.
218 IF( m.GE.mnthr )
THEN
223 maxwrk = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1,
225 maxwrk = max( maxwrk, 3*n+2*n*
226 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
227 IF( wntvo .OR. wntvas )
228 $ maxwrk = max( maxwrk, 3*n+( n-1 )*
229 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
230 maxwrk = max( maxwrk, bdspac )
231 minwrk = max( 4*n, bdspac )
232 maxwrk = max( maxwrk, minwrk )
233 ELSE IF( wntuo .AND. wntvn )
THEN
237 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
238 wrkbl = max( wrkbl, n+n*ilaenv( 1,
'DORGQR',
' ', m,
240 wrkbl = max( wrkbl, 3*n+2*n*
241 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
242 wrkbl = max( wrkbl, 3*n+n*
243 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
244 wrkbl = max( wrkbl, bdspac )
245 maxwrk = max( n*n+wrkbl, n*n+m*n+n )
246 minwrk = max( 3*n+m, bdspac )
247 maxwrk = max( maxwrk, minwrk )
248 ELSE IF( wntuo .AND. wntvas )
THEN
253 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
254 wrkbl = max( wrkbl, n+n*ilaenv( 1,
'DORGQR',
' ', m,
256 wrkbl = max( wrkbl, 3*n+2*n*
257 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
258 wrkbl = max( wrkbl, 3*n+n*
259 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
260 wrkbl = max( wrkbl, 3*n+( n-1 )*
261 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
262 wrkbl = max( wrkbl, bdspac )
263 maxwrk = max( n*n+wrkbl, n*n+m*n+n )
264 minwrk = max( 3*n+m, bdspac )
265 maxwrk = max( maxwrk, minwrk )
266 ELSE IF( wntus .AND. wntvn )
THEN
270 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
271 wrkbl = max( wrkbl, n+n*ilaenv( 1,
'DORGQR',
' ', m,
273 wrkbl = max( wrkbl, 3*n+2*n*
274 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
275 wrkbl = max( wrkbl, 3*n+n*
276 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
277 wrkbl = max( wrkbl, bdspac )
279 minwrk = max( 3*n+m, bdspac )
280 maxwrk = max( maxwrk, minwrk )
281 ELSE IF( wntus .AND. wntvo )
THEN
285 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
286 wrkbl = max( wrkbl, n+n*ilaenv( 1,
'DORGQR',
' ', m,
288 wrkbl = max( wrkbl, 3*n+2*n*
289 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
290 wrkbl = max( wrkbl, 3*n+n*
291 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
292 wrkbl = max( wrkbl, 3*n+( n-1 )*
293 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
294 wrkbl = max( wrkbl, bdspac )
295 maxwrk = 2*n*n + wrkbl
296 minwrk = max( 3*n+m, bdspac )
297 maxwrk = max( maxwrk, minwrk )
298 ELSE IF( wntus .AND. wntvas )
THEN
303 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
304 wrkbl = max( wrkbl, n+n*ilaenv( 1,
'DORGQR',
' ', m,
306 wrkbl = max( wrkbl, 3*n+2*n*
307 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
308 wrkbl = max( wrkbl, 3*n+n*
309 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
310 wrkbl = max( wrkbl, 3*n+( n-1 )*
311 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
312 wrkbl = max( wrkbl, bdspac )
314 minwrk = max( 3*n+m, bdspac )
315 maxwrk = max( maxwrk, minwrk )
316 ELSE IF( wntua .AND. wntvn )
THEN
320 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
321 wrkbl = max( wrkbl, n+m*ilaenv( 1,
'DORGQR',
' ', m,
323 wrkbl = max( wrkbl, 3*n+2*n*
324 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
325 wrkbl = max( wrkbl, 3*n+n*
326 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
327 wrkbl = max( wrkbl, bdspac )
329 minwrk = max( 3*n+m, bdspac )
330 maxwrk = max( maxwrk, minwrk )
331 ELSE IF( wntua .AND. wntvo )
THEN
335 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
336 wrkbl = max( wrkbl, n+m*ilaenv( 1,
'DORGQR',
' ', m,
338 wrkbl = max( wrkbl, 3*n+2*n*
339 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
340 wrkbl = max( wrkbl, 3*n+n*
341 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
342 wrkbl = max( wrkbl, 3*n+( n-1 )*
343 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
344 wrkbl = max( wrkbl, bdspac )
345 maxwrk = 2*n*n + wrkbl
346 minwrk = max( 3*n+m, bdspac )
347 maxwrk = max( maxwrk, minwrk )
348 ELSE IF( wntua .AND. wntvas )
THEN
353 wrkbl = n + n*ilaenv( 1,
'DGEQRF',
' ', m, n, -1, -1 )
354 wrkbl = max( wrkbl, n+m*ilaenv( 1,
'DORGQR',
' ', m,
356 wrkbl = max( wrkbl, 3*n+2*n*
357 $ ilaenv( 1,
'DGEBRD',
' ', n, n, -1, -1 ) )
358 wrkbl = max( wrkbl, 3*n+n*
359 $ ilaenv( 1,
'DORGBR',
'Q', n, n, n, -1 ) )
360 wrkbl = max( wrkbl, 3*n+( n-1 )*
361 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
362 wrkbl = max( wrkbl, bdspac )
364 minwrk = max( 3*n+m, bdspac )
365 maxwrk = max( maxwrk, minwrk )
371 maxwrk = 3*n + ( m+n )*ilaenv( 1,
'DGEBRD',
' ', m, n,
373 IF( wntus .OR. wntuo )
374 $ maxwrk = max( maxwrk, 3*n+n*
375 $ ilaenv( 1,
'DORGBR',
'Q', m, n, n, -1 ) )
377 $ maxwrk = max( maxwrk, 3*n+m*
378 $ ilaenv( 1,
'DORGBR',
'Q', m, m, n, -1 ) )
380 $ maxwrk = max( maxwrk, 3*n+( n-1 )*
381 $ ilaenv( 1,
'DORGBR',
'P', n, n, n, -1 ) )
382 maxwrk = max( maxwrk, bdspac )
383 minwrk = max( 3*n+m, bdspac )
384 maxwrk = max( maxwrk, minwrk )
391 IF( n.GE.mnthr )
THEN
396 maxwrk = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1,
398 maxwrk = max( maxwrk, 3*m+2*m*
399 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
400 IF( wntuo .OR. wntuas )
401 $ maxwrk = max( maxwrk, 3*m+m*
402 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
403 maxwrk = max( maxwrk, bdspac )
404 minwrk = max( 4*m, bdspac )
405 maxwrk = max( maxwrk, minwrk )
406 ELSE IF( wntvo .AND. wntun )
THEN
410 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
411 wrkbl = max( wrkbl, m+m*ilaenv( 1,
'DORGLQ',
' ', m,
413 wrkbl = max( wrkbl, 3*m+2*m*
414 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
415 wrkbl = max( wrkbl, 3*m+( m-1 )*
416 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
417 wrkbl = max( wrkbl, bdspac )
418 maxwrk = max( m*m+wrkbl, m*m+m*n+m )
419 minwrk = max( 3*m+n, bdspac )
420 maxwrk = max( maxwrk, minwrk )
421 ELSE IF( wntvo .AND. wntuas )
THEN
426 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
427 wrkbl = max( wrkbl, m+m*ilaenv( 1,
'DORGLQ',
' ', m,
429 wrkbl = max( wrkbl, 3*m+2*m*
430 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
431 wrkbl = max( wrkbl, 3*m+( m-1 )*
432 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
433 wrkbl = max( wrkbl, 3*m+m*
434 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
435 wrkbl = max( wrkbl, bdspac )
436 maxwrk = max( m*m+wrkbl, m*m+m*n+m )
437 minwrk = max( 3*m+n, bdspac )
438 maxwrk = max( maxwrk, minwrk )
439 ELSE IF( wntvs .AND. wntun )
THEN
443 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
444 wrkbl = max( wrkbl, m+m*ilaenv( 1,
'DORGLQ',
' ', m,
446 wrkbl = max( wrkbl, 3*m+2*m*
447 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
448 wrkbl = max( wrkbl, 3*m+( m-1 )*
449 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
450 wrkbl = max( wrkbl, bdspac )
452 minwrk = max( 3*m+n, bdspac )
453 maxwrk = max( maxwrk, minwrk )
454 ELSE IF( wntvs .AND. wntuo )
THEN
458 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
459 wrkbl = max( wrkbl, m+m*ilaenv( 1,
'DORGLQ',
' ', m,
461 wrkbl = max( wrkbl, 3*m+2*m*
462 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
463 wrkbl = max( wrkbl, 3*m+( m-1 )*
464 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
465 wrkbl = max( wrkbl, 3*m+m*
466 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
467 wrkbl = max( wrkbl, bdspac )
468 maxwrk = 2*m*m + wrkbl
469 minwrk = max( 3*m+n, bdspac )
470 maxwrk = max( maxwrk, minwrk )
471 ELSE IF( wntvs .AND. wntuas )
THEN
476 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
477 wrkbl = max( wrkbl, m+m*ilaenv( 1,
'DORGLQ',
' ', m,
479 wrkbl = max( wrkbl, 3*m+2*m*
480 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
481 wrkbl = max( wrkbl, 3*m+( m-1 )*
482 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
483 wrkbl = max( wrkbl, 3*m+m*
484 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
485 wrkbl = max( wrkbl, bdspac )
487 minwrk = max( 3*m+n, bdspac )
488 maxwrk = max( maxwrk, minwrk )
489 ELSE IF( wntva .AND. wntun )
THEN
493 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
494 wrkbl = max( wrkbl, m+n*ilaenv( 1,
'DORGLQ',
' ', n,
496 wrkbl = max( wrkbl, 3*m+2*m*
497 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
498 wrkbl = max( wrkbl, 3*m+( m-1 )*
499 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
500 wrkbl = max( wrkbl, bdspac )
502 minwrk = max( 3*m+n, bdspac )
503 maxwrk = max( maxwrk, minwrk )
504 ELSE IF( wntva .AND. wntuo )
THEN
508 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
509 wrkbl = max( wrkbl, m+n*ilaenv( 1,
'DORGLQ',
' ', n,
511 wrkbl = max( wrkbl, 3*m+2*m*
512 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
513 wrkbl = max( wrkbl, 3*m+( m-1 )*
514 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
515 wrkbl = max( wrkbl, 3*m+m*
516 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
517 wrkbl = max( wrkbl, bdspac )
518 maxwrk = 2*m*m + wrkbl
519 minwrk = max( 3*m+n, bdspac )
520 maxwrk = max( maxwrk, minwrk )
521 ELSE IF( wntva .AND. wntuas )
THEN
526 wrkbl = m + m*ilaenv( 1,
'DGELQF',
' ', m, n, -1, -1 )
527 wrkbl = max( wrkbl, m+n*ilaenv( 1,
'DORGLQ',
' ', n,
529 wrkbl = max( wrkbl, 3*m+2*m*
530 $ ilaenv( 1,
'DGEBRD',
' ', m, m, -1, -1 ) )
531 wrkbl = max( wrkbl, 3*m+( m-1 )*
532 $ ilaenv( 1,
'DORGBR',
'P', m, m, m, -1 ) )
533 wrkbl = max( wrkbl, 3*m+m*
534 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
535 wrkbl = max( wrkbl, bdspac )
537 minwrk = max( 3*m+n, bdspac )
538 maxwrk = max( maxwrk, minwrk )
544 maxwrk = 3*m + ( m+n )*ilaenv( 1,
'DGEBRD',
' ', m, n,
546 IF( wntvs .OR. wntvo )
547 $ maxwrk = max( maxwrk, 3*m+m*
548 $ ilaenv( 1,
'DORGBR',
'P', m, n, m, -1 ) )
550 $ maxwrk = max( maxwrk, 3*m+n*
551 $ ilaenv( 1,
'DORGBR',
'P', n, n, m, -1 ) )
553 $ maxwrk = max( maxwrk, 3*m+( m-1 )*
554 $ ilaenv( 1,
'DORGBR',
'Q', m, m, m, -1 ) )
555 maxwrk = max( maxwrk, bdspac )
556 minwrk = max( 3*m+n, bdspac )
557 maxwrk = max( maxwrk, minwrk )
563 IF( lwork.LT.minwrk .AND. .NOT.lquery )
THEN
567 CALL xerbla(
'DGESVD', -info )
569 ELSE IF( lquery )
THEN
575 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
584 smlnum = sqrt( dlamch(
'S' ) ) / eps
585 bignum = one / smlnum
589 anrm = dlange(
'M', m, n, a, lda, dum )
591 IF( anrm.GT.zero .AND. anrm.LT.smlnum )
THEN
593 CALL dlascl(
'G', 0, 0, anrm, smlnum, m, n, a, lda, ierr )
594 ELSE IF( anrm.GT.bignum )
THEN
596 CALL dlascl(
'G', 0, 0, anrm, bignum, m, n, a, lda, ierr )
605 IF( m.GE.mnthr )
THEN
618 CALL dgeqrf( m, n, a, lda, work( itau ), work( iwork ),
619 $ lwork-iwork+1, ierr )
623 CALL dlaset(
'L', n-1, n-1, zero, zero, a( 2, 1 ), lda )
632 CALL dgebrd( n, n, a, lda, s, work( ie ), work( itauq ),
633 $ work( itaup ), work( iwork ), lwork-iwork+1,
636 IF( wntvo .OR. wntvas )
THEN
641 CALL dorgbr(
'P', n, n, n, a, lda, work( itaup ),
642 $ work( iwork ), lwork-iwork+1, ierr )
651 CALL dbdsqr(
'U', n, ncvt, 0, 0, s, work( ie ), a, lda,
652 $ dum, 1, dum, 1, work( iwork ), info )
657 $
CALL dlacpy(
'F', n, n, a, lda, vt, ldvt )
659 ELSE IF( wntuo .AND. wntvn )
THEN
665 IF( lwork.GE.n*n+max( 4*n, bdspac ) )
THEN
670 IF( lwork.GE.max( wrkbl, lda*n+n )+lda*n )
THEN
676 ELSE IF( lwork.GE.max( wrkbl, lda*n+n )+n*n )
THEN
686 ldwrku = ( lwork-n*n-n ) / n
695 CALL dgeqrf( m, n, a, lda, work( itau ),
696 $ work( iwork ), lwork-iwork+1, ierr )
700 CALL dlacpy(
'U', n, n, a, lda, work( ir ), ldwrkr )
701 CALL dlaset(
'L', n-1, n-1, zero, zero, work( ir+1 ),
707 CALL dorgqr( m, n, n, a, lda, work( itau ),
708 $ work( iwork ), lwork-iwork+1, ierr )
717 CALL dgebrd( n, n, work( ir ), ldwrkr, s, work( ie ),
718 $ work( itauq ), work( itaup ),
719 $ work( iwork ), lwork-iwork+1, ierr )
724 CALL dorgbr(
'Q', n, n, n, work( ir ), ldwrkr,
725 $ work( itauq ), work( iwork ),
726 $ lwork-iwork+1, ierr )
733 CALL dbdsqr(
'U', n, 0, n, 0, s, work( ie ), dum, 1,
734 $ work( ir ), ldwrkr, dum, 1,
735 $ work( iwork ), info )
742 DO 10 i = 1, m, ldwrku
743 chunk = min( m-i+1, ldwrku )
744 CALL dgemm(
'N',
'N', chunk, n, n, one, a( i, 1 ),
745 $ lda, work( ir ), ldwrkr, zero,
746 $ work( iu ), ldwrku )
747 CALL dlacpy(
'F', chunk, n, work( iu ), ldwrku,
763 CALL dgebrd( m, n, a, lda, s, work( ie ),
764 $ work( itauq ), work( itaup ),
765 $ work( iwork ), lwork-iwork+1, ierr )
770 CALL dorgbr(
'Q', m, n, n, a, lda, work( itauq ),
771 $ work( iwork ), lwork-iwork+1, ierr )
778 CALL dbdsqr(
'U', n, 0, m, 0, s, work( ie ), dum, 1,
779 $ a, lda, dum, 1, work( iwork ), info )
783 ELSE IF( wntuo .AND. wntvas )
THEN
789 IF( lwork.GE.n*n+max( 4*n, bdspac ) )
THEN
794 IF( lwork.GE.max( wrkbl, lda*n+n )+lda*n )
THEN
800 ELSE IF( lwork.GE.max( wrkbl, lda*n+n )+n*n )
THEN
810 ldwrku = ( lwork-n*n-n ) / n
819 CALL dgeqrf( m, n, a, lda, work( itau ),
820 $ work( iwork ), lwork-iwork+1, ierr )
824 CALL dlacpy(
'U', n, n, a, lda, vt, ldvt )
825 CALL dlaset(
'L', n-1, n-1, zero, zero, vt( 2, 1 ),
831 CALL dorgqr( m, n, n, a, lda, work( itau ),
832 $ work( iwork ), lwork-iwork+1, ierr )
841 CALL dgebrd( n, n, vt, ldvt, s, work( ie ),
842 $ work( itauq ), work( itaup ),
843 $ work( iwork ), lwork-iwork+1, ierr )
844 CALL dlacpy(
'L', n, n, vt, ldvt, work( ir ), ldwrkr )
849 CALL dorgbr(
'Q', n, n, n, work( ir ), ldwrkr,
850 $ work( itauq ), work( iwork ),
851 $ lwork-iwork+1, ierr )
856 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
857 $ work( iwork ), lwork-iwork+1, ierr )
865 CALL dbdsqr(
'U', n, n, n, 0, s, work( ie ), vt, ldvt,
866 $ work( ir ), ldwrkr, dum, 1,
867 $ work( iwork ), info )
874 DO 20 i = 1, m, ldwrku
875 chunk = min( m-i+1, ldwrku )
876 CALL dgemm(
'N',
'N', chunk, n, n, one, a( i, 1 ),
877 $ lda, work( ir ), ldwrkr, zero,
878 $ work( iu ), ldwrku )
879 CALL dlacpy(
'F', chunk, n, work( iu ), ldwrku,
893 CALL dgeqrf( m, n, a, lda, work( itau ),
894 $ work( iwork ), lwork-iwork+1, ierr )
898 CALL dlacpy(
'U', n, n, a, lda, vt, ldvt )
899 CALL dlaset(
'L', n-1, n-1, zero, zero, vt( 2, 1 ),
905 CALL dorgqr( m, n, n, a, lda, work( itau ),
906 $ work( iwork ), lwork-iwork+1, ierr )
915 CALL dgebrd( n, n, vt, ldvt, s, work( ie ),
916 $ work( itauq ), work( itaup ),
917 $ work( iwork ), lwork-iwork+1, ierr )
922 CALL dormbr(
'Q',
'R',
'N', m, n, n, vt, ldvt,
923 $ work( itauq ), a, lda, work( iwork ),
924 $ lwork-iwork+1, ierr )
929 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
930 $ work( iwork ), lwork-iwork+1, ierr )
938 CALL dbdsqr(
'U', n, n, m, 0, s, work( ie ), vt, ldvt,
939 $ a, lda, dum, 1, work( iwork ), info )
943 ELSE IF( wntus )
THEN
951 IF( lwork.GE.n*n+max( 4*n, bdspac ) )
THEN
956 IF( lwork.GE.wrkbl+lda*n )
THEN
973 CALL dgeqrf( m, n, a, lda, work( itau ),
974 $ work( iwork ), lwork-iwork+1, ierr )
978 CALL dlacpy(
'U', n, n, a, lda, work( ir ),
980 CALL dlaset(
'L', n-1, n-1, zero, zero,
981 $ work( ir+1 ), ldwrkr )
986 CALL dorgqr( m, n, n, a, lda, work( itau ),
987 $ work( iwork ), lwork-iwork+1, ierr )
996 CALL dgebrd( n, n, work( ir ), ldwrkr, s,
997 $ work( ie ), work( itauq ),
998 $ work( itaup ), work( iwork ),
999 $ lwork-iwork+1, ierr )
1004 CALL dorgbr(
'Q', n, n, n, work( ir ), ldwrkr,
1005 $ work( itauq ), work( iwork ),
1006 $ lwork-iwork+1, ierr )
1013 CALL dbdsqr(
'U', n, 0, n, 0, s, work( ie ), dum,
1014 $ 1, work( ir ), ldwrkr, dum, 1,
1015 $ work( iwork ), info )
1021 CALL dgemm(
'N',
'N', m, n, n, one, a, lda,
1022 $ work( ir ), ldwrkr, zero, u, ldu )
1034 CALL dgeqrf( m, n, a, lda, work( itau ),
1035 $ work( iwork ), lwork-iwork+1, ierr )
1036 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1041 CALL dorgqr( m, n, n, u, ldu, work( itau ),
1042 $ work( iwork ), lwork-iwork+1, ierr )
1050 CALL dlaset(
'L', n-1, n-1, zero, zero, a( 2, 1 ),
1056 CALL dgebrd( n, n, a, lda, s, work( ie ),
1057 $ work( itauq ), work( itaup ),
1058 $ work( iwork ), lwork-iwork+1, ierr )
1063 CALL dormbr(
'Q',
'R',
'N', m, n, n, a, lda,
1064 $ work( itauq ), u, ldu, work( iwork ),
1065 $ lwork-iwork+1, ierr )
1072 CALL dbdsqr(
'U', n, 0, m, 0, s, work( ie ), dum,
1073 $ 1, u, ldu, dum, 1, work( iwork ),
1078 ELSE IF( wntvo )
THEN
1084 IF( lwork.GE.2*n*n+max( 4*n, bdspac ) )
THEN
1089 IF( lwork.GE.wrkbl+2*lda*n )
THEN
1096 ELSE IF( lwork.GE.wrkbl+( lda+n )*n )
THEN
1111 itau = ir + ldwrkr*n
1117 CALL dgeqrf( m, n, a, lda, work( itau ),
1118 $ work( iwork ), lwork-iwork+1, ierr )
1122 CALL dlacpy(
'U', n, n, a, lda, work( iu ),
1124 CALL dlaset(
'L', n-1, n-1, zero, zero,
1125 $ work( iu+1 ), ldwrku )
1130 CALL dorgqr( m, n, n, a, lda, work( itau ),
1131 $ work( iwork ), lwork-iwork+1, ierr )
1142 CALL dgebrd( n, n, work( iu ), ldwrku, s,
1143 $ work( ie ), work( itauq ),
1144 $ work( itaup ), work( iwork ),
1145 $ lwork-iwork+1, ierr )
1146 CALL dlacpy(
'U', n, n, work( iu ), ldwrku,
1147 $ work( ir ), ldwrkr )
1152 CALL dorgbr(
'Q', n, n, n, work( iu ), ldwrku,
1153 $ work( itauq ), work( iwork ),
1154 $ lwork-iwork+1, ierr )
1160 CALL dorgbr(
'P', n, n, n, work( ir ), ldwrkr,
1161 $ work( itaup ), work( iwork ),
1162 $ lwork-iwork+1, ierr )
1170 CALL dbdsqr(
'U', n, n, n, 0, s, work( ie ),
1171 $ work( ir ), ldwrkr, work( iu ),
1172 $ ldwrku, dum, 1, work( iwork ), info )
1178 CALL dgemm(
'N',
'N', m, n, n, one, a, lda,
1179 $ work( iu ), ldwrku, zero, u, ldu )
1184 CALL dlacpy(
'F', n, n, work( ir ), ldwrkr, a,
1197 CALL dgeqrf( m, n, a, lda, work( itau ),
1198 $ work( iwork ), lwork-iwork+1, ierr )
1199 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1204 CALL dorgqr( m, n, n, u, ldu, work( itau ),
1205 $ work( iwork ), lwork-iwork+1, ierr )
1213 CALL dlaset(
'L', n-1, n-1, zero, zero, a( 2, 1 ),
1219 CALL dgebrd( n, n, a, lda, s, work( ie ),
1220 $ work( itauq ), work( itaup ),
1221 $ work( iwork ), lwork-iwork+1, ierr )
1226 CALL dormbr(
'Q',
'R',
'N', m, n, n, a, lda,
1227 $ work( itauq ), u, ldu, work( iwork ),
1228 $ lwork-iwork+1, ierr )
1233 CALL dorgbr(
'P', n, n, n, a, lda, work( itaup ),
1234 $ work( iwork ), lwork-iwork+1, ierr )
1242 CALL dbdsqr(
'U', n, n, m, 0, s, work( ie ), a,
1243 $ lda, u, ldu, dum, 1, work( iwork ),
1248 ELSE IF( wntvas )
THEN
1255 IF( lwork.GE.n*n+max( 4*n, bdspac ) )
THEN
1260 IF( lwork.GE.wrkbl+lda*n )
THEN
1271 itau = iu + ldwrku*n
1277 CALL dgeqrf( m, n, a, lda, work( itau ),
1278 $ work( iwork ), lwork-iwork+1, ierr )
1282 CALL dlacpy(
'U', n, n, a, lda, work( iu ),
1284 CALL dlaset(
'L', n-1, n-1, zero, zero,
1285 $ work( iu+1 ), ldwrku )
1290 CALL dorgqr( m, n, n, a, lda, work( itau ),
1291 $ work( iwork ), lwork-iwork+1, ierr )
1300 CALL dgebrd( n, n, work( iu ), ldwrku, s,
1301 $ work( ie ), work( itauq ),
1302 $ work( itaup ), work( iwork ),
1303 $ lwork-iwork+1, ierr )
1304 CALL dlacpy(
'U', n, n, work( iu ), ldwrku, vt,
1310 CALL dorgbr(
'Q', n, n, n, work( iu ), ldwrku,
1311 $ work( itauq ), work( iwork ),
1312 $ lwork-iwork+1, ierr )
1318 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
1319 $ work( iwork ), lwork-iwork+1, ierr )
1327 CALL dbdsqr(
'U', n, n, n, 0, s, work( ie ), vt,
1328 $ ldvt, work( iu ), ldwrku, dum, 1,
1329 $ work( iwork ), info )
1335 CALL dgemm(
'N',
'N', m, n, n, one, a, lda,
1336 $ work( iu ), ldwrku, zero, u, ldu )
1348 CALL dgeqrf( m, n, a, lda, work( itau ),
1349 $ work( iwork ), lwork-iwork+1, ierr )
1350 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1355 CALL dorgqr( m, n, n, u, ldu, work( itau ),
1356 $ work( iwork ), lwork-iwork+1, ierr )
1360 CALL dlacpy(
'U', n, n, a, lda, vt, ldvt )
1361 CALL dlaset(
'L', n-1, n-1, zero, zero, vt( 2, 1 ),
1371 CALL dgebrd( n, n, vt, ldvt, s, work( ie ),
1372 $ work( itauq ), work( itaup ),
1373 $ work( iwork ), lwork-iwork+1, ierr )
1379 CALL dormbr(
'Q',
'R',
'N', m, n, n, vt, ldvt,
1380 $ work( itauq ), u, ldu, work( iwork ),
1381 $ lwork-iwork+1, ierr )
1386 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
1387 $ work( iwork ), lwork-iwork+1, ierr )
1395 CALL dbdsqr(
'U', n, n, m, 0, s, work( ie ), vt,
1396 $ ldvt, u, ldu, dum, 1, work( iwork ),
1403 ELSE IF( wntua )
THEN
1411 IF( lwork.GE.n*n+max( n+m, 4*n, bdspac ) )
THEN
1416 IF( lwork.GE.wrkbl+lda*n )
THEN
1427 itau = ir + ldwrkr*n
1433 CALL dgeqrf( m, n, a, lda, work( itau ),
1434 $ work( iwork ), lwork-iwork+1, ierr )
1435 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1439 CALL dlacpy(
'U', n, n, a, lda, work( ir ),
1441 CALL dlaset(
'L', n-1, n-1, zero, zero,
1442 $ work( ir+1 ), ldwrkr )
1447 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1448 $ work( iwork ), lwork-iwork+1, ierr )
1457 CALL dgebrd( n, n, work( ir ), ldwrkr, s,
1458 $ work( ie ), work( itauq ),
1459 $ work( itaup ), work( iwork ),
1460 $ lwork-iwork+1, ierr )
1465 CALL dorgbr(
'Q', n, n, n, work( ir ), ldwrkr,
1466 $ work( itauq ), work( iwork ),
1467 $ lwork-iwork+1, ierr )
1474 CALL dbdsqr(
'U', n, 0, n, 0, s, work( ie ), dum,
1475 $ 1, work( ir ), ldwrkr, dum, 1,
1476 $ work( iwork ), info )
1482 CALL dgemm(
'N',
'N', m, n, n, one, u, ldu,
1483 $ work( ir ), ldwrkr, zero, a, lda )
1487 CALL dlacpy(
'F', m, n, a, lda, u, ldu )
1499 CALL dgeqrf( m, n, a, lda, work( itau ),
1500 $ work( iwork ), lwork-iwork+1, ierr )
1501 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1506 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1507 $ work( iwork ), lwork-iwork+1, ierr )
1515 CALL dlaset(
'L', n-1, n-1, zero, zero, a( 2, 1 ),
1521 CALL dgebrd( n, n, a, lda, s, work( ie ),
1522 $ work( itauq ), work( itaup ),
1523 $ work( iwork ), lwork-iwork+1, ierr )
1529 CALL dormbr(
'Q',
'R',
'N', m, n, n, a, lda,
1530 $ work( itauq ), u, ldu, work( iwork ),
1531 $ lwork-iwork+1, ierr )
1538 CALL dbdsqr(
'U', n, 0, m, 0, s, work( ie ), dum,
1539 $ 1, u, ldu, dum, 1, work( iwork ),
1544 ELSE IF( wntvo )
THEN
1550 IF( lwork.GE.2*n*n+max( n+m, 4*n, bdspac ) )
THEN
1555 IF( lwork.GE.wrkbl+2*lda*n )
THEN
1562 ELSE IF( lwork.GE.wrkbl+( lda+n )*n )
THEN
1577 itau = ir + ldwrkr*n
1583 CALL dgeqrf( m, n, a, lda, work( itau ),
1584 $ work( iwork ), lwork-iwork+1, ierr )
1585 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1590 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1591 $ work( iwork ), lwork-iwork+1, ierr )
1595 CALL dlacpy(
'U', n, n, a, lda, work( iu ),
1597 CALL dlaset(
'L', n-1, n-1, zero, zero,
1598 $ work( iu+1 ), ldwrku )
1609 CALL dgebrd( n, n, work( iu ), ldwrku, s,
1610 $ work( ie ), work( itauq ),
1611 $ work( itaup ), work( iwork ),
1612 $ lwork-iwork+1, ierr )
1613 CALL dlacpy(
'U', n, n, work( iu ), ldwrku,
1614 $ work( ir ), ldwrkr )
1619 CALL dorgbr(
'Q', n, n, n, work( iu ), ldwrku,
1620 $ work( itauq ), work( iwork ),
1621 $ lwork-iwork+1, ierr )
1627 CALL dorgbr(
'P', n, n, n, work( ir ), ldwrkr,
1628 $ work( itaup ), work( iwork ),
1629 $ lwork-iwork+1, ierr )
1637 CALL dbdsqr(
'U', n, n, n, 0, s, work( ie ),
1638 $ work( ir ), ldwrkr, work( iu ),
1639 $ ldwrku, dum, 1, work( iwork ), info )
1645 CALL dgemm(
'N',
'N', m, n, n, one, u, ldu,
1646 $ work( iu ), ldwrku, zero, a, lda )
1650 CALL dlacpy(
'F', m, n, a, lda, u, ldu )
1654 CALL dlacpy(
'F', n, n, work( ir ), ldwrkr, a,
1667 CALL dgeqrf( m, n, a, lda, work( itau ),
1668 $ work( iwork ), lwork-iwork+1, ierr )
1669 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1674 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1675 $ work( iwork ), lwork-iwork+1, ierr )
1683 CALL dlaset(
'L', n-1, n-1, zero, zero, a( 2, 1 ),
1689 CALL dgebrd( n, n, a, lda, s, work( ie ),
1690 $ work( itauq ), work( itaup ),
1691 $ work( iwork ), lwork-iwork+1, ierr )
1697 CALL dormbr(
'Q',
'R',
'N', m, n, n, a, lda,
1698 $ work( itauq ), u, ldu, work( iwork ),
1699 $ lwork-iwork+1, ierr )
1704 CALL dorgbr(
'P', n, n, n, a, lda, work( itaup ),
1705 $ work( iwork ), lwork-iwork+1, ierr )
1713 CALL dbdsqr(
'U', n, n, m, 0, s, work( ie ), a,
1714 $ lda, u, ldu, dum, 1, work( iwork ),
1719 ELSE IF( wntvas )
THEN
1726 IF( lwork.GE.n*n+max( n+m, 4*n, bdspac ) )
THEN
1731 IF( lwork.GE.wrkbl+lda*n )
THEN
1742 itau = iu + ldwrku*n
1748 CALL dgeqrf( m, n, a, lda, work( itau ),
1749 $ work( iwork ), lwork-iwork+1, ierr )
1750 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1755 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1756 $ work( iwork ), lwork-iwork+1, ierr )
1760 CALL dlacpy(
'U', n, n, a, lda, work( iu ),
1762 CALL dlaset(
'L', n-1, n-1, zero, zero,
1763 $ work( iu+1 ), ldwrku )
1772 CALL dgebrd( n, n, work( iu ), ldwrku, s,
1773 $ work( ie ), work( itauq ),
1774 $ work( itaup ), work( iwork ),
1775 $ lwork-iwork+1, ierr )
1776 CALL dlacpy(
'U', n, n, work( iu ), ldwrku, vt,
1782 CALL dorgbr(
'Q', n, n, n, work( iu ), ldwrku,
1783 $ work( itauq ), work( iwork ),
1784 $ lwork-iwork+1, ierr )
1790 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
1791 $ work( iwork ), lwork-iwork+1, ierr )
1799 CALL dbdsqr(
'U', n, n, n, 0, s, work( ie ), vt,
1800 $ ldvt, work( iu ), ldwrku, dum, 1,
1801 $ work( iwork ), info )
1807 CALL dgemm(
'N',
'N', m, n, n, one, u, ldu,
1808 $ work( iu ), ldwrku, zero, a, lda )
1812 CALL dlacpy(
'F', m, n, a, lda, u, ldu )
1824 CALL dgeqrf( m, n, a, lda, work( itau ),
1825 $ work( iwork ), lwork-iwork+1, ierr )
1826 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1831 CALL dorgqr( m, m, n, u, ldu, work( itau ),
1832 $ work( iwork ), lwork-iwork+1, ierr )
1836 CALL dlacpy(
'U', n, n, a, lda, vt, ldvt )
1837 CALL dlaset(
'L', n-1, n-1, zero, zero, vt( 2, 1 ),
1847 CALL dgebrd( n, n, vt, ldvt, s, work( ie ),
1848 $ work( itauq ), work( itaup ),
1849 $ work( iwork ), lwork-iwork+1, ierr )
1855 CALL dormbr(
'Q',
'R',
'N', m, n, n, vt, ldvt,
1856 $ work( itauq ), u, ldu, work( iwork ),
1857 $ lwork-iwork+1, ierr )
1862 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
1863 $ work( iwork ), lwork-iwork+1, ierr )
1871 CALL dbdsqr(
'U', n, n, m, 0, s, work( ie ), vt,
1872 $ ldvt, u, ldu, dum, 1, work( iwork ),
1896 CALL dgebrd( m, n, a, lda, s, work( ie ), work( itauq ),
1897 $ work( itaup ), work( iwork ), lwork-iwork+1,
1905 CALL dlacpy(
'L', m, n, a, lda, u, ldu )
1910 CALL dorgbr(
'Q', m, ncu, n, u, ldu, work( itauq ),
1911 $ work( iwork ), lwork-iwork+1, ierr )
1919 CALL dlacpy(
'U', n, n, a, lda, vt, ldvt )
1920 CALL dorgbr(
'P', n, n, n, vt, ldvt, work( itaup ),
1921 $ work( iwork ), lwork-iwork+1, ierr )
1929 CALL dorgbr(
'Q', m, n, n, a, lda, work( itauq ),
1930 $ work( iwork ), lwork-iwork+1, ierr )
1938 CALL dorgbr(
'P', n, n, n, a, lda, work( itaup ),
1939 $ work( iwork ), lwork-iwork+1, ierr )
1942 IF( wntuas .OR. wntuo )
1946 IF( wntvas .OR. wntvo )
1950 IF( ( .NOT.wntuo ) .AND. ( .NOT.wntvo ) )
THEN
1957 CALL dbdsqr(
'U', n, ncvt, nru, 0, s, work( ie ), vt,
1958 $ ldvt, u, ldu, dum, 1, work( iwork ), info )
1959 ELSE IF( ( .NOT.wntuo ) .AND. wntvo )
THEN
1966 CALL dbdsqr(
'U', n, ncvt, nru, 0, s, work( ie ), a, lda,
1967 $ u, ldu, dum, 1, work( iwork ), info )
1975 CALL dbdsqr(
'U', n, ncvt, nru, 0, s, work( ie ), vt,
1976 $ ldvt, a, lda, dum, 1, work( iwork ), info )
1987 IF( n.GE.mnthr )
THEN
2000 CALL dgelqf( m, n, a, lda, work( itau ), work( iwork ),
2001 $ lwork-iwork+1, ierr )
2005 CALL dlaset(
'U', m-1, m-1, zero, zero, a( 1, 2 ), lda )
2014 CALL dgebrd( m, m, a, lda, s, work( ie ), work( itauq ),
2015 $ work( itaup ), work( iwork ), lwork-iwork+1,
2017 IF( wntuo .OR. wntuas )
THEN
2022 CALL dorgbr(
'Q', m, m, m, a, lda, work( itauq ),
2023 $ work( iwork ), lwork-iwork+1, ierr )
2027 IF( wntuo .OR. wntuas )
2034 CALL dbdsqr(
'U', m, 0, nru, 0, s, work( ie ), dum, 1, a,
2035 $ lda, dum, 1, work( iwork ), info )
2040 $
CALL dlacpy(
'F', m, m, a, lda, u, ldu )
2042 ELSE IF( wntvo .AND. wntun )
THEN
2048 IF( lwork.GE.m*m+max( 4*m, bdspac ) )
THEN
2053 IF( lwork.GE.max( wrkbl, lda*n+m )+lda*m )
THEN
2060 ELSE IF( lwork.GE.max( wrkbl, lda*n+m )+m*m )
THEN
2072 chunk = ( lwork-m*m-m ) / m
2075 itau = ir + ldwrkr*m
2081 CALL dgelqf( m, n, a, lda, work( itau ),
2082 $ work( iwork ), lwork-iwork+1, ierr )
2086 CALL dlacpy(
'L', m, m, a, lda, work( ir ), ldwrkr )
2087 CALL dlaset(
'U', m-1, m-1, zero, zero,
2088 $ work( ir+ldwrkr ), ldwrkr )
2093 CALL dorglq( m, n, m, a, lda, work( itau ),
2094 $ work( iwork ), lwork-iwork+1, ierr )
2103 CALL dgebrd( m, m, work( ir ), ldwrkr, s, work( ie ),
2104 $ work( itauq ), work( itaup ),
2105 $ work( iwork ), lwork-iwork+1, ierr )
2110 CALL dorgbr(
'P', m, m, m, work( ir ), ldwrkr,
2111 $ work( itaup ), work( iwork ),
2112 $ lwork-iwork+1, ierr )
2119 CALL dbdsqr(
'U', m, m, 0, 0, s, work( ie ),
2120 $ work( ir ), ldwrkr, dum, 1, dum, 1,
2121 $ work( iwork ), info )
2128 DO 30 i = 1, n, chunk
2129 blk = min( n-i+1, chunk )
2130 CALL dgemm(
'N',
'N', m, blk, m, one, work( ir ),
2131 $ ldwrkr, a( 1, i ), lda, zero,
2132 $ work( iu ), ldwrku )
2133 CALL dlacpy(
'F', m, blk, work( iu ), ldwrku,
2149 CALL dgebrd( m, n, a, lda, s, work( ie ),
2150 $ work( itauq ), work( itaup ),
2151 $ work( iwork ), lwork-iwork+1, ierr )
2156 CALL dorgbr(
'P', m, n, m, a, lda, work( itaup ),
2157 $ work( iwork ), lwork-iwork+1, ierr )
2164 CALL dbdsqr(
'L', m, n, 0, 0, s, work( ie ), a, lda,
2165 $ dum, 1, dum, 1, work( iwork ), info )
2169 ELSE IF( wntvo .AND. wntuas )
THEN
2175 IF( lwork.GE.m*m+max( 4*m, bdspac ) )
THEN
2180 IF( lwork.GE.max( wrkbl, lda*n+m )+lda*m )
THEN
2187 ELSE IF( lwork.GE.max( wrkbl, lda*n+m )+m*m )
THEN
2199 chunk = ( lwork-m*m-m ) / m
2202 itau = ir + ldwrkr*m
2208 CALL dgelqf( m, n, a, lda, work( itau ),
2209 $ work( iwork ), lwork-iwork+1, ierr )
2213 CALL dlacpy(
'L', m, m, a, lda, u, ldu )
2214 CALL dlaset(
'U', m-1, m-1, zero, zero, u( 1, 2 ),
2220 CALL dorglq( m, n, m, a, lda, work( itau ),
2221 $ work( iwork ), lwork-iwork+1, ierr )
2230 CALL dgebrd( m, m, u, ldu, s, work( ie ),
2231 $ work( itauq ), work( itaup ),
2232 $ work( iwork ), lwork-iwork+1, ierr )
2233 CALL dlacpy(
'U', m, m, u, ldu, work( ir ), ldwrkr )
2238 CALL dorgbr(
'P', m, m, m, work( ir ), ldwrkr,
2239 $ work( itaup ), work( iwork ),
2240 $ lwork-iwork+1, ierr )
2245 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
2246 $ work( iwork ), lwork-iwork+1, ierr )
2254 CALL dbdsqr(
'U', m, m, m, 0, s, work( ie ),
2255 $ work( ir ), ldwrkr, u, ldu, dum, 1,
2256 $ work( iwork ), info )
2263 DO 40 i = 1, n, chunk
2264 blk = min( n-i+1, chunk )
2265 CALL dgemm(
'N',
'N', m, blk, m, one, work( ir ),
2266 $ ldwrkr, a( 1, i ), lda, zero,
2267 $ work( iu ), ldwrku )
2268 CALL dlacpy(
'F', m, blk, work( iu ), ldwrku,
2282 CALL dgelqf( m, n, a, lda, work( itau ),
2283 $ work( iwork ), lwork-iwork+1, ierr )
2287 CALL dlacpy(
'L', m, m, a, lda, u, ldu )
2288 CALL dlaset(
'U', m-1, m-1, zero, zero, u( 1, 2 ),
2294 CALL dorglq( m, n, m, a, lda, work( itau ),
2295 $ work( iwork ), lwork-iwork+1, ierr )
2304 CALL dgebrd( m, m, u, ldu, s, work( ie ),
2305 $ work( itauq ), work( itaup ),
2306 $ work( iwork ), lwork-iwork+1, ierr )
2311 CALL dormbr(
'P',
'L',
'T', m, n, m, u, ldu,
2312 $ work( itaup ), a, lda, work( iwork ),
2313 $ lwork-iwork+1, ierr )
2318 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
2319 $ work( iwork ), lwork-iwork+1, ierr )
2327 CALL dbdsqr(
'U', m, n, m, 0, s, work( ie ), a, lda,
2328 $ u, ldu, dum, 1, work( iwork ), info )
2332 ELSE IF( wntvs )
THEN
2340 IF( lwork.GE.m*m+max( 4*m, bdspac ) )
THEN
2345 IF( lwork.GE.wrkbl+lda*m )
THEN
2356 itau = ir + ldwrkr*m
2362 CALL dgelqf( m, n, a, lda, work( itau ),
2363 $ work( iwork ), lwork-iwork+1, ierr )
2367 CALL dlacpy(
'L', m, m, a, lda, work( ir ),
2369 CALL dlaset(
'U', m-1, m-1, zero, zero,
2370 $ work( ir+ldwrkr ), ldwrkr )
2375 CALL dorglq( m, n, m, a, lda, work( itau ),
2376 $ work( iwork ), lwork-iwork+1, ierr )
2385 CALL dgebrd( m, m, work( ir ), ldwrkr, s,
2386 $ work( ie ), work( itauq ),
2387 $ work( itaup ), work( iwork ),
2388 $ lwork-iwork+1, ierr )
2394 CALL dorgbr(
'P', m, m, m, work( ir ), ldwrkr,
2395 $ work( itaup ), work( iwork ),
2396 $ lwork-iwork+1, ierr )
2403 CALL dbdsqr(
'U', m, m, 0, 0, s, work( ie ),
2404 $ work( ir ), ldwrkr, dum, 1, dum, 1,
2405 $ work( iwork ), info )
2411 CALL dgemm(
'N',
'N', m, n, m, one, work( ir ),
2412 $ ldwrkr, a, lda, zero, vt, ldvt )
2424 CALL dgelqf( m, n, a, lda, work( itau ),
2425 $ work( iwork ), lwork-iwork+1, ierr )
2429 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2434 CALL dorglq( m, n, m, vt, ldvt, work( itau ),
2435 $ work( iwork ), lwork-iwork+1, ierr )
2443 CALL dlaset(
'U', m-1, m-1, zero, zero, a( 1, 2 ),
2449 CALL dgebrd( m, m, a, lda, s, work( ie ),
2450 $ work( itauq ), work( itaup ),
2451 $ work( iwork ), lwork-iwork+1, ierr )
2456 CALL dormbr(
'P',
'L',
'T', m, n, m, a, lda,
2457 $ work( itaup ), vt, ldvt,
2458 $ work( iwork ), lwork-iwork+1, ierr )
2465 CALL dbdsqr(
'U', m, n, 0, 0, s, work( ie ), vt,
2466 $ ldvt, dum, 1, dum, 1, work( iwork ),
2471 ELSE IF( wntuo )
THEN
2477 IF( lwork.GE.2*m*m+max( 4*m, bdspac ) )
THEN
2482 IF( lwork.GE.wrkbl+2*lda*m )
THEN
2489 ELSE IF( lwork.GE.wrkbl+( lda+m )*m )
THEN
2504 itau = ir + ldwrkr*m
2510 CALL dgelqf( m, n, a, lda, work( itau ),
2511 $ work( iwork ), lwork-iwork+1, ierr )
2515 CALL dlacpy(
'L', m, m, a, lda, work( iu ),
2517 CALL dlaset(
'U', m-1, m-1, zero, zero,
2518 $ work( iu+ldwrku ), ldwrku )
2523 CALL dorglq( m, n, m, a, lda, work( itau ),
2524 $ work( iwork ), lwork-iwork+1, ierr )
2535 CALL dgebrd( m, m, work( iu ), ldwrku, s,
2536 $ work( ie ), work( itauq ),
2537 $ work( itaup ), work( iwork ),
2538 $ lwork-iwork+1, ierr )
2539 CALL dlacpy(
'L', m, m, work( iu ), ldwrku,
2540 $ work( ir ), ldwrkr )
2546 CALL dorgbr(
'P', m, m, m, work( iu ), ldwrku,
2547 $ work( itaup ), work( iwork ),
2548 $ lwork-iwork+1, ierr )
2553 CALL dorgbr(
'Q', m, m, m, work( ir ), ldwrkr,
2554 $ work( itauq ), work( iwork ),
2555 $ lwork-iwork+1, ierr )
2563 CALL dbdsqr(
'U', m, m, m, 0, s, work( ie ),
2564 $ work( iu ), ldwrku, work( ir ),
2565 $ ldwrkr, dum, 1, work( iwork ), info )
2571 CALL dgemm(
'N',
'N', m, n, m, one, work( iu ),
2572 $ ldwrku, a, lda, zero, vt, ldvt )
2577 CALL dlacpy(
'F', m, m, work( ir ), ldwrkr, a,
2590 CALL dgelqf( m, n, a, lda, work( itau ),
2591 $ work( iwork ), lwork-iwork+1, ierr )
2592 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2597 CALL dorglq( m, n, m, vt, ldvt, work( itau ),
2598 $ work( iwork ), lwork-iwork+1, ierr )
2606 CALL dlaset(
'U', m-1, m-1, zero, zero, a( 1, 2 ),
2612 CALL dgebrd( m, m, a, lda, s, work( ie ),
2613 $ work( itauq ), work( itaup ),
2614 $ work( iwork ), lwork-iwork+1, ierr )
2619 CALL dormbr(
'P',
'L',
'T', m, n, m, a, lda,
2620 $ work( itaup ), vt, ldvt,
2621 $ work( iwork ), lwork-iwork+1, ierr )
2626 CALL dorgbr(
'Q', m, m, m, a, lda, work( itauq ),
2627 $ work( iwork ), lwork-iwork+1, ierr )
2635 CALL dbdsqr(
'U', m, n, m, 0, s, work( ie ), vt,
2636 $ ldvt, a, lda, dum, 1, work( iwork ),
2641 ELSE IF( wntuas )
THEN
2648 IF( lwork.GE.m*m+max( 4*m, bdspac ) )
THEN
2653 IF( lwork.GE.wrkbl+lda*m )
THEN
2664 itau = iu + ldwrku*m
2670 CALL dgelqf( m, n, a, lda, work( itau ),
2671 $ work( iwork ), lwork-iwork+1, ierr )
2675 CALL dlacpy(
'L', m, m, a, lda, work( iu ),
2677 CALL dlaset(
'U', m-1, m-1, zero, zero,
2678 $ work( iu+ldwrku ), ldwrku )
2683 CALL dorglq( m, n, m, a, lda, work( itau ),
2684 $ work( iwork ), lwork-iwork+1, ierr )
2693 CALL dgebrd( m, m, work( iu ), ldwrku, s,
2694 $ work( ie ), work( itauq ),
2695 $ work( itaup ), work( iwork ),
2696 $ lwork-iwork+1, ierr )
2697 CALL dlacpy(
'L', m, m, work( iu ), ldwrku, u,
2704 CALL dorgbr(
'P', m, m, m, work( iu ), ldwrku,
2705 $ work( itaup ), work( iwork ),
2706 $ lwork-iwork+1, ierr )
2711 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
2712 $ work( iwork ), lwork-iwork+1, ierr )
2720 CALL dbdsqr(
'U', m, m, m, 0, s, work( ie ),
2721 $ work( iu ), ldwrku, u, ldu, dum, 1,
2722 $ work( iwork ), info )
2728 CALL dgemm(
'N',
'N', m, n, m, one, work( iu ),
2729 $ ldwrku, a, lda, zero, vt, ldvt )
2741 CALL dgelqf( m, n, a, lda, work( itau ),
2742 $ work( iwork ), lwork-iwork+1, ierr )
2743 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2748 CALL dorglq( m, n, m, vt, ldvt, work( itau ),
2749 $ work( iwork ), lwork-iwork+1, ierr )
2753 CALL dlacpy(
'L', m, m, a, lda, u, ldu )
2754 CALL dlaset(
'U', m-1, m-1, zero, zero, u( 1, 2 ),
2764 CALL dgebrd( m, m, u, ldu, s, work( ie ),
2765 $ work( itauq ), work( itaup ),
2766 $ work( iwork ), lwork-iwork+1, ierr )
2772 CALL dormbr(
'P',
'L',
'T', m, n, m, u, ldu,
2773 $ work( itaup ), vt, ldvt,
2774 $ work( iwork ), lwork-iwork+1, ierr )
2779 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
2780 $ work( iwork ), lwork-iwork+1, ierr )
2788 CALL dbdsqr(
'U', m, n, m, 0, s, work( ie ), vt,
2789 $ ldvt, u, ldu, dum, 1, work( iwork ),
2796 ELSE IF( wntva )
THEN
2804 IF( lwork.GE.m*m+max( n+m, 4*m, bdspac ) )
THEN
2809 IF( lwork.GE.wrkbl+lda*m )
THEN
2820 itau = ir + ldwrkr*m
2826 CALL dgelqf( m, n, a, lda, work( itau ),
2827 $ work( iwork ), lwork-iwork+1, ierr )
2828 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2832 CALL dlacpy(
'L', m, m, a, lda, work( ir ),
2834 CALL dlaset(
'U', m-1, m-1, zero, zero,
2835 $ work( ir+ldwrkr ), ldwrkr )
2840 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
2841 $ work( iwork ), lwork-iwork+1, ierr )
2850 CALL dgebrd( m, m, work( ir ), ldwrkr, s,
2851 $ work( ie ), work( itauq ),
2852 $ work( itaup ), work( iwork ),
2853 $ lwork-iwork+1, ierr )
2859 CALL dorgbr(
'P', m, m, m, work( ir ), ldwrkr,
2860 $ work( itaup ), work( iwork ),
2861 $ lwork-iwork+1, ierr )
2868 CALL dbdsqr(
'U', m, m, 0, 0, s, work( ie ),
2869 $ work( ir ), ldwrkr, dum, 1, dum, 1,
2870 $ work( iwork ), info )
2876 CALL dgemm(
'N',
'N', m, n, m, one, work( ir ),
2877 $ ldwrkr, vt, ldvt, zero, a, lda )
2881 CALL dlacpy(
'F', m, n, a, lda, vt, ldvt )
2893 CALL dgelqf( m, n, a, lda, work( itau ),
2894 $ work( iwork ), lwork-iwork+1, ierr )
2895 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2900 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
2901 $ work( iwork ), lwork-iwork+1, ierr )
2909 CALL dlaset(
'U', m-1, m-1, zero, zero, a( 1, 2 ),
2915 CALL dgebrd( m, m, a, lda, s, work( ie ),
2916 $ work( itauq ), work( itaup ),
2917 $ work( iwork ), lwork-iwork+1, ierr )
2923 CALL dormbr(
'P',
'L',
'T', m, n, m, a, lda,
2924 $ work( itaup ), vt, ldvt,
2925 $ work( iwork ), lwork-iwork+1, ierr )
2932 CALL dbdsqr(
'U', m, n, 0, 0, s, work( ie ), vt,
2933 $ ldvt, dum, 1, dum, 1, work( iwork ),
2938 ELSE IF( wntuo )
THEN
2944 IF( lwork.GE.2*m*m+max( n+m, 4*m, bdspac ) )
THEN
2949 IF( lwork.GE.wrkbl+2*lda*m )
THEN
2956 ELSE IF( lwork.GE.wrkbl+( lda+m )*m )
THEN
2971 itau = ir + ldwrkr*m
2977 CALL dgelqf( m, n, a, lda, work( itau ),
2978 $ work( iwork ), lwork-iwork+1, ierr )
2979 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
2984 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
2985 $ work( iwork ), lwork-iwork+1, ierr )
2989 CALL dlacpy(
'L', m, m, a, lda, work( iu ),
2991 CALL dlaset(
'U', m-1, m-1, zero, zero,
2992 $ work( iu+ldwrku ), ldwrku )
3003 CALL dgebrd( m, m, work( iu ), ldwrku, s,
3004 $ work( ie ), work( itauq ),
3005 $ work( itaup ), work( iwork ),
3006 $ lwork-iwork+1, ierr )
3007 CALL dlacpy(
'L', m, m, work( iu ), ldwrku,
3008 $ work( ir ), ldwrkr )
3014 CALL dorgbr(
'P', m, m, m, work( iu ), ldwrku,
3015 $ work( itaup ), work( iwork ),
3016 $ lwork-iwork+1, ierr )
3021 CALL dorgbr(
'Q', m, m, m, work( ir ), ldwrkr,
3022 $ work( itauq ), work( iwork ),
3023 $ lwork-iwork+1, ierr )
3031 CALL dbdsqr(
'U', m, m, m, 0, s, work( ie ),
3032 $ work( iu ), ldwrku, work( ir ),
3033 $ ldwrkr, dum, 1, work( iwork ), info )
3039 CALL dgemm(
'N',
'N', m, n, m, one, work( iu ),
3040 $ ldwrku, vt, ldvt, zero, a, lda )
3044 CALL dlacpy(
'F', m, n, a, lda, vt, ldvt )
3048 CALL dlacpy(
'F', m, m, work( ir ), ldwrkr, a,
3061 CALL dgelqf( m, n, a, lda, work( itau ),
3062 $ work( iwork ), lwork-iwork+1, ierr )
3063 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
3068 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
3069 $ work( iwork ), lwork-iwork+1, ierr )
3077 CALL dlaset(
'U', m-1, m-1, zero, zero, a( 1, 2 ),
3083 CALL dgebrd( m, m, a, lda, s, work( ie ),
3084 $ work( itauq ), work( itaup ),
3085 $ work( iwork ), lwork-iwork+1, ierr )
3091 CALL dormbr(
'P',
'L',
'T', m, n, m, a, lda,
3092 $ work( itaup ), vt, ldvt,
3093 $ work( iwork ), lwork-iwork+1, ierr )
3098 CALL dorgbr(
'Q', m, m, m, a, lda, work( itauq ),
3099 $ work( iwork ), lwork-iwork+1, ierr )
3107 CALL dbdsqr(
'U', m, n, m, 0, s, work( ie ), vt,
3108 $ ldvt, a, lda, dum, 1, work( iwork ),
3113 ELSE IF( wntuas )
THEN
3120 IF( lwork.GE.m*m+max( n+m, 4*m, bdspac ) )
THEN
3125 IF( lwork.GE.wrkbl+lda*m )
THEN
3136 itau = iu + ldwrku*m
3142 CALL dgelqf( m, n, a, lda, work( itau ),
3143 $ work( iwork ), lwork-iwork+1, ierr )
3144 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
3149 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
3150 $ work( iwork ), lwork-iwork+1, ierr )
3154 CALL dlacpy(
'L', m, m, a, lda, work( iu ),
3156 CALL dlaset(
'U', m-1, m-1, zero, zero,
3157 $ work( iu+ldwrku ), ldwrku )
3166 CALL dgebrd( m, m, work( iu ), ldwrku, s,
3167 $ work( ie ), work( itauq ),
3168 $ work( itaup ), work( iwork ),
3169 $ lwork-iwork+1, ierr )
3170 CALL dlacpy(
'L', m, m, work( iu ), ldwrku, u,
3176 CALL dorgbr(
'P', m, m, m, work( iu ), ldwrku,
3177 $ work( itaup ), work( iwork ),
3178 $ lwork-iwork+1, ierr )
3183 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
3184 $ work( iwork ), lwork-iwork+1, ierr )
3192 CALL dbdsqr(
'U', m, m, m, 0, s, work( ie ),
3193 $ work( iu ), ldwrku, u, ldu, dum, 1,
3194 $ work( iwork ), info )
3200 CALL dgemm(
'N',
'N', m, n, m, one, work( iu ),
3201 $ ldwrku, vt, ldvt, zero, a, lda )
3205 CALL dlacpy(
'F', m, n, a, lda, vt, ldvt )
3217 CALL dgelqf( m, n, a, lda, work( itau ),
3218 $ work( iwork ), lwork-iwork+1, ierr )
3219 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
3224 CALL dorglq( n, n, m, vt, ldvt, work( itau ),
3225 $ work( iwork ), lwork-iwork+1, ierr )
3229 CALL dlacpy(
'L', m, m, a, lda, u, ldu )
3230 CALL dlaset(
'U', m-1, m-1, zero, zero, u( 1, 2 ),
3240 CALL dgebrd( m, m, u, ldu, s, work( ie ),
3241 $ work( itauq ), work( itaup ),
3242 $ work( iwork ), lwork-iwork+1, ierr )
3248 CALL dormbr(
'P',
'L',
'T', m, n, m, u, ldu,
3249 $ work( itaup ), vt, ldvt,
3250 $ work( iwork ), lwork-iwork+1, ierr )
3255 CALL dorgbr(
'Q', m, m, m, u, ldu, work( itauq ),
3256 $ work( iwork ), lwork-iwork+1, ierr )
3264 CALL dbdsqr(
'U', m, n, m, 0, s, work( ie ), vt,
3265 $ ldvt, u, ldu, dum, 1, work( iwork ),
3289 CALL dgebrd( m, n, a, lda, s, work( ie ), work( itauq ),
3290 $ work( itaup ), work( iwork ), lwork-iwork+1,
3298 CALL dlacpy(
'L', m, m, a, lda, u, ldu )
3299 CALL dorgbr(
'Q', m, m, n, u, ldu, work( itauq ),
3300 $ work( iwork ), lwork-iwork+1, ierr )
3308 CALL dlacpy(
'U', m, n, a, lda, vt, ldvt )
3313 CALL dorgbr(
'P', nrvt, n, m, vt, ldvt, work( itaup ),
3314 $ work( iwork ), lwork-iwork+1, ierr )
3322 CALL dorgbr(
'Q', m, m, n, a, lda, work( itauq ),
3323 $ work( iwork ), lwork-iwork+1, ierr )
3331 CALL dorgbr(
'P', m, n, m, a, lda, work( itaup ),
3332 $ work( iwork ), lwork-iwork+1, ierr )
3335 IF( wntuas .OR. wntuo )
3339 IF( wntvas .OR. wntvo )
3343 IF( ( .NOT.wntuo ) .AND. ( .NOT.wntvo ) )
THEN
3350 CALL dbdsqr(
'L', m, ncvt, nru, 0, s, work( ie ), vt,
3351 $ ldvt, u, ldu, dum, 1, work( iwork ), info )
3352 ELSE IF( ( .NOT.wntuo ) .AND. wntvo )
THEN
3359 CALL dbdsqr(
'L', m, ncvt, nru, 0, s, work( ie ), a, lda,
3360 $ u, ldu, dum, 1, work( iwork ), info )
3368 CALL dbdsqr(
'L', m, ncvt, nru, 0, s, work( ie ), vt,
3369 $ ldvt, a, lda, dum, 1, work( iwork ), info )
3379 IF( info.NE.0 )
THEN
3381 DO 50 i = 1, minmn - 1
3382 work( i+1 ) = work( i+ie-1 )
3386 DO 60 i = minmn - 1, 1, -1
3387 work( i+1 ) = work( i+ie-1 )
3394 IF( iscl.EQ.1 )
THEN
3395 IF( anrm.GT.bignum )
3396 $
CALL dlascl(
'G', 0, 0, bignum, anrm, minmn, 1, s, minmn,
3398 IF( info.NE.0 .AND. anrm.GT.bignum )
3399 $
CALL dlascl(
'G', 0, 0, bignum, anrm, minmn-1, 1, work( 2 ),
3401 IF( anrm.LT.smlnum )
3402 $
CALL dlascl(
'G', 0, 0, smlnum, anrm, minmn, 1, s, minmn,
3404 IF( info.NE.0 .AND. anrm.LT.smlnum )
3405 $
CALL dlascl(
'G', 0, 0, smlnum, anrm, minmn-1, 1, work( 2 ),
subroutine dbdsqr(UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, LDU, C, LDC, WORK, INFO)
subroutine dgebrd(M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, INFO)
subroutine dgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
subroutine dgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
subroutine dgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO)
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
subroutine dlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
subroutine dorgbr(VECT, M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
subroutine dorglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
subroutine dorgqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
subroutine dormbr(VECT, SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
subroutine xerbla(SRNAME, INFO)