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