C_LAPACK: Fixes to make it compile with MSVC (#3605)
[platform/upstream/openblas.git] / lapack-netlib / TESTING / MATGEN / clatmt.c
1 #include <math.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <stdio.h>
5 #include <complex.h>
6 #ifdef complex
7 #undef complex
8 #endif
9 #ifdef I
10 #undef I
11 #endif
12
13 #if defined(_WIN64)
14 typedef long long BLASLONG;
15 typedef unsigned long long BLASULONG;
16 #else
17 typedef long BLASLONG;
18 typedef unsigned long BLASULONG;
19 #endif
20
21 #ifdef LAPACK_ILP64
22 typedef BLASLONG blasint;
23 #if defined(_WIN64)
24 #define blasabs(x) llabs(x)
25 #else
26 #define blasabs(x) labs(x)
27 #endif
28 #else
29 typedef int blasint;
30 #define blasabs(x) abs(x)
31 #endif
32
33 typedef blasint integer;
34
35 typedef unsigned int uinteger;
36 typedef char *address;
37 typedef short int shortint;
38 typedef float real;
39 typedef double doublereal;
40 typedef struct { real r, i; } complex;
41 typedef struct { doublereal r, i; } doublecomplex;
42 #ifdef _MSC_VER
43 static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
44 static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
45 static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
46 static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
47 #else
48 static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
49 static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
50 static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
51 static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
52 #endif
53 #define pCf(z) (*_pCf(z))
54 #define pCd(z) (*_pCd(z))
55 typedef int logical;
56 typedef short int shortlogical;
57 typedef char logical1;
58 typedef char integer1;
59
60 #define TRUE_ (1)
61 #define FALSE_ (0)
62
63 /* Extern is for use with -E */
64 #ifndef Extern
65 #define Extern extern
66 #endif
67
68 /* I/O stuff */
69
70 typedef int flag;
71 typedef int ftnlen;
72 typedef int ftnint;
73
74 /*external read, write*/
75 typedef struct
76 {       flag cierr;
77         ftnint ciunit;
78         flag ciend;
79         char *cifmt;
80         ftnint cirec;
81 } cilist;
82
83 /*internal read, write*/
84 typedef struct
85 {       flag icierr;
86         char *iciunit;
87         flag iciend;
88         char *icifmt;
89         ftnint icirlen;
90         ftnint icirnum;
91 } icilist;
92
93 /*open*/
94 typedef struct
95 {       flag oerr;
96         ftnint ounit;
97         char *ofnm;
98         ftnlen ofnmlen;
99         char *osta;
100         char *oacc;
101         char *ofm;
102         ftnint orl;
103         char *oblnk;
104 } olist;
105
106 /*close*/
107 typedef struct
108 {       flag cerr;
109         ftnint cunit;
110         char *csta;
111 } cllist;
112
113 /*rewind, backspace, endfile*/
114 typedef struct
115 {       flag aerr;
116         ftnint aunit;
117 } alist;
118
119 /* inquire */
120 typedef struct
121 {       flag inerr;
122         ftnint inunit;
123         char *infile;
124         ftnlen infilen;
125         ftnint  *inex;  /*parameters in standard's order*/
126         ftnint  *inopen;
127         ftnint  *innum;
128         ftnint  *innamed;
129         char    *inname;
130         ftnlen  innamlen;
131         char    *inacc;
132         ftnlen  inacclen;
133         char    *inseq;
134         ftnlen  inseqlen;
135         char    *indir;
136         ftnlen  indirlen;
137         char    *infmt;
138         ftnlen  infmtlen;
139         char    *inform;
140         ftnint  informlen;
141         char    *inunf;
142         ftnlen  inunflen;
143         ftnint  *inrecl;
144         ftnint  *innrec;
145         char    *inblank;
146         ftnlen  inblanklen;
147 } inlist;
148
149 #define VOID void
150
151 union Multitype {       /* for multiple entry points */
152         integer1 g;
153         shortint h;
154         integer i;
155         /* longint j; */
156         real r;
157         doublereal d;
158         complex c;
159         doublecomplex z;
160         };
161
162 typedef union Multitype Multitype;
163
164 struct Vardesc {        /* for Namelist */
165         char *name;
166         char *addr;
167         ftnlen *dims;
168         int  type;
169         };
170 typedef struct Vardesc Vardesc;
171
172 struct Namelist {
173         char *name;
174         Vardesc **vars;
175         int nvars;
176         };
177 typedef struct Namelist Namelist;
178
179 #define abs(x) ((x) >= 0 ? (x) : -(x))
180 #define dabs(x) (fabs(x))
181 #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
182 #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
183 #define dmin(a,b) (f2cmin(a,b))
184 #define dmax(a,b) (f2cmax(a,b))
185 #define bit_test(a,b)   ((a) >> (b) & 1)
186 #define bit_clear(a,b)  ((a) & ~((uinteger)1 << (b)))
187 #define bit_set(a,b)    ((a) |  ((uinteger)1 << (b)))
188
189 #define abort_() { sig_die("Fortran abort routine called", 1); }
190 #define c_abs(z) (cabsf(Cf(z)))
191 #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
192 #ifdef _MSC_VER
193 #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
194 #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
195 #else
196 #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
197 #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
198 #endif
199 #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
200 #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
201 #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
202 //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
203 #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
204 #define d_abs(x) (fabs(*(x)))
205 #define d_acos(x) (acos(*(x)))
206 #define d_asin(x) (asin(*(x)))
207 #define d_atan(x) (atan(*(x)))
208 #define d_atn2(x, y) (atan2(*(x),*(y)))
209 #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
210 #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
211 #define d_cos(x) (cos(*(x)))
212 #define d_cosh(x) (cosh(*(x)))
213 #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
214 #define d_exp(x) (exp(*(x)))
215 #define d_imag(z) (cimag(Cd(z)))
216 #define r_imag(z) (cimagf(Cf(z)))
217 #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
218 #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
219 #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
220 #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
221 #define d_log(x) (log(*(x)))
222 #define d_mod(x, y) (fmod(*(x), *(y)))
223 #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
224 #define d_nint(x) u_nint(*(x))
225 #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
226 #define d_sign(a,b) u_sign(*(a),*(b))
227 #define r_sign(a,b) u_sign(*(a),*(b))
228 #define d_sin(x) (sin(*(x)))
229 #define d_sinh(x) (sinh(*(x)))
230 #define d_sqrt(x) (sqrt(*(x)))
231 #define d_tan(x) (tan(*(x)))
232 #define d_tanh(x) (tanh(*(x)))
233 #define i_abs(x) abs(*(x))
234 #define i_dnnt(x) ((integer)u_nint(*(x)))
235 #define i_len(s, n) (n)
236 #define i_nint(x) ((integer)u_nint(*(x)))
237 #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
238 #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
239 #define pow_si(B,E) spow_ui(*(B),*(E))
240 #define pow_ri(B,E) spow_ui(*(B),*(E))
241 #define pow_di(B,E) dpow_ui(*(B),*(E))
242 #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
243 #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
244 #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
245 #define s_cat(lpp, rpp, rnp, np, llp) {         ftnlen i, nc, ll; char *f__rp, *lp;     ll = (llp); lp = (lpp);         for(i=0; i < (int)*(np); ++i) {                 nc = ll;                if((rnp)[i] < nc) nc = (rnp)[i];                ll -= nc;               f__rp = (rpp)[i];               while(--nc >= 0) *lp++ = *(f__rp)++;         }  while(--ll >= 0) *lp++ = ' '; }
246 #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
247 #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
248 #define sig_die(s, kill) { exit(1); }
249 #define s_stop(s, n) {exit(0);}
250 static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
251 #define z_abs(z) (cabs(Cd(z)))
252 #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
253 #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
254 #define myexit_() break;
255 #define mycycle() continue;
256 #define myceiling(w) {ceil(w)}
257 #define myhuge(w) {HUGE_VAL}
258 //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
259 #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
260
261 /* procedure parameter types for -A and -C++ */
262
263 #define F2C_proc_par_types 1
264 #ifdef __cplusplus
265 typedef logical (*L_fp)(...);
266 #else
267 typedef logical (*L_fp)();
268 #endif
269
270 static float spow_ui(float x, integer n) {
271         float pow=1.0; unsigned long int u;
272         if(n != 0) {
273                 if(n < 0) n = -n, x = 1/x;
274                 for(u = n; ; ) {
275                         if(u & 01) pow *= x;
276                         if(u >>= 1) x *= x;
277                         else break;
278                 }
279         }
280         return pow;
281 }
282 static double dpow_ui(double x, integer n) {
283         double pow=1.0; unsigned long int u;
284         if(n != 0) {
285                 if(n < 0) n = -n, x = 1/x;
286                 for(u = n; ; ) {
287                         if(u & 01) pow *= x;
288                         if(u >>= 1) x *= x;
289                         else break;
290                 }
291         }
292         return pow;
293 }
294 #ifdef _MSC_VER
295 static _Fcomplex cpow_ui(complex x, integer n) {
296         complex pow={1.0,0.0}; unsigned long int u;
297                 if(n != 0) {
298                 if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
299                 for(u = n; ; ) {
300                         if(u & 01) pow.r *= x.r, pow.i *= x.i;
301                         if(u >>= 1) x.r *= x.r, x.i *= x.i;
302                         else break;
303                 }
304         }
305         _Fcomplex p={pow.r, pow.i};
306         return p;
307 }
308 #else
309 static _Complex float cpow_ui(_Complex float x, integer n) {
310         _Complex float pow=1.0; unsigned long int u;
311         if(n != 0) {
312                 if(n < 0) n = -n, x = 1/x;
313                 for(u = n; ; ) {
314                         if(u & 01) pow *= x;
315                         if(u >>= 1) x *= x;
316                         else break;
317                 }
318         }
319         return pow;
320 }
321 #endif
322 #ifdef _MSC_VER
323 static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
324         _Dcomplex pow={1.0,0.0}; unsigned long int u;
325         if(n != 0) {
326                 if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
327                 for(u = n; ; ) {
328                         if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
329                         if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
330                         else break;
331                 }
332         }
333         _Dcomplex p = {pow._Val[0], pow._Val[1]};
334         return p;
335 }
336 #else
337 static _Complex double zpow_ui(_Complex double x, integer n) {
338         _Complex double pow=1.0; unsigned long int u;
339         if(n != 0) {
340                 if(n < 0) n = -n, x = 1/x;
341                 for(u = n; ; ) {
342                         if(u & 01) pow *= x;
343                         if(u >>= 1) x *= x;
344                         else break;
345                 }
346         }
347         return pow;
348 }
349 #endif
350 static integer pow_ii(integer x, integer n) {
351         integer pow; unsigned long int u;
352         if (n <= 0) {
353                 if (n == 0 || x == 1) pow = 1;
354                 else if (x != -1) pow = x == 0 ? 1/x : 0;
355                 else n = -n;
356         }
357         if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
358                 u = n;
359                 for(pow = 1; ; ) {
360                         if(u & 01) pow *= x;
361                         if(u >>= 1) x *= x;
362                         else break;
363                 }
364         }
365         return pow;
366 }
367 static integer dmaxloc_(double *w, integer s, integer e, integer *n)
368 {
369         double m; integer i, mi;
370         for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
371                 if (w[i-1]>m) mi=i ,m=w[i-1];
372         return mi-s+1;
373 }
374 static integer smaxloc_(float *w, integer s, integer e, integer *n)
375 {
376         float m; integer i, mi;
377         for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
378                 if (w[i-1]>m) mi=i ,m=w[i-1];
379         return mi-s+1;
380 }
381 static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
382         integer n = *n_, incx = *incx_, incy = *incy_, i;
383 #ifdef _MSC_VER
384         _Fcomplex zdotc = {0.0, 0.0};
385         if (incx == 1 && incy == 1) {
386                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
387                         zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
388                         zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
389                 }
390         } else {
391                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
392                         zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
393                         zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
394                 }
395         }
396         pCf(z) = zdotc;
397 }
398 #else
399         _Complex float zdotc = 0.0;
400         if (incx == 1 && incy == 1) {
401                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
402                         zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
403                 }
404         } else {
405                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
406                         zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
407                 }
408         }
409         pCf(z) = zdotc;
410 }
411 #endif
412 static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
413         integer n = *n_, incx = *incx_, incy = *incy_, i;
414 #ifdef _MSC_VER
415         _Dcomplex zdotc = {0.0, 0.0};
416         if (incx == 1 && incy == 1) {
417                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
418                         zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
419                         zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
420                 }
421         } else {
422                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
423                         zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
424                         zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
425                 }
426         }
427         pCd(z) = zdotc;
428 }
429 #else
430         _Complex double zdotc = 0.0;
431         if (incx == 1 && incy == 1) {
432                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
433                         zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
434                 }
435         } else {
436                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
437                         zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
438                 }
439         }
440         pCd(z) = zdotc;
441 }
442 #endif  
443 static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
444         integer n = *n_, incx = *incx_, incy = *incy_, i;
445 #ifdef _MSC_VER
446         _Fcomplex zdotc = {0.0, 0.0};
447         if (incx == 1 && incy == 1) {
448                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
449                         zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
450                         zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
451                 }
452         } else {
453                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
454                         zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
455                         zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
456                 }
457         }
458         pCf(z) = zdotc;
459 }
460 #else
461         _Complex float zdotc = 0.0;
462         if (incx == 1 && incy == 1) {
463                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
464                         zdotc += Cf(&x[i]) * Cf(&y[i]);
465                 }
466         } else {
467                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
468                         zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
469                 }
470         }
471         pCf(z) = zdotc;
472 }
473 #endif
474 static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
475         integer n = *n_, incx = *incx_, incy = *incy_, i;
476 #ifdef _MSC_VER
477         _Dcomplex zdotc = {0.0, 0.0};
478         if (incx == 1 && incy == 1) {
479                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
480                         zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
481                         zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
482                 }
483         } else {
484                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
485                         zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
486                         zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
487                 }
488         }
489         pCd(z) = zdotc;
490 }
491 #else
492         _Complex double zdotc = 0.0;
493         if (incx == 1 && incy == 1) {
494                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
495                         zdotc += Cd(&x[i]) * Cd(&y[i]);
496                 }
497         } else {
498                 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
499                         zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
500                 }
501         }
502         pCd(z) = zdotc;
503 }
504 #endif
505 /*  -- translated by f2c (version 20000121).
506    You must link the resulting object file with the libraries:
507         -lf2c -lm   (in that order)
508 */
509
510
511
512
513 /* Table of constant values */
514
515 static complex c_b1 = {0.f,0.f};
516 static integer c__1 = 1;
517 static integer c__5 = 5;
518 static logical c_true = TRUE_;
519 static logical c_false = FALSE_;
520
521 /* > \brief \b CLATMT */
522
523 /*  =========== DOCUMENTATION =========== */
524
525 /* Online html documentation available at */
526 /*            http://www.netlib.org/lapack/explore-html/ */
527
528 /*  Definition: */
529 /*  =========== */
530
531 /*       SUBROUTINE CLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, */
532 /*                          RANK, KL, KU, PACK, A, LDA, WORK, INFO ) */
533
534 /*       REAL               COND, DMAX */
535 /*       INTEGER            INFO, KL, KU, LDA, M, MODE, N, RANK */
536 /*       CHARACTER          DIST, PACK, SYM */
537 /*       COMPLEX            A( LDA, * ), WORK( * ) */
538 /*       REAL               D( * ) */
539 /*       INTEGER            ISEED( 4 ) */
540
541
542 /* > \par Purpose: */
543 /*  ============= */
544 /* > */
545 /* > \verbatim */
546 /* > */
547 /* >    CLATMT generates random matrices with specified singular values */
548 /* >    (or hermitian with specified eigenvalues) */
549 /* >    for testing LAPACK programs. */
550 /* > */
551 /* >    CLATMT operates by applying the following sequence of */
552 /* >    operations: */
553 /* > */
554 /* >      Set the diagonal to D, where D may be input or */
555 /* >         computed according to MODE, COND, DMAX, and SYM */
556 /* >         as described below. */
557 /* > */
558 /* >      Generate a matrix with the appropriate band structure, by one */
559 /* >         of two methods: */
560 /* > */
561 /* >      Method A: */
562 /* >          Generate a dense M x N matrix by multiplying D on the left */
563 /* >              and the right by random unitary matrices, then: */
564 /* > */
565 /* >          Reduce the bandwidth according to KL and KU, using */
566 /* >              Householder transformations. */
567 /* > */
568 /* >      Method B: */
569 /* >          Convert the bandwidth-0 (i.e., diagonal) matrix to a */
570 /* >              bandwidth-1 matrix using Givens rotations, "chasing" */
571 /* >              out-of-band elements back, much as in QR; then convert */
572 /* >              the bandwidth-1 to a bandwidth-2 matrix, etc.  Note */
573 /* >              that for reasonably small bandwidths (relative to M and */
574 /* >              N) this requires less storage, as a dense matrix is not */
575 /* >              generated.  Also, for hermitian or symmetric matrices, */
576 /* >              only one triangle is generated. */
577 /* > */
578 /* >      Method A is chosen if the bandwidth is a large fraction of the */
579 /* >          order of the matrix, and LDA is at least M (so a dense */
580 /* >          matrix can be stored.)  Method B is chosen if the bandwidth */
581 /* >          is small (< 1/2 N for hermitian or symmetric, < .3 N+M for */
582 /* >          non-symmetric), or LDA is less than M and not less than the */
583 /* >          bandwidth. */
584 /* > */
585 /* >      Pack the matrix if desired. Options specified by PACK are: */
586 /* >         no packing */
587 /* >         zero out upper half (if hermitian) */
588 /* >         zero out lower half (if hermitian) */
589 /* >         store the upper half columnwise (if hermitian or upper */
590 /* >               triangular) */
591 /* >         store the lower half columnwise (if hermitian or lower */
592 /* >               triangular) */
593 /* >         store the lower triangle in banded format (if hermitian or */
594 /* >               lower triangular) */
595 /* >         store the upper triangle in banded format (if hermitian or */
596 /* >               upper triangular) */
597 /* >         store the entire matrix in banded format */
598 /* >      If Method B is chosen, and band format is specified, then the */
599 /* >         matrix will be generated in the band format, so no repacking */
600 /* >         will be necessary. */
601 /* > \endverbatim */
602
603 /*  Arguments: */
604 /*  ========== */
605
606 /* > \param[in] M */
607 /* > \verbatim */
608 /* >          M is INTEGER */
609 /* >           The number of rows of A. Not modified. */
610 /* > \endverbatim */
611 /* > */
612 /* > \param[in] N */
613 /* > \verbatim */
614 /* >          N is INTEGER */
615 /* >           The number of columns of A. N must equal M if the matrix */
616 /* >           is symmetric or hermitian (i.e., if SYM is not 'N') */
617 /* >           Not modified. */
618 /* > \endverbatim */
619 /* > */
620 /* > \param[in] DIST */
621 /* > \verbatim */
622 /* >          DIST is CHARACTER*1 */
623 /* >           On entry, DIST specifies the type of distribution to be used */
624 /* >           to generate the random eigen-/singular values. */
625 /* >           'U' => UNIFORM( 0, 1 )  ( 'U' for uniform ) */
626 /* >           'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) */
627 /* >           'N' => NORMAL( 0, 1 )   ( 'N' for normal ) */
628 /* >           Not modified. */
629 /* > \endverbatim */
630 /* > */
631 /* > \param[in,out] ISEED */
632 /* > \verbatim */
633 /* >          ISEED is INTEGER array, dimension ( 4 ) */
634 /* >           On entry ISEED specifies the seed of the random number */
635 /* >           generator. They should lie between 0 and 4095 inclusive, */
636 /* >           and ISEED(4) should be odd. The random number generator */
637 /* >           uses a linear congruential sequence limited to small */
638 /* >           integers, and so should produce machine independent */
639 /* >           random numbers. The values of ISEED are changed on */
640 /* >           exit, and can be used in the next call to CLATMT */
641 /* >           to continue the same random number sequence. */
642 /* >           Changed on exit. */
643 /* > \endverbatim */
644 /* > */
645 /* > \param[in] SYM */
646 /* > \verbatim */
647 /* >          SYM is CHARACTER*1 */
648 /* >           If SYM='H', the generated matrix is hermitian, with */
649 /* >             eigenvalues specified by D, COND, MODE, and DMAX; they */
650 /* >             may be positive, negative, or zero. */
651 /* >           If SYM='P', the generated matrix is hermitian, with */
652 /* >             eigenvalues (= singular values) specified by D, COND, */
653 /* >             MODE, and DMAX; they will not be negative. */
654 /* >           If SYM='N', the generated matrix is nonsymmetric, with */
655 /* >             singular values specified by D, COND, MODE, and DMAX; */
656 /* >             they will not be negative. */
657 /* >           If SYM='S', the generated matrix is (complex) symmetric, */
658 /* >             with singular values specified by D, COND, MODE, and */
659 /* >             DMAX; they will not be negative. */
660 /* >           Not modified. */
661 /* > \endverbatim */
662 /* > */
663 /* > \param[in,out] D */
664 /* > \verbatim */
665 /* >          D is REAL array, dimension ( MIN( M, N ) ) */
666 /* >           This array is used to specify the singular values or */
667 /* >           eigenvalues of A (see SYM, above.)  If MODE=0, then D is */
668 /* >           assumed to contain the singular/eigenvalues, otherwise */
669 /* >           they will be computed according to MODE, COND, and DMAX, */
670 /* >           and placed in D. */
671 /* >           Modified if MODE is nonzero. */
672 /* > \endverbatim */
673 /* > */
674 /* > \param[in] MODE */
675 /* > \verbatim */
676 /* >          MODE is INTEGER */
677 /* >           On entry this describes how the singular/eigenvalues are to */
678 /* >           be specified: */
679 /* >           MODE = 0 means use D as input */
680 /* >           MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND */
681 /* >           MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND */
682 /* >           MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1)) */
683 /* >           MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) */
684 /* >           MODE = 5 sets D to random numbers in the range */
685 /* >                    ( 1/COND , 1 ) such that their logarithms */
686 /* >                    are uniformly distributed. */
687 /* >           MODE = 6 set D to random numbers from same distribution */
688 /* >                    as the rest of the matrix. */
689 /* >           MODE < 0 has the same meaning as ABS(MODE), except that */
690 /* >              the order of the elements of D is reversed. */
691 /* >           Thus if MODE is positive, D has entries ranging from */
692 /* >              1 to 1/COND, if negative, from 1/COND to 1, */
693 /* >           If SYM='H', and MODE is neither 0, 6, nor -6, then */
694 /* >              the elements of D will also be multiplied by a random */
695 /* >              sign (i.e., +1 or -1.) */
696 /* >           Not modified. */
697 /* > \endverbatim */
698 /* > */
699 /* > \param[in] COND */
700 /* > \verbatim */
701 /* >          COND is REAL */
702 /* >           On entry, this is used as described under MODE above. */
703 /* >           If used, it must be >= 1. Not modified. */
704 /* > \endverbatim */
705 /* > */
706 /* > \param[in] DMAX */
707 /* > \verbatim */
708 /* >          DMAX is REAL */
709 /* >           If MODE is neither -6, 0 nor 6, the contents of D, as */
710 /* >           computed according to MODE and COND, will be scaled by */
711 /* >           DMAX / f2cmax(abs(D(i))); thus, the maximum absolute eigen- or */
712 /* >           singular value (which is to say the norm) will be abs(DMAX). */
713 /* >           Note that DMAX need not be positive: if DMAX is negative */
714 /* >           (or zero), D will be scaled by a negative number (or zero). */
715 /* >           Not modified. */
716 /* > \endverbatim */
717 /* > */
718 /* > \param[in] RANK */
719 /* > \verbatim */
720 /* >          RANK is INTEGER */
721 /* >           The rank of matrix to be generated for modes 1,2,3 only. */
722 /* >           D( RANK+1:N ) = 0. */
723 /* >           Not modified. */
724 /* > \endverbatim */
725 /* > */
726 /* > \param[in] KL */
727 /* > \verbatim */
728 /* >          KL is INTEGER */
729 /* >           This specifies the lower bandwidth of the  matrix. For */
730 /* >           example, KL=0 implies upper triangular, KL=1 implies upper */
731 /* >           Hessenberg, and KL being at least M-1 means that the matrix */
732 /* >           has full lower bandwidth.  KL must equal KU if the matrix */
733 /* >           is symmetric or hermitian. */
734 /* >           Not modified. */
735 /* > \endverbatim */
736 /* > */
737 /* > \param[in] KU */
738 /* > \verbatim */
739 /* >          KU is INTEGER */
740 /* >           This specifies the upper bandwidth of the  matrix. For */
741 /* >           example, KU=0 implies lower triangular, KU=1 implies lower */
742 /* >           Hessenberg, and KU being at least N-1 means that the matrix */
743 /* >           has full upper bandwidth.  KL must equal KU if the matrix */
744 /* >           is symmetric or hermitian. */
745 /* >           Not modified. */
746 /* > \endverbatim */
747 /* > */
748 /* > \param[in] PACK */
749 /* > \verbatim */
750 /* >          PACK is CHARACTER*1 */
751 /* >           This specifies packing of matrix as follows: */
752 /* >           'N' => no packing */
753 /* >           'U' => zero out all subdiagonal entries (if symmetric */
754 /* >                  or hermitian) */
755 /* >           'L' => zero out all superdiagonal entries (if symmetric */
756 /* >                  or hermitian) */
757 /* >           'C' => store the upper triangle columnwise (only if the */
758 /* >                  matrix is symmetric, hermitian, or upper triangular) */
759 /* >           'R' => store the lower triangle columnwise (only if the */
760 /* >                  matrix is symmetric, hermitian, or lower triangular) */
761 /* >           'B' => store the lower triangle in band storage scheme */
762 /* >                  (only if the matrix is symmetric, hermitian, or */
763 /* >                  lower triangular) */
764 /* >           'Q' => store the upper triangle in band storage scheme */
765 /* >                  (only if the matrix is symmetric, hermitian, or */
766 /* >                  upper triangular) */
767 /* >           'Z' => store the entire matrix in band storage scheme */
768 /* >                      (pivoting can be provided for by using this */
769 /* >                      option to store A in the trailing rows of */
770 /* >                      the allocated storage) */
771 /* > */
772 /* >           Using these options, the various LAPACK packed and banded */
773 /* >           storage schemes can be obtained: */
774 /* >           GB                    - use 'Z' */
775 /* >           PB, SB, HB, or TB     - use 'B' or 'Q' */
776 /* >           PP, SP, HB, or TP     - use 'C' or 'R' */
777 /* > */
778 /* >           If two calls to CLATMT differ only in the PACK parameter, */
779 /* >           they will generate mathematically equivalent matrices. */
780 /* >           Not modified. */
781 /* > \endverbatim */
782 /* > */
783 /* > \param[in,out] A */
784 /* > \verbatim */
785 /* >          A is COMPLEX array, dimension ( LDA, N ) */
786 /* >           On exit A is the desired test matrix.  A is first generated */
787 /* >           in full (unpacked) form, and then packed, if so specified */
788 /* >           by PACK.  Thus, the first M elements of the first N */
789 /* >           columns will always be modified.  If PACK specifies a */
790 /* >           packed or banded storage scheme, all LDA elements of the */
791 /* >           first N columns will be modified; the elements of the */
792 /* >           array which do not correspond to elements of the generated */
793 /* >           matrix are set to zero. */
794 /* >           Modified. */
795 /* > \endverbatim */
796 /* > */
797 /* > \param[in] LDA */
798 /* > \verbatim */
799 /* >          LDA is INTEGER */
800 /* >           LDA specifies the first dimension of A as declared in the */
801 /* >           calling program.  If PACK='N', 'U', 'L', 'C', or 'R', then */
802 /* >           LDA must be at least M.  If PACK='B' or 'Q', then LDA must */
803 /* >           be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)). */
804 /* >           If PACK='Z', LDA must be large enough to hold the packed */
805 /* >           array: MIN( KU, N-1) + MIN( KL, M-1) + 1. */
806 /* >           Not modified. */
807 /* > \endverbatim */
808 /* > */
809 /* > \param[out] WORK */
810 /* > \verbatim */
811 /* >          WORK is COMPLEX array, dimension ( 3*MAX( N, M ) ) */
812 /* >           Workspace. */
813 /* >           Modified. */
814 /* > \endverbatim */
815 /* > */
816 /* > \param[out] INFO */
817 /* > \verbatim */
818 /* >          INFO is INTEGER */
819 /* >           Error code.  On exit, INFO will be set to one of the */
820 /* >           following values: */
821 /* >             0 => normal return */
822 /* >            -1 => M negative or unequal to N and SYM='S', 'H', or 'P' */
823 /* >            -2 => N negative */
824 /* >            -3 => DIST illegal string */
825 /* >            -5 => SYM illegal string */
826 /* >            -7 => MODE not in range -6 to 6 */
827 /* >            -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 */
828 /* >           -10 => KL negative */
829 /* >           -11 => KU negative, or SYM is not 'N' and KU is not equal to */
830 /* >                  KL */
831 /* >           -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N'; */
832 /* >                  or PACK='C' or 'Q' and SYM='N' and KL is not zero; */
833 /* >                  or PACK='R' or 'B' and SYM='N' and KU is not zero; */
834 /* >                  or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not */
835 /* >                  N. */
836 /* >           -14 => LDA is less than M, or PACK='Z' and LDA is less than */
837 /* >                  MIN(KU,N-1) + MIN(KL,M-1) + 1. */
838 /* >            1  => Error return from SLATM7 */
839 /* >            2  => Cannot scale to DMAX (f2cmax. sing. value is 0) */
840 /* >            3  => Error return from CLAGGE, CLAGHE or CLAGSY */
841 /* > \endverbatim */
842
843 /*  Authors: */
844 /*  ======== */
845
846 /* > \author Univ. of Tennessee */
847 /* > \author Univ. of California Berkeley */
848 /* > \author Univ. of Colorado Denver */
849 /* > \author NAG Ltd. */
850
851 /* > \date December 2016 */
852
853 /* > \ingroup complex_matgen */
854
855 /*  ===================================================================== */
856 /* Subroutine */ int clatmt_(integer *m, integer *n, char *dist, integer *
857         iseed, char *sym, real *d__, integer *mode, real *cond, real *dmax__, 
858         integer *rank, integer *kl, integer *ku, char *pack, complex *a, 
859         integer *lda, complex *work, integer *info)
860 {
861     /* System generated locals */
862     integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6;
863     real r__1, r__2, r__3;
864     complex q__1, q__2, q__3;
865     logical L__1;
866
867     /* Local variables */
868     integer ilda, icol;
869     real temp;
870     logical csym;
871     integer irow, isym;
872     complex c__;
873     integer i__, j, k;
874     complex s;
875     real alpha, angle, realc;
876     integer ipack, ioffg;
877     extern logical lsame_(char *, char *);
878     integer iinfo;
879     extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *);
880     complex ctemp;
881     integer idist, mnmin;
882     complex extra;
883     integer iskew;
884     complex dummy;
885     extern /* Subroutine */ int slatm7_(integer *, real *, integer *, integer 
886             *, integer *, real *, integer *, integer *, integer *);
887     integer ic, jc, nc;
888     extern /* Subroutine */ int clagge_(integer *, integer *, integer *, 
889             integer *, real *, complex *, integer *, integer *, complex *, 
890             integer *), claghe_(integer *, integer *, real *, complex *, 
891             integer *, integer *, complex *, integer *);
892     integer il;
893     complex ct;
894     integer iendch, ir, jr, ipackg, mr;
895     //extern /* Complex */ VOID clarnd_(complex *, integer *, integer *);
896     extern complex clarnd_(integer *, integer *);
897     integer minlda;
898     complex st;
899     extern /* Subroutine */ int claset_(char *, integer *, integer *, complex 
900             *, complex *, complex *, integer *), clartg_(complex *, 
901             complex *, real *, complex *, complex *), xerbla_(char *, integer 
902             *), clagsy_(integer *, integer *, real *, complex *, 
903             integer *, integer *, complex *, integer *);
904     extern real slarnd_(integer *, integer *);
905     extern /* Subroutine */ int clarot_(logical *, logical *, logical *, 
906             integer *, complex *, complex *, complex *, integer *, complex *, 
907             complex *);
908     integer ioffst, irsign;
909     logical givens, iltemp, ilextr, topdwn;
910     integer ir1, ir2, isympk, jch, llb, jkl, jku, uub;
911
912
913 /*  -- LAPACK computational routine (version 3.7.0) -- */
914 /*  -- LAPACK is a software package provided by Univ. of Tennessee,    -- */
915 /*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
916 /*     December 2016 */
917
918
919 /*  ===================================================================== */
920
921
922 /*     1)      Decode and Test the input parameters. */
923 /*             Initialize flags & seed. */
924
925     /* Parameter adjustments */
926     --iseed;
927     --d__;
928     a_dim1 = *lda;
929     a_offset = 1 + a_dim1 * 1;
930     a -= a_offset;
931     --work;
932
933     /* Function Body */
934     *info = 0;
935
936 /*     Quick return if possible */
937
938     if (*m == 0 || *n == 0) {
939         return 0;
940     }
941
942 /*     Decode DIST */
943
944     if (lsame_(dist, "U")) {
945         idist = 1;
946     } else if (lsame_(dist, "S")) {
947         idist = 2;
948     } else if (lsame_(dist, "N")) {
949         idist = 3;
950     } else {
951         idist = -1;
952     }
953
954 /*     Decode SYM */
955
956     if (lsame_(sym, "N")) {
957         isym = 1;
958         irsign = 0;
959         csym = FALSE_;
960     } else if (lsame_(sym, "P")) {
961         isym = 2;
962         irsign = 0;
963         csym = FALSE_;
964     } else if (lsame_(sym, "S")) {
965         isym = 2;
966         irsign = 0;
967         csym = TRUE_;
968     } else if (lsame_(sym, "H")) {
969         isym = 2;
970         irsign = 1;
971         csym = FALSE_;
972     } else {
973         isym = -1;
974     }
975
976 /*     Decode PACK */
977
978     isympk = 0;
979     if (lsame_(pack, "N")) {
980         ipack = 0;
981     } else if (lsame_(pack, "U")) {
982         ipack = 1;
983         isympk = 1;
984     } else if (lsame_(pack, "L")) {
985         ipack = 2;
986         isympk = 1;
987     } else if (lsame_(pack, "C")) {
988         ipack = 3;
989         isympk = 2;
990     } else if (lsame_(pack, "R")) {
991         ipack = 4;
992         isympk = 3;
993     } else if (lsame_(pack, "B")) {
994         ipack = 5;
995         isympk = 3;
996     } else if (lsame_(pack, "Q")) {
997         ipack = 6;
998         isympk = 2;
999     } else if (lsame_(pack, "Z")) {
1000         ipack = 7;
1001     } else {
1002         ipack = -1;
1003     }
1004
1005 /*     Set certain internal parameters */
1006
1007     mnmin = f2cmin(*m,*n);
1008 /* Computing MIN */
1009     i__1 = *kl, i__2 = *m - 1;
1010     llb = f2cmin(i__1,i__2);
1011 /* Computing MIN */
1012     i__1 = *ku, i__2 = *n - 1;
1013     uub = f2cmin(i__1,i__2);
1014 /* Computing MIN */
1015     i__1 = *m, i__2 = *n + llb;
1016     mr = f2cmin(i__1,i__2);
1017 /* Computing MIN */
1018     i__1 = *n, i__2 = *m + uub;
1019     nc = f2cmin(i__1,i__2);
1020
1021     if (ipack == 5 || ipack == 6) {
1022         minlda = uub + 1;
1023     } else if (ipack == 7) {
1024         minlda = llb + uub + 1;
1025     } else {
1026         minlda = *m;
1027     }
1028
1029 /*     Use Givens rotation method if bandwidth small enough, */
1030 /*     or if LDA is too small to store the matrix unpacked. */
1031
1032     givens = FALSE_;
1033     if (isym == 1) {
1034 /* Computing MAX */
1035         i__1 = 1, i__2 = mr + nc;
1036         if ((real) (llb + uub) < (real) f2cmax(i__1,i__2) * .3f) {
1037             givens = TRUE_;
1038         }
1039     } else {
1040         if (llb << 1 < *m) {
1041             givens = TRUE_;
1042         }
1043     }
1044     if (*lda < *m && *lda >= minlda) {
1045         givens = TRUE_;
1046     }
1047
1048 /*     Set INFO if an error */
1049
1050     if (*m < 0) {
1051         *info = -1;
1052     } else if (*m != *n && isym != 1) {
1053         *info = -1;
1054     } else if (*n < 0) {
1055         *info = -2;
1056     } else if (idist == -1) {
1057         *info = -3;
1058     } else if (isym == -1) {
1059         *info = -5;
1060     } else if (abs(*mode) > 6) {
1061         *info = -7;
1062     } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.f) {
1063         *info = -8;
1064     } else if (*kl < 0) {
1065         *info = -10;
1066     } else if (*ku < 0 || isym != 1 && *kl != *ku) {
1067         *info = -11;
1068     } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym 
1069             == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk 
1070             != 0 && *m != *n) {
1071         *info = -12;
1072     } else if (*lda < f2cmax(1,minlda)) {
1073         *info = -14;
1074     }
1075
1076     if (*info != 0) {
1077         i__1 = -(*info);
1078         xerbla_("CLATMT", &i__1);
1079         return 0;
1080     }
1081
1082 /*     Initialize random number generator */
1083
1084     for (i__ = 1; i__ <= 4; ++i__) {
1085         iseed[i__] = (i__1 = iseed[i__], abs(i__1)) % 4096;
1086 /* L100: */
1087     }
1088
1089     if (iseed[4] % 2 != 1) {
1090         ++iseed[4];
1091     }
1092
1093 /*     2)      Set up D  if indicated. */
1094
1095 /*             Compute D according to COND and MODE */
1096
1097     slatm7_(mode, cond, &irsign, &idist, &iseed[1], &d__[1], &mnmin, rank, &
1098             iinfo);
1099     if (iinfo != 0) {
1100         *info = 1;
1101         return 0;
1102     }
1103
1104 /*     Choose Top-Down if D is (apparently) increasing, */
1105 /*     Bottom-Up if D is (apparently) decreasing. */
1106
1107     if (abs(d__[1]) <= (r__1 = d__[*rank], abs(r__1))) {
1108         topdwn = TRUE_;
1109     } else {
1110         topdwn = FALSE_;
1111     }
1112
1113     if (*mode != 0 && abs(*mode) != 6) {
1114
1115 /*        Scale by DMAX */
1116
1117         temp = abs(d__[1]);
1118         i__1 = *rank;
1119         for (i__ = 2; i__ <= i__1; ++i__) {
1120 /* Computing MAX */
1121             r__2 = temp, r__3 = (r__1 = d__[i__], abs(r__1));
1122             temp = f2cmax(r__2,r__3);
1123 /* L110: */
1124         }
1125
1126         if (temp > 0.f) {
1127             alpha = *dmax__ / temp;
1128         } else {
1129             *info = 2;
1130             return 0;
1131         }
1132
1133         sscal_(rank, &alpha, &d__[1], &c__1);
1134
1135     }
1136
1137     claset_("Full", lda, n, &c_b1, &c_b1, &a[a_offset], lda);
1138
1139 /*     3)      Generate Banded Matrix using Givens rotations. */
1140 /*             Also the special case of UUB=LLB=0 */
1141
1142 /*               Compute Addressing constants to cover all */
1143 /*               storage formats.  Whether GE, HE, SY, GB, HB, or SB, */
1144 /*               upper or lower triangle or both, */
1145 /*               the (i,j)-th element is in */
1146 /*               A( i - ISKEW*j + IOFFST, j ) */
1147
1148     if (ipack > 4) {
1149         ilda = *lda - 1;
1150         iskew = 1;
1151         if (ipack > 5) {
1152             ioffst = uub + 1;
1153         } else {
1154             ioffst = 1;
1155         }
1156     } else {
1157         ilda = *lda;
1158         iskew = 0;
1159         ioffst = 0;
1160     }
1161
1162 /*     IPACKG is the format that the matrix is generated in. If this is */
1163 /*     different from IPACK, then the matrix must be repacked at the */
1164 /*     end.  It also signals how to compute the norm, for scaling. */
1165
1166     ipackg = 0;
1167
1168 /*     Diagonal Matrix -- We are done, unless it */
1169 /*     is to be stored HP/SP/PP/TP (PACK='R' or 'C') */
1170
1171     if (llb == 0 && uub == 0) {
1172         i__1 = mnmin;
1173         for (j = 1; j <= i__1; ++j) {
1174             i__2 = (1 - iskew) * j + ioffst + j * a_dim1;
1175             i__3 = j;
1176             q__1.r = d__[i__3], q__1.i = 0.f;
1177             a[i__2].r = q__1.r, a[i__2].i = q__1.i;
1178 /* L120: */
1179         }
1180
1181         if (ipack <= 2 || ipack >= 5) {
1182             ipackg = ipack;
1183         }
1184
1185     } else if (givens) {
1186
1187 /*        Check whether to use Givens rotations, */
1188 /*        Householder transformations, or nothing. */
1189
1190         if (isym == 1) {
1191
1192 /*           Non-symmetric -- A = U D V */
1193
1194             if (ipack > 4) {
1195                 ipackg = ipack;
1196             } else {
1197                 ipackg = 0;
1198             }
1199
1200             i__1 = mnmin;
1201             for (j = 1; j <= i__1; ++j) {
1202                 i__2 = (1 - iskew) * j + ioffst + j * a_dim1;
1203                 i__3 = j;
1204                 q__1.r = d__[i__3], q__1.i = 0.f;
1205                 a[i__2].r = q__1.r, a[i__2].i = q__1.i;
1206 /* L130: */
1207             }
1208
1209             if (topdwn) {
1210                 jkl = 0;
1211                 i__1 = uub;
1212                 for (jku = 1; jku <= i__1; ++jku) {
1213
1214 /*                 Transform from bandwidth JKL, JKU-1 to JKL, JKU */
1215
1216 /*                 Last row actually rotated is M */
1217 /*                 Last column actually rotated is MIN( M+JKU, N ) */
1218
1219 /* Computing MIN */
1220                     i__3 = *m + jku;
1221                     i__2 = f2cmin(i__3,*n) + jkl - 1;
1222                     for (jr = 1; jr <= i__2; ++jr) {
1223                         extra.r = 0.f, extra.i = 0.f;
1224                         angle = slarnd_(&c__1, &iseed[1]) * 
1225                                 6.2831853071795864769252867663f;
1226                         r__1 = cos(angle);
1227                         //clarnd_(&q__2, &c__5, &iseed[1]);
1228                         q__2=clarnd_(&c__5, &iseed[1]);
1229                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1230                         c__.r = q__1.r, c__.i = q__1.i;
1231                         r__1 = sin(angle);
1232                         //clarnd_(&q__2, &c__5, &iseed[1]);
1233                         q__2=clarnd_(&c__5, &iseed[1]);
1234                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1235                         s.r = q__1.r, s.i = q__1.i;
1236 /* Computing MAX */
1237                         i__3 = 1, i__4 = jr - jkl;
1238                         icol = f2cmax(i__3,i__4);
1239                         if (jr < *m) {
1240 /* Computing MIN */
1241                             i__3 = *n, i__4 = jr + jku;
1242                             il = f2cmin(i__3,i__4) + 1 - icol;
1243                             L__1 = jr > jkl;
1244                             clarot_(&c_true, &L__1, &c_false, &il, &c__, &s, &
1245                                     a[jr - iskew * icol + ioffst + icol * 
1246                                     a_dim1], &ilda, &extra, &dummy);
1247                         }
1248
1249 /*                    Chase "EXTRA" back up */
1250
1251                         ir = jr;
1252                         ic = icol;
1253                         i__3 = -jkl - jku;
1254                         for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1; 
1255                                 jch += i__3) {
1256                             if (ir < *m) {
1257                                 clartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst 
1258                                         + (ic + 1) * a_dim1], &extra, &realc, 
1259                                         &s, &dummy);
1260                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1261                                 q__1=clarnd_(&c__5, &iseed[1]);
1262                                 dummy.r = q__1.r, dummy.i = q__1.i;
1263                                 q__2.r = realc * dummy.r, q__2.i = realc * 
1264                                         dummy.i;
1265                                 r_cnjg(&q__1, &q__2);
1266                                 c__.r = q__1.r, c__.i = q__1.i;
1267                                 q__3.r = -s.r, q__3.i = -s.i;
1268                                 q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, 
1269                                         q__2.i = q__3.r * dummy.i + q__3.i * 
1270                                         dummy.r;
1271                                 r_cnjg(&q__1, &q__2);
1272                                 s.r = q__1.r, s.i = q__1.i;
1273                             }
1274 /* Computing MAX */
1275                             i__4 = 1, i__5 = jch - jku;
1276                             irow = f2cmax(i__4,i__5);
1277                             il = ir + 2 - irow;
1278                             ctemp.r = 0.f, ctemp.i = 0.f;
1279                             iltemp = jch > jku;
1280                             clarot_(&c_false, &iltemp, &c_true, &il, &c__, &s,
1281                                      &a[irow - iskew * ic + ioffst + ic * 
1282                                     a_dim1], &ilda, &ctemp, &extra);
1283                             if (iltemp) {
1284                                 clartg_(&a[irow + 1 - iskew * (ic + 1) + 
1285                                         ioffst + (ic + 1) * a_dim1], &ctemp, &
1286                                         realc, &s, &dummy);
1287                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1288                                 q__1=clarnd_(&c__5, &iseed[1]);
1289                                 dummy.r = q__1.r, dummy.i = q__1.i;
1290                                 q__2.r = realc * dummy.r, q__2.i = realc * 
1291                                         dummy.i;
1292                                 r_cnjg(&q__1, &q__2);
1293                                 c__.r = q__1.r, c__.i = q__1.i;
1294                                 q__3.r = -s.r, q__3.i = -s.i;
1295                                 q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, 
1296                                         q__2.i = q__3.r * dummy.i + q__3.i * 
1297                                         dummy.r;
1298                                 r_cnjg(&q__1, &q__2);
1299                                 s.r = q__1.r, s.i = q__1.i;
1300
1301 /* Computing MAX */
1302                                 i__4 = 1, i__5 = jch - jku - jkl;
1303                                 icol = f2cmax(i__4,i__5);
1304                                 il = ic + 2 - icol;
1305                                 extra.r = 0.f, extra.i = 0.f;
1306                                 L__1 = jch > jku + jkl;
1307                                 clarot_(&c_true, &L__1, &c_true, &il, &c__, &
1308                                         s, &a[irow - iskew * icol + ioffst + 
1309                                         icol * a_dim1], &ilda, &extra, &ctemp)
1310                                         ;
1311                                 ic = icol;
1312                                 ir = irow;
1313                             }
1314 /* L140: */
1315                         }
1316 /* L150: */
1317                     }
1318 /* L160: */
1319                 }
1320
1321                 jku = uub;
1322                 i__1 = llb;
1323                 for (jkl = 1; jkl <= i__1; ++jkl) {
1324
1325 /*                 Transform from bandwidth JKL-1, JKU to JKL, JKU */
1326
1327 /* Computing MIN */
1328                     i__3 = *n + jkl;
1329                     i__2 = f2cmin(i__3,*m) + jku - 1;
1330                     for (jc = 1; jc <= i__2; ++jc) {
1331                         extra.r = 0.f, extra.i = 0.f;
1332                         angle = slarnd_(&c__1, &iseed[1]) * 
1333                                 6.2831853071795864769252867663f;
1334                         r__1 = cos(angle);
1335                         //clarnd_(&q__2, &c__5, &iseed[1]);
1336                         q__2=clarnd_(&c__5, &iseed[1]);
1337                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1338                         c__.r = q__1.r, c__.i = q__1.i;
1339                         r__1 = sin(angle);
1340                         //clarnd_(&q__2, &c__5, &iseed[1]);
1341                         q__2=clarnd_(&c__5, &iseed[1]);
1342                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1343                         s.r = q__1.r, s.i = q__1.i;
1344 /* Computing MAX */
1345                         i__3 = 1, i__4 = jc - jku;
1346                         irow = f2cmax(i__3,i__4);
1347                         if (jc < *n) {
1348 /* Computing MIN */
1349                             i__3 = *m, i__4 = jc + jkl;
1350                             il = f2cmin(i__3,i__4) + 1 - irow;
1351                             L__1 = jc > jku;
1352                             clarot_(&c_false, &L__1, &c_false, &il, &c__, &s, 
1353                                     &a[irow - iskew * jc + ioffst + jc * 
1354                                     a_dim1], &ilda, &extra, &dummy);
1355                         }
1356
1357 /*                    Chase "EXTRA" back up */
1358
1359                         ic = jc;
1360                         ir = irow;
1361                         i__3 = -jkl - jku;
1362                         for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1; 
1363                                 jch += i__3) {
1364                             if (ic < *n) {
1365                                 clartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst 
1366                                         + (ic + 1) * a_dim1], &extra, &realc, 
1367                                         &s, &dummy);
1368                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1369                                 q__1=clarnd_(&c__5, &iseed[1]);
1370                                 dummy.r = q__1.r, dummy.i = q__1.i;
1371                                 q__2.r = realc * dummy.r, q__2.i = realc * 
1372                                         dummy.i;
1373                                 r_cnjg(&q__1, &q__2);
1374                                 c__.r = q__1.r, c__.i = q__1.i;
1375                                 q__3.r = -s.r, q__3.i = -s.i;
1376                                 q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, 
1377                                         q__2.i = q__3.r * dummy.i + q__3.i * 
1378                                         dummy.r;
1379                                 r_cnjg(&q__1, &q__2);
1380                                 s.r = q__1.r, s.i = q__1.i;
1381                             }
1382 /* Computing MAX */
1383                             i__4 = 1, i__5 = jch - jkl;
1384                             icol = f2cmax(i__4,i__5);
1385                             il = ic + 2 - icol;
1386                             ctemp.r = 0.f, ctemp.i = 0.f;
1387                             iltemp = jch > jkl;
1388                             clarot_(&c_true, &iltemp, &c_true, &il, &c__, &s, 
1389                                     &a[ir - iskew * icol + ioffst + icol * 
1390                                     a_dim1], &ilda, &ctemp, &extra);
1391                             if (iltemp) {
1392                                 clartg_(&a[ir + 1 - iskew * (icol + 1) + 
1393                                         ioffst + (icol + 1) * a_dim1], &ctemp,
1394                                          &realc, &s, &dummy);
1395                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1396                                 q__1=clarnd_(&c__5, &iseed[1]);
1397                                 dummy.r = q__1.r, dummy.i = q__1.i;
1398                                 q__2.r = realc * dummy.r, q__2.i = realc * 
1399                                         dummy.i;
1400                                 r_cnjg(&q__1, &q__2);
1401                                 c__.r = q__1.r, c__.i = q__1.i;
1402                                 q__3.r = -s.r, q__3.i = -s.i;
1403                                 q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, 
1404                                         q__2.i = q__3.r * dummy.i + q__3.i * 
1405                                         dummy.r;
1406                                 r_cnjg(&q__1, &q__2);
1407                                 s.r = q__1.r, s.i = q__1.i;
1408 /* Computing MAX */
1409                                 i__4 = 1, i__5 = jch - jkl - jku;
1410                                 irow = f2cmax(i__4,i__5);
1411                                 il = ir + 2 - irow;
1412                                 extra.r = 0.f, extra.i = 0.f;
1413                                 L__1 = jch > jkl + jku;
1414                                 clarot_(&c_false, &L__1, &c_true, &il, &c__, &
1415                                         s, &a[irow - iskew * icol + ioffst + 
1416                                         icol * a_dim1], &ilda, &extra, &ctemp)
1417                                         ;
1418                                 ic = icol;
1419                                 ir = irow;
1420                             }
1421 /* L170: */
1422                         }
1423 /* L180: */
1424                     }
1425 /* L190: */
1426                 }
1427
1428             } else {
1429
1430 /*              Bottom-Up -- Start at the bottom right. */
1431
1432                 jkl = 0;
1433                 i__1 = uub;
1434                 for (jku = 1; jku <= i__1; ++jku) {
1435
1436 /*                 Transform from bandwidth JKL, JKU-1 to JKL, JKU */
1437
1438 /*                 First row actually rotated is M */
1439 /*                 First column actually rotated is MIN( M+JKU, N ) */
1440
1441 /* Computing MIN */
1442                     i__2 = *m, i__3 = *n + jkl;
1443                     iendch = f2cmin(i__2,i__3) - 1;
1444 /* Computing MIN */
1445                     i__2 = *m + jku;
1446                     i__3 = 1 - jkl;
1447                     for (jc = f2cmin(i__2,*n) - 1; jc >= i__3; --jc) {
1448                         extra.r = 0.f, extra.i = 0.f;
1449                         angle = slarnd_(&c__1, &iseed[1]) * 
1450                                 6.2831853071795864769252867663f;
1451                         r__1 = cos(angle);
1452                         //clarnd_(&q__2, &c__5, &iseed[1]);
1453                         q__2=clarnd_(&c__5, &iseed[1]);
1454                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1455                         c__.r = q__1.r, c__.i = q__1.i;
1456                         r__1 = sin(angle);
1457                         //clarnd_(&q__2, &c__5, &iseed[1]);
1458                         q__2=clarnd_(&c__5, &iseed[1]);
1459                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1460                         s.r = q__1.r, s.i = q__1.i;
1461 /* Computing MAX */
1462                         i__2 = 1, i__4 = jc - jku + 1;
1463                         irow = f2cmax(i__2,i__4);
1464                         if (jc > 0) {
1465 /* Computing MIN */
1466                             i__2 = *m, i__4 = jc + jkl + 1;
1467                             il = f2cmin(i__2,i__4) + 1 - irow;
1468                             L__1 = jc + jkl < *m;
1469                             clarot_(&c_false, &c_false, &L__1, &il, &c__, &s, 
1470                                     &a[irow - iskew * jc + ioffst + jc * 
1471                                     a_dim1], &ilda, &dummy, &extra);
1472                         }
1473
1474 /*                    Chase "EXTRA" back down */
1475
1476                         ic = jc;
1477                         i__2 = iendch;
1478                         i__4 = jkl + jku;
1479                         for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <= 
1480                                 i__2; jch += i__4) {
1481                             ilextr = ic > 0;
1482                             if (ilextr) {
1483                                 clartg_(&a[jch - iskew * ic + ioffst + ic * 
1484                                         a_dim1], &extra, &realc, &s, &dummy);
1485                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1486                                 q__1=clarnd_(&c__5, &iseed[1]);
1487                                 dummy.r = q__1.r, dummy.i = q__1.i;
1488                                 q__1.r = realc * dummy.r, q__1.i = realc * 
1489                                         dummy.i;
1490                                 c__.r = q__1.r, c__.i = q__1.i;
1491                                 q__1.r = s.r * dummy.r - s.i * dummy.i, 
1492                                         q__1.i = s.r * dummy.i + s.i * 
1493                                         dummy.r;
1494                                 s.r = q__1.r, s.i = q__1.i;
1495                             }
1496                             ic = f2cmax(1,ic);
1497 /* Computing MIN */
1498                             i__5 = *n - 1, i__6 = jch + jku;
1499                             icol = f2cmin(i__5,i__6);
1500                             iltemp = jch + jku < *n;
1501                             ctemp.r = 0.f, ctemp.i = 0.f;
1502                             i__5 = icol + 2 - ic;
1503                             clarot_(&c_true, &ilextr, &iltemp, &i__5, &c__, &
1504                                     s, &a[jch - iskew * ic + ioffst + ic * 
1505                                     a_dim1], &ilda, &extra, &ctemp);
1506                             if (iltemp) {
1507                                 clartg_(&a[jch - iskew * icol + ioffst + icol 
1508                                         * a_dim1], &ctemp, &realc, &s, &dummy)
1509                                         ;
1510                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1511                                 q__1=clarnd_(&c__5, &iseed[1]);
1512                                 dummy.r = q__1.r, dummy.i = q__1.i;
1513                                 q__1.r = realc * dummy.r, q__1.i = realc * 
1514                                         dummy.i;
1515                                 c__.r = q__1.r, c__.i = q__1.i;
1516                                 q__1.r = s.r * dummy.r - s.i * dummy.i, 
1517                                         q__1.i = s.r * dummy.i + s.i * 
1518                                         dummy.r;
1519                                 s.r = q__1.r, s.i = q__1.i;
1520 /* Computing MIN */
1521                                 i__5 = iendch, i__6 = jch + jkl + jku;
1522                                 il = f2cmin(i__5,i__6) + 2 - jch;
1523                                 extra.r = 0.f, extra.i = 0.f;
1524                                 L__1 = jch + jkl + jku <= iendch;
1525                                 clarot_(&c_false, &c_true, &L__1, &il, &c__, &
1526                                         s, &a[jch - iskew * icol + ioffst + 
1527                                         icol * a_dim1], &ilda, &ctemp, &extra)
1528                                         ;
1529                                 ic = icol;
1530                             }
1531 /* L200: */
1532                         }
1533 /* L210: */
1534                     }
1535 /* L220: */
1536                 }
1537
1538                 jku = uub;
1539                 i__1 = llb;
1540                 for (jkl = 1; jkl <= i__1; ++jkl) {
1541
1542 /*                 Transform from bandwidth JKL-1, JKU to JKL, JKU */
1543
1544 /*                 First row actually rotated is MIN( N+JKL, M ) */
1545 /*                 First column actually rotated is N */
1546
1547 /* Computing MIN */
1548                     i__3 = *n, i__4 = *m + jku;
1549                     iendch = f2cmin(i__3,i__4) - 1;
1550 /* Computing MIN */
1551                     i__3 = *n + jkl;
1552                     i__4 = 1 - jku;
1553                     for (jr = f2cmin(i__3,*m) - 1; jr >= i__4; --jr) {
1554                         extra.r = 0.f, extra.i = 0.f;
1555                         angle = slarnd_(&c__1, &iseed[1]) * 
1556                                 6.2831853071795864769252867663f;
1557                         r__1 = cos(angle);
1558                         //clarnd_(&q__2, &c__5, &iseed[1]);
1559                         q__2=clarnd_(&c__5, &iseed[1]);
1560                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1561                         c__.r = q__1.r, c__.i = q__1.i;
1562                         r__1 = sin(angle);
1563                         //clarnd_(&q__2, &c__5, &iseed[1]);
1564                         q__2=clarnd_(&c__5, &iseed[1]);
1565                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1566                         s.r = q__1.r, s.i = q__1.i;
1567 /* Computing MAX */
1568                         i__3 = 1, i__2 = jr - jkl + 1;
1569                         icol = f2cmax(i__3,i__2);
1570                         if (jr > 0) {
1571 /* Computing MIN */
1572                             i__3 = *n, i__2 = jr + jku + 1;
1573                             il = f2cmin(i__3,i__2) + 1 - icol;
1574                             L__1 = jr + jku < *n;
1575                             clarot_(&c_true, &c_false, &L__1, &il, &c__, &s, &
1576                                     a[jr - iskew * icol + ioffst + icol * 
1577                                     a_dim1], &ilda, &dummy, &extra);
1578                         }
1579
1580 /*                    Chase "EXTRA" back down */
1581
1582                         ir = jr;
1583                         i__3 = iendch;
1584                         i__2 = jkl + jku;
1585                         for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <= 
1586                                 i__3; jch += i__2) {
1587                             ilextr = ir > 0;
1588                             if (ilextr) {
1589                                 clartg_(&a[ir - iskew * jch + ioffst + jch * 
1590                                         a_dim1], &extra, &realc, &s, &dummy);
1591                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1592                                 q__1=clarnd_(&c__5, &iseed[1]);
1593                                 dummy.r = q__1.r, dummy.i = q__1.i;
1594                                 q__1.r = realc * dummy.r, q__1.i = realc * 
1595                                         dummy.i;
1596                                 c__.r = q__1.r, c__.i = q__1.i;
1597                                 q__1.r = s.r * dummy.r - s.i * dummy.i, 
1598                                         q__1.i = s.r * dummy.i + s.i * 
1599                                         dummy.r;
1600                                 s.r = q__1.r, s.i = q__1.i;
1601                             }
1602                             ir = f2cmax(1,ir);
1603 /* Computing MIN */
1604                             i__5 = *m - 1, i__6 = jch + jkl;
1605                             irow = f2cmin(i__5,i__6);
1606                             iltemp = jch + jkl < *m;
1607                             ctemp.r = 0.f, ctemp.i = 0.f;
1608                             i__5 = irow + 2 - ir;
1609                             clarot_(&c_false, &ilextr, &iltemp, &i__5, &c__, &
1610                                     s, &a[ir - iskew * jch + ioffst + jch * 
1611                                     a_dim1], &ilda, &extra, &ctemp);
1612                             if (iltemp) {
1613                                 clartg_(&a[irow - iskew * jch + ioffst + jch *
1614                                          a_dim1], &ctemp, &realc, &s, &dummy);
1615                                 //clarnd_(&q__1, &c__5, &iseed[1]);
1616                                 q__1=clarnd_(&c__5, &iseed[1]);
1617                                 dummy.r = q__1.r, dummy.i = q__1.i;
1618                                 q__1.r = realc * dummy.r, q__1.i = realc * 
1619                                         dummy.i;
1620                                 c__.r = q__1.r, c__.i = q__1.i;
1621                                 q__1.r = s.r * dummy.r - s.i * dummy.i, 
1622                                         q__1.i = s.r * dummy.i + s.i * 
1623                                         dummy.r;
1624                                 s.r = q__1.r, s.i = q__1.i;
1625 /* Computing MIN */
1626                                 i__5 = iendch, i__6 = jch + jkl + jku;
1627                                 il = f2cmin(i__5,i__6) + 2 - jch;
1628                                 extra.r = 0.f, extra.i = 0.f;
1629                                 L__1 = jch + jkl + jku <= iendch;
1630                                 clarot_(&c_true, &c_true, &L__1, &il, &c__, &
1631                                         s, &a[irow - iskew * jch + ioffst + 
1632                                         jch * a_dim1], &ilda, &ctemp, &extra);
1633                                 ir = irow;
1634                             }
1635 /* L230: */
1636                         }
1637 /* L240: */
1638                     }
1639 /* L250: */
1640                 }
1641
1642             }
1643
1644         } else {
1645
1646 /*           Symmetric -- A = U D U' */
1647 /*           Hermitian -- A = U D U* */
1648
1649             ipackg = ipack;
1650             ioffg = ioffst;
1651
1652             if (topdwn) {
1653
1654 /*              Top-Down -- Generate Upper triangle only */
1655
1656                 if (ipack >= 5) {
1657                     ipackg = 6;
1658                     ioffg = uub + 1;
1659                 } else {
1660                     ipackg = 1;
1661                 }
1662
1663                 i__1 = mnmin;
1664                 for (j = 1; j <= i__1; ++j) {
1665                     i__4 = (1 - iskew) * j + ioffg + j * a_dim1;
1666                     i__2 = j;
1667                     q__1.r = d__[i__2], q__1.i = 0.f;
1668                     a[i__4].r = q__1.r, a[i__4].i = q__1.i;
1669 /* L260: */
1670                 }
1671
1672                 i__1 = uub;
1673                 for (k = 1; k <= i__1; ++k) {
1674                     i__4 = *n - 1;
1675                     for (jc = 1; jc <= i__4; ++jc) {
1676 /* Computing MAX */
1677                         i__2 = 1, i__3 = jc - k;
1678                         irow = f2cmax(i__2,i__3);
1679 /* Computing MIN */
1680                         i__2 = jc + 1, i__3 = k + 2;
1681                         il = f2cmin(i__2,i__3);
1682                         extra.r = 0.f, extra.i = 0.f;
1683                         i__2 = jc - iskew * (jc + 1) + ioffg + (jc + 1) * 
1684                                 a_dim1;
1685                         ctemp.r = a[i__2].r, ctemp.i = a[i__2].i;
1686                         angle = slarnd_(&c__1, &iseed[1]) * 
1687                                 6.2831853071795864769252867663f;
1688                         r__1 = cos(angle);
1689                         //clarnd_(&q__2, &c__5, &iseed[1]);
1690                         q__2=clarnd_(&c__5, &iseed[1]);
1691                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1692                         c__.r = q__1.r, c__.i = q__1.i;
1693                         r__1 = sin(angle);
1694                         //clarnd_(&q__2, &c__5, &iseed[1]);
1695                         q__2=clarnd_(&c__5, &iseed[1]);
1696                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1697                         s.r = q__1.r, s.i = q__1.i;
1698                         if (csym) {
1699                             ct.r = c__.r, ct.i = c__.i;
1700                             st.r = s.r, st.i = s.i;
1701                         } else {
1702                             r_cnjg(&q__1, &ctemp);
1703                             ctemp.r = q__1.r, ctemp.i = q__1.i;
1704                             r_cnjg(&q__1, &c__);
1705                             ct.r = q__1.r, ct.i = q__1.i;
1706                             r_cnjg(&q__1, &s);
1707                             st.r = q__1.r, st.i = q__1.i;
1708                         }
1709                         L__1 = jc > k;
1710                         clarot_(&c_false, &L__1, &c_true, &il, &c__, &s, &a[
1711                                 irow - iskew * jc + ioffg + jc * a_dim1], &
1712                                 ilda, &extra, &ctemp);
1713 /* Computing MIN */
1714                         i__3 = k, i__5 = *n - jc;
1715                         i__2 = f2cmin(i__3,i__5) + 1;
1716                         clarot_(&c_true, &c_true, &c_false, &i__2, &ct, &st, &
1717                                 a[(1 - iskew) * jc + ioffg + jc * a_dim1], &
1718                                 ilda, &ctemp, &dummy);
1719
1720 /*                    Chase EXTRA back up the matrix */
1721
1722                         icol = jc;
1723                         i__2 = -k;
1724                         for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1; 
1725                                 jch += i__2) {
1726                             clartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg + 
1727                                     (icol + 1) * a_dim1], &extra, &realc, &s, 
1728                                     &dummy);
1729                             //clarnd_(&q__1, &c__5, &iseed[1]);
1730                             q__1=clarnd_(&c__5, &iseed[1]);
1731                             dummy.r = q__1.r, dummy.i = q__1.i;
1732                             q__2.r = realc * dummy.r, q__2.i = realc * 
1733                                     dummy.i;
1734                             r_cnjg(&q__1, &q__2);
1735                             c__.r = q__1.r, c__.i = q__1.i;
1736                             q__3.r = -s.r, q__3.i = -s.i;
1737                             q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, 
1738                                     q__2.i = q__3.r * dummy.i + q__3.i * 
1739                                     dummy.r;
1740                             r_cnjg(&q__1, &q__2);
1741                             s.r = q__1.r, s.i = q__1.i;
1742                             i__3 = jch - iskew * (jch + 1) + ioffg + (jch + 1)
1743                                      * a_dim1;
1744                             ctemp.r = a[i__3].r, ctemp.i = a[i__3].i;
1745                             if (csym) {
1746                                 ct.r = c__.r, ct.i = c__.i;
1747                                 st.r = s.r, st.i = s.i;
1748                             } else {
1749                                 r_cnjg(&q__1, &ctemp);
1750                                 ctemp.r = q__1.r, ctemp.i = q__1.i;
1751                                 r_cnjg(&q__1, &c__);
1752                                 ct.r = q__1.r, ct.i = q__1.i;
1753                                 r_cnjg(&q__1, &s);
1754                                 st.r = q__1.r, st.i = q__1.i;
1755                             }
1756                             i__3 = k + 2;
1757                             clarot_(&c_true, &c_true, &c_true, &i__3, &c__, &
1758                                     s, &a[(1 - iskew) * jch + ioffg + jch * 
1759                                     a_dim1], &ilda, &ctemp, &extra);
1760 /* Computing MAX */
1761                             i__3 = 1, i__5 = jch - k;
1762                             irow = f2cmax(i__3,i__5);
1763 /* Computing MIN */
1764                             i__3 = jch + 1, i__5 = k + 2;
1765                             il = f2cmin(i__3,i__5);
1766                             extra.r = 0.f, extra.i = 0.f;
1767                             L__1 = jch > k;
1768                             clarot_(&c_false, &L__1, &c_true, &il, &ct, &st, &
1769                                     a[irow - iskew * jch + ioffg + jch * 
1770                                     a_dim1], &ilda, &extra, &ctemp);
1771                             icol = jch;
1772 /* L270: */
1773                         }
1774 /* L280: */
1775                     }
1776 /* L290: */
1777                 }
1778
1779 /*              If we need lower triangle, copy from upper. Note that */
1780 /*              the order of copying is chosen to work for 'q' -> 'b' */
1781
1782                 if (ipack != ipackg && ipack != 3) {
1783                     i__1 = *n;
1784                     for (jc = 1; jc <= i__1; ++jc) {
1785                         irow = ioffst - iskew * jc;
1786                         if (csym) {
1787 /* Computing MIN */
1788                             i__2 = *n, i__3 = jc + uub;
1789                             i__4 = f2cmin(i__2,i__3);
1790                             for (jr = jc; jr <= i__4; ++jr) {
1791                                 i__2 = jr + irow + jc * a_dim1;
1792                                 i__3 = jc - iskew * jr + ioffg + jr * a_dim1;
1793                                 a[i__2].r = a[i__3].r, a[i__2].i = a[i__3].i;
1794 /* L300: */
1795                             }
1796                         } else {
1797 /* Computing MIN */
1798                             i__2 = *n, i__3 = jc + uub;
1799                             i__4 = f2cmin(i__2,i__3);
1800                             for (jr = jc; jr <= i__4; ++jr) {
1801                                 i__2 = jr + irow + jc * a_dim1;
1802                                 r_cnjg(&q__1, &a[jc - iskew * jr + ioffg + jr 
1803                                         * a_dim1]);
1804                                 a[i__2].r = q__1.r, a[i__2].i = q__1.i;
1805 /* L310: */
1806                             }
1807                         }
1808 /* L320: */
1809                     }
1810                     if (ipack == 5) {
1811                         i__1 = *n;
1812                         for (jc = *n - uub + 1; jc <= i__1; ++jc) {
1813                             i__4 = uub + 1;
1814                             for (jr = *n + 2 - jc; jr <= i__4; ++jr) {
1815                                 i__2 = jr + jc * a_dim1;
1816                                 a[i__2].r = 0.f, a[i__2].i = 0.f;
1817 /* L330: */
1818                             }
1819 /* L340: */
1820                         }
1821                     }
1822                     if (ipackg == 6) {
1823                         ipackg = ipack;
1824                     } else {
1825                         ipackg = 0;
1826                     }
1827                 }
1828             } else {
1829
1830 /*              Bottom-Up -- Generate Lower triangle only */
1831
1832                 if (ipack >= 5) {
1833                     ipackg = 5;
1834                     if (ipack == 6) {
1835                         ioffg = 1;
1836                     }
1837                 } else {
1838                     ipackg = 2;
1839                 }
1840
1841                 i__1 = mnmin;
1842                 for (j = 1; j <= i__1; ++j) {
1843                     i__4 = (1 - iskew) * j + ioffg + j * a_dim1;
1844                     i__2 = j;
1845                     q__1.r = d__[i__2], q__1.i = 0.f;
1846                     a[i__4].r = q__1.r, a[i__4].i = q__1.i;
1847 /* L350: */
1848                 }
1849
1850                 i__1 = uub;
1851                 for (k = 1; k <= i__1; ++k) {
1852                     for (jc = *n - 1; jc >= 1; --jc) {
1853 /* Computing MIN */
1854                         i__4 = *n + 1 - jc, i__2 = k + 2;
1855                         il = f2cmin(i__4,i__2);
1856                         extra.r = 0.f, extra.i = 0.f;
1857                         i__4 = (1 - iskew) * jc + 1 + ioffg + jc * a_dim1;
1858                         ctemp.r = a[i__4].r, ctemp.i = a[i__4].i;
1859                         angle = slarnd_(&c__1, &iseed[1]) * 
1860                                 6.2831853071795864769252867663f;
1861                         r__1 = cos(angle);
1862                         //clarnd_(&q__2, &c__5, &iseed[1]);
1863                         q__2=clarnd_(&c__5, &iseed[1]);
1864                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1865                         c__.r = q__1.r, c__.i = q__1.i;
1866                         r__1 = sin(angle);
1867                         //clarnd_(&q__2, &c__5, &iseed[1]);
1868                         q__2=clarnd_(&c__5, &iseed[1]);
1869                         q__1.r = r__1 * q__2.r, q__1.i = r__1 * q__2.i;
1870                         s.r = q__1.r, s.i = q__1.i;
1871                         if (csym) {
1872                             ct.r = c__.r, ct.i = c__.i;
1873                             st.r = s.r, st.i = s.i;
1874                         } else {
1875                             r_cnjg(&q__1, &ctemp);
1876                             ctemp.r = q__1.r, ctemp.i = q__1.i;
1877                             r_cnjg(&q__1, &c__);
1878                             ct.r = q__1.r, ct.i = q__1.i;
1879                             r_cnjg(&q__1, &s);
1880                             st.r = q__1.r, st.i = q__1.i;
1881                         }
1882                         L__1 = *n - jc > k;
1883                         clarot_(&c_false, &c_true, &L__1, &il, &c__, &s, &a[(
1884                                 1 - iskew) * jc + ioffg + jc * a_dim1], &ilda,
1885                                  &ctemp, &extra);
1886 /* Computing MAX */
1887                         i__4 = 1, i__2 = jc - k + 1;
1888                         icol = f2cmax(i__4,i__2);
1889                         i__4 = jc + 2 - icol;
1890                         clarot_(&c_true, &c_false, &c_true, &i__4, &ct, &st, &
1891                                 a[jc - iskew * icol + ioffg + icol * a_dim1], 
1892                                 &ilda, &dummy, &ctemp);
1893
1894 /*                    Chase EXTRA back down the matrix */
1895
1896                         icol = jc;
1897                         i__4 = *n - 1;
1898                         i__2 = k;
1899                         for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <= 
1900                                 i__4; jch += i__2) {
1901                             clartg_(&a[jch - iskew * icol + ioffg + icol * 
1902                                     a_dim1], &extra, &realc, &s, &dummy);
1903                             //clarnd_(&q__1, &c__5, &iseed[1]);
1904                             q__1=clarnd_(&c__5, &iseed[1]);
1905                             dummy.r = q__1.r, dummy.i = q__1.i;
1906                             q__1.r = realc * dummy.r, q__1.i = realc * 
1907                                     dummy.i;
1908                             c__.r = q__1.r, c__.i = q__1.i;
1909                             q__1.r = s.r * dummy.r - s.i * dummy.i, q__1.i = 
1910                                     s.r * dummy.i + s.i * dummy.r;
1911                             s.r = q__1.r, s.i = q__1.i;
1912                             i__3 = (1 - iskew) * jch + 1 + ioffg + jch * 
1913                                     a_dim1;
1914                             ctemp.r = a[i__3].r, ctemp.i = a[i__3].i;
1915                             if (csym) {
1916                                 ct.r = c__.r, ct.i = c__.i;
1917                                 st.r = s.r, st.i = s.i;
1918                             } else {
1919                                 r_cnjg(&q__1, &ctemp);
1920                                 ctemp.r = q__1.r, ctemp.i = q__1.i;
1921                                 r_cnjg(&q__1, &c__);
1922                                 ct.r = q__1.r, ct.i = q__1.i;
1923                                 r_cnjg(&q__1, &s);
1924                                 st.r = q__1.r, st.i = q__1.i;
1925                             }
1926                             i__3 = k + 2;
1927                             clarot_(&c_true, &c_true, &c_true, &i__3, &c__, &
1928                                     s, &a[jch - iskew * icol + ioffg + icol * 
1929                                     a_dim1], &ilda, &extra, &ctemp);
1930 /* Computing MIN */
1931                             i__3 = *n + 1 - jch, i__5 = k + 2;
1932                             il = f2cmin(i__3,i__5);
1933                             extra.r = 0.f, extra.i = 0.f;
1934                             L__1 = *n - jch > k;
1935                             clarot_(&c_false, &c_true, &L__1, &il, &ct, &st, &
1936                                     a[(1 - iskew) * jch + ioffg + jch * 
1937                                     a_dim1], &ilda, &ctemp, &extra);
1938                             icol = jch;
1939 /* L360: */
1940                         }
1941 /* L370: */
1942                     }
1943 /* L380: */
1944                 }
1945
1946 /*              If we need upper triangle, copy from lower. Note that */
1947 /*              the order of copying is chosen to work for 'b' -> 'q' */
1948
1949                 if (ipack != ipackg && ipack != 4) {
1950                     for (jc = *n; jc >= 1; --jc) {
1951                         irow = ioffst - iskew * jc;
1952                         if (csym) {
1953 /* Computing MAX */
1954                             i__2 = 1, i__4 = jc - uub;
1955                             i__1 = f2cmax(i__2,i__4);
1956                             for (jr = jc; jr >= i__1; --jr) {
1957                                 i__2 = jr + irow + jc * a_dim1;
1958                                 i__4 = jc - iskew * jr + ioffg + jr * a_dim1;
1959                                 a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i;
1960 /* L390: */
1961                             }
1962                         } else {
1963 /* Computing MAX */
1964                             i__2 = 1, i__4 = jc - uub;
1965                             i__1 = f2cmax(i__2,i__4);
1966                             for (jr = jc; jr >= i__1; --jr) {
1967                                 i__2 = jr + irow + jc * a_dim1;
1968                                 r_cnjg(&q__1, &a[jc - iskew * jr + ioffg + jr 
1969                                         * a_dim1]);
1970                                 a[i__2].r = q__1.r, a[i__2].i = q__1.i;
1971 /* L400: */
1972                             }
1973                         }
1974 /* L410: */
1975                     }
1976                     if (ipack == 6) {
1977                         i__1 = uub;
1978                         for (jc = 1; jc <= i__1; ++jc) {
1979                             i__2 = uub + 1 - jc;
1980                             for (jr = 1; jr <= i__2; ++jr) {
1981                                 i__4 = jr + jc * a_dim1;
1982                                 a[i__4].r = 0.f, a[i__4].i = 0.f;
1983 /* L420: */
1984                             }
1985 /* L430: */
1986                         }
1987                     }
1988                     if (ipackg == 5) {
1989                         ipackg = ipack;
1990                     } else {
1991                         ipackg = 0;
1992                     }
1993                 }
1994             }
1995
1996 /*           Ensure that the diagonal is real if Hermitian */
1997
1998             if (! csym) {
1999                 i__1 = *n;
2000                 for (jc = 1; jc <= i__1; ++jc) {
2001                     irow = ioffst + (1 - iskew) * jc;
2002                     i__2 = irow + jc * a_dim1;
2003                     i__4 = irow + jc * a_dim1;
2004                     r__1 = a[i__4].r;
2005                     q__1.r = r__1, q__1.i = 0.f;
2006                     a[i__2].r = q__1.r, a[i__2].i = q__1.i;
2007 /* L440: */
2008                 }
2009             }
2010
2011         }
2012
2013     } else {
2014
2015 /*        4)      Generate Banded Matrix by first */
2016 /*                Rotating by random Unitary matrices, */
2017 /*                then reducing the bandwidth using Householder */
2018 /*                transformations. */
2019
2020 /*                Note: we should get here only if LDA .ge. N */
2021
2022         if (isym == 1) {
2023
2024 /*           Non-symmetric -- A = U D V */
2025
2026             clagge_(&mr, &nc, &llb, &uub, &d__[1], &a[a_offset], lda, &iseed[
2027                     1], &work[1], &iinfo);
2028         } else {
2029
2030 /*           Symmetric -- A = U D U' or */
2031 /*           Hermitian -- A = U D U* */
2032
2033             if (csym) {
2034                 clagsy_(m, &llb, &d__[1], &a[a_offset], lda, &iseed[1], &work[
2035                         1], &iinfo);
2036             } else {
2037                 claghe_(m, &llb, &d__[1], &a[a_offset], lda, &iseed[1], &work[
2038                         1], &iinfo);
2039             }
2040         }
2041
2042         if (iinfo != 0) {
2043             *info = 3;
2044             return 0;
2045         }
2046     }
2047
2048 /*     5)      Pack the matrix */
2049
2050     if (ipack != ipackg) {
2051         if (ipack == 1) {
2052
2053 /*           'U' -- Upper triangular, not packed */
2054
2055             i__1 = *m;
2056             for (j = 1; j <= i__1; ++j) {
2057                 i__2 = *m;
2058                 for (i__ = j + 1; i__ <= i__2; ++i__) {
2059                     i__4 = i__ + j * a_dim1;
2060                     a[i__4].r = 0.f, a[i__4].i = 0.f;
2061 /* L450: */
2062                 }
2063 /* L460: */
2064             }
2065
2066         } else if (ipack == 2) {
2067
2068 /*           'L' -- Lower triangular, not packed */
2069
2070             i__1 = *m;
2071             for (j = 2; j <= i__1; ++j) {
2072                 i__2 = j - 1;
2073                 for (i__ = 1; i__ <= i__2; ++i__) {
2074                     i__4 = i__ + j * a_dim1;
2075                     a[i__4].r = 0.f, a[i__4].i = 0.f;
2076 /* L470: */
2077                 }
2078 /* L480: */
2079             }
2080
2081         } else if (ipack == 3) {
2082
2083 /*           'C' -- Upper triangle packed Columnwise. */
2084
2085             icol = 1;
2086             irow = 0;
2087             i__1 = *m;
2088             for (j = 1; j <= i__1; ++j) {
2089                 i__2 = j;
2090                 for (i__ = 1; i__ <= i__2; ++i__) {
2091                     ++irow;
2092                     if (irow > *lda) {
2093                         irow = 1;
2094                         ++icol;
2095                     }
2096                     i__4 = irow + icol * a_dim1;
2097                     i__3 = i__ + j * a_dim1;
2098                     a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
2099 /* L490: */
2100                 }
2101 /* L500: */
2102             }
2103
2104         } else if (ipack == 4) {
2105
2106 /*           'R' -- Lower triangle packed Columnwise. */
2107
2108             icol = 1;
2109             irow = 0;
2110             i__1 = *m;
2111             for (j = 1; j <= i__1; ++j) {
2112                 i__2 = *m;
2113                 for (i__ = j; i__ <= i__2; ++i__) {
2114                     ++irow;
2115                     if (irow > *lda) {
2116                         irow = 1;
2117                         ++icol;
2118                     }
2119                     i__4 = irow + icol * a_dim1;
2120                     i__3 = i__ + j * a_dim1;
2121                     a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
2122 /* L510: */
2123                 }
2124 /* L520: */
2125             }
2126
2127         } else if (ipack >= 5) {
2128
2129 /*           'B' -- The lower triangle is packed as a band matrix. */
2130 /*           'Q' -- The upper triangle is packed as a band matrix. */
2131 /*           'Z' -- The whole matrix is packed as a band matrix. */
2132
2133             if (ipack == 5) {
2134                 uub = 0;
2135             }
2136             if (ipack == 6) {
2137                 llb = 0;
2138             }
2139
2140             i__1 = uub;
2141             for (j = 1; j <= i__1; ++j) {
2142 /* Computing MIN */
2143                 i__2 = j + llb;
2144                 for (i__ = f2cmin(i__2,*m); i__ >= 1; --i__) {
2145                     i__2 = i__ - j + uub + 1 + j * a_dim1;
2146                     i__4 = i__ + j * a_dim1;
2147                     a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i;
2148 /* L530: */
2149                 }
2150 /* L540: */
2151             }
2152
2153             i__1 = *n;
2154             for (j = uub + 2; j <= i__1; ++j) {
2155 /* Computing MIN */
2156                 i__4 = j + llb;
2157                 i__2 = f2cmin(i__4,*m);
2158                 for (i__ = j - uub; i__ <= i__2; ++i__) {
2159                     i__4 = i__ - j + uub + 1 + j * a_dim1;
2160                     i__3 = i__ + j * a_dim1;
2161                     a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
2162 /* L550: */
2163                 }
2164 /* L560: */
2165             }
2166         }
2167
2168 /*        If packed, zero out extraneous elements. */
2169
2170 /*        Symmetric/Triangular Packed -- */
2171 /*        zero out everything after A(IROW,ICOL) */
2172
2173         if (ipack == 3 || ipack == 4) {
2174             i__1 = *m;
2175             for (jc = icol; jc <= i__1; ++jc) {
2176                 i__2 = *lda;
2177                 for (jr = irow + 1; jr <= i__2; ++jr) {
2178                     i__4 = jr + jc * a_dim1;
2179                     a[i__4].r = 0.f, a[i__4].i = 0.f;
2180 /* L570: */
2181                 }
2182                 irow = 0;
2183 /* L580: */
2184             }
2185
2186         } else if (ipack >= 5) {
2187
2188 /*           Packed Band -- */
2189 /*              1st row is now in A( UUB+2-j, j), zero above it */
2190 /*              m-th row is now in A( M+UUB-j,j), zero below it */
2191 /*              last non-zero diagonal is now in A( UUB+LLB+1,j ), */
2192 /*                 zero below it, too. */
2193
2194             ir1 = uub + llb + 2;
2195             ir2 = uub + *m + 2;
2196             i__1 = *n;
2197             for (jc = 1; jc <= i__1; ++jc) {
2198                 i__2 = uub + 1 - jc;
2199                 for (jr = 1; jr <= i__2; ++jr) {
2200                     i__4 = jr + jc * a_dim1;
2201                     a[i__4].r = 0.f, a[i__4].i = 0.f;
2202 /* L590: */
2203                 }
2204 /* Computing MAX */
2205 /* Computing MIN */
2206                 i__3 = ir1, i__5 = ir2 - jc;
2207                 i__2 = 1, i__4 = f2cmin(i__3,i__5);
2208                 i__6 = *lda;
2209                 for (jr = f2cmax(i__2,i__4); jr <= i__6; ++jr) {
2210                     i__2 = jr + jc * a_dim1;
2211                     a[i__2].r = 0.f, a[i__2].i = 0.f;
2212 /* L600: */
2213                 }
2214 /* L610: */
2215             }
2216         }
2217     }
2218
2219     return 0;
2220
2221 /*     End of CLATMT */
2222
2223 } /* clatmt_ */
2224