LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ cgelsd()

subroutine cgelsd ( integer  M,
integer  N,
integer  NRHS,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldb, * )  B,
integer  LDB,
real, dimension( * )  S,
real  RCOND,
integer  RANK,
complex, dimension( * )  WORK,
integer  LWORK,
real, dimension( * )  RWORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

CGELSD computes the minimum-norm solution to a linear least squares problem for GE matrices

Download CGELSD + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 CGELSD computes the minimum-norm solution to a real linear least
 squares problem:
     minimize 2-norm(| b - A*x |)
 using the singular value decomposition (SVD) of A. A is an M-by-N
 matrix which may be rank-deficient.

 Several right hand side vectors b and solution vectors x can be
 handled in a single call; they are stored as the columns of the
 M-by-NRHS right hand side matrix B and the N-by-NRHS solution
 matrix X.

 The problem is solved in three steps:
 (1) Reduce the coefficient matrix A to bidiagonal form with
     Householder transformations, reducing the original problem
     into a "bidiagonal least squares problem" (BLS)
 (2) Solve the BLS using a divide and conquer approach.
 (3) Apply back all the Householder transformations to solve
     the original least squares problem.

 The effective rank of A is determined by treating as zero those
 singular values which are less than RCOND times the largest singular
 value.

 The divide and conquer algorithm makes very mild assumptions about
 floating point arithmetic. It will work on machines with a guard
 digit in add/subtract, or on those binary machines without guard
 digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
 Cray-2. It could conceivably fail on hexadecimal or decimal machines
 without guard digits, but we know of none.
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrix A. M >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrix A. N >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrices B and X. NRHS >= 0.
[in,out]A
          A is COMPLEX array, dimension (LDA,N)
          On entry, the M-by-N matrix A.
          On exit, A has been destroyed.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A. LDA >= max(1,M).
[in,out]B
          B is COMPLEX array, dimension (LDB,NRHS)
          On entry, the M-by-NRHS right hand side matrix B.
          On exit, B is overwritten by the N-by-NRHS solution matrix X.
          If m >= n and RANK = n, the residual sum-of-squares for
          the solution in the i-th column is given by the sum of
          squares of the modulus of elements n+1:m in that column.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,M,N).
[out]S
          S is REAL array, dimension (min(M,N))
          The singular values of A in decreasing order.
          The condition number of A in the 2-norm = S(1)/S(min(m,n)).
[in]RCOND
          RCOND is REAL
          RCOND is used to determine the effective rank of A.
          Singular values S(i) <= RCOND*S(1) are treated as zero.
          If RCOND < 0, machine precision is used instead.
[out]RANK
          RANK is INTEGER
          The effective rank of A, i.e., the number of singular values
          which are greater than RCOND*S(1).
[out]WORK
          WORK is COMPLEX array, dimension (MAX(1,LWORK))
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK. LWORK must be at least 1.
          The exact minimum amount of workspace needed depends on M,
          N and NRHS. As long as LWORK is at least
              2 * N + N * NRHS
          if M is greater than or equal to N or
              2 * M + M * NRHS
          if M is less than N, the code will execute correctly.
          For good performance, LWORK should generally be larger.

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal size of the array WORK and the
          minimum sizes of the arrays RWORK and IWORK, and returns
          these values as the first entries of the WORK, RWORK and
          IWORK arrays, and no error message related to LWORK is issued
          by XERBLA.
[out]RWORK
          RWORK is REAL array, dimension (MAX(1,LRWORK))
          LRWORK >=
             10*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
             MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
          if M is greater than or equal to N or
             10*M + 2*M*SMLSIZ + 8*M*NLVL + 3*SMLSIZ*NRHS +
             MAX( (SMLSIZ+1)**2, N*(1+NRHS) + 2*NRHS )
          if M is less than N, the code will execute correctly.
          SMLSIZ is returned by ILAENV and is equal to the maximum
          size of the subproblems at the bottom of the computation
          tree (usually about 25), and
             NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
          On exit, if INFO = 0, RWORK(1) returns the minimum LRWORK.
[out]IWORK
          IWORK is INTEGER array, dimension (MAX(1,LIWORK))
          LIWORK >= max(1, 3*MINMN*NLVL + 11*MINMN),
          where MINMN = MIN( M,N ).
          On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
