LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

◆ sgegv()

subroutine sgegv ( character jobvl,
character jobvr,
integer n,
real, dimension( lda, * ) a,
integer lda,
real, dimension( ldb, * ) b,
integer ldb,
real, dimension( * ) alphar,
real, dimension( * ) alphai,
real, dimension( * ) beta,
real, dimension( ldvl, * ) vl,
integer ldvl,
real, dimension( ldvr, * ) vr,
integer ldvr,
real, dimension( * ) work,
integer lwork,
integer info )

SGEGV computes the eigenvalues and, optionally, the left and/or right eigenvectors of a real matrix pair (A,B).

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

Purpose:
!> !> This routine is deprecated and has been replaced by routine SGGEV. !> !> SGEGV computes the eigenvalues and, optionally, the left and/or right !> eigenvectors of a real matrix pair (A,B). !> Given two square matrices A and B, !> the generalized nonsymmetric eigenvalue problem (GNEP) is to find the !> eigenvalues lambda and corresponding (non-zero) eigenvectors x such !> that !> !> A*x = lambda*B*x. !> !> An alternate form is to find the eigenvalues mu and corresponding !> eigenvectors y such that !> !> mu*A*y = B*y. !> !> These two forms are equivalent with mu = 1/lambda and x = y if !> neither lambda nor mu is zero. In order to deal with the case that !> lambda or mu is zero or small, two values alpha and beta are returned !> for each eigenvalue, such that lambda = alpha/beta and !> mu = beta/alpha. !> !> The vectors x and y in the above equations are right eigenvectors of !> the matrix pair (A,B). Vectors u and v satisfying !> !> u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B !> !> are left eigenvectors of (A,B). !> !> Note: this routine performs on A and B !>
Parameters
[in]JOBVL
!> JOBVL is CHARACTER*1 !> = 'N': do not compute the left generalized eigenvectors; !> = 'V': compute the left generalized eigenvectors (returned !> in VL). !>
[in]JOBVR
!> JOBVR is CHARACTER*1 !> = 'N': do not compute the right generalized eigenvectors; !> = 'V': compute the right generalized eigenvectors (returned !> in VR). !>
[in]N
!> N is INTEGER !> The order of the matrices A, B, VL, and VR. N >= 0. !>
[in,out]A
!> A is REAL array, dimension (LDA, N) !> On entry, the matrix A. !> If JOBVL = 'V' or JOBVR = 'V', then on exit A !> contains the real Schur form of A from the generalized Schur !> factorization of the pair (A,B) after balancing. !> If no eigenvectors were computed, then only the diagonal !> blocks from the Schur form will be correct. See SGGHRD and !> SHGEQZ for details. !>
[in]LDA
!> LDA is INTEGER !> The leading dimension of A. LDA >= max(1,N). !>
[in,out]B
!> B is REAL array, dimension (LDB, N) !> On entry, the matrix B. !> If JOBVL = 'V' or JOBVR = 'V', then on exit B contains the !> upper triangular matrix obtained from B in the generalized !> Schur factorization of the pair (A,B) after balancing. !> If no eigenvectors were computed, then only those elements of !> B corresponding to the diagonal blocks from the Schur form of !> A will be correct. See SGGHRD and SHGEQZ for details. !>
[in]LDB
!> LDB is INTEGER !> The leading dimension of B. LDB >= max(1,N). !>
[out]ALPHAR
!> ALPHAR is REAL array, dimension (N) !> The real parts of each scalar alpha defining an eigenvalue of !> GNEP. !>
[out]ALPHAI
!> ALPHAI is REAL array, dimension (N) !> The imaginary parts of each scalar alpha defining an !> eigenvalue of GNEP. If ALPHAI(j) is zero, then the j-th !> eigenvalue is real; if positive, then the j-th and !> (j+1)-st eigenvalues are a complex conjugate pair, with !> ALPHAI(j+1) = -ALPHAI(j). !>
[out]BETA
!> BETA is REAL array, dimension (N) !> The scalars beta that define the eigenvalues of GNEP. !> !> Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and !> beta = BETA(j) represent the j-th eigenvalue of the matrix !> pair (A,B), in one of the forms lambda = alpha/beta or !> mu = beta/alpha. Since either lambda or mu may overflow, !> they should not, in general, be computed. !>
[out]VL
!> VL is REAL array, dimension (LDVL,N) !> If JOBVL = 'V', the left eigenvectors u(j) are stored !> in the columns of VL, in the same order as their eigenvalues. !> If the j-th eigenvalue is real, then u(j) = VL(:,j). !> If the j-th and (j+1)-st eigenvalues form a complex conjugate !> pair, then !> u(j) = VL(:,j) + i*VL(:,j+1) !> and !> u(j+1) = VL(:,j) - i*VL(:,j+1). !> !> Each eigenvector is scaled so that its largest component has !> abs(real part) + abs(imag. part) = 1, except for eigenvectors !> corresponding to an eigenvalue with alpha = beta = 0, which !> are set to zero. !> Not referenced if JOBVL = 'N'. !>
[in]LDVL
!> LDVL is INTEGER !> The leading dimension of the matrix VL. LDVL >= 1, and !> if JOBVL = 'V', LDVL >= N. !>
[out]VR
!> VR is REAL array, dimension (LDVR,N) !> If JOBVR = 'V', the right eigenvectors x(j) are stored !> in the columns of VR, in the same order as their eigenvalues. !> If the j-th eigenvalue is real, then x(j) = VR(:,j). !> If the j-th and (j+1)-st eigenvalues form a complex conjugate !> pair, then !> x(j) = VR(:,j) + i*VR(:,j+1) !> and !> x(j+1) = VR(:,j) - i*VR(:,j+1). !> !> Each eigenvector is scaled so that its largest component has !> abs(real part) + abs(imag. part) = 1, except for eigenvalues !> corresponding to an eigenvalue with alpha = beta = 0, which !> are set to zero. !> Not referenced if JOBVR = 'N'. !>
[in]LDVR
!> LDVR is INTEGER !> The leading dimension of the matrix VR. LDVR >= 1, and !> if JOBVR = 'V', LDVR >= N. !>
[out]WORK
!> WORK is REAL 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 >= max(1,8*N). !> For good performance, LWORK must generally be larger. !> To compute the optimal value of LWORK, call ILAENV to get !> blocksizes (for SGEQRF, SORMQR, and SORGQR.) Then compute: !> NB -- MAX of the blocksizes for SGEQRF, SORMQR, and SORGQR; !> The optimal LWORK is: !> 2*N + MAX( 6*N, N*(NB+1) ). !> !> If LWORK = -1, then a workspace query is assumed; the routine !> only calculates the optimal size of the WORK array, returns !> this value as the first entry of the WORK array, and no error !> message related to LWORK is issued by XERBLA. !>
[out]INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value. !> = 1,...,N: !> The QZ iteration failed. No eigenvectors have been !> calculated, but ALPHAR(j), ALPHAI(j), and BETA(j) !> should be correct for j=INFO+1,...,N. !> > N: errors that usually indicate LAPACK problems: !> =N+1: error return from SGGBAL !> =N+2: error return from SGEQRF !> =N+3: error return from SORMQR !> =N+4: error return from SORGQR !> =N+5: error return from SGGHRD !> =N+6: error return from SHGEQZ (other than failed !> iteration) !> =N+7: error return from STGEVC !> =N+8: error return from SGGBAK (computing VL) !> =N+9: error return from SGGBAK (computing VR) !> =N+10: error return from SLASCL (various calls) !>
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!> !> Balancing !> --------- !> !> This driver calls SGGBAL to both permute and scale rows and columns !> of A and B. The permutations PL and PR are chosen so that PL*A*PR !> and PL*B*R will be upper triangular except for the diagonal blocks !> A(i:j,i:j) and B(i:j,i:j), with i and j as close together as !> possible. The diagonal scaling matrices DL and DR are chosen so !> that the pair DL*PL*A*PR*DR, DL*PL*B*PR*DR have elements close to !> one (except for the elements that start out zero.) !> !> After the eigenvalues and eigenvectors of the balanced matrices !> have been computed, SGGBAK transforms the eigenvectors back to what !> they would have been (in perfect arithmetic) if they had not been !> balanced. !> !> Contents of A and B on Exit !> -------- -- - --- - -- ---- !> !> If any eigenvectors are computed (either JOBVL='V' or JOBVR='V' or !> both), then on exit the arrays A and B will contain the real Schur !> form[*] of the versions of A and B. If no eigenvectors !> are computed, then only the diagonal blocks will be correct. !> !> [*] See SHGEQZ, SGEGS, or read the book , !> by Golub & van Loan, pub. by Johns Hopkins U. Press. !>

