Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/single/stgsja.c

raw symbols SCIP
1 /* lapack/single/stgsja.f -- translated by f2c (version 20050501).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11 */
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/
17
18 /* Table of constant values */
19
20 static realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! c_b13cxx . . $ c_b13. = (float)0.;
21 static realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! c_b14cxx . . $ c_b14. = (float)1.;
22 static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1;
23 static realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! c_b43cxx . . $ c_b43. = (float)-1.;
24
25 /*< >*/
26 /* Subroutine */ int stgsja_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:289:9`!(const char *jobu, const char *jobv, const char *jobq, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *m,
27 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *p, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *k, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *l, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *a, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lda,
28 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *b, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldb, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *tola, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *tolb, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *alpha, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *
29 beta, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *u, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldu, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *v, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldv, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *q, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *
30 ldq, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *work, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ncycle, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! jobu_len,
31 ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! jobv_len, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! jobq_len)
32 {
33 /* System generated locals */
34 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! a_dim1, a_offset, b_dim1, b_offset, q_dim1, q_offset, u_dim1,
35 u_offset, v_dim1, v_offset, i__1, i__2, i__3, i__4;
36 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! r__1;
37
38 /* Local variables */
39 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, j;
40 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! a1, a2, a3, b1, b2, b3, csq, csu, csv, snq, rwk, snu, snv;
41 extern /* Subroutine */ int srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *,
42 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *);
43 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! gamma;
44 extern logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(const char *, const char *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
45 extern /* Subroutine */ int sscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:278:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *);
46 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! initq, initu, initv, wantq, upper;
47 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! error, ssmin;
48 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! wantu, wantv;
49 extern /* Subroutine */ int scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *,
50 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *), slags2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:247:9`!(logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *,
51 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *);
52 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! kcycle;
53 extern /* Subroutine */ int xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!), slapll_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:255:9`!(
54 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *), slartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:260:9`!(
55 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *), slaset_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:262:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *
56 , integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
57 (void)jobu_len;
58 (void)jobv_len;
59 (void)jobq_len;
60
61 /* -- LAPACK routine (version 3.0) -- */
62 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
63 /* Courant Institute, Argonne National Lab, and Rice University */
64 /* June 30, 1999 */
65
66 /* .. Scalar Arguments .. */
67 /*< CHARACTER JOBQ, JOBU, JOBV >*/
68 /*< >*/
69 /*< REAL TOLA, TOLB >*/
70 /* .. */
71 /* .. Array Arguments .. */
72 /*< >*/
73 /* .. */
74
75 /* Purpose */
76 /* ======= */
77
78 /* STGSJA computes the generalized singular value decomposition (GSVD) */
79 /* of two real upper triangular (or trapezoidal) matrices A and B. */
80
81 /* On entry, it is assumed that matrices A and B have the following */
82 /* forms, which may be obtained by the preprocessing subroutine SGGSVP */
83 /* from a general M-by-N matrix A and P-by-N matrix B: */
84
85 /* N-K-L K L */
86 /* A = K ( 0 A12 A13 ) if M-K-L >= 0; */
87 /* L ( 0 0 A23 ) */
88 /* M-K-L ( 0 0 0 ) */
89
90 /* N-K-L K L */
91 /* A = K ( 0 A12 A13 ) if M-K-L < 0; */
92 /* M-K ( 0 0 A23 ) */
93
94 /* N-K-L K L */
95 /* B = L ( 0 0 B13 ) */
96 /* P-L ( 0 0 0 ) */
97
98 /* where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular */
99 /* upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, */
100 /* otherwise A23 is (M-K)-by-L upper trapezoidal. */
101
102 /* On exit, */
103
104 /* U'*A*Q = D1*( 0 R ), V'*B*Q = D2*( 0 R ), */
105
106 /* where U, V and Q are orthogonal matrices, Z' denotes the transpose */
107 /* of Z, R is a nonsingular upper triangular matrix, and D1 and D2 are */
108 /* ``diagonal'' matrices, which are of the following structures: */
109
110 /* If M-K-L >= 0, */
111
112 /* K L */
113 /* D1 = K ( I 0 ) */
114 /* L ( 0 C ) */
115 /* M-K-L ( 0 0 ) */
116
117 /* K L */
118 /* D2 = L ( 0 S ) */
119 /* P-L ( 0 0 ) */
120
121 /* N-K-L K L */
122 /* ( 0 R ) = K ( 0 R11 R12 ) K */
123 /* L ( 0 0 R22 ) L */
124
125 /* where */
126
127 /* C = diag( ALPHA(K+1), ... , ALPHA(K+L) ), */
128 /* S = diag( BETA(K+1), ... , BETA(K+L) ), */
129 /* C**2 + S**2 = I. */
130
131 /* R is stored in A(1:K+L,N-K-L+1:N) on exit. */
132
133 /* If M-K-L < 0, */
134
135 /* K M-K K+L-M */
136 /* D1 = K ( I 0 0 ) */
137 /* M-K ( 0 C 0 ) */
138
139 /* K M-K K+L-M */
140 /* D2 = M-K ( 0 S 0 ) */
141 /* K+L-M ( 0 0 I ) */
142 /* P-L ( 0 0 0 ) */
143
144 /* N-K-L K M-K K+L-M */
145 /* ( 0 R ) = K ( 0 R11 R12 R13 ) */
146 /* M-K ( 0 0 R22 R23 ) */
147 /* K+L-M ( 0 0 0 R33 ) */
148
149 /* where */
150 /* C = diag( ALPHA(K+1), ... , ALPHA(M) ), */
151 /* S = diag( BETA(K+1), ... , BETA(M) ), */
152 /* C**2 + S**2 = I. */
153
154 /* R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored */
155 /* ( 0 R22 R23 ) */
156 /* in B(M-K+1:L,N+M-K-L+1:N) on exit. */
157
158 /* The computation of the orthogonal transformation matrices U, V or Q */
159 /* is optional. These matrices may either be formed explicitly, or they */
160 /* may be postmultiplied into input matrices U1, V1, or Q1. */
161
162 /* Arguments */
163 /* ========= */
164
165 /* JOBU (input) CHARACTER*1 */
166 /* = 'U': U must contain an orthogonal matrix U1 on entry, and */
167 /* the product U1*U is returned; */
168 /* = 'I': U is initialized to the unit matrix, and the */
169 /* orthogonal matrix U is returned; */
170 /* = 'N': U is not computed. */
171
172 /* JOBV (input) CHARACTER*1 */
173 /* = 'V': V must contain an orthogonal matrix V1 on entry, and */
174 /* the product V1*V is returned; */
175 /* = 'I': V is initialized to the unit matrix, and the */
176 /* orthogonal matrix V is returned; */
177 /* = 'N': V is not computed. */
178
179 /* JOBQ (input) CHARACTER*1 */
180 /* = 'Q': Q must contain an orthogonal matrix Q1 on entry, and */
181 /* the product Q1*Q is returned; */
182 /* = 'I': Q is initialized to the unit matrix, and the */
183 /* orthogonal matrix Q is returned; */
184 /* = 'N': Q is not computed. */
185
186 /* M (input) INTEGER */
187 /* The number of rows of the matrix A. M >= 0. */
188
189 /* P (input) INTEGER */
190 /* The number of rows of the matrix B. P >= 0. */
191
192 /* N (input) INTEGER */
193 /* The number of columns of the matrices A and B. N >= 0. */
194
195 /* K (input) INTEGER */
196 /* L (input) INTEGER */
197 /* K and L specify the subblocks in the input matrices A and B: */
198 /* A23 = A(K+1:MIN(K+L,M),N-L+1:N) and B13 = B(1:L,N-L+1:N) */
199 /* of A and B, whose GSVD is going to be computed by STGSJA. */
200 /* See Further details. */
201
202 /* A (input/output) REAL array, dimension (LDA,N) */
203 /* On entry, the M-by-N matrix A. */
204 /* On exit, A(N-K+1:N,1:MIN(K+L,M) ) contains the triangular */
205 /* matrix R or part of R. See Purpose for details. */
206
207 /* LDA (input) INTEGER */
208 /* The leading dimension of the array A. LDA >= max(1,M). */
209
210 /* B (input/output) REAL 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
215 /* LDB (input) INTEGER */
216 /* The leading dimension of the array B. LDB >= max(1,P). */
217
218 /* TOLA (input) REAL */
219 /* TOLB (input) REAL */
220 /* TOLA and TOLB are the convergence criteria for the Jacobi- */
221 /* Kogbetliantz iteration procedure. Generally, they are the */
222 /* same as used in the preprocessing step, say */
223 /* TOLA = max(M,N)*norm(A)*MACHEPS, */
224 /* TOLB = max(P,N)*norm(B)*MACHEPS. */
225
226 /* ALPHA (output) REAL array, dimension (N) */
227 /* BETA (output) REAL array, dimension (N) */
228 /* On exit, ALPHA and BETA contain the generalized singular */
229 /* value pairs of A and B; */
230 /* ALPHA(1:K) = 1, */
231 /* BETA(1:K) = 0, */
232 /* and if M-K-L >= 0, */
233 /* ALPHA(K+1:K+L) = diag(C), */
234 /* BETA(K+1:K+L) = diag(S), */
235 /* or if M-K-L < 0, */
236 /* ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0 */
237 /* BETA(K+1:M) = S, BETA(M+1:K+L) = 1. */
238 /* Furthermore, if K+L < N, */
239 /* ALPHA(K+L+1:N) = 0 and */
240 /* BETA(K+L+1:N) = 0. */
241
242 /* U (input/output) REAL array, dimension (LDU,M) */
243 /* On entry, if JOBU = 'U', U must contain a matrix U1 (usually */
244 /* the orthogonal matrix returned by SGGSVP). */
245 /* On exit, */
246 /* if JOBU = 'I', U contains the orthogonal matrix U; */
247 /* if JOBU = 'U', U contains the product U1*U. */
248 /* If JOBU = 'N', U is not referenced. */
249
250 /* LDU (input) INTEGER */
251 /* The leading dimension of the array U. LDU >= max(1,M) if */
252 /* JOBU = 'U'; LDU >= 1 otherwise. */
253
254 /* V (input/output) REAL array, dimension (LDV,P) */
255 /* On entry, if JOBV = 'V', V must contain a matrix V1 (usually */
256 /* the orthogonal matrix returned by SGGSVP). */
257 /* On exit, */
258 /* if JOBV = 'I', V contains the orthogonal matrix V; */
259 /* if JOBV = 'V', V contains the product V1*V. */
260 /* If JOBV = 'N', V is not referenced. */
261
262 /* LDV (input) INTEGER */
263 /* The leading dimension of the array V. LDV >= max(1,P) if */
264 /* JOBV = 'V'; LDV >= 1 otherwise. */
265
266 /* Q (input/output) REAL array, dimension (LDQ,N) */
267 /* On entry, if JOBQ = 'Q', Q must contain a matrix Q1 (usually */
268 /* the orthogonal matrix returned by SGGSVP). */
269 /* On exit, */
270 /* if JOBQ = 'I', Q contains the orthogonal matrix Q; */
271 /* if JOBQ = 'Q', Q contains the product Q1*Q. */
272 /* If JOBQ = 'N', Q is not referenced. */
273
274 /* LDQ (input) INTEGER */
275 /* The leading dimension of the array Q. LDQ >= max(1,N) if */
276 /* JOBQ = 'Q'; LDQ >= 1 otherwise. */
277
278 /* WORK (workspace) REAL array, dimension (2*N) */
279
280 /* NCYCLE (output) INTEGER */
281 /* The number of cycles required for convergence. */
282
283 /* INFO (output) INTEGER */
284 /* = 0: successful exit */
285 /* < 0: if INFO = -i, the i-th argument had an illegal value. */
286 /* = 1: the procedure does not converge after MAXIT cycles. */
287
288 /* Internal Parameters */
289 /* =================== */
290
291 /* MAXIT INTEGER */
292 /* MAXIT specifies the total loops that the iterative procedure */
293 /* may take. If after MAXIT cycles, the routine fails to */
294 /* converge, we return INFO = 1. */
295
296 /* Further Details */
297 /* =============== */
298
299 /* STGSJA essentially uses a variant of Kogbetliantz algorithm to reduce */
300 /* min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L */
301 /* matrix B13 to the form: */
302
303 /* U1'*A13*Q1 = C1*R1; V1'*B13*Q1 = S1*R1, */
304
305 /* where U1, V1 and Q1 are orthogonal matrix, and Z' is the transpose */
306 /* of Z. C1 and S1 are diagonal matrices satisfying */
307
308 /* C1**2 + S1**2 = I, */
309
310 /* and R1 is an L-by-L nonsingular upper triangular matrix. */
311
312 /* ===================================================================== */
313
314 /* .. Parameters .. */
315 /*< INTEGER MAXIT >*/
316 /*< PARAMETER ( MAXIT = 40 ) >*/
317 /*< REAL ZERO, ONE >*/
318 /*< PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 ) >*/
319 /* .. */
320 /* .. Local Scalars .. */
321
322 /*< LOGICAL INITQ, INITU, INITV, UPPER, WANTQ, WANTU, WANTV >*/
323 /*< INTEGER I, J, KCYCLE >*/
324 /*< >*/
325 /* .. */
326 /* .. External Functions .. */
327 /*< LOGICAL LSAME >*/
328 /*< EXTERNAL LSAME >*/
329 /* .. */
330 /* .. External Subroutines .. */
331 /*< >*/
332 /* .. */
333 /* .. Intrinsic Functions .. */
334 /*< INTRINSIC ABS, MAX, MIN >*/
335 /* .. */
336 /* .. Executable Statements .. */
337
338 /* Decode and test the input parameters */
339
340 /*< INITU = LSAME( JOBU, 'I' ) >*/
341 /* Parameter adjustments */
342 a_dim1 = *lda;
343 a_offset = 1 + a_dim1;
344 a -= a_offset;
345 b_dim1 = *ldb;
346 b_offset = 1 + b_dim1;
347 b -= b_offset;
348 --alpha;
349 --beta;
350 u_dim1 = *ldu;
351 u_offset = 1 + u_dim1;
352 u -= u_offset;
353 v_dim1 = *ldv;
354 v_offset = 1 + v_dim1;
355 v -= v_offset;
356 q_dim1 = *ldq;
357 q_offset = 1 + q_dim1;
358 q -= q_offset;
359 --work;
360
361 /* Function Body */
362 initu = lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobu, "I", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
363 /*< WANTU = INITU .OR. LSAME( JOBU, 'U' ) >*/
364 wantu = initu || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobu, "U", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
365
366 /*< INITV = LSAME( JOBV, 'I' ) >*/
367 initv = lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobv, "I", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
368 /*< WANTV = INITV .OR. LSAME( JOBV, 'V' ) >*/
369 wantv = initv || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobv, "V", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
370
371 /*< INITQ = LSAME( JOBQ, 'I' ) >*/
372 initq = lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobq, "I", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
373 /*< WANTQ = INITQ .OR. LSAME( JOBQ, 'Q' ) >*/
374 wantq = initq || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobq, "Q", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
375
376 /*< INFO = 0 >*/
377 *info = 0;
378 /*< IF( .NOT.( INITU .OR. WANTU .OR. LSAME( JOBU, 'N' ) ) ) THEN >*/
379 if (! (initu || wantu || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobu, "N", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1))) {
380 /*< INFO = -1 >*/
381 *info = -1;
382 /*< ELSE IF( .NOT.( INITV .OR. WANTV .OR. LSAME( JOBV, 'N' ) ) ) THEN >*/
383 } else if (! (initv || wantv || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobv, "N", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1)))
384 {
385 /*< INFO = -2 >*/
386 *info = -2;
387 /*< ELSE IF( .NOT.( INITQ .OR. WANTQ .OR. LSAME( JOBQ, 'N' ) ) ) THEN >*/
388 } else if (! (initq || wantq || lsame_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:194:9`!(jobq, "N", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1)))
389 {
390 /*< INFO = -3 >*/
391 *info = -3;
392 /*< ELSE IF( M.LT.0 ) THEN >*/
393 } else if (*m < 0) {
394 /*< INFO = -4 >*/
395 *info = -4;
396 /*< ELSE IF( P.LT.0 ) THEN >*/
397 } else if (*p < 0) {
398 /*< INFO = -5 >*/
399 *info = -5;
400 /*< ELSE IF( N.LT.0 ) THEN >*/
401 } else if (*n < 0) {
402 /*< INFO = -6 >*/
403 *info = -6;
404 /*< ELSE IF( LDA.LT.MAX( 1, M ) ) THEN >*/
405 } else if (*lda < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*m)) {
406 /*< INFO = -10 >*/
407 *info = -10;
408 /*< ELSE IF( LDB.LT.MAX( 1, P ) ) THEN >*/
409 } else if (*ldb < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*p)) {
410 /*< INFO = -12 >*/
411 *info = -12;
412 /*< ELSE IF( LDU.LT.1 .OR. ( WANTU .AND. LDU.LT.M ) ) THEN >*/
413 } else if (*ldu < 1 || (wantu && *ldu < *m)) {
414 /*< INFO = -18 >*/
415 *info = -18;
416 /*< ELSE IF( LDV.LT.1 .OR. ( WANTV .AND. LDV.LT.P ) ) THEN >*/
417 } else if (*ldv < 1 || (wantv && *ldv < *p)) {
418 /*< INFO = -20 >*/
419 *info = -20;
420 /*< ELSE IF( LDQ.LT.1 .OR. ( WANTQ .AND. LDQ.LT.N ) ) THEN >*/
421 } else if (*ldq < 1 || (wantq && *ldq < *n)) {
422 /*< INFO = -22 >*/
423 *info = -22;
424 /*< END IF >*/
425 }
426 /*< IF( INFO.NE.0 ) THEN >*/
427 if (*info != 0) {
428 /*< CALL XERBLA( 'STGSJA', -INFO ) >*/
429 i__1 = -(*info);
430 xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!("STGSJA", &i__1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6);
431 /*< RETURN >*/
432 return 0;
433 /*< END IF >*/
434 }
435
436 /* Initialize U, V and Q, if necessary */
437
438 /*< >*/
439 if (initu) {
440 slaset_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:262:9`!("Full", m, m, &c_b13cxx . . $ c_b13., &c_b14cxx . . $ c_b14., &u[u_offset], ldu, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
441 }
442 /*< >*/
443 if (initv) {
444 slaset_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:262:9`!("Full", p, p, &c_b13cxx . . $ c_b13., &c_b14cxx . . $ c_b14., &v[v_offset], ldv, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
445 }
446 /*< >*/
447 if (initq) {
448 slaset_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:262:9`!("Full", n, n, &c_b13cxx . . $ c_b13., &c_b14cxx . . $ c_b14., &q[q_offset], ldq, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
449 }
450
451 /* Loop until convergence */
452
453 /*< UPPER = .FALSE. >*/
454 upper = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!;
455 /*< DO 40 KCYCLE = 1, MAXIT >*/
456 for (kcycle = 1; kcycle <= 40; ++kcycle) {
457
458 /*< UPPER = .NOT.UPPER >*/
459 upper = ! upper;
460
461 /*< DO 20 I = 1, L - 1 >*/
462 i__1 = *l - 1;
463 for (i__ = 1; i__ <= i__1; ++i__) {
464 /*< DO 10 J = I + 1, L >*/
465 i__2 = *l;
466 for (j = i__ + 1; j <= i__2; ++j) {
467
468 /*< A1 = ZERO >*/
469 a1 = (float)0.;
470 /*< A2 = ZERO >*/
471 a2 = (float)0.;
472 /*< A3 = ZERO >*/
473 a3 = (float)0.;
474 /*< >*/
475 if (*k + i__ <= *m) {
476 a1 = a[*k + i__ + (*n - *l + i__) * a_dim1];
477 }
478 /*< >*/
479 if (*k + j <= *m) {
480 a3 = a[*k + j + (*n - *l + j) * a_dim1];
481 }
482
483 /*< B1 = B( I, N-L+I ) >*/
484 b1 = b[i__ + (*n - *l + i__) * b_dim1];
485 /*< B3 = B( J, N-L+J ) >*/
486 b3 = b[j + (*n - *l + j) * b_dim1];
487
488 /*< IF( UPPER ) THEN >*/
489 if (upper) {
490 /*< >*/
491 if (*k + i__ <= *m) {
492 a2 = a[*k + i__ + (*n - *l + j) * a_dim1];
493 }
494 /*< B2 = B( I, N-L+J ) >*/
495 b2 = b[i__ + (*n - *l + j) * b_dim1];
496 /*< ELSE >*/
497 } else {
498 /*< >*/
499 if (*k + j <= *m) {
500 a2 = a[*k + j + (*n - *l + i__) * a_dim1];
501 }
502 /*< B2 = B( J, N-L+I ) >*/
503 b2 = b[j + (*n - *l + i__) * b_dim1];
504 /*< END IF >*/
505 }
506
507 /*< >*/
508 slags2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:247:9`!(&upper, &a1, &a2, &a3, &b1, &b2, &b3, &csu, &snu, &
509 csv, &snv, &csq, &snq);
510
511 /* Update (K+I)-th and (K+J)-th rows of matrix A: U'*A */
512
513 /*< >*/
514 if (*k + j <= *m) {
515 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(l, &a[*k + j + (*n - *l + 1) * a_dim1], lda, &a[*k
516 + i__ + (*n - *l + 1) * a_dim1], lda, &csu, &snu);
517 }
518
519 /* Update I-th and J-th rows of matrix B: V'*B */
520
521 /*< >*/
522 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(l, &b[j + (*n - *l + 1) * b_dim1], ldb, &b[i__ + (*n - *
523 l + 1) * b_dim1], ldb, &csv, &snv);
524
525 /* Update (N-L+I)-th and (N-L+J)-th columns of matrices */
526 /* A and B: A*Q and B*Q */
527
528 /*< >*/
529 /* Computing MIN */
530 i__4 = *k + *l;
531 i__3 = mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(i__4,*m);
532 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(&i__3, &a[(*n - *l + j) * a_dim1 + 1], &c__1cxx . . $ c__1., &a[(*n - *
533 l + i__) * a_dim1 + 1], &c__1cxx . . $ c__1., &csq, &snq);
534
535 /*< >*/
536 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(l, &b[(*n - *l + j) * b_dim1 + 1], &c__1cxx . . $ c__1., &b[(*n - *l +
537 i__) * b_dim1 + 1], &c__1cxx . . $ c__1., &csq, &snq);
538
539 /*< IF( UPPER ) THEN >*/
540 if (upper) {
541 /*< >*/
542 if (*k + i__ <= *m) {
543 a[*k + i__ + (*n - *l + j) * a_dim1] = (float)0.;
544 }
545 /*< B( I, N-L+J ) = ZERO >*/
546 b[i__ + (*n - *l + j) * b_dim1] = (float)0.;
547 /*< ELSE >*/
548 } else {
549 /*< >*/
550 if (*k + j <= *m) {
551 a[*k + j + (*n - *l + i__) * a_dim1] = (float)0.;
552 }
553 /*< B( J, N-L+I ) = ZERO >*/
554 b[j + (*n - *l + i__) * b_dim1] = (float)0.;
555 /*< END IF >*/
556 }
557
558 /* Update orthogonal matrices U, V, Q, if desired. */
559
560 /*< >*/
561 if (wantu && *k + j <= *m) {
562 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(m, &u[(*k + j) * u_dim1 + 1], &c__1cxx . . $ c__1., &u[(*k + i__) *
563 u_dim1 + 1], &c__1cxx . . $ c__1., &csu, &snu);
564 }
565
566 /*< >*/
567 if (wantv) {
568 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(p, &v[j * v_dim1 + 1], &c__1cxx . . $ c__1., &v[i__ * v_dim1 + 1],
569 &c__1cxx . . $ c__1., &csv, &snv);
570 }
571
572 /*< >*/
573 if (wantq) {
574 srot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:274:9`!(n, &q[(*n - *l + j) * q_dim1 + 1], &c__1cxx . . $ c__1., &q[(*n - *
575 l + i__) * q_dim1 + 1], &c__1cxx . . $ c__1., &csq, &snq);
576 }
577
578 /*< 10 CONTINUE >*/
579 /* L10: */
580 }
581 /*< 20 CONTINUE >*/
582 /* L20: */
583 }
584
585 /*< IF( .NOT.UPPER ) THEN >*/
586 if (! upper) {
587
588 /* The matrices A13 and B13 were lower triangular at the start */
589 /* of the cycle, and are now upper triangular. */
590
591 /* Convergence test: test the parallelism of the corresponding */
592 /* rows of A and B. */
593
594 /*< ERROR = ZERO >*/
595 error = (float)0.;
596 /*< DO 30 I = 1, MIN( L, M-K ) >*/
597 /* Computing MIN */
598 i__2 = *l, i__3 = *m - *k;
599 i__1 = mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(i__2,i__3);
600 for (i__ = 1; i__ <= i__1; ++i__) {
601 /*< CALL SCOPY( L-I+1, A( K+I, N-L+I ), LDA, WORK, 1 ) >*/
602 i__2 = *l - i__ + 1;
603 scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(&i__2, &a[*k + i__ + (*n - *l + i__) * a_dim1], lda, &
604 work[1], &c__1cxx . . $ c__1.);
605 /*< CALL SCOPY( L-I+1, B( I, N-L+I ), LDB, WORK( L+1 ), 1 ) >*/
606 i__2 = *l - i__ + 1;
607 scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(&i__2, &b[i__ + (*n - *l + i__) * b_dim1], ldb, &work[*
608 l + 1], &c__1cxx . . $ c__1.);
609 /*< CALL SLAPLL( L-I+1, WORK, 1, WORK( L+1 ), 1, SSMIN ) >*/
610 i__2 = *l - i__ + 1;
611 slapll_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:255:9`!(&i__2, &work[1], &c__1cxx . . $ c__1., &work[*l + 1], &c__1cxx . . $ c__1., &ssmin);
612 /*< ERROR = MAX( ERROR, SSMIN ) >*/
613 error = dmaxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:162:9`!(error,ssmin);
614 /*< 30 CONTINUE >*/
615 /* L30: */
616 }
617
618 /*< >*/
619 if (dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(error) <= dmincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:161:9`!(*tola,*tolb)) {
620 goto L50;
621 }
622 /*< END IF >*/
623 }
624
625 /* End of cycle loop */
626
627 /*< 40 CONTINUE >*/
628 /* L40: */
629 }
630
631 /* The algorithm has not converged after MAXIT cycles. */
632
633 /*< INFO = 1 >*/
634 *info = 1;
635 /*< GO TO 100 >*/
636 goto L100;
637
638 /*< 50 CONTINUE >*/
639 L50:
640
641 /* If ERROR <= MIN(TOLA,TOLB), then the algorithm has converged. */
642 /* Compute the generalized singular value pairs (ALPHA, BETA), and */
643 /* set the triangular matrix R to array A. */
644
645 /*< DO 60 I = 1, K >*/
646 i__1 = *k;
647 for (i__ = 1; i__ <= i__1; ++i__) {
648 /*< ALPHA( I ) = ONE >*/
649 alpha[i__] = (float)1.;
650 /*< BETA( I ) = ZERO >*/
651 beta[i__] = (float)0.;
652 /*< 60 CONTINUE >*/
653 /* L60: */
654 }
655
656 /*< DO 70 I = 1, MIN( L, M-K ) >*/
657 /* Computing MIN */
658 i__2 = *l, i__3 = *m - *k;
659 i__1 = mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(i__2,i__3);
660 for (i__ = 1; i__ <= i__1; ++i__) {
661
662 /*< A1 = A( K+I, N-L+I ) >*/
663 a1 = a[*k + i__ + (*n - *l + i__) * a_dim1];
664 /*< B1 = B( I, N-L+I ) >*/
665 b1 = b[i__ + (*n - *l + i__) * b_dim1];
666
667 /*< IF( A1.NE.ZERO ) THEN >*/
668 if (a1 != (float)0.) {
669 /*< GAMMA = B1 / A1 >*/
670 gamma = b1 / a1;
671
672 /* change sign if necessary */
673
674 /*< IF( GAMMA.LT.ZERO ) THEN >*/
675 if (gamma < (float)0.) {
676 /*< CALL SSCAL( L-I+1, -ONE, B( I, N-L+I ), LDB ) >*/
677 i__2 = *l - i__ + 1;
678 sscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:278:9`!(&i__2, &c_b43cxx . . $ c_b43., &b[i__ + (*n - *l + i__) * b_dim1], ldb)
679 ;
680 /*< >*/
681 if (wantv) {
682 sscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:278:9`!(p, &c_b43cxx . . $ c_b43., &v[i__ * v_dim1 + 1], &c__1cxx . . $ c__1.);
683 }
684 /*< END IF >*/
685 }
686
687 /*< >*/
688 r__1 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(gamma);
689 slartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:260:9`!(&r__1, &c_b14cxx . . $ c_b14., &beta[*k + i__], &alpha[*k + i__], &rwk);
690
691 /*< IF( ALPHA( K+I ).GE.BETA( K+I ) ) THEN >*/
692 if (alpha[*k + i__] >= beta[*k + i__]) {
693 /*< >*/
694 i__2 = *l - i__ + 1;
695 r__1 = (float)1. / alpha[*k + i__];
696 sscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:278:9`!(&i__2, &r__1, &a[*k + i__ + (*n - *l + i__) * a_dim1],
697 lda);
698 /*< ELSE >*/
699 } else {
700 /*< >*/
701 i__2 = *l - i__ + 1;
702 r__1 = (float)1. / beta[*k + i__];
703 sscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:278:9`!(&i__2, &r__1, &b[i__ + (*n - *l + i__) * b_dim1], ldb);
704 /*< >*/
705 i__2 = *l - i__ + 1;
706 scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(&i__2, &b[i__ + (*n - *l + i__) * b_dim1], ldb, &a[*k
707 + i__ + (*n - *l + i__) * a_dim1], lda);
708 /*< END IF >*/
709 }
710
711 /*< ELSE >*/
712 } else {
713
714 /*< ALPHA( K+I ) = ZERO >*/
715 alpha[*k + i__] = (float)0.;
716 /*< BETA( K+I ) = ONE >*/
717 beta[*k + i__] = (float)1.;
718 /*< >*/
719 i__2 = *l - i__ + 1;
720 scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(&i__2, &b[i__ + (*n - *l + i__) * b_dim1], ldb, &a[*k +
721 i__ + (*n - *l + i__) * a_dim1], lda);
722
723 /*< END IF >*/
724 }
725
726 /*< 70 CONTINUE >*/
727 /* L70: */
728 }
729
730 /* Post-assignment */
731
732 /*< DO 80 I = M + 1, K + L >*/
733 i__1 = *k + *l;
734 for (i__ = *m + 1; i__ <= i__1; ++i__) {
735 /*< ALPHA( I ) = ZERO >*/
736 alpha[i__] = (float)0.;
737 /*< BETA( I ) = ONE >*/
738 beta[i__] = (float)1.;
739 /*< 80 CONTINUE >*/
740 /* L80: */
741 }
742
743 /*< IF( K+L.LT.N ) THEN >*/
744 if (*k + *l < *n) {
745 /*< DO 90 I = K + L + 1, N >*/
746 i__1 = *n;
747 for (i__ = *k + *l + 1; i__ <= i__1; ++i__) {
748 /*< ALPHA( I ) = ZERO >*/
749 alpha[i__] = (float)0.;
750 /*< BETA( I ) = ZERO >*/
751 beta[i__] = (float)0.;
752 /*< 90 CONTINUE >*/
753 /* L90: */
754 }
755 /*< END IF >*/
756 }
757
758 /*< 100 CONTINUE >*/
759 L100:
760 /*< NCYCLE = KCYCLE >*/
761 *ncycle = kcycle;
762 /*< RETURN >*/
763 return 0;
764
765 /* End of STGSJA */
766
767 /*< END >*/
768 } /* stgsja_ */
769
770 #ifdef __cplusplus
771 }
772 #endif