Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/complex16/zunghr.c

raw symbols SCIP
1 /* lapack/complex16/zunghr.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 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1;
21 static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c_n1cxx . . $ c_n1. = -1;
22
23 /*< SUBROUTINE ZUNGHR( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO ) >*/
24 /* Subroutine */ int zunghr_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:347:9`!(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`! *ilo, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ihi,
25 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *a, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lda, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *tau, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *
26 work, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lwork, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info)
27 {
28 /* System generated locals */
29 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! a_dim1, a_offset, i__1, i__2, i__3, i__4;
30
31 /* Local variables */
32 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, j, nb, nh, iinfo;
33 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`!);
34 extern integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ilaenv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:181:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, char *, char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
35 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63: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`!, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
36 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! lwkopt=0;
37 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! lquery;
38 extern /* Subroutine */ int zungqr_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:348:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
39 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *,
40 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *);
41
42
43 /* -- LAPACK routine (version 3.0) -- */
44 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
45 /* Courant Institute, Argonne National Lab, and Rice University */
46 /* June 30, 1999 */
47
48 /* .. Scalar Arguments .. */
49 /*< INTEGER IHI, ILO, INFO, LDA, LWORK, N >*/
50 /* .. */
51 /* .. Array Arguments .. */
52 /*< COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * ) >*/
53 /* .. */
54
55 /* Purpose */
56 /* ======= */
57
58 /* ZUNGHR generates a complex unitary matrix Q which is defined as the */
59 /* product of IHI-ILO elementary reflectors of order N, as returned by */
60 /* ZGEHRD: */
61
62 /* Q = H(ilo) H(ilo+1) . . . H(ihi-1). */
63
64 /* Arguments */
65 /* ========= */
66
67 /* N (input) INTEGER */
68 /* The order of the matrix Q. N >= 0. */
69
70 /* ILO (input) INTEGER */
71 /* IHI (input) INTEGER */
72 /* ILO and IHI must have the same values as in the previous call */
73 /* of ZGEHRD. Q is equal to the unit matrix except in the */
74 /* submatrix Q(ilo+1:ihi,ilo+1:ihi). */
75 /* 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. */
76
77 /* A (input/output) COMPLEX*16 array, dimension (LDA,N) */
78 /* On entry, the vectors which define the elementary reflectors, */
79 /* as returned by ZGEHRD. */
80 /* On exit, the N-by-N unitary matrix Q. */
81
82 /* LDA (input) INTEGER */
83 /* The leading dimension of the array A. LDA >= max(1,N). */
84
85 /* TAU (input) COMPLEX*16 array, dimension (N-1) */
86 /* TAU(i) must contain the scalar factor of the elementary */
87 /* reflector H(i), as returned by ZGEHRD. */
88
89 /* WORK (workspace/output) COMPLEX*16 array, dimension (LWORK) */
90 /* On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
91
92 /* LWORK (input) INTEGER */
93 /* The dimension of the array WORK. LWORK >= IHI-ILO. */
94 /* For optimum performance LWORK >= (IHI-ILO)*NB, where NB is */
95 /* the optimal blocksize. */
96
97 /* If LWORK = -1, then a workspace query is assumed; the routine */
98 /* only calculates the optimal size of the WORK array, returns */
99 /* this value as the first entry of the WORK array, and no error */
100 /* message related to LWORK is issued by XERBLA. */
101
102 /* INFO (output) INTEGER */
103 /* = 0: successful exit */
104 /* < 0: if INFO = -i, the i-th argument had an illegal value */
105
106 /* ===================================================================== */
107
108 /* .. Parameters .. */
109 /*< COMPLEX*16 ZERO, ONE >*/
110 /*< >*/
111 /* .. */
112 /* .. Local Scalars .. */
113 /*< LOGICAL LQUERY >*/
114 /*< INTEGER I, IINFO, J, LWKOPT, NB, NH >*/
115 /* .. */
116 /* .. External Subroutines .. */
117 /*< EXTERNAL XERBLA, ZUNGQR >*/
118 /* .. */
119 /* .. External Functions .. */
120 /*< INTEGER ILAENV >*/
121 /*< EXTERNAL ILAENV >*/
122 /* .. */
123 /* .. Intrinsic Functions .. */
124 /*< INTRINSIC MAX, MIN >*/
125 /* .. */
126 /* .. Executable Statements .. */
127
128 /* Test the input arguments */
129
130 /*< INFO = 0 >*/
131 /* Parameter adjustments */
132 a_dim1 = *lda;
133 a_offset = 1 + a_dim1;
134 a -= a_offset;
135 --tau;
136 --work;
137
138 /* Function Body */
139 *info = 0;
140 /*< NH = IHI - ILO >*/
141 nh = *ihi - *ilo;
142 /*< LQUERY = ( LWORK.EQ.-1 ) >*/
143 lquery = *lwork == -1;
144 /*< IF( N.LT.0 ) THEN >*/
145 if (*n < 0) {
146 /*< INFO = -1 >*/
147 *info = -1;
148 /*< ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN >*/
149 } else if (*ilo < 1 || *ilo > maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*n)) {
150 /*< INFO = -2 >*/
151 *info = -2;
152 /*< ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN >*/
153 } else if (*ihi < mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(*ilo,*n) || *ihi > *n) {
154 /*< INFO = -3 >*/
155 *info = -3;
156 /*< ELSE IF( LDA.LT.MAX( 1, N ) ) THEN >*/
157 } else if (*lda < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*n)) {
158 /*< INFO = -5 >*/
159 *info = -5;
160 /*< ELSE IF( LWORK.LT.MAX( 1, NH ) .AND. .NOT.LQUERY ) THEN >*/
161 } else if (*lwork < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,nh) && ! lquery) {
162 /*< INFO = -8 >*/
163 *info = -8;
164 /*< END IF >*/
165 }
166
167 /*< IF( INFO.EQ.0 ) THEN >*/
168 if (*info == 0) {
169 /*< NB = ILAENV( 1, 'ZUNGQR', ' ', NH, NH, NH, -1 ) >*/
170 nb = ilaenv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:181:9`!(&c__1cxx . . $ c__1., "ZUNGQR", " ", &nh, &nh, &nh, &c_n1cxx . . $ c_n1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6, (
171 ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
172 /*< LWKOPT = MAX( 1, NH )*NB >*/
173 lwkopt = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,nh) * nb;
174 /*< WORK( 1 ) = LWKOPT >*/
175 work[1].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = (doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!) lwkopt, work[1].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
176 /*< END IF >*/
177 }
178
179 /*< IF( INFO.NE.0 ) THEN >*/
180 if (*info != 0) {
181 /*< CALL XERBLA( 'ZUNGHR', -INFO ) >*/
182 i__1 = -(*info);
183 xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!("ZUNGHR", &i__1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6);
184 /*< RETURN >*/
185 return 0;
186 /*< ELSE IF( LQUERY ) THEN >*/
187 } else if (lquery) {
188 /*< RETURN >*/
189 return 0;
190 /*< END IF >*/
191 }
192
193 /* Quick return if possible */
194
195 /*< IF( N.EQ.0 ) THEN >*/
196 if (*n == 0) {
197 /*< WORK( 1 ) = 1 >*/
198 work[1].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 1., work[1].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
199 /*< RETURN >*/
200 return 0;
201 /*< END IF >*/
202 }
203
204 /* Shift the vectors which define the elementary reflectors one */
205 /* column to the right, and set the first ilo and the last n-ihi */
206 /* rows and columns to those of the unit matrix */
207
208 /*< DO 40 J = IHI, ILO + 1, -1 >*/
209 i__1 = *ilo + 1;
210 for (j = *ihi; j >= i__1; --j) {
211 /*< DO 10 I = 1, J - 1 >*/
212 i__2 = j - 1;
213 for (i__ = 1; i__ <= i__2; ++i__) {
214 /*< A( I, J ) = ZERO >*/
215 i__3 = i__ + j * a_dim1;
216 a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 0., a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
217 /*< 10 CONTINUE >*/
218 /* L10: */
219 }
220 /*< DO 20 I = J + 1, IHI >*/
221 i__2 = *ihi;
222 for (i__ = j + 1; i__ <= i__2; ++i__) {
223 /*< A( I, J ) = A( I, J-1 ) >*/
224 i__3 = i__ + j * a_dim1;
225 i__4 = i__ + (j - 1) * a_dim1;
226 a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = a[i__4].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = a[i__4].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
227 /*< 20 CONTINUE >*/
228 /* L20: */
229 }
230 /*< DO 30 I = IHI + 1, N >*/
231 i__2 = *n;
232 for (i__ = *ihi + 1; i__ <= i__2; ++i__) {
233 /*< A( I, J ) = ZERO >*/
234 i__3 = i__ + j * a_dim1;
235 a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 0., a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
236 /*< 30 CONTINUE >*/
237 /* L30: */
238 }
239 /*< 40 CONTINUE >*/
240 /* L40: */
241 }
242 /*< DO 60 J = 1, ILO >*/
243 i__1 = *ilo;
244 for (j = 1; j <= i__1; ++j) {
245 /*< DO 50 I = 1, N >*/
246 i__2 = *n;
247 for (i__ = 1; i__ <= i__2; ++i__) {
248 /*< A( I, J ) = ZERO >*/
249 i__3 = i__ + j * a_dim1;
250 a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 0., a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
251 /*< 50 CONTINUE >*/
252 /* L50: */
253 }
254 /*< A( J, J ) = ONE >*/
255 i__2 = j + j * a_dim1;
256 a[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 1., a[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
257 /*< 60 CONTINUE >*/
258 /* L60: */
259 }
260 /*< DO 80 J = IHI + 1, N >*/
261 i__1 = *n;
262 for (j = *ihi + 1; j <= i__1; ++j) {
263 /*< DO 70 I = 1, N >*/
264 i__2 = *n;
265 for (i__ = 1; i__ <= i__2; ++i__) {
266 /*< A( I, J ) = ZERO >*/
267 i__3 = i__ + j * a_dim1;
268 a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 0., a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
269 /*< 70 CONTINUE >*/
270 /* L70: */
271 }
272 /*< A( J, J ) = ONE >*/
273 i__2 = j + j * a_dim1;
274 a[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 1., a[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
275 /*< 80 CONTINUE >*/
276 /* L80: */
277 }
278
279 /*< IF( NH.GT.0 ) THEN >*/
280 if (nh > 0) {
281
282 /* Generate Q(ilo+1:ihi,ilo+1:ihi) */
283
284 /*< >*/
285 zungqr_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:348:9`!(&nh, &nh, &nh, &a[*ilo + 1 + (*ilo + 1) * a_dim1], lda, &tau[*
286 ilo], &work[1], lwork, &iinfo);
287 /*< END IF >*/
288 }
289 /*< WORK( 1 ) = LWKOPT >*/
290 work[1].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = (doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!) lwkopt, work[1].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
291 /*< RETURN >*/
292 return 0;
293
294 /* End of ZUNGHR */
295
296 /*< END >*/
297 } /* zunghr_ */
298
299 #ifdef __cplusplus
300 }
301 #endif