Definition at line 302 of file sgegv.f.

305*
306* -- LAPACK driver routine --
307* -- LAPACK is a software package provided by Univ. of Tennessee, --
308* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
309*
310* .. Scalar Arguments ..
311 CHARACTER JOBVL, JOBVR
312 INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, N
313* ..
314* .. Array Arguments ..
315 REAL A( LDA, * ), ALPHAI( * ), ALPHAR( * ),
316 $ B( LDB, * ), BETA( * ), VL( LDVL, * ),
317 $ VR( LDVR, * ), WORK( * )
318* ..
319*
320* =====================================================================
321*
322* .. Parameters ..
323 REAL ZERO, ONE
324 parameter( zero = 0.0e0, one = 1.0e0 )
325* ..
326* .. Local Scalars ..
327 LOGICAL ILIMIT, ILV, ILVL, ILVR, LQUERY
328 CHARACTER CHTEMP
329 INTEGER ICOLS, IHI, IINFO, IJOBVL, IJOBVR, ILEFT, ILO,
330 $ IN, IRIGHT, IROWS, ITAU, IWORK, JC, JR, LOPT,
331 $ LWKMIN, LWKOPT, NB, NB1, NB2, NB3
332 REAL ABSAI, ABSAR, ABSB, ANRM, ANRM1, ANRM2, BNRM,
333 $ BNRM1, BNRM2, EPS, ONEPLS, SAFMAX, SAFMIN,
334 $ SALFAI, SALFAR, SBETA, SCALE, TEMP
335* ..
336* .. Local Arrays ..
337 LOGICAL LDUMMA( 1 )
338* ..
339* .. External Subroutines ..
340 EXTERNAL sgeqrf, sggbak, sggbal, sgghrd, shgeqz, slacpy,
342* ..
343* .. External Functions ..
344 LOGICAL LSAME
345 INTEGER ILAENV
346 REAL SLAMCH, SLANGE
347 EXTERNAL ilaenv, lsame, slamch, slange
348* ..
349* .. Intrinsic Functions ..
350 INTRINSIC abs, int, max
351* ..
352* .. Executable Statements ..
353*
354* Decode the input arguments
355*
356 IF( lsame( jobvl, 'N' ) ) THEN
357 ijobvl = 1
358 ilvl = .false.
359 ELSE IF( lsame( jobvl, 'V' ) ) THEN
360 ijobvl = 2
361 ilvl = .true.
362 ELSE
363 ijobvl = -1
364 ilvl = .false.
365 END IF
366*
367 IF( lsame( jobvr, 'N' ) ) THEN
368 ijobvr = 1
369 ilvr = .false.
370 ELSE IF( lsame( jobvr, 'V' ) ) THEN
371 ijobvr = 2
372 ilvr = .true.
373 ELSE
374 ijobvr = -1
375 ilvr = .false.
376 END IF
377 ilv = ilvl .OR. ilvr
378*
379* Test the input arguments
380*
381 lwkmin = max( 8*n, 1 )
382 lwkopt = lwkmin
383 work( 1 ) = lwkopt
384 lquery = ( lwork.EQ.-1 )
385 info = 0
386 IF( ijobvl.LE.0 ) THEN
387 info = -1
388 ELSE IF( ijobvr.LE.0 ) THEN
389 info = -2
390 ELSE IF( n.LT.0 ) THEN
391 info = -3
392 ELSE IF( lda.LT.max( 1, n ) ) THEN
393 info = -5
394 ELSE IF( ldb.LT.max( 1, n ) ) THEN
395 info = -7
396 ELSE IF( ldvl.LT.1 .OR. ( ilvl .AND. ldvl.LT.n ) ) THEN
397 info = -12
398 ELSE IF( ldvr.LT.1 .OR. ( ilvr .AND. ldvr.LT.n ) ) THEN
399 info = -14
400 ELSE IF( lwork.LT.lwkmin .AND. .NOT.lquery ) THEN
401 info = -16
402 END IF
403*
404 IF( info.EQ.0 ) THEN
405 nb1 = ilaenv( 1, 'SGEQRF', ' ', n, n, -1, -1 )
406 nb2 = ilaenv( 1, 'SORMQR', ' ', n, n, n, -1 )
407 nb3 = ilaenv( 1, 'SORGQR', ' ', n, n, n, -1 )
408 nb = max( nb1, nb2, nb3 )
409 lopt = 2*n + max( 6*n, n*(nb+1) )
410 work( 1 ) = lopt
411 END IF
412*
413 IF( info.NE.0 ) THEN
414 CALL xerbla( 'SGEGV ', -info )
415 RETURN
416 ELSE IF( lquery ) THEN
417 RETURN
418 END IF
419*
420* Quick return if possible
421*
422 IF( n.EQ.0 )
423 $ RETURN
424*
425* Get machine constants
426*
427 eps = slamch( 'E' )*slamch( 'B' )
428 safmin = slamch( 'S' )
429 safmin = safmin + safmin
430 safmax = one / safmin
431 onepls = one + ( 4*eps )
432*
433* Scale A
434*
435 anrm = slange( 'M', n, n, a, lda, work )
436 anrm1 = anrm
437 anrm2 = one
438 IF( anrm.LT.one ) THEN
439 IF( safmax*anrm.LT.one ) THEN
440 anrm1 = safmin
441 anrm2 = safmax*anrm
442 END IF
443 END IF
444*
445 IF( anrm.GT.zero ) THEN
446 CALL slascl( 'G', -1, -1, anrm, one, n, n, a, lda, iinfo )
447 IF( iinfo.NE.0 ) THEN
448 info = n + 10
449 RETURN
450 END IF
451 END IF
452*
453* Scale B
454*
455 bnrm = slange( 'M', n, n, b, ldb, work )
456 bnrm1 = bnrm
457 bnrm2 = one
458 IF( bnrm.LT.one ) THEN
459 IF( safmax*bnrm.LT.one ) THEN
460 bnrm1 = safmin
461 bnrm2 = safmax*bnrm
462 END IF
463 END IF
464*
465 IF( bnrm.GT.zero ) THEN
466 CALL slascl( 'G', -1, -1, bnrm, one, n, n, b, ldb, iinfo )
467 IF( iinfo.NE.0 ) THEN
468 info = n + 10
469 RETURN
470 END IF
471 END IF
472*
473* Permute the matrix to make it more nearly triangular
474* Workspace layout: (8*N words -- "work" requires 6*N words)
475* left_permutation, right_permutation, work...
476*
477 ileft = 1
478 iright = n + 1
479 iwork = iright + n
480 CALL sggbal( 'P', n, a, lda, b, ldb, ilo, ihi, work( ileft ),
481 $ work( iright ), work( iwork ), iinfo )
482 IF( iinfo.NE.0 ) THEN
483 info = n + 1
484 GO TO 120
485 END IF
486*
487* Reduce B to triangular form, and initialize VL and/or VR
488* Workspace layout: ("work..." must have at least N words)
489* left_permutation, right_permutation, tau, work...
490*
491 irows = ihi + 1 - ilo
492 IF( ilv ) THEN
493 icols = n + 1 - ilo
494 ELSE
495 icols = irows
496 END IF
497 itau = iwork
498 iwork = itau + irows
499 CALL sgeqrf( irows, icols, b( ilo, ilo ), ldb, work( itau ),
500 $ work( iwork ), lwork+1-iwork, iinfo )
501 IF( iinfo.GE.0 )
502 $ lwkopt = max( lwkopt, int( work( iwork ) )+iwork-1 )
503 IF( iinfo.NE.0 ) THEN
504 info = n + 2
505 GO TO 120
506 END IF
507*
508 CALL sormqr( 'L', 'T', irows, icols, irows, b( ilo, ilo ), ldb,
509 $ work( itau ), a( ilo, ilo ), lda, work( iwork ),
510 $ lwork+1-iwork, iinfo )
511 IF( iinfo.GE.0 )
512 $ lwkopt = max( lwkopt, int( work( iwork ) )+iwork-1 )
513 IF( iinfo.NE.0 ) THEN
514 info = n + 3
515 GO TO 120
516 END IF
517*
518 IF( ilvl ) THEN
519 CALL slaset( 'Full', n, n, zero, one, vl, ldvl )
520 CALL slacpy( 'L', irows-1, irows-1, b( ilo+1, ilo ), ldb,
521 $ vl( ilo+1, ilo ), ldvl )
522 CALL sorgqr( irows, irows, irows, vl( ilo, ilo ), ldvl,
523 $ work( itau ), work( iwork ), lwork+1-iwork,
524 $ iinfo )
525 IF( iinfo.GE.0 )
526 $ lwkopt = max( lwkopt, int( work( iwork ) )+iwork-1 )
527 IF( iinfo.NE.0 ) THEN
528 info = n + 4
529 GO TO 120
530 END IF
531 END IF
532*
533 IF( ilvr )
534 $ CALL slaset( 'Full', n, n, zero, one, vr, ldvr )
535*
536* Reduce to generalized Hessenberg form
537*
538 IF( ilv ) THEN
539*
540* Eigenvectors requested -- work on whole matrix.
541*
542 CALL sgghrd( jobvl, jobvr, n, ilo, ihi, a, lda, b, ldb, vl,
543 $ ldvl, vr, ldvr, iinfo )
544 ELSE
545 CALL sgghrd( 'N', 'N', irows, 1, irows, a( ilo, ilo ), lda,
546 $ b( ilo, ilo ), ldb, vl, ldvl, vr, ldvr, iinfo )
547 END IF
548 IF( iinfo.NE.0 ) THEN
549 info = n + 5
550 GO TO 120
551 END IF
552*
553* Perform QZ algorithm
554* Workspace layout: ("work..." must have at least 1 word)
555* left_permutation, right_permutation, work...
556*
557 iwork = itau
558 IF( ilv ) THEN
559 chtemp = 'S'
560 ELSE
561 chtemp = 'E'
562 END IF
563 CALL shgeqz( chtemp, jobvl, jobvr, n, ilo, ihi, a, lda, b, ldb,
564 $ alphar, alphai, beta, vl, ldvl, vr, ldvr,
565 $ work( iwork ), lwork+1-iwork, iinfo )
566 IF( iinfo.GE.0 )
567 $ lwkopt = max( lwkopt, int( work( iwork ) )+iwork-1 )
568 IF( iinfo.NE.0 ) THEN
569 IF( iinfo.GT.0 .AND. iinfo.LE.n ) THEN
570 info = iinfo
571 ELSE IF( iinfo.GT.n .AND. iinfo.LE.2*n ) THEN
572 info = iinfo - n
573 ELSE
574 info = n + 6
575 END IF
576 GO TO 120
577 END IF
578*
579 IF( ilv ) THEN
580*
581* Compute Eigenvectors (STGEVC requires 6*N words of workspace)
582*
583 IF( ilvl ) THEN
584 IF( ilvr ) THEN
585 chtemp = 'B'
586 ELSE
587 chtemp = 'L'
588 END IF
589 ELSE
590 chtemp = 'R'
591 END IF
592*
593 CALL stgevc( chtemp, 'B', ldumma, n, a, lda, b, ldb, vl, ldvl,
594 $ vr, ldvr, n, in, work( iwork ), iinfo )
595 IF( iinfo.NE.0 ) THEN
596 info = n + 7
597 GO TO 120
598 END IF
599*
600* Undo balancing on VL and VR, rescale
601*
602 IF( ilvl ) THEN
603 CALL sggbak( 'P', 'L', n, ilo, ihi, work( ileft ),
604 $ work( iright ), n, vl, ldvl, iinfo )
605 IF( iinfo.NE.0 ) THEN
606 info = n + 8
607 GO TO 120
608 END IF
609 DO 50 jc = 1, n
610 IF( alphai( jc ).LT.zero )
611 $ GO TO 50
612 temp = zero
613 IF( alphai( jc ).EQ.zero ) THEN
614 DO 10 jr = 1, n
615 temp = max( temp, abs( vl( jr, jc ) ) )
616 10 CONTINUE
617 ELSE
618 DO 20 jr = 1, n
619 temp = max( temp, abs( vl( jr, jc ) )+
620 $ abs( vl( jr, jc+1 ) ) )
621 20 CONTINUE
622 END IF
623 IF( temp.LT.safmin )
624 $ GO TO 50
625 temp = one / temp
626 IF( alphai( jc ).EQ.zero ) THEN
627 DO 30 jr = 1, n
628 vl( jr, jc ) = vl( jr, jc )*temp
629 30 CONTINUE
630 ELSE
631 DO 40 jr = 1, n
632 vl( jr, jc ) = vl( jr, jc )*temp
633 vl( jr, jc+1 ) = vl( jr, jc+1 )*temp
634 40 CONTINUE
635 END IF
636 50 CONTINUE
637 END IF
638 IF( ilvr ) THEN
639 CALL sggbak( 'P', 'R', n, ilo, ihi, work( ileft ),
640 $ work( iright ), n, vr, ldvr, iinfo )
641 IF( iinfo.NE.0 ) THEN
642 info = n + 9
643 GO TO 120
644 END IF
645 DO 100 jc = 1, n
646 IF( alphai( jc ).LT.zero )
647 $ GO TO 100
648 temp = zero
649 IF( alphai( jc ).EQ.zero ) THEN
650 DO 60 jr = 1, n
651 temp = max( temp, abs( vr( jr, jc ) ) )
652 60 CONTINUE
653 ELSE
654 DO 70 jr = 1, n
655 temp = max( temp, abs( vr( jr, jc ) )+
656 $ abs( vr( jr, jc+1 ) ) )
657 70 CONTINUE
658 END IF
659 IF( temp.LT.safmin )
660 $ GO TO 100
661 temp = one / temp
662 IF( alphai( jc ).EQ.zero ) THEN
663 DO 80 jr = 1, n
664 vr( jr, jc ) = vr( jr, jc )*temp
665 80 CONTINUE
666 ELSE
667 DO 90 jr = 1, n
668 vr( jr, jc ) = vr( jr, jc )*temp
669 vr( jr, jc+1 ) = vr( jr, jc+1 )*temp
670 90 CONTINUE
671 END IF
672 100 CONTINUE
673 END IF
674*
675* End of eigenvector calculation
676*
677 END IF
678*
679* Undo scaling in alpha, beta
680*
681* Note: this does not give the alpha and beta for the unscaled
682* problem.
683*
684* Un-scaling is limited to avoid underflow in alpha and beta
685* if they are significant.
686*
687 DO 110 jc = 1, n
688 absar = abs( alphar( jc ) )
689 absai = abs( alphai( jc ) )
690 absb = abs( beta( jc ) )
691 salfar = anrm*alphar( jc )
692 salfai = anrm*alphai( jc )
693 sbeta = bnrm*beta( jc )
694 ilimit = .false.
695 scale = one
696*
697* Check for significant underflow in ALPHAI
698*
699 IF( abs( salfai ).LT.safmin .AND. absai.GE.
700 $ max( safmin, eps*absar, eps*absb ) ) THEN
701 ilimit = .true.
702 scale = ( onepls*safmin / anrm1 ) /
703 $ max( onepls*safmin, anrm2*absai )
704*
705 ELSE IF( salfai.EQ.zero ) THEN
706*
707* If insignificant underflow in ALPHAI, then make the
708* conjugate eigenvalue real.
709*
710 IF( alphai( jc ).LT.zero .AND. jc.GT.1 ) THEN
711 alphai( jc-1 ) = zero
712 ELSE IF( alphai( jc ).GT.zero .AND. jc.LT.n ) THEN
713 alphai( jc+1 ) = zero
714 END IF
715 END IF
716*
717* Check for significant underflow in ALPHAR
718*
719 IF( abs( salfar ).LT.safmin .AND. absar.GE.
720 $ max( safmin, eps*absai, eps*absb ) ) THEN
721 ilimit = .true.
722 scale = max( scale, ( onepls*safmin / anrm1 ) /
723 $ max( onepls*safmin, anrm2*absar ) )
724 END IF
725*
726* Check for significant underflow in BETA
727*
728 IF( abs( sbeta ).LT.safmin .AND. absb.GE.
729 $ max( safmin, eps*absar, eps*absai ) ) THEN
730 ilimit = .true.
731 scale = max( scale, ( onepls*safmin / bnrm1 ) /
732 $ max( onepls*safmin, bnrm2*absb ) )
733 END IF
734*
735* Check for possible overflow when limiting scaling
736*
737 IF( ilimit ) THEN
738 temp = ( scale*safmin )*max( abs( salfar ), abs( salfai ),
739 $ abs( sbeta ) )
740 IF( temp.GT.one )
741 $ scale = scale / temp
742 IF( scale.LT.one )
743 $ ilimit = .false.
744 END IF
745*
746* Recompute un-scaled ALPHAR, ALPHAI, BETA if necessary.
747*
748 IF( ilimit ) THEN
749 salfar = ( scale*alphar( jc ) )*anrm
750 salfai = ( scale*alphai( jc ) )*anrm
751 sbeta = ( scale*beta( jc ) )*bnrm
752 END IF
753 alphar( jc ) = salfar
754 alphai( jc ) = salfai
755 beta( jc ) = sbeta
756 110 CONTINUE
757*
758 120 CONTINUE
759 work( 1 ) = lwkopt
760*
761 RETURN
762*
763* End of SGEGV
764*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine sgeqrf(m, n, a, lda, tau, work, lwork, info)
SGEQRF
Definition sgeqrf.f:144
subroutine sggbak(job, side, n, ilo, ihi, lscale, rscale, m, v, ldv, info)
SGGBAK
Definition sggbak.f:146
subroutine sggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
SGGBAL
Definition sggbal.f:175
subroutine sgghrd(compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, info)
SGGHRD
Definition sgghrd.f:206
subroutine shgeqz(job, compq, compz, n, ilo, ihi, h, ldh, t, ldt, alphar, alphai, beta, q, ldq, z, ldz, work, lwork, info)
SHGEQZ
Definition shgeqz.f:303
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
Definition slacpy.f:101
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
real function slange(norm, m, n, a, lda, work)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition slange.f:112
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:142
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:108
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine stgevc(side, howmny, select, n, s, lds, p, ldp, vl, ldvl, vr, ldvr, mm, m, work, info)
STGEVC
Definition stgevc.f:293
subroutine sorgqr(m, n, k, a, lda, tau, work, lwork, info)
SORGQR
Definition sorgqr.f:126
subroutine sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
SORMQR
Definition sormqr.f:166
Here is the call graph for this function: