301 SUBROUTINE shgeqz( JOB, COMPQ, COMPZ, N, ILO, IHI, H, LDH, T, LDT,
302 $ ALPHAR, ALPHAI, BETA, Q, LDQ, Z, LDZ, WORK,
310 CHARACTER COMPQ, COMPZ, JOB
311 INTEGER IHI, ILO, INFO, LDH, LDQ, LDT, LDZ, LWORK, N
314 REAL ALPHAI( * ), ALPHAR( * ), BETA( * ),
315 $ H( LDH, * ), Q( LDQ, * ), T( LDT, * ),
316 $ work( * ), z( ldz, * )
323 REAL HALF, ZERO, ONE, SAFETY
324 PARAMETER ( HALF = 0.5e+0, zero = 0.0e+0, one = 1.0e+0,
328 LOGICAL ILAZR2, ILAZRO, ILPIVT, ILQ, ILSCHR, ILZ,
330 INTEGER ICOMPQ, ICOMPZ, IFIRST, IFRSTM, IITER, ILAST,
331 $ ILASTM, IN, ISCHUR, ISTART, J, JC, JCH, JITER,
333 REAL A11, A12, A1I, A1R, A21, A22, A2I, A2R, AD11,
334 $ AD11L, AD12, AD12L, AD21, AD21L, AD22, AD22L,
335 $ ad32l, an, anorm, ascale, atol, b11, b1a, b1i,
336 $ b1r, b22, b2a, b2i, b2r, bn, bnorm, bscale,
337 $ btol, c, c11i, c11r, c12, c21, c22i, c22r, cl,
338 $ cq, cr, cz, eshift, s, s1, s1inv, s2, safmax,
339 $ safmin, scale, sl, sqi, sqr, sr, szi, szr, t1,
340 $ t2, t3, tau, temp, temp2, tempi, tempr, u1,
341 $ u12, u12l, u2, ulp, vs, w11, w12, w21, w22,
349 REAL SLAMCH, SLANHS, SLAPY2, SLAPY3, SROUNDUP_LWORK
350 EXTERNAL lsame, slamch, slanhs, slapy2, slapy3,
358 INTRINSIC abs, max, min, real, sqrt
364 IF( lsame( job,
'E' ) )
THEN
367 ELSE IF( lsame( job,
'S' ) )
THEN
374 IF( lsame( compq,
'N' ) )
THEN
377 ELSE IF( lsame( compq,
'V' ) )
THEN
380 ELSE IF( lsame( compq,
'I' ) )
THEN
387 IF( lsame( compz,
'N' ) )
THEN
390 ELSE IF( lsame( compz,
'V' ) )
THEN
393 ELSE IF( lsame( compz,
'I' ) )
THEN
403 work( 1 ) = max( 1, n )
404 lquery = ( lwork.EQ.-1 )
405 IF( ischur.EQ.0 )
THEN
407 ELSE IF( icompq.EQ.0 )
THEN
409 ELSE IF( icompz.EQ.0 )
THEN
411 ELSE IF( n.LT.0 )
THEN
413 ELSE IF( ilo.LT.1 )
THEN
415 ELSE IF( ihi.GT.n .OR. ihi.LT.ilo-1 )
THEN
417 ELSE IF( ldh.LT.n )
THEN
419 ELSE IF( ldt.LT.n )
THEN
421 ELSE IF( ldq.LT.1 .OR. ( ilq .AND. ldq.LT.n ) )
THEN
423 ELSE IF( ldz.LT.1 .OR. ( ilz .AND. ldz.LT.n ) )
THEN
425 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
429 CALL xerbla(
'SHGEQZ', -info )
431 ELSE IF( lquery )
THEN
438 work( 1 ) = real( 1 )
445 $
CALL slaset(
'Full', n, n, zero, one, q, ldq )
447 $
CALL slaset(
'Full', n, n, zero, one, z, ldz )
452 safmin = slamch(
'S' )
453 safmax = one / safmin
454 ulp = slamch(
'E' )*slamch(
'B' )
455 anorm = slanhs(
'F', in, h( ilo, ilo ), ldh, work )
456 bnorm = slanhs(
'F', in, t( ilo, ilo ), ldt, work )
457 atol = max( safmin, ulp*anorm )
458 btol = max( safmin, ulp*bnorm )
459 ascale = one / max( safmin, anorm )
460 bscale = one / max( safmin, bnorm )
465 IF( t( j, j ).LT.zero )
THEN
468 h( jr, j ) = -h( jr, j )
469 t( jr, j ) = -t( jr, j )
472 h( j, j ) = -h( j, j )
473 t( j, j ) = -t( j, j )
477 z( jr, j ) = -z( jr, j )
481 alphar( j ) = h( j, j )
483 beta( j ) = t( j, j )
516 maxit = 30*( ihi-ilo+1 )
518 DO 360 jiter = 1, maxit
526 IF( ilast.EQ.ilo )
THEN
532 IF( abs( h( ilast, ilast-1 ) ).LE.max( safmin, ulp*(
533 $ abs( h( ilast, ilast ) ) + abs( h( ilast-1, ilast-1 ) )
535 h( ilast, ilast-1 ) = zero
540 IF( abs( t( ilast, ilast ) ).LE.btol )
THEN
541 t( ilast, ilast ) = zero
547 DO 60 j = ilast - 1, ilo, -1
554 IF( abs( h( j, j-1 ) ).LE.max( safmin, ulp*(
555 $ abs( h( j, j ) ) + abs( h( j-1, j-1 ) )
566 IF( abs( t( j, j ) ).LT.btol )
THEN
572 IF( .NOT.ilazro )
THEN
573 temp = abs( h( j, j-1 ) )
574 temp2 = abs( h( j, j ) )
575 tempr = max( temp, temp2 )
576 IF( tempr.LT.one .AND. tempr.NE.zero )
THEN
578 temp2 = temp2 / tempr
580 IF( temp*( ascale*abs( h( j+1, j ) ) ).LE.temp2*
581 $ ( ascale*atol ) )ilazr2 = .true.
590 IF( ilazro .OR. ilazr2 )
THEN
591 DO 40 jch = j, ilast - 1
593 CALL slartg( temp, h( jch+1, jch ), c, s,
595 h( jch+1, jch ) = zero
596 CALL srot( ilastm-jch, h( jch, jch+1 ), ldh,
597 $ h( jch+1, jch+1 ), ldh, c, s )
598 CALL srot( ilastm-jch, t( jch, jch+1 ), ldt,
599 $ t( jch+1, jch+1 ), ldt, c, s )
601 $
CALL srot( n, q( 1, jch ), 1, q( 1, jch+1 ), 1,
604 $ h( jch, jch-1 ) = h( jch, jch-1 )*c
606 IF( abs( t( jch+1, jch+1 ) ).GE.btol )
THEN
607 IF( jch+1.GE.ilast )
THEN
614 t( jch+1, jch+1 ) = zero
622 DO 50 jch = j, ilast - 1
623 temp = t( jch, jch+1 )
624 CALL slartg( temp, t( jch+1, jch+1 ), c, s,
626 t( jch+1, jch+1 ) = zero
627 IF( jch.LT.ilastm-1 )
628 $
CALL srot( ilastm-jch-1, t( jch, jch+2 ), ldt,
629 $ t( jch+1, jch+2 ), ldt, c, s )
630 CALL srot( ilastm-jch+2, h( jch, jch-1 ), ldh,
631 $ h( jch+1, jch-1 ), ldh, c, s )
633 $
CALL srot( n, q( 1, jch ), 1, q( 1, jch+1 ), 1,
635 temp = h( jch+1, jch )
636 CALL slartg( temp, h( jch+1, jch-1 ), c, s,
638 h( jch+1, jch-1 ) = zero
639 CALL srot( jch+1-ifrstm, h( ifrstm, jch ), 1,
640 $ h( ifrstm, jch-1 ), 1, c, s )
641 CALL srot( jch-ifrstm, t( ifrstm, jch ), 1,
642 $ t( ifrstm, jch-1 ), 1, c, s )
644 $
CALL srot( n, z( 1, jch ), 1, z( 1, jch-1 ), 1,
649 ELSE IF( ilazro )
THEN
670 temp = h( ilast, ilast )
671 CALL slartg( temp, h( ilast, ilast-1 ), c, s,
672 $ h( ilast, ilast ) )
673 h( ilast, ilast-1 ) = zero
674 CALL srot( ilast-ifrstm, h( ifrstm, ilast ), 1,
675 $ h( ifrstm, ilast-1 ), 1, c, s )
676 CALL srot( ilast-ifrstm, t( ifrstm, ilast ), 1,
677 $ t( ifrstm, ilast-1 ), 1, c, s )
679 $
CALL srot( n, z( 1, ilast ), 1, z( 1, ilast-1 ), 1, c, s )
685 IF( t( ilast, ilast ).LT.zero )
THEN
687 DO 90 j = ifrstm, ilast
688 h( j, ilast ) = -h( j, ilast )
689 t( j, ilast ) = -t( j, ilast )
692 h( ilast, ilast ) = -h( ilast, ilast )
693 t( ilast, ilast ) = -t( ilast, ilast )
697 z( j, ilast ) = -z( j, ilast )
701 alphar( ilast ) = h( ilast, ilast )
702 alphai( ilast ) = zero
703 beta( ilast ) = t( ilast, ilast )
715 IF( .NOT.ilschr )
THEN
717 IF( ifrstm.GT.ilast )
729 IF( .NOT.ilschr )
THEN
739 IF( ( iiter / 10 )*10.EQ.iiter )
THEN
744 IF( ( real( maxit )*safmin )*abs( h( ilast, ilast-1 ) ).LT.
745 $ abs( t( ilast-1, ilast-1 ) ) )
THEN
746 eshift = h( ilast, ilast-1 ) /
747 $ t( ilast-1, ilast-1 )
749 eshift = eshift + one / ( safmin*real( maxit ) )
760 CALL slag2( h( ilast-1, ilast-1 ), ldh,
761 $ t( ilast-1, ilast-1 ), ldt, safmin*safety, s1,
764 IF ( abs( (wr/s1)*t( ilast, ilast ) - h( ilast, ilast ) )
765 $ .GT. abs( (wr2/s2)*t( ilast, ilast )
766 $ - h( ilast, ilast ) ) )
THEN
774 temp = max( s1, safmin*max( one, abs( wr ), abs( wi ) ) )
781 temp = min( ascale, one )*( half*safmax )
782 IF( s1.GT.temp )
THEN
788 temp = min( bscale, one )*( half*safmax )
789 IF( abs( wr ).GT.temp )
790 $ scale = min( scale, temp / abs( wr ) )
796 DO 120 j = ilast - 1, ifirst + 1, -1
798 temp = abs( s1*h( j, j-1 ) )
799 temp2 = abs( s1*h( j, j )-wr*t( j, j ) )
800 tempr = max( temp, temp2 )
801 IF( tempr.LT.one .AND. tempr.NE.zero )
THEN
803 temp2 = temp2 / tempr
805 IF( abs( ( ascale*h( j+1, j ) )*temp ).LE.( ascale*atol )*
816 temp = s1*h( istart, istart ) - wr*t( istart, istart )
817 temp2 = s1*h( istart+1, istart )
818 CALL slartg( temp, temp2, c, s, tempr )
822 DO 190 j = istart, ilast - 1
823 IF( j.GT.istart )
THEN
825 CALL slartg( temp, h( j+1, j-1 ), c, s, h( j, j-1 ) )
829 DO 140 jc = j, ilastm
830 temp = c*h( j, jc ) + s*h( j+1, jc )
831 h( j+1, jc ) = -s*h( j, jc ) + c*h( j+1, jc )
833 temp2 = c*t( j, jc ) + s*t( j+1, jc )
834 t( j+1, jc ) = -s*t( j, jc ) + c*t( j+1, jc )
839 temp = c*q( jr, j ) + s*q( jr, j+1 )
840 q( jr, j+1 ) = -s*q( jr, j ) + c*q( jr, j+1 )
846 CALL slartg( temp, t( j+1, j ), c, s, t( j+1, j+1 ) )
849 DO 160 jr = ifrstm, min( j+2, ilast )
850 temp = c*h( jr, j+1 ) + s*h( jr, j )
851 h( jr, j ) = -s*h( jr, j+1 ) + c*h( jr, j )
854 DO 170 jr = ifrstm, j
855 temp = c*t( jr, j+1 ) + s*t( jr, j )
856 t( jr, j ) = -s*t( jr, j+1 ) + c*t( jr, j )
861 temp = c*z( jr, j+1 ) + s*z( jr, j )
862 z( jr, j ) = -s*z( jr, j+1 ) + c*z( jr, j )
878 IF( ifirst+1.EQ.ilast )
THEN
888 CALL slasv2( t( ilast-1, ilast-1 ), t( ilast-1, ilast ),
889 $ t( ilast, ilast ), b22, b11, sr, cr, sl, cl )
891 IF( b11.LT.zero )
THEN
898 CALL srot( ilastm+1-ifirst, h( ilast-1, ilast-1 ), ldh,
899 $ h( ilast, ilast-1 ), ldh, cl, sl )
900 CALL srot( ilast+1-ifrstm, h( ifrstm, ilast-1 ), 1,
901 $ h( ifrstm, ilast ), 1, cr, sr )
903 IF( ilast.LT.ilastm )
904 $
CALL srot( ilastm-ilast, t( ilast-1, ilast+1 ), ldt,
905 $ t( ilast, ilast+1 ), ldt, cl, sl )
906 IF( ifrstm.LT.ilast-1 )
907 $
CALL srot( ifirst-ifrstm, t( ifrstm, ilast-1 ), 1,
908 $ t( ifrstm, ilast ), 1, cr, sr )
911 $
CALL srot( n, q( 1, ilast-1 ), 1, q( 1, ilast ), 1, cl,
914 $
CALL srot( n, z( 1, ilast-1 ), 1, z( 1, ilast ), 1, cr,
917 t( ilast-1, ilast-1 ) = b11
918 t( ilast-1, ilast ) = zero
919 t( ilast, ilast-1 ) = zero
920 t( ilast, ilast ) = b22
924 IF( b22.LT.zero )
THEN
925 DO 210 j = ifrstm, ilast
926 h( j, ilast ) = -h( j, ilast )
927 t( j, ilast ) = -t( j, ilast )
932 z( j, ilast ) = -z( j, ilast )
942 CALL slag2( h( ilast-1, ilast-1 ), ldh,
943 $ t( ilast-1, ilast-1 ), ldt, safmin*safety, s1,
944 $ temp, wr, temp2, wi )
955 a11 = h( ilast-1, ilast-1 )
956 a21 = h( ilast, ilast-1 )
957 a12 = h( ilast-1, ilast )
958 a22 = h( ilast, ilast )
966 c11r = s1*a11 - wr*b11
970 c22r = s1*a22 - wr*b22
973 IF( abs( c11r )+abs( c11i )+abs( c12 ).GT.abs( c21 )+
974 $ abs( c22r )+abs( c22i ) )
THEN
975 t1 = slapy3( c12, c11r, c11i )
980 cz = slapy2( c22r, c22i )
981 IF( cz.LE.safmin )
THEN
988 t1 = slapy2( cz, c21 )
990 szr = -c21*tempr / t1
1001 an = abs( a11 ) + abs( a12 ) + abs( a21 ) + abs( a22 )
1002 bn = abs( b11 ) + abs( b22 )
1003 wabs = abs( wr ) + abs( wi )
1004 IF( s1*an.GT.wabs*bn )
THEN
1009 a1r = cz*a11 + szr*a12
1011 a2r = cz*a21 + szr*a22
1013 cq = slapy2( a1r, a1i )
1014 IF( cq.LE.safmin )
THEN
1021 sqr = tempr*a2r + tempi*a2i
1022 sqi = tempi*a2r - tempr*a2i
1025 t1 = slapy3( cq, sqr, sqi )
1032 tempr = sqr*szr - sqi*szi
1033 tempi = sqr*szi + sqi*szr
1034 b1r = cq*cz*b11 + tempr*b22
1036 b1a = slapy2( b1r, b1i )
1037 b2r = cq*cz*b22 + tempr*b11
1039 b2a = slapy2( b2r, b2i )
1043 beta( ilast-1 ) = b1a
1045 alphar( ilast-1 ) = ( wr*b1a )*s1inv
1046 alphai( ilast-1 ) = ( wi*b1a )*s1inv
1047 alphar( ilast ) = ( wr*b2a )*s1inv
1048 alphai( ilast ) = -( wi*b2a )*s1inv
1060 IF( .NOT.ilschr )
THEN
1062 IF( ifrstm.GT.ilast )
1080 ad11 = ( ascale*h( ilast-1, ilast-1 ) ) /
1081 $ ( bscale*t( ilast-1, ilast-1 ) )
1082 ad21 = ( ascale*h( ilast, ilast-1 ) ) /
1083 $ ( bscale*t( ilast-1, ilast-1 ) )
1084 ad12 = ( ascale*h( ilast-1, ilast ) ) /
1085 $ ( bscale*t( ilast, ilast ) )
1086 ad22 = ( ascale*h( ilast, ilast ) ) /
1087 $ ( bscale*t( ilast, ilast ) )
1088 u12 = t( ilast-1, ilast ) / t( ilast, ilast )
1089 ad11l = ( ascale*h( ifirst, ifirst ) ) /
1090 $ ( bscale*t( ifirst, ifirst ) )
1091 ad21l = ( ascale*h( ifirst+1, ifirst ) ) /
1092 $ ( bscale*t( ifirst, ifirst ) )
1093 ad12l = ( ascale*h( ifirst, ifirst+1 ) ) /
1094 $ ( bscale*t( ifirst+1, ifirst+1 ) )
1095 ad22l = ( ascale*h( ifirst+1, ifirst+1 ) ) /
1096 $ ( bscale*t( ifirst+1, ifirst+1 ) )
1097 ad32l = ( ascale*h( ifirst+2, ifirst+1 ) ) /
1098 $ ( bscale*t( ifirst+1, ifirst+1 ) )
1099 u12l = t( ifirst, ifirst+1 ) / t( ifirst+1, ifirst+1 )
1101 v( 1 ) = ( ad11-ad11l )*( ad22-ad11l ) - ad12*ad21 +
1102 $ ad21*u12*ad11l + ( ad12l-ad11l*u12l )*ad21l
1103 v( 2 ) = ( ( ad22l-ad11l )-ad21l*u12l-( ad11-ad11l )-
1104 $ ( ad22-ad11l )+ad21*u12 )*ad21l
1105 v( 3 ) = ad32l*ad21l
1109 CALL slarfg( 3, v( 1 ), v( 2 ), 1, tau )
1114 DO 290 j = istart, ilast - 2
1120 IF( j.GT.istart )
THEN
1121 v( 1 ) = h( j, j-1 )
1122 v( 2 ) = h( j+1, j-1 )
1123 v( 3 ) = h( j+2, j-1 )
1125 CALL slarfg( 3, h( j, j-1 ), v( 2 ), 1, tau )
1127 h( j+1, j-1 ) = zero
1128 h( j+2, j-1 ) = zero
1133 DO 230 jc = j, ilastm
1134 temp = h( j, jc )+v( 2 )*h( j+1, jc )+v( 3 )*
1136 h( j, jc ) = h( j, jc ) - temp*tau
1137 h( j+1, jc ) = h( j+1, jc ) - temp*t2
1138 h( j+2, jc ) = h( j+2, jc ) - temp*t3
1139 temp2 = t( j, jc )+v( 2 )*t( j+1, jc )+v( 3 )*
1141 t( j, jc ) = t( j, jc ) - temp2*tau
1142 t( j+1, jc ) = t( j+1, jc ) - temp2*t2
1143 t( j+2, jc ) = t( j+2, jc ) - temp2*t3
1147 temp = q( jr, j )+v( 2 )*q( jr, j+1 )+v( 3 )*
1149 q( jr, j ) = q( jr, j ) - temp*tau
1150 q( jr, j+1 ) = q( jr, j+1 ) - temp*t2
1151 q( jr, j+2 ) = q( jr, j+2 ) - temp*t3
1160 temp = max( abs( t( j+1, j+1 ) ), abs( t( j+1, j+2 ) ) )
1161 temp2 = max( abs( t( j+2, j+1 ) ), abs( t( j+2, j+2 ) ) )
1162 IF( max( temp, temp2 ).LT.safmin )
THEN
1167 ELSE IF( temp.GE.temp2 )
THEN
1185 IF( abs( w12 ).GT.abs( w11 ) )
THEN
1199 w22 = w22 - temp*w12
1205 IF( abs( w22 ).LT.safmin )
THEN
1211 IF( abs( w22 ).LT.abs( u2 ) )
1212 $ scale = abs( w22 / u2 )
1213 IF( abs( w11 ).LT.abs( u1 ) )
1214 $ scale = min( scale, abs( w11 / u1 ) )
1218 u2 = ( scale*u2 ) / w22
1219 u1 = ( scale*u1-w12*u2 ) / w11
1230 t1 = sqrt( scale**2+u1**2+u2**2 )
1231 tau = one + scale / t1
1232 vs = -one / ( scale+t1 )
1241 DO 260 jr = ifrstm, min( j+3, ilast )
1242 temp = h( jr, j )+v( 2 )*h( jr, j+1 )+v( 3 )*
1244 h( jr, j ) = h( jr, j ) - temp*tau
1245 h( jr, j+1 ) = h( jr, j+1 ) - temp*t2
1246 h( jr, j+2 ) = h( jr, j+2 ) - temp*t3
1248 DO 270 jr = ifrstm, j + 2
1249 temp = t( jr, j )+v( 2 )*t( jr, j+1 )+v( 3 )*
1251 t( jr, j ) = t( jr, j ) - temp*tau
1252 t( jr, j+1 ) = t( jr, j+1 ) - temp*t2
1253 t( jr, j+2 ) = t( jr, j+2 ) - temp*t3
1257 temp = z( jr, j )+v( 2 )*z( jr, j+1 )+v( 3 )*
1259 z( jr, j ) = z( jr, j ) - temp*tau
1260 z( jr, j+1 ) = z( jr, j+1 ) - temp*t2
1261 z( jr, j+2 ) = z( jr, j+2 ) - temp*t3
1274 CALL slartg( temp, h( j+1, j-1 ), c, s, h( j, j-1 ) )
1275 h( j+1, j-1 ) = zero
1277 DO 300 jc = j, ilastm
1278 temp = c*h( j, jc ) + s*h( j+1, jc )
1279 h( j+1, jc ) = -s*h( j, jc ) + c*h( j+1, jc )
1281 temp2 = c*t( j, jc ) + s*t( j+1, jc )
1282 t( j+1, jc ) = -s*t( j, jc ) + c*t( j+1, jc )
1287 temp = c*q( jr, j ) + s*q( jr, j+1 )
1288 q( jr, j+1 ) = -s*q( jr, j ) + c*q( jr, j+1 )
1295 temp = t( j+1, j+1 )
1296 CALL slartg( temp, t( j+1, j ), c, s, t( j+1, j+1 ) )
1299 DO 320 jr = ifrstm, ilast
1300 temp = c*h( jr, j+1 ) + s*h( jr, j )
1301 h( jr, j ) = -s*h( jr, j+1 ) + c*h( jr, j )
1304 DO 330 jr = ifrstm, ilast - 1
1305 temp = c*t( jr, j+1 ) + s*t( jr, j )
1306 t( jr, j ) = -s*t( jr, j+1 ) + c*t( jr, j )
1311 temp = c*z( jr, j+1 ) + s*z( jr, j )
1312 z( jr, j ) = -s*z( jr, j+1 ) + c*z( jr, j )
1339 DO 410 j = 1, ilo - 1
1340 IF( t( j, j ).LT.zero )
THEN
1343 h( jr, j ) = -h( jr, j )
1344 t( jr, j ) = -t( jr, j )
1347 h( j, j ) = -h( j, j )
1348 t( j, j ) = -t( j, j )
1352 z( jr, j ) = -z( jr, j )
1356 alphar( j ) = h( j, j )
1358 beta( j ) = t( j, j )
1368 work( 1 ) = sroundup_lwork( n )
subroutine xerbla(srname, info)
subroutine shgeqz(job, compq, compz, n, ilo, ihi, h, ldh, t, ldt, alphar, alphai, beta, q, ldq, z, ldz, work, lwork, info)
SHGEQZ
subroutine slag2(a, lda, b, ldb, safmin, scale1, scale2, wr1, wr2, wi)
SLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary ...
subroutine slarfg(n, alpha, x, incx, tau)
SLARFG generates an elementary reflector (Householder matrix).
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine slasv2(f, g, h, ssmin, ssmax, snr, csr, snl, csl)
SLASV2 computes the singular value decomposition of a 2-by-2 triangular matrix.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT