LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
ztgsja.f
Go to the documentation of this file.
1*> \brief \b ZTGSJA
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZTGSJA + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ztgsja.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ztgsja.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztgsja.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZTGSJA( JOBU, JOBV, JOBQ, M, P, N, K, L, A, LDA, B,
20* LDB, TOLA, TOLB, ALPHA, BETA, U, LDU, V, LDV,
21* Q, LDQ, WORK, NCYCLE, INFO )
22*
23* .. Scalar Arguments ..
24* CHARACTER JOBQ, JOBU, JOBV
25* INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N,
26* $ NCYCLE, P
27* DOUBLE PRECISION TOLA, TOLB
28* ..
29* .. Array Arguments ..
30* DOUBLE PRECISION ALPHA( * ), BETA( * )
31* COMPLEX*16 A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
32* $ U( LDU, * ), V( LDV, * ), WORK( * )
33* ..
34*
35*
36*> \par Purpose:
37* =============
38*>
39*> \verbatim
40*>
41*> ZTGSJA computes the generalized singular value decomposition (GSVD)
42*> of two complex upper triangular (or trapezoidal) matrices A and B.
43*>
44*> On entry, it is assumed that matrices A and B have the following
45*> forms, which may be obtained by the preprocessing subroutine ZGGSVP
46*> from a general M-by-N matrix A and P-by-N matrix B:
47*>
48*> N-K-L K L
49*> A = K ( 0 A12 A13 ) if M-K-L >= 0;
50*> L ( 0 0 A23 )
51*> M-K-L ( 0 0 0 )
52*>
53*> N-K-L K L
54*> A = K ( 0 A12 A13 ) if M-K-L < 0;
55*> M-K ( 0 0 A23 )
56*>
57*> N-K-L K L
58*> B = L ( 0 0 B13 )
59*> P-L ( 0 0 0 )
60*>
61*> where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular
62*> upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0,
63*> otherwise A23 is (M-K)-by-L upper trapezoidal.
64*>
65*> On exit,
66*>
67*> U**H *A*Q = D1*( 0 R ), V**H *B*Q = D2*( 0 R ),
68*>
69*> where U, V and Q are unitary matrices.
70*> R is a nonsingular upper triangular matrix, and D1
71*> and D2 are ``diagonal'' matrices, which are of the following
72*> structures:
73*>
74*> If M-K-L >= 0,
75*>
76*> K L
77*> D1 = K ( I 0 )
78*> L ( 0 C )
79*> M-K-L ( 0 0 )
80*>
81*> K L
82*> D2 = L ( 0 S )
83*> P-L ( 0 0 )
84*>
85*> N-K-L K L
86*> ( 0 R ) = K ( 0 R11 R12 ) K
87*> L ( 0 0 R22 ) L
88*>
89*> where
90*>
91*> C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
92*> S = diag( BETA(K+1), ... , BETA(K+L) ),
93*> C**2 + S**2 = I.
94*>
95*> R is stored in A(1:K+L,N-K-L+1:N) on exit.
96*>
97*> If M-K-L < 0,
98*>
99*> K M-K K+L-M
100*> D1 = K ( I 0 0 )
101*> M-K ( 0 C 0 )
102*>
103*> K M-K K+L-M
104*> D2 = M-K ( 0 S 0 )
105*> K+L-M ( 0 0 I )
106*> P-L ( 0 0 0 )
107*>
108*> N-K-L K M-K K+L-M
109*> ( 0 R ) = K ( 0 R11 R12 R13 )
110*> M-K ( 0 0 R22 R23 )
111*> K+L-M ( 0 0 0 R33 )
112*>
113*> where
114*> C = diag( ALPHA(K+1), ... , ALPHA(M) ),
115*> S = diag( BETA(K+1), ... , BETA(M) ),
116*> C**2 + S**2 = I.
117*>
118*> R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored
119*> ( 0 R22 R23 )
120*> in B(M-K+1:L,N+M-K-L+1:N) on exit.
121*>
122*> The computation of the unitary transformation matrices U, V or Q
123*> is optional. These matrices may either be formed explicitly, or they
124*> may be postmultiplied into input matrices U1, V1, or Q1.
125*> \endverbatim
126*
127* Arguments:
128* ==========
129*
130*> \param[in] JOBU
131*> \verbatim
132*> JOBU is CHARACTER*1
133*> = 'U': U must contain a unitary matrix U1 on entry, and
134*> the product U1*U is returned;
135*> = 'I': U is initialized to the unit matrix, and the
136*> unitary matrix U is returned;
137*> = 'N': U is not computed.
138*> \endverbatim
139*>
140*> \param[in] JOBV
141*> \verbatim
142*> JOBV is CHARACTER*1
143*> = 'V': V must contain a unitary matrix V1 on entry, and
144*> the product V1*V is returned;
145*> = 'I': V is initialized to the unit matrix, and the
146*> unitary matrix V is returned;
147*> = 'N': V is not computed.
148*> \endverbatim
149*>
150*> \param[in] JOBQ
151*> \verbatim
152*> JOBQ is CHARACTER*1
153*> = 'Q': Q must contain a unitary matrix Q1 on entry, and
154*> the product Q1*Q is returned;
155*> = 'I': Q is initialized to the unit matrix, and the
156*> unitary matrix Q is returned;
157*> = 'N': Q is not computed.
158*> \endverbatim
159*>
160*> \param[in] M
161*> \verbatim
162*> M is INTEGER
163*> The number of rows of the matrix A. M >= 0.
164*> \endverbatim
165*>
166*> \param[in] P
167*> \verbatim
168*> P is INTEGER
169*> The number of rows of the matrix B. P >= 0.
170*> \endverbatim
171*>
172*> \param[in] N
173*> \verbatim
174*> N is INTEGER
175*> The number of columns of the matrices A and B. N >= 0.
176*> \endverbatim
177*>
178*> \param[in] K
179*> \verbatim
180*> K is INTEGER
181*> \endverbatim
182*>
183*> \param[in] L
184*> \verbatim
185*> L is INTEGER
186*>
187*> K and L specify the subblocks in the input matrices A and B:
188*> A23 = A(K+1:MIN(K+L,M),N-L+1:N) and B13 = B(1:L,,N-L+1:N)
189*> of A and B, whose GSVD is going to be computed by ZTGSJA.
190*> See Further Details.
191*> \endverbatim
192*>
193*> \param[in,out] A
194*> \verbatim
195*> A is COMPLEX*16 array, dimension (LDA,N)
196*> On entry, the M-by-N matrix A.
197*> On exit, A(N-K+1:N,1:MIN(K+L,M) ) contains the triangular
198*> matrix R or part of R. See Purpose for details.
199*> \endverbatim
200*>
201*> \param[in] LDA
202*> \verbatim
203*> LDA is INTEGER
204*> The leading dimension of the array A. LDA >= max(1,M).
205*> \endverbatim
206*>
207*> \param[in,out] B
208*> \verbatim
209*> B is COMPLEX*16 array, dimension (LDB,N)
210*> On entry, the P-by-N matrix B.
211*> On exit, if necessary, B(M-K+1:L,N+M-K-L+1:N) contains
212*> a part of R. See Purpose for details.
213*> \endverbatim
214*>
215*> \param[in] LDB
216*> \verbatim
217*> LDB is INTEGER
218*> The leading dimension of the array B. LDB >= max(1,P).
219*> \endverbatim
220*>
221*> \param[in] TOLA
222*> \verbatim
223*> TOLA is DOUBLE PRECISION
224*> \endverbatim
225*>
226*> \param[in] TOLB
227*> \verbatim
228*> TOLB is DOUBLE PRECISION
229*>
230*> TOLA and TOLB are the convergence criteria for the Jacobi-
231*> Kogbetliantz iteration procedure. Generally, they are the
232*> same as used in the preprocessing step, say
233*> TOLA = MAX(M,N)*norm(A)*MAZHEPS,
234*> TOLB = MAX(P,N)*norm(B)*MAZHEPS.
235*> \endverbatim
236*>
237*> \param[out] ALPHA
238*> \verbatim
239*> ALPHA is DOUBLE PRECISION array, dimension (N)
240*> \endverbatim
241*>
242*> \param[out] BETA
243*> \verbatim
244*> BETA is DOUBLE PRECISION array, dimension (N)
245*>
246*> On exit, ALPHA and BETA contain the generalized singular
247*> value pairs of A and B;
248*> ALPHA(1:K) = 1,
249*> BETA(1:K) = 0,
250*> and if M-K-L >= 0,
251*> ALPHA(K+1:K+L) = diag(C),
252*> BETA(K+1:K+L) = diag(S),
253*> or if M-K-L < 0,
254*> ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0
255*> BETA(K+1:M) = S, BETA(M+1:K+L) = 1.
256*> Furthermore, if K+L < N,
257*> ALPHA(K+L+1:N) = 0 and
258*> BETA(K+L+1:N) = 0.
259*> \endverbatim
260*>
261*> \param[in,out] U
262*> \verbatim
263*> U is COMPLEX*16 array, dimension (LDU,M)
264*> On entry, if JOBU = 'U', U must contain a matrix U1 (usually
265*> the unitary matrix returned by ZGGSVP).
266*> On exit,
267*> if JOBU = 'I', U contains the unitary matrix U;
268*> if JOBU = 'U', U contains the product U1*U.
269*> If JOBU = 'N', U is not referenced.
270*> \endverbatim
271*>
272*> \param[in] LDU
273*> \verbatim
274*> LDU is INTEGER
275*> The leading dimension of the array U. LDU >= max(1,M) if
276*> JOBU = 'U'; LDU >= 1 otherwise.
277*> \endverbatim
278*>
279*> \param[in,out] V
280*> \verbatim
281*> V is COMPLEX*16 array, dimension (LDV,P)
282*> On entry, if JOBV = 'V', V must contain a matrix V1 (usually
283*> the unitary matrix returned by ZGGSVP).
284*> On exit,
285*> if JOBV = 'I', V contains the unitary matrix V;
286*> if JOBV = 'V', V contains the product V1*V.
287*> If JOBV = 'N', V is not referenced.
288*> \endverbatim
289*>
290*> \param[in] LDV
291*> \verbatim
292*> LDV is INTEGER
293*> The leading dimension of the array V. LDV >= max(1,P) if
294*> JOBV = 'V'; LDV >= 1 otherwise.
295*> \endverbatim
296*>
297*> \param[in,out] Q
298*> \verbatim
299*> Q is COMPLEX*16 array, dimension (LDQ,N)
300*> On entry, if JOBQ = 'Q', Q must contain a matrix Q1 (usually
301*> the unitary matrix returned by ZGGSVP).
302*> On exit,
303*> if JOBQ = 'I', Q contains the unitary matrix Q;
304*> if JOBQ = 'Q', Q contains the product Q1*Q.
305*> If JOBQ = 'N', Q is not referenced.
306*> \endverbatim
307*>
308*> \param[in] LDQ
309*> \verbatim
310*> LDQ is INTEGER
311*> The leading dimension of the array Q. LDQ >= max(1,N) if
312*> JOBQ = 'Q'; LDQ >= 1 otherwise.
313*> \endverbatim
314*>
315*> \param[out] WORK
316*> \verbatim
317*> WORK is COMPLEX*16 array, dimension (2*N)
318*> \endverbatim
319*>
320*> \param[out] NCYCLE
321*> \verbatim
322*> NCYCLE is INTEGER
323*> The number of cycles required for convergence.
324*> \endverbatim
325*>
326*> \param[out] INFO
327*> \verbatim
328*> INFO is INTEGER
329*> = 0: successful exit
330*> < 0: if INFO = -i, the i-th argument had an illegal value.
331*> = 1: the procedure does not converge after MAXIT cycles.
332*> \endverbatim
333*
334*> \par Internal Parameters:
335* =========================
336*>
337*> \verbatim
338*> MAXIT INTEGER
339*> MAXIT specifies the total loops that the iterative procedure
340*> may take. If after MAXIT cycles, the routine fails to
341*> converge, we return INFO = 1.
342*> \endverbatim
343*
344* Authors:
345* ========
346*
347*> \author Univ. of Tennessee
348*> \author Univ. of California Berkeley
349*> \author Univ. of Colorado Denver
350*> \author NAG Ltd.
351*
352*> \ingroup tgsja
353*
354*> \par Further Details:
355* =====================
356*>
357*> \verbatim
358*>
359*> ZTGSJA essentially uses a variant of Kogbetliantz algorithm to reduce
360*> min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L
361*> matrix B13 to the form:
362*>
363*> U1**H *A13*Q1 = C1*R1; V1**H *B13*Q1 = S1*R1,
364*>
365*> where U1, V1 and Q1 are unitary matrix.
366*> C1 and S1 are diagonal matrices satisfying
367*>
368*> C1**2 + S1**2 = I,
369*>
370*> and R1 is an L-by-L nonsingular upper triangular matrix.
371*> \endverbatim
372*>
373* =====================================================================
374 SUBROUTINE ztgsja( JOBU, JOBV, JOBQ, M, P, N, K, L, A, LDA, B,
375 $ LDB, TOLA, TOLB, ALPHA, BETA, U, LDU, V, LDV,
376 $ Q, LDQ, WORK, NCYCLE, INFO )
377*
378* -- LAPACK computational routine --
379* -- LAPACK is a software package provided by Univ. of Tennessee, --
380* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
381*
382* .. Scalar Arguments ..
383 CHARACTER JOBQ, JOBU, JOBV
384 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N,
385 $ ncycle, p
386 DOUBLE PRECISION TOLA, TOLB
387* ..
388* .. Array Arguments ..
389 DOUBLE PRECISION ALPHA( * ), BETA( * )
390 COMPLEX*16 A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
391 $ u( ldu, * ), v( ldv, * ), work( * )
392* ..
393*
394* =====================================================================
395*
396* .. Parameters ..
397 INTEGER MAXIT
398 PARAMETER ( MAXIT = 40 )
399 DOUBLE PRECISION ZERO, ONE, HUGENUM
400 parameter( zero = 0.0d+0, one = 1.0d+0 )
401 COMPLEX*16 CZERO, CONE
402 parameter( czero = ( 0.0d+0, 0.0d+0 ),
403 $ cone = ( 1.0d+0, 0.0d+0 ) )
404* ..
405* .. Local Scalars ..
406*
407 LOGICAL INITQ, INITU, INITV, UPPER, WANTQ, WANTU, WANTV
408 INTEGER I, J, KCYCLE
409 DOUBLE PRECISION A1, A3, B1, B3, CSQ, CSU, CSV, ERROR, GAMMA,
410 $ rwk, ssmin
411 COMPLEX*16 A2, B2, SNQ, SNU, SNV
412* ..
413* .. External Functions ..
414 LOGICAL LSAME
415 EXTERNAL LSAME
416* ..
417* .. External Subroutines ..
418 EXTERNAL dlartg, xerbla, zcopy, zdscal, zlags2,
419 $ zlapll,
420 $ zlaset, zrot
421* ..
422* .. Intrinsic Functions ..
423 INTRINSIC abs, dble, dconjg, max, min, huge
424 parameter( hugenum = huge(zero) )
425* ..
426* .. Executable Statements ..
427*
428* Decode and test the input parameters
429*
430 initu = lsame( jobu, 'I' )
431 wantu = initu .OR. lsame( jobu, 'U' )
432*
433 initv = lsame( jobv, 'I' )
434 wantv = initv .OR. lsame( jobv, 'V' )
435*
436 initq = lsame( jobq, 'I' )
437 wantq = initq .OR. lsame( jobq, 'Q' )
438*
439 info = 0
440 IF( .NOT.( initu .OR. wantu .OR. lsame( jobu, 'N' ) ) ) THEN
441 info = -1
442 ELSE IF( .NOT.( initv .OR.
443 $ wantv .OR.
444 $ lsame( jobv, 'N' ) ) ) THEN
445 info = -2
446 ELSE IF( .NOT.( initq .OR.
447 $ wantq .OR.
448 $ lsame( jobq, 'N' ) ) ) THEN
449 info = -3
450 ELSE IF( m.LT.0 ) THEN
451 info = -4
452 ELSE IF( p.LT.0 ) THEN
453 info = -5
454 ELSE IF( n.LT.0 ) THEN
455 info = -6
456 ELSE IF( lda.LT.max( 1, m ) ) THEN
457 info = -10
458 ELSE IF( ldb.LT.max( 1, p ) ) THEN
459 info = -12
460 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) ) THEN
461 info = -18
462 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) ) THEN
463 info = -20
464 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) ) THEN
465 info = -22
466 END IF
467 IF( info.NE.0 ) THEN
468 CALL xerbla( 'ZTGSJA', -info )
469 RETURN
470 END IF
471*
472* Initialize U, V and Q, if necessary
473*
474 IF( initu )
475 $ CALL zlaset( 'Full', m, m, czero, cone, u, ldu )
476 IF( initv )
477 $ CALL zlaset( 'Full', p, p, czero, cone, v, ldv )
478 IF( initq )
479 $ CALL zlaset( 'Full', n, n, czero, cone, q, ldq )
480*
481* Loop until convergence
482*
483 upper = .false.
484 DO 40 kcycle = 1, maxit
485*
486 upper = .NOT.upper
487*
488 DO 20 i = 1, l - 1
489 DO 10 j = i + 1, l
490*
491 a1 = zero
492 a2 = czero
493 a3 = zero
494 IF( k+i.LE.m )
495 $ a1 = dble( a( k+i, n-l+i ) )
496 IF( k+j.LE.m )
497 $ a3 = dble( a( k+j, n-l+j ) )
498*
499 b1 = dble( b( i, n-l+i ) )
500 b3 = dble( b( j, n-l+j ) )
501*
502 IF( upper ) THEN
503 IF( k+i.LE.m )
504 $ a2 = a( k+i, n-l+j )
505 b2 = b( i, n-l+j )
506 ELSE
507 IF( k+j.LE.m )
508 $ a2 = a( k+j, n-l+i )
509 b2 = b( j, n-l+i )
510 END IF
511*
512 CALL zlags2( upper, a1, a2, a3, b1, b2, b3, csu, snu,
513 $ csv, snv, csq, snq )
514*
515* Update (K+I)-th and (K+J)-th rows of matrix A: U**H *A
516*
517 IF( k+j.LE.m )
518 $ CALL zrot( l, a( k+j, n-l+1 ), lda, a( k+i,
519 $ n-l+1 ),
520 $ lda, csu, dconjg( snu ) )
521*
522* Update I-th and J-th rows of matrix B: V**H *B
523*
524 CALL zrot( l, b( j, n-l+1 ), ldb, b( i, n-l+1 ), ldb,
525 $ csv, dconjg( snv ) )
526*
527* Update (N-L+I)-th and (N-L+J)-th columns of matrices
528* A and B: A*Q and B*Q
529*
530 CALL zrot( min( k+l, m ), a( 1, n-l+j ), 1,
531 $ a( 1, n-l+i ), 1, csq, snq )
532*
533 CALL zrot( l, b( 1, n-l+j ), 1, b( 1, n-l+i ), 1, csq,
534 $ snq )
535*
536 IF( upper ) THEN
537 IF( k+i.LE.m )
538 $ a( k+i, n-l+j ) = czero
539 b( i, n-l+j ) = czero
540 ELSE
541 IF( k+j.LE.m )
542 $ a( k+j, n-l+i ) = czero
543 b( j, n-l+i ) = czero
544 END IF
545*
546* Ensure that the diagonal elements of A and B are real.
547*
548 IF( k+i.LE.m )
549 $ a( k+i, n-l+i ) = dble( a( k+i, n-l+i ) )
550 IF( k+j.LE.m )
551 $ a( k+j, n-l+j ) = dble( a( k+j, n-l+j ) )
552 b( i, n-l+i ) = dble( b( i, n-l+i ) )
553 b( j, n-l+j ) = dble( b( j, n-l+j ) )
554*
555* Update unitary matrices U, V, Q, if desired.
556*
557 IF( wantu .AND. k+j.LE.m )
558 $ CALL zrot( m, u( 1, k+j ), 1, u( 1, k+i ), 1, csu,
559 $ snu )
560*
561 IF( wantv )
562 $ CALL zrot( p, v( 1, j ), 1, v( 1, i ), 1, csv,
563 $ snv )
564*
565 IF( wantq )
566 $ CALL zrot( n, q( 1, n-l+j ), 1, q( 1, n-l+i ), 1,
567 $ csq,
568 $ snq )
569*
570 10 CONTINUE
571 20 CONTINUE
572*
573 IF( .NOT.upper ) THEN
574*
575* The matrices A13 and B13 were lower triangular at the start
576* of the cycle, and are now upper triangular.
577*
578* Convergence test: test the parallelism of the corresponding
579* rows of A and B.
580*
581 error = zero
582 DO 30 i = 1, min( l, m-k )
583 CALL zcopy( l-i+1, a( k+i, n-l+i ), lda, work, 1 )
584 CALL zcopy( l-i+1, b( i, n-l+i ), ldb, work( l+1 ),
585 $ 1 )
586 CALL zlapll( l-i+1, work, 1, work( l+1 ), 1, ssmin )
587 error = max( error, ssmin )
588 30 CONTINUE
589*
590 IF( abs( error ).LE.min( tola, tolb ) )
591 $ GO TO 50
592 END IF
593*
594* End of cycle loop
595*
596 40 CONTINUE
597*
598* The algorithm has not converged after MAXIT cycles.
599*
600 info = 1
601 GO TO 100
602*
603 50 CONTINUE
604*
605* If ERROR <= MIN(TOLA,TOLB), then the algorithm has converged.
606* Compute the generalized singular value pairs (ALPHA, BETA), and
607* set the triangular matrix R to array A.
608*
609 DO 60 i = 1, k
610 alpha( i ) = one
611 beta( i ) = zero
612 60 CONTINUE
613*
614 DO 70 i = 1, min( l, m-k )
615*
616 a1 = dble( a( k+i, n-l+i ) )
617 b1 = dble( b( i, n-l+i ) )
618 gamma = b1 / a1
619*
620 IF( (gamma.LE.hugenum).AND.(gamma.GE.-hugenum) ) THEN
621*
622 IF( gamma.LT.zero ) THEN
623 CALL zdscal( l-i+1, -one, b( i, n-l+i ), ldb )
624 IF( wantv )
625 $ CALL zdscal( p, -one, v( 1, i ), 1 )
626 END IF
627*
628 CALL dlartg( abs( gamma ), one, beta( k+i ),
629 $ alpha( k+i ),
630 $ rwk )
631*
632 IF( alpha( k+i ).GE.beta( k+i ) ) THEN
633 CALL zdscal( l-i+1, one / alpha( k+i ), a( k+i,
634 $ n-l+i ),
635 $ lda )
636 ELSE
637 CALL zdscal( l-i+1, one / beta( k+i ), b( i, n-l+i ),
638 $ ldb )
639 CALL zcopy( l-i+1, b( i, n-l+i ), ldb, a( k+i,
640 $ n-l+i ),
641 $ lda )
642 END IF
643*
644 ELSE
645*
646 alpha( k+i ) = zero
647 beta( k+i ) = one
648 CALL zcopy( l-i+1, b( i, n-l+i ), ldb, a( k+i, n-l+i ),
649 $ lda )
650 END IF
651 70 CONTINUE
652*
653* Post-assignment
654*
655 DO 80 i = m + 1, k + l
656 alpha( i ) = zero
657 beta( i ) = one
658 80 CONTINUE
659*
660 IF( k+l.LT.n ) THEN
661 DO 90 i = k + l + 1, n
662 alpha( i ) = zero
663 beta( i ) = zero
664 90 CONTINUE
665 END IF
666*
667 100 CONTINUE
668 ncycle = kcycle
669*
670 RETURN
671*
672* End of ZTGSJA
673*
674 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
Definition zcopy.f:81
subroutine zlags2(upper, a1, a2, a3, b1, b2, b3, csu, snu, csv, snv, csq, snq)
ZLAGS2
Definition zlags2.f:157
subroutine zlapll(n, x, incx, y, incy, ssmin)
ZLAPLL measures the linear dependence of two vectors.
Definition zlapll.f:98
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
Definition dlartg.f90:111
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Definition zlaset.f:104
subroutine zrot(n, cx, incx, cy, incy, c, s)
ZROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors.
Definition zrot.f:101
subroutine zdscal(n, da, zx, incx)
ZDSCAL
Definition zdscal.f:78
subroutine ztgsja(jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb, tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
ZTGSJA
Definition ztgsja.f:377