[out]INFO
          INFO is INTEGER
          = 0: successful exit
          < 0: if INFO = -i, the i-th argument had an illegal value.
          > 0:  the algorithm for computing the SVD failed to converge;
                if INFO = i, i off-diagonal elements of an intermediate
                bidiagonal form did not converge to zero.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Ming Gu and Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA
Osni Marques, LBNL/NERSC, USA

Definition at line 223 of file cgelsd.f.

225 *
226 * -- LAPACK driver routine --
227 * -- LAPACK is a software package provided by Univ. of Tennessee, --
228 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
229 *
230 * .. Scalar Arguments ..
231  INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
232  REAL RCOND
233 * ..
234 * .. Array Arguments ..
235  INTEGER IWORK( * )
236  REAL RWORK( * ), S( * )
237  COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
238 * ..
239 *
240 * =====================================================================
241 *
242 * .. Parameters ..
243  REAL ZERO, ONE, TWO
244  parameter( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
245  COMPLEX CZERO
246  parameter( czero = ( 0.0e+0, 0.0e+0 ) )
247 * ..
248 * .. Local Scalars ..
249  LOGICAL LQUERY
250  INTEGER IASCL, IBSCL, IE, IL, ITAU, ITAUP, ITAUQ,
251  $ LDWORK, LIWORK, LRWORK, MAXMN, MAXWRK, MINMN,
252  $ MINWRK, MM, MNTHR, NLVL, NRWORK, NWORK, SMLSIZ
253  REAL ANRM, BIGNUM, BNRM, EPS, SFMIN, SMLNUM
254 * ..
255 * .. External Subroutines ..
256  EXTERNAL cgebrd, cgelqf, cgeqrf, clacpy,
257  $ clalsd, clascl, claset, cunmbr,
258  $ cunmlq, cunmqr, slabad, slascl,
259  $ slaset, xerbla
260 * ..
261 * .. External Functions ..
262  INTEGER ILAENV
263  REAL CLANGE, SLAMCH
264  EXTERNAL clange, slamch, ilaenv
265 * ..
266 * .. Intrinsic Functions ..
267  INTRINSIC int, log, max, min, real
268 * ..
269 * .. Executable Statements ..
270 *
271 * Test the input arguments.
272 *
273  info = 0
274  minmn = min( m, n )
275  maxmn = max( m, n )
276  lquery = ( lwork.EQ.-1 )
277  IF( m.LT.0 ) THEN
278  info = -1
279  ELSE IF( n.LT.0 ) THEN
280  info = -2
281  ELSE IF( nrhs.LT.0 ) THEN
282  info = -3
283  ELSE IF( lda.LT.max( 1, m ) ) THEN
284  info = -5
285  ELSE IF( ldb.LT.max( 1, maxmn ) ) THEN
286  info = -7
287  END IF
288 *
289 * Compute workspace.
290 * (Note: Comments in the code beginning "Workspace:" describe the
291 * minimal amount of workspace needed at that point in the code,
292 * as well as the preferred amount for good performance.
293 * NB refers to the optimal block size for the immediately
294 * following subroutine, as returned by ILAENV.)
295 *
296  IF( info.EQ.0 ) THEN
297  minwrk = 1
298  maxwrk = 1
299  liwork = 1
300  lrwork = 1
301  IF( minmn.GT.0 ) THEN
302  smlsiz = ilaenv( 9, 'CGELSD', ' ', 0, 0, 0, 0 )
303  mnthr = ilaenv( 6, 'CGELSD', ' ', m, n, nrhs, -1 )
304  nlvl = max( int( log( real( minmn ) / real( smlsiz + 1 ) ) /
305  $ log( two ) ) + 1, 0 )
306  liwork = 3*minmn*nlvl + 11*minmn
307  mm = m
308  IF( m.GE.n .AND. m.GE.mnthr ) THEN
309 *
310 * Path 1a - overdetermined, with many more rows than
311 * columns.
312 *
313  mm = n
314  maxwrk = max( maxwrk, n*ilaenv( 1, 'CGEQRF', ' ', m, n,
315  $ -1, -1 ) )
316  maxwrk = max( maxwrk, nrhs*ilaenv( 1, 'CUNMQR', 'LC', m,
317  $ nrhs, n, -1 ) )
318  END IF
319  IF( m.GE.n ) THEN
320 *
321 * Path 1 - overdetermined or exactly determined.
322 *
323  lrwork = 10*n + 2*n*smlsiz + 8*n*nlvl + 3*smlsiz*nrhs +
324  $ max( (smlsiz+1)**2, n*(1+nrhs) + 2*nrhs )
325  maxwrk = max( maxwrk, 2*n + ( mm + n )*ilaenv( 1,
326  $ 'CGEBRD', ' ', mm, n, -1, -1 ) )
327  maxwrk = max( maxwrk, 2*n + nrhs*ilaenv( 1, 'CUNMBR',
328  $ 'QLC', mm, nrhs, n, -1 ) )
329  maxwrk = max( maxwrk, 2*n + ( n - 1 )*ilaenv( 1,
330  $ 'CUNMBR', 'PLN', n, nrhs, n, -1 ) )
331  maxwrk = max( maxwrk, 2*n + n*nrhs )
332  minwrk = max( 2*n + mm, 2*n + n*nrhs )
333  END IF
334  IF( n.GT.m ) THEN
335  lrwork = 10*m + 2*m*smlsiz + 8*m*nlvl + 3*smlsiz*nrhs +
336  $ max( (smlsiz+1)**2, n*(1+nrhs) + 2*nrhs )
337  IF( n.GE.mnthr ) THEN
338 *
339 * Path 2a - underdetermined, with many more columns
340 * than rows.
341 *
342  maxwrk = m + m*ilaenv( 1, 'CGELQF', ' ', m, n, -1,
343  $ -1 )
344  maxwrk = max( maxwrk, m*m + 4*m + 2*m*ilaenv( 1,
345  $ 'CGEBRD', ' ', m, m, -1, -1 ) )
346  maxwrk = max( maxwrk, m*m + 4*m + nrhs*ilaenv( 1,
347  $ 'CUNMBR', 'QLC', m, nrhs, m, -1 ) )
348  maxwrk = max( maxwrk, m*m + 4*m + ( m - 1 )*ilaenv( 1,
349  $ 'CUNMLQ', 'LC', n, nrhs, m, -1 ) )
350  IF( nrhs.GT.1 ) THEN
351  maxwrk = max( maxwrk, m*m + m + m*nrhs )
352  ELSE
353  maxwrk = max( maxwrk, m*m + 2*m )
354  END IF
355  maxwrk = max( maxwrk, m*m + 4*m + m*nrhs )
356 ! XXX: Ensure the Path 2a case below is triggered. The workspace
357 ! calculation should use queries for all routines eventually.
358  maxwrk = max( maxwrk,
359  $ 4*m+m*m+max( m, 2*m-4, nrhs, n-3*m ) )
360  ELSE
361 *
362 * Path 2 - underdetermined.
363 *
364  maxwrk = 2*m + ( n + m )*ilaenv( 1, 'CGEBRD', ' ', m,
365  $ n, -1, -1 )
366  maxwrk = max( maxwrk, 2*m + nrhs*ilaenv( 1, 'CUNMBR',
367  $ 'QLC', m, nrhs, m, -1 ) )
368  maxwrk = max( maxwrk, 2*m + m*ilaenv( 1, 'CUNMBR',
369  $ 'PLN', n, nrhs, m, -1 ) )
370  maxwrk = max( maxwrk, 2*m + m*nrhs )
371  END IF
372  minwrk = max( 2*m + n, 2*m + m*nrhs )
373  END IF
374  END IF
375  minwrk = min( minwrk, maxwrk )
376  work( 1 ) = maxwrk
377  iwork( 1 ) = liwork
378  rwork( 1 ) = lrwork
379 *
380  IF( lwork.LT.minwrk .AND. .NOT.lquery ) THEN
381  info = -12
382  END IF
383  END IF
384 *
385  IF( info.NE.0 ) THEN
386  CALL xerbla( 'CGELSD', -info )
387  RETURN
388  ELSE IF( lquery ) THEN
389  RETURN
390  END IF
391 *
392 * Quick return if possible.
393 *
394  IF( m.EQ.0 .OR. n.EQ.0 ) THEN
395  rank = 0
396  RETURN
397  END IF
398 *
399 * Get machine parameters.
400 *
401  eps = slamch( 'P' )
402  sfmin = slamch( 'S' )
403  smlnum = sfmin / eps
404  bignum = one / smlnum
405  CALL slabad( smlnum, bignum )
406 *
407 * Scale A if max entry outside range [SMLNUM,BIGNUM].
408 *
409  anrm = clange( 'M', m, n, a, lda, rwork )
410  iascl = 0
411  IF( anrm.GT.zero .AND. anrm.LT.smlnum ) THEN
412 *
413 * Scale matrix norm up to SMLNUM
414 *
415  CALL clascl( 'G', 0, 0, anrm, smlnum, m, n, a, lda, info )
416  iascl = 1
417  ELSE IF( anrm.GT.bignum ) THEN
418 *
419 * Scale matrix norm down to BIGNUM.
420 *
421  CALL clascl( 'G', 0, 0, anrm, bignum, m, n, a, lda, info )
422  iascl = 2
423  ELSE IF( anrm.EQ.zero ) THEN
424 *
425 * Matrix all zero. Return zero solution.
426 *
427  CALL claset( 'F', max( m, n ), nrhs, czero, czero, b, ldb )
428  CALL slaset( 'F', minmn, 1, zero, zero, s, 1 )
429  rank = 0
430  GO TO 10
431  END IF
432 *
433 * Scale B if max entry outside range [SMLNUM,BIGNUM].
434 *
435  bnrm = clange( 'M', m, nrhs, b, ldb, rwork )
436  ibscl = 0
437  IF( bnrm.GT.zero .AND. bnrm.LT.smlnum ) THEN
438 *
439 * Scale matrix norm up to SMLNUM.
440 *
441  CALL clascl( 'G', 0, 0, bnrm, smlnum, m, nrhs, b, ldb, info )
442  ibscl = 1
443  ELSE IF( bnrm.GT.bignum ) THEN
444 *
445 * Scale matrix norm down to BIGNUM.
446 *
447  CALL clascl( 'G', 0, 0, bnrm, bignum, m, nrhs, b, ldb, info )
448  ibscl = 2
449  END IF
450 *
451 * If M < N make sure B(M+1:N,:) = 0
452 *
453  IF( m.LT.n )
454  $ CALL claset( 'F', n-m, nrhs, czero, czero, b( m+1, 1 ), ldb )
455 *
456 * Overdetermined case.
457 *
458  IF( m.GE.n ) THEN
459 *
460 * Path 1 - overdetermined or exactly determined.
461 *
462  mm = m
463  IF( m.GE.mnthr ) THEN
464 *
465 * Path 1a - overdetermined, with many more rows than columns
466 *
467  mm = n
468  itau = 1
469  nwork = itau + n
470 *
471 * Compute A=Q*R.
472 * (RWorkspace: need N)
473 * (CWorkspace: need N, prefer N*NB)
474 *
475  CALL cgeqrf( m, n, a, lda, work( itau ), work( nwork ),
476  $ lwork-nwork+1, info )
477 *
478 * Multiply B by transpose(Q).
479 * (RWorkspace: need N)
480 * (CWorkspace: need NRHS, prefer NRHS*NB)
481 *
482  CALL cunmqr( 'L', 'C', m, nrhs, n, a, lda, work( itau ), b,
483  $ ldb, work( nwork ), lwork-nwork+1, info )
484 *
485 * Zero out below R.
486 *
487  IF( n.GT.1 ) THEN
488  CALL claset( 'L', n-1, n-1, czero, czero, a( 2, 1 ),
489  $ lda )
490  END IF
491  END IF
492 *
493  itauq = 1
494  itaup = itauq + n
495  nwork = itaup + n
496  ie = 1
497  nrwork = ie + n
498 *
499 * Bidiagonalize R in A.
500 * (RWorkspace: need N)
501 * (CWorkspace: need 2*N+MM, prefer 2*N+(MM+N)*NB)
502 *
503  CALL cgebrd( mm, n, a, lda, s, rwork( ie ), work( itauq ),
504  $ work( itaup ), work( nwork ), lwork-nwork+1,
505  $ info )
506 *
507 * Multiply B by transpose of left bidiagonalizing vectors of R.
508 * (CWorkspace: need 2*N+NRHS, prefer 2*N+NRHS*NB)
509 *
510  CALL cunmbr( 'Q', 'L', 'C', mm, nrhs, n, a, lda, work( itauq ),
511  $ b, ldb, work( nwork ), lwork-nwork+1, info )
512 *
513 * Solve the bidiagonal least squares problem.
514 *
515  CALL clalsd( 'U', smlsiz, n, nrhs, s, rwork( ie ), b, ldb,
516  $ rcond, rank, work( nwork ), rwork( nrwork ),
517  $ iwork, info )
518  IF( info.NE.0 ) THEN
519  GO TO 10
520  END IF
521 *
522 * Multiply B by right bidiagonalizing vectors of R.
523 *
524  CALL cunmbr( 'P', 'L', 'N', n, nrhs, n, a, lda, work( itaup ),
525  $ b, ldb, work( nwork ), lwork-nwork+1, info )
526 *
527  ELSE IF( n.GE.mnthr .AND. lwork.GE.4*m+m*m+
528  $ max( m, 2*m-4, nrhs, n-3*m ) ) THEN
529 *
530 * Path 2a - underdetermined, with many more columns than rows
531 * and sufficient workspace for an efficient algorithm.
532 *
533  ldwork = m
534  IF( lwork.GE.max( 4*m+m*lda+max( m, 2*m-4, nrhs, n-3*m ),
535  $ m*lda+m+m*nrhs ) )ldwork = lda
536  itau = 1
537  nwork = m + 1
538 *
539 * Compute A=L*Q.
540 * (CWorkspace: need 2*M, prefer M+M*NB)
541 *
542  CALL cgelqf( m, n, a, lda, work( itau ), work( nwork ),
543  $ lwork-nwork+1, info )
544  il = nwork
545 *
546 * Copy L to WORK(IL), zeroing out above its diagonal.
547 *
548  CALL clacpy( 'L', m, m, a, lda, work( il ), ldwork )
549  CALL claset( 'U', m-1, m-1, czero, czero, work( il+ldwork ),
550  $ ldwork )
551  itauq = il + ldwork*m
552  itaup = itauq + m
553  nwork = itaup + m
554  ie = 1
555  nrwork = ie + m
556 *
557 * Bidiagonalize L in WORK(IL).
558 * (RWorkspace: need M)
559 * (CWorkspace: need M*M+4*M, prefer M*M+4*M+2*M*NB)
560 *
561  CALL cgebrd( m, m, work( il ), ldwork, s, rwork( ie ),
562  $ work( itauq ), work( itaup ), work( nwork ),
563  $ lwork-nwork+1, info )
564 *
565 * Multiply B by transpose of left bidiagonalizing vectors of L.
566 * (CWorkspace: need M*M+4*M+NRHS, prefer M*M+4*M+NRHS*NB)
567 *
568  CALL cunmbr( 'Q', 'L', 'C', m, nrhs, m, work( il ), ldwork,
569  $ work( itauq ), b, ldb, work( nwork ),
570  $ lwork-nwork+1, info )
571 *
572 * Solve the bidiagonal least squares problem.
573 *
574  CALL clalsd( 'U', smlsiz, m, nrhs, s, rwork( ie ), b, ldb,
575  $ rcond, rank, work( nwork ), rwork( nrwork ),
576  $ iwork, info )
577  IF( info.NE.0 ) THEN
578  GO TO 10
579  END IF
580 *
581 * Multiply B by right bidiagonalizing vectors of L.
582 *
583  CALL cunmbr( 'P', 'L', 'N', m, nrhs, m, work( il ), ldwork,
584  $ work( itaup ), b, ldb, work( nwork ),
585  $ lwork-nwork+1, info )
586 *
587 * Zero out below first M rows of B.
588 *
589  CALL claset( 'F', n-m, nrhs, czero, czero, b( m+1, 1 ), ldb )
590  nwork = itau + m
591 *
592 * Multiply transpose(Q) by B.
593 * (CWorkspace: need NRHS, prefer NRHS*NB)
594 *
595  CALL cunmlq( 'L', 'C', n, nrhs, m, a, lda, work( itau ), b,
596  $ ldb, work( nwork ), lwork-nwork+1, info )
597 *
598  ELSE
599 *
600 * Path 2 - remaining underdetermined cases.
601 *
602  itauq = 1
603  itaup = itauq + m
604  nwork = itaup + m
605  ie = 1
606  nrwork = ie + m
607 *
608 * Bidiagonalize A.
609 * (RWorkspace: need M)
610 * (CWorkspace: need 2*M+N, prefer 2*M+(M+N)*NB)
611 *
612  CALL cgebrd( m, n, a, lda, s, rwork( ie ), work( itauq ),
613  $ work( itaup ), work( nwork ), lwork-nwork+1,
614  $ info )
615 *
616 * Multiply B by transpose of left bidiagonalizing vectors.
617 * (CWorkspace: need 2*M+NRHS, prefer 2*M+NRHS*NB)
618 *
619  CALL cunmbr( 'Q', 'L', 'C', m, nrhs, n, a, lda, work( itauq ),
620  $ b, ldb, work( nwork ), lwork-nwork+1, info )
621 *
622 * Solve the bidiagonal least squares problem.
623 *
624  CALL clalsd( 'L', smlsiz, m, nrhs, s, rwork( ie ), b, ldb,
625  $ rcond, rank, work( nwork ), rwork( nrwork ),
626  $ iwork, info )
627  IF( info.NE.0 ) THEN
628  GO TO 10
629  END IF
630 *
631 * Multiply B by right bidiagonalizing vectors of A.
632 *
633  CALL cunmbr( 'P', 'L', 'N', n, nrhs, m, a, lda, work( itaup ),
634  $ b, ldb, work( nwork ), lwork-nwork+1, info )
635 *
636  END IF
637 *
638 * Undo scaling.
639 *
640  IF( iascl.EQ.1 ) THEN
641  CALL clascl( 'G', 0, 0, anrm, smlnum, n, nrhs, b, ldb, info )
642  CALL slascl( 'G', 0, 0, smlnum, anrm, minmn, 1, s, minmn,
643  $ info )
644  ELSE IF( iascl.EQ.2 ) THEN
645  CALL clascl( 'G', 0, 0, anrm, bignum, n, nrhs, b, ldb, info )
646  CALL slascl( 'G', 0, 0, bignum, anrm, minmn, 1, s, minmn,
647  $ info )
648  END IF
649  IF( ibscl.EQ.1 ) THEN
650  CALL clascl( 'G', 0, 0, smlnum, bnrm, n, nrhs, b, ldb, info )
651  ELSE IF( ibscl.EQ.2 ) THEN
652  CALL clascl( 'G', 0, 0, bignum, bnrm, n, nrhs, b, ldb, info )
653  END IF
654 *
655  10 CONTINUE
656  work( 1 ) = maxwrk
657  iwork( 1 ) = liwork
658  rwork( 1 ) = lrwork
659  RETURN
660 *
661 * End of CGELSD
662 *
subroutine slabad(SMALL, LARGE)
SLABAD
Definition: slabad.f:74
subroutine slascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: slascl.f:143
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.
Definition: slaset.f:110
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
ILAENV
Definition: ilaenv.f:162
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:115
subroutine cgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
CGEQRF
Definition: cgeqrf.f:145
subroutine cgebrd(M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, INFO)
CGEBRD
Definition: cgebrd.f:206
subroutine cgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
CGELQF
Definition: cgelqf.f:143
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Definition: claset.f:106
subroutine clascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: clascl.f:143
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
Definition: clacpy.f:103
subroutine clalsd(UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND, RANK, WORK, RWORK, IWORK, INFO)
CLALSD uses the singular value decomposition of A to solve the least squares problem.
Definition: clalsd.f:186
subroutine cunmbr(VECT, SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
CUNMBR
Definition: cunmbr.f:197
subroutine cunmlq(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
CUNMLQ
Definition: cunmlq.f:168
subroutine cunmqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
CUNMQR
Definition: cunmqr.f:168
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: