C_LAPACK: Fixes to make it compile with MSVC (#3605)
[platform/upstream/openblas.git] / lapack-netlib / SRC / zgbtrf.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]/Cd(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 doublecomplex c_b1 = {1.,0.};
516 static integer c__1 = 1;
517 static integer c__65 = 65;
518
519 /* > \brief \b ZGBTRF */
520
521 /*  =========== DOCUMENTATION =========== */
522
523 /* Online html documentation available at */
524 /*            http://www.netlib.org/lapack/explore-html/ */
525
526 /* > \htmlonly */
527 /* > Download ZGBTRF + dependencies */
528 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgbtrf.
529 f"> */
530 /* > [TGZ]</a> */
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgbtrf.
532 f"> */
533 /* > [ZIP]</a> */
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbtrf.
535 f"> */
536 /* > [TXT]</a> */
537 /* > \endhtmlonly */
538
539 /*  Definition: */
540 /*  =========== */
541
542 /*       SUBROUTINE ZGBTRF( M, N, KL, KU, AB, LDAB, IPIV, INFO ) */
543
544 /*       INTEGER            INFO, KL, KU, LDAB, M, N */
545 /*       INTEGER            IPIV( * ) */
546 /*       COMPLEX*16         AB( LDAB, * ) */
547
548
549 /* > \par Purpose: */
550 /*  ============= */
551 /* > */
552 /* > \verbatim */
553 /* > */
554 /* > ZGBTRF computes an LU factorization of a complex m-by-n band matrix A */
555 /* > using partial pivoting with row interchanges. */
556 /* > */
557 /* > This is the blocked version of the algorithm, calling Level 3 BLAS. */
558 /* > \endverbatim */
559
560 /*  Arguments: */
561 /*  ========== */
562
563 /* > \param[in] M */
564 /* > \verbatim */
565 /* >          M is INTEGER */
566 /* >          The number of rows of the matrix A.  M >= 0. */
567 /* > \endverbatim */
568 /* > */
569 /* > \param[in] N */
570 /* > \verbatim */
571 /* >          N is INTEGER */
572 /* >          The number of columns of the matrix A.  N >= 0. */
573 /* > \endverbatim */
574 /* > */
575 /* > \param[in] KL */
576 /* > \verbatim */
577 /* >          KL is INTEGER */
578 /* >          The number of subdiagonals within the band of A.  KL >= 0. */
579 /* > \endverbatim */
580 /* > */
581 /* > \param[in] KU */
582 /* > \verbatim */
583 /* >          KU is INTEGER */
584 /* >          The number of superdiagonals within the band of A.  KU >= 0. */
585 /* > \endverbatim */
586 /* > */
587 /* > \param[in,out] AB */
588 /* > \verbatim */
589 /* >          AB is COMPLEX*16 array, dimension (LDAB,N) */
590 /* >          On entry, the matrix A in band storage, in rows KL+1 to */
591 /* >          2*KL+KU+1; rows 1 to KL of the array need not be set. */
592 /* >          The j-th column of A is stored in the j-th column of the */
593 /* >          array AB as follows: */
594 /* >          AB(kl+ku+1+i-j,j) = A(i,j) for f2cmax(1,j-ku)<=i<=f2cmin(m,j+kl) */
595 /* > */
596 /* >          On exit, details of the factorization: U is stored as an */
597 /* >          upper triangular band matrix with KL+KU superdiagonals in */
598 /* >          rows 1 to KL+KU+1, and the multipliers used during the */
599 /* >          factorization are stored in rows KL+KU+2 to 2*KL+KU+1. */
600 /* >          See below for further details. */
601 /* > \endverbatim */
602 /* > */
603 /* > \param[in] LDAB */
604 /* > \verbatim */
605 /* >          LDAB is INTEGER */
606 /* >          The leading dimension of the array AB.  LDAB >= 2*KL+KU+1. */
607 /* > \endverbatim */
608 /* > */
609 /* > \param[out] IPIV */
610 /* > \verbatim */
611 /* >          IPIV is INTEGER array, dimension (f2cmin(M,N)) */
612 /* >          The pivot indices; for 1 <= i <= f2cmin(M,N), row i of the */
613 /* >          matrix was interchanged with row IPIV(i). */
614 /* > \endverbatim */
615 /* > */
616 /* > \param[out] INFO */
617 /* > \verbatim */
618 /* >          INFO is INTEGER */
619 /* >          = 0: successful exit */
620 /* >          < 0: if INFO = -i, the i-th argument had an illegal value */
621 /* >          > 0: if INFO = +i, U(i,i) is exactly zero. The factorization */
622 /* >               has been completed, but the factor U is exactly */
623 /* >               singular, and division by zero will occur if it is used */
624 /* >               to solve a system of equations. */
625 /* > \endverbatim */
626
627 /*  Authors: */
628 /*  ======== */
629
630 /* > \author Univ. of Tennessee */
631 /* > \author Univ. of California Berkeley */
632 /* > \author Univ. of Colorado Denver */
633 /* > \author NAG Ltd. */
634
635 /* > \date December 2016 */
636
637 /* > \ingroup complex16GBcomputational */
638
639 /* > \par Further Details: */
640 /*  ===================== */
641 /* > */
642 /* > \verbatim */
643 /* > */
644 /* >  The band storage scheme is illustrated by the following example, when */
645 /* >  M = N = 6, KL = 2, KU = 1: */
646 /* > */
647 /* >  On entry:                       On exit: */
648 /* > */
649 /* >      *    *    *    +    +    +       *    *    *   u14  u25  u36 */
650 /* >      *    *    +    +    +    +       *    *   u13  u24  u35  u46 */
651 /* >      *   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56 */
652 /* >     a11  a22  a33  a44  a55  a66     u11  u22  u33  u44  u55  u66 */
653 /* >     a21  a32  a43  a54  a65   *      m21  m32  m43  m54  m65   * */
654 /* >     a31  a42  a53  a64   *    *      m31  m42  m53  m64   *    * */
655 /* > */
656 /* >  Array elements marked * are not used by the routine; elements marked */
657 /* >  + need not be set on entry, but are required by the routine to store */
658 /* >  elements of U because of fill-in resulting from the row interchanges. */
659 /* > \endverbatim */
660 /* > */
661 /*  ===================================================================== */
662 /* Subroutine */ int zgbtrf_(integer *m, integer *n, integer *kl, integer *ku,
663          doublecomplex *ab, integer *ldab, integer *ipiv, integer *info)
664 {
665     /* System generated locals */
666     integer ab_dim1, ab_offset, i__1, i__2, i__3, i__4, i__5, i__6;
667     doublecomplex z__1;
668
669     /* Local variables */
670     doublecomplex temp;
671     integer i__, j;
672     extern /* Subroutine */ int zscal_(integer *, doublecomplex *, 
673             doublecomplex *, integer *), zgemm_(char *, char *, integer *, 
674             integer *, integer *, doublecomplex *, doublecomplex *, integer *,
675              doublecomplex *, integer *, doublecomplex *, doublecomplex *, 
676             integer *);
677     doublecomplex work13[4160]  /* was [65][64] */, work31[4160]        /* 
678             was [65][64] */;
679     integer i2, i3, j2, j3, k2;
680     extern /* Subroutine */ int zgeru_(integer *, integer *, doublecomplex *, 
681             doublecomplex *, integer *, doublecomplex *, integer *, 
682             doublecomplex *, integer *), zcopy_(integer *, doublecomplex *, 
683             integer *, doublecomplex *, integer *), zswap_(integer *, 
684             doublecomplex *, integer *, doublecomplex *, integer *), ztrsm_(
685             char *, char *, char *, char *, integer *, integer *, 
686             doublecomplex *, doublecomplex *, integer *, doublecomplex *, 
687             integer *), zgbtf2_(integer *, 
688             integer *, integer *, integer *, doublecomplex *, integer *, 
689             integer *, integer *);
690     integer jb, nb, ii, jj, jm, ip, jp, km, ju, kv, nw;
691     extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
692     extern integer ilaenv_(integer *, char *, char *, integer *, integer *, 
693             integer *, integer *, ftnlen, ftnlen), izamax_(integer *, 
694             doublecomplex *, integer *);
695     extern /* Subroutine */ int zlaswp_(integer *, doublecomplex *, integer *,
696              integer *, integer *, integer *, integer *);
697
698
699 /*  -- LAPACK computational routine (version 3.7.0) -- */
700 /*  -- LAPACK is a software package provided by Univ. of Tennessee,    -- */
701 /*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
702 /*     December 2016 */
703
704
705 /*  ===================================================================== */
706
707
708 /*     KV is the number of superdiagonals in the factor U, allowing for */
709 /*     fill-in */
710
711     /* Parameter adjustments */
712     ab_dim1 = *ldab;
713     ab_offset = 1 + ab_dim1 * 1;
714     ab -= ab_offset;
715     --ipiv;
716
717     /* Function Body */
718     kv = *ku + *kl;
719
720 /*     Test the input parameters. */
721
722     *info = 0;
723     if (*m < 0) {
724         *info = -1;
725     } else if (*n < 0) {
726         *info = -2;
727     } else if (*kl < 0) {
728         *info = -3;
729     } else if (*ku < 0) {
730         *info = -4;
731     } else if (*ldab < *kl + kv + 1) {
732         *info = -6;
733     }
734     if (*info != 0) {
735         i__1 = -(*info);
736         xerbla_("ZGBTRF", &i__1, (ftnlen)6);
737         return 0;
738     }
739
740 /*     Quick return if possible */
741
742     if (*m == 0 || *n == 0) {
743         return 0;
744     }
745
746 /*     Determine the block size for this environment */
747
748     nb = ilaenv_(&c__1, "ZGBTRF", " ", m, n, kl, ku, (ftnlen)6, (ftnlen)1);
749
750 /*     The block size must not exceed the limit set by the size of the */
751 /*     local arrays WORK13 and WORK31. */
752
753     nb = f2cmin(nb,64);
754
755     if (nb <= 1 || nb > *kl) {
756
757 /*        Use unblocked code */
758
759         zgbtf2_(m, n, kl, ku, &ab[ab_offset], ldab, &ipiv[1], info);
760     } else {
761
762 /*        Use blocked code */
763
764 /*        Zero the superdiagonal elements of the work array WORK13 */
765
766         i__1 = nb;
767         for (j = 1; j <= i__1; ++j) {
768             i__2 = j - 1;
769             for (i__ = 1; i__ <= i__2; ++i__) {
770                 i__3 = i__ + j * 65 - 66;
771                 work13[i__3].r = 0., work13[i__3].i = 0.;
772 /* L10: */
773             }
774 /* L20: */
775         }
776
777 /*        Zero the subdiagonal elements of the work array WORK31 */
778
779         i__1 = nb;
780         for (j = 1; j <= i__1; ++j) {
781             i__2 = nb;
782             for (i__ = j + 1; i__ <= i__2; ++i__) {
783                 i__3 = i__ + j * 65 - 66;
784                 work31[i__3].r = 0., work31[i__3].i = 0.;
785 /* L30: */
786             }
787 /* L40: */
788         }
789
790 /*        Gaussian elimination with partial pivoting */
791
792 /*        Set fill-in elements in columns KU+2 to KV to zero */
793
794         i__1 = f2cmin(kv,*n);
795         for (j = *ku + 2; j <= i__1; ++j) {
796             i__2 = *kl;
797             for (i__ = kv - j + 2; i__ <= i__2; ++i__) {
798                 i__3 = i__ + j * ab_dim1;
799                 ab[i__3].r = 0., ab[i__3].i = 0.;
800 /* L50: */
801             }
802 /* L60: */
803         }
804
805 /*        JU is the index of the last column affected by the current */
806 /*        stage of the factorization */
807
808         ju = 1;
809
810         i__1 = f2cmin(*m,*n);
811         i__2 = nb;
812         for (j = 1; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
813 /* Computing MIN */
814             i__3 = nb, i__4 = f2cmin(*m,*n) - j + 1;
815             jb = f2cmin(i__3,i__4);
816
817 /*           The active part of the matrix is partitioned */
818
819 /*              A11   A12   A13 */
820 /*              A21   A22   A23 */
821 /*              A31   A32   A33 */
822
823 /*           Here A11, A21 and A31 denote the current block of JB columns */
824 /*           which is about to be factorized. The number of rows in the */
825 /*           partitioning are JB, I2, I3 respectively, and the numbers */
826 /*           of columns are JB, J2, J3. The superdiagonal elements of A13 */
827 /*           and the subdiagonal elements of A31 lie outside the band. */
828
829 /* Computing MIN */
830             i__3 = *kl - jb, i__4 = *m - j - jb + 1;
831             i2 = f2cmin(i__3,i__4);
832 /* Computing MIN */
833             i__3 = jb, i__4 = *m - j - *kl + 1;
834             i3 = f2cmin(i__3,i__4);
835
836 /*           J2 and J3 are computed after JU has been updated. */
837
838 /*           Factorize the current block of JB columns */
839
840             i__3 = j + jb - 1;
841             for (jj = j; jj <= i__3; ++jj) {
842
843 /*              Set fill-in elements in column JJ+KV to zero */
844
845                 if (jj + kv <= *n) {
846                     i__4 = *kl;
847                     for (i__ = 1; i__ <= i__4; ++i__) {
848                         i__5 = i__ + (jj + kv) * ab_dim1;
849                         ab[i__5].r = 0., ab[i__5].i = 0.;
850 /* L70: */
851                     }
852                 }
853
854 /*              Find pivot and test for singularity. KM is the number of */
855 /*              subdiagonal elements in the current column. */
856
857 /* Computing MIN */
858                 i__4 = *kl, i__5 = *m - jj;
859                 km = f2cmin(i__4,i__5);
860                 i__4 = km + 1;
861                 jp = izamax_(&i__4, &ab[kv + 1 + jj * ab_dim1], &c__1);
862                 ipiv[jj] = jp + jj - j;
863                 i__4 = kv + jp + jj * ab_dim1;
864                 if (ab[i__4].r != 0. || ab[i__4].i != 0.) {
865 /* Computing MAX */
866 /* Computing MIN */
867                     i__6 = jj + *ku + jp - 1;
868                     i__4 = ju, i__5 = f2cmin(i__6,*n);
869                     ju = f2cmax(i__4,i__5);
870                     if (jp != 1) {
871
872 /*                    Apply interchange to columns J to J+JB-1 */
873
874                         if (jp + jj - 1 < j + *kl) {
875
876                             i__4 = *ldab - 1;
877                             i__5 = *ldab - 1;
878                             zswap_(&jb, &ab[kv + 1 + jj - j + j * ab_dim1], &
879                                     i__4, &ab[kv + jp + jj - j + j * ab_dim1],
880                                      &i__5);
881                         } else {
882
883 /*                       The interchange affects columns J to JJ-1 of A31 */
884 /*                       which are stored in the work array WORK31 */
885
886                             i__4 = jj - j;
887                             i__5 = *ldab - 1;
888                             zswap_(&i__4, &ab[kv + 1 + jj - j + j * ab_dim1], 
889                                     &i__5, &work31[jp + jj - j - *kl - 1], &
890                                     c__65);
891                             i__4 = j + jb - jj;
892                             i__5 = *ldab - 1;
893                             i__6 = *ldab - 1;
894                             zswap_(&i__4, &ab[kv + 1 + jj * ab_dim1], &i__5, &
895                                     ab[kv + jp + jj * ab_dim1], &i__6);
896                         }
897                     }
898
899 /*                 Compute multipliers */
900
901                     z_div(&z__1, &c_b1, &ab[kv + 1 + jj * ab_dim1]);
902                     zscal_(&km, &z__1, &ab[kv + 2 + jj * ab_dim1], &c__1);
903
904 /*                 Update trailing submatrix within the band and within */
905 /*                 the current block. JM is the index of the last column */
906 /*                 which needs to be updated. */
907
908 /* Computing MIN */
909                     i__4 = ju, i__5 = j + jb - 1;
910                     jm = f2cmin(i__4,i__5);
911                     if (jm > jj) {
912                         i__4 = jm - jj;
913                         z__1.r = -1., z__1.i = 0.;
914                         i__5 = *ldab - 1;
915                         i__6 = *ldab - 1;
916                         zgeru_(&km, &i__4, &z__1, &ab[kv + 2 + jj * ab_dim1], 
917                                 &c__1, &ab[kv + (jj + 1) * ab_dim1], &i__5, &
918                                 ab[kv + 1 + (jj + 1) * ab_dim1], &i__6);
919                     }
920                 } else {
921
922 /*                 If pivot is zero, set INFO to the index of the pivot */
923 /*                 unless a zero pivot has already been found. */
924
925                     if (*info == 0) {
926                         *info = jj;
927                     }
928                 }
929
930 /*              Copy current column of A31 into the work array WORK31 */
931
932 /* Computing MIN */
933                 i__4 = jj - j + 1;
934                 nw = f2cmin(i__4,i3);
935                 if (nw > 0) {
936                     zcopy_(&nw, &ab[kv + *kl + 1 - jj + j + jj * ab_dim1], &
937                             c__1, &work31[(jj - j + 1) * 65 - 65], &c__1);
938                 }
939 /* L80: */
940             }
941             if (j + jb <= *n) {
942
943 /*              Apply the row interchanges to the other blocks. */
944
945 /* Computing MIN */
946                 i__3 = ju - j + 1;
947                 j2 = f2cmin(i__3,kv) - jb;
948 /* Computing MAX */
949                 i__3 = 0, i__4 = ju - j - kv + 1;
950                 j3 = f2cmax(i__3,i__4);
951
952 /*              Use ZLASWP to apply the row interchanges to A12, A22, and */
953 /*              A32. */
954
955                 i__3 = *ldab - 1;
956                 zlaswp_(&j2, &ab[kv + 1 - jb + (j + jb) * ab_dim1], &i__3, &
957                         c__1, &jb, &ipiv[j], &c__1);
958
959 /*              Adjust the pivot indices. */
960
961                 i__3 = j + jb - 1;
962                 for (i__ = j; i__ <= i__3; ++i__) {
963                     ipiv[i__] = ipiv[i__] + j - 1;
964 /* L90: */
965                 }
966
967 /*              Apply the row interchanges to A13, A23, and A33 */
968 /*              columnwise. */
969
970                 k2 = j - 1 + jb + j2;
971                 i__3 = j3;
972                 for (i__ = 1; i__ <= i__3; ++i__) {
973                     jj = k2 + i__;
974                     i__4 = j + jb - 1;
975                     for (ii = j + i__ - 1; ii <= i__4; ++ii) {
976                         ip = ipiv[ii];
977                         if (ip != ii) {
978                             i__5 = kv + 1 + ii - jj + jj * ab_dim1;
979                             temp.r = ab[i__5].r, temp.i = ab[i__5].i;
980                             i__5 = kv + 1 + ii - jj + jj * ab_dim1;
981                             i__6 = kv + 1 + ip - jj + jj * ab_dim1;
982                             ab[i__5].r = ab[i__6].r, ab[i__5].i = ab[i__6].i;
983                             i__5 = kv + 1 + ip - jj + jj * ab_dim1;
984                             ab[i__5].r = temp.r, ab[i__5].i = temp.i;
985                         }
986 /* L100: */
987                     }
988 /* L110: */
989                 }
990
991 /*              Update the relevant part of the trailing submatrix */
992
993                 if (j2 > 0) {
994
995 /*                 Update A12 */
996
997                     i__3 = *ldab - 1;
998                     i__4 = *ldab - 1;
999                     ztrsm_("Left", "Lower", "No transpose", "Unit", &jb, &j2, 
1000                             &c_b1, &ab[kv + 1 + j * ab_dim1], &i__3, &ab[kv + 
1001                             1 - jb + (j + jb) * ab_dim1], &i__4);
1002
1003                     if (i2 > 0) {
1004
1005 /*                    Update A22 */
1006
1007                         z__1.r = -1., z__1.i = 0.;
1008                         i__3 = *ldab - 1;
1009                         i__4 = *ldab - 1;
1010                         i__5 = *ldab - 1;
1011                         zgemm_("No transpose", "No transpose", &i2, &j2, &jb, 
1012                                 &z__1, &ab[kv + 1 + jb + j * ab_dim1], &i__3, 
1013                                 &ab[kv + 1 - jb + (j + jb) * ab_dim1], &i__4, 
1014                                 &c_b1, &ab[kv + 1 + (j + jb) * ab_dim1], &
1015                                 i__5);
1016                     }
1017
1018                     if (i3 > 0) {
1019
1020 /*                    Update A32 */
1021
1022                         z__1.r = -1., z__1.i = 0.;
1023                         i__3 = *ldab - 1;
1024                         i__4 = *ldab - 1;
1025                         zgemm_("No transpose", "No transpose", &i3, &j2, &jb, 
1026                                 &z__1, work31, &c__65, &ab[kv + 1 - jb + (j + 
1027                                 jb) * ab_dim1], &i__3, &c_b1, &ab[kv + *kl + 
1028                                 1 - jb + (j + jb) * ab_dim1], &i__4);
1029                     }
1030                 }
1031
1032                 if (j3 > 0) {
1033
1034 /*                 Copy the lower triangle of A13 into the work array */
1035 /*                 WORK13 */
1036
1037                     i__3 = j3;
1038                     for (jj = 1; jj <= i__3; ++jj) {
1039                         i__4 = jb;
1040                         for (ii = jj; ii <= i__4; ++ii) {
1041                             i__5 = ii + jj * 65 - 66;
1042                             i__6 = ii - jj + 1 + (jj + j + kv - 1) * ab_dim1;
1043                             work13[i__5].r = ab[i__6].r, work13[i__5].i = ab[
1044                                     i__6].i;
1045 /* L120: */
1046                         }
1047 /* L130: */
1048                     }
1049
1050 /*                 Update A13 in the work array */
1051
1052                     i__3 = *ldab - 1;
1053                     ztrsm_("Left", "Lower", "No transpose", "Unit", &jb, &j3, 
1054                             &c_b1, &ab[kv + 1 + j * ab_dim1], &i__3, work13, &
1055                             c__65);
1056
1057                     if (i2 > 0) {
1058
1059 /*                    Update A23 */
1060
1061                         z__1.r = -1., z__1.i = 0.;
1062                         i__3 = *ldab - 1;
1063                         i__4 = *ldab - 1;
1064                         zgemm_("No transpose", "No transpose", &i2, &j3, &jb, 
1065                                 &z__1, &ab[kv + 1 + jb + j * ab_dim1], &i__3, 
1066                                 work13, &c__65, &c_b1, &ab[jb + 1 + (j + kv) *
1067                                  ab_dim1], &i__4);
1068                     }
1069
1070                     if (i3 > 0) {
1071
1072 /*                    Update A33 */
1073
1074                         z__1.r = -1., z__1.i = 0.;
1075                         i__3 = *ldab - 1;
1076                         zgemm_("No transpose", "No transpose", &i3, &j3, &jb, 
1077                                 &z__1, work31, &c__65, work13, &c__65, &c_b1, 
1078                                 &ab[*kl + 1 + (j + kv) * ab_dim1], &i__3);
1079                     }
1080
1081 /*                 Copy the lower triangle of A13 back into place */
1082
1083                     i__3 = j3;
1084                     for (jj = 1; jj <= i__3; ++jj) {
1085                         i__4 = jb;
1086                         for (ii = jj; ii <= i__4; ++ii) {
1087                             i__5 = ii - jj + 1 + (jj + j + kv - 1) * ab_dim1;
1088                             i__6 = ii + jj * 65 - 66;
1089                             ab[i__5].r = work13[i__6].r, ab[i__5].i = work13[
1090                                     i__6].i;
1091 /* L140: */
1092                         }
1093 /* L150: */
1094                     }
1095                 }
1096             } else {
1097
1098 /*              Adjust the pivot indices. */
1099
1100                 i__3 = j + jb - 1;
1101                 for (i__ = j; i__ <= i__3; ++i__) {
1102                     ipiv[i__] = ipiv[i__] + j - 1;
1103 /* L160: */
1104                 }
1105             }
1106
1107 /*           Partially undo the interchanges in the current block to */
1108 /*           restore the upper triangular form of A31 and copy the upper */
1109 /*           triangle of A31 back into place */
1110
1111             i__3 = j;
1112             for (jj = j + jb - 1; jj >= i__3; --jj) {
1113                 jp = ipiv[jj] - jj + 1;
1114                 if (jp != 1) {
1115
1116 /*                 Apply interchange to columns J to JJ-1 */
1117
1118                     if (jp + jj - 1 < j + *kl) {
1119
1120 /*                    The interchange does not affect A31 */
1121
1122                         i__4 = jj - j;
1123                         i__5 = *ldab - 1;
1124                         i__6 = *ldab - 1;
1125                         zswap_(&i__4, &ab[kv + 1 + jj - j + j * ab_dim1], &
1126                                 i__5, &ab[kv + jp + jj - j + j * ab_dim1], &
1127                                 i__6);
1128                     } else {
1129
1130 /*                    The interchange does affect A31 */
1131
1132                         i__4 = jj - j;
1133                         i__5 = *ldab - 1;
1134                         zswap_(&i__4, &ab[kv + 1 + jj - j + j * ab_dim1], &
1135                                 i__5, &work31[jp + jj - j - *kl - 1], &c__65);
1136                     }
1137                 }
1138
1139 /*              Copy the current column of A31 back into place */
1140
1141 /* Computing MIN */
1142                 i__4 = i3, i__5 = jj - j + 1;
1143                 nw = f2cmin(i__4,i__5);
1144                 if (nw > 0) {
1145                     zcopy_(&nw, &work31[(jj - j + 1) * 65 - 65], &c__1, &ab[
1146                             kv + *kl + 1 - jj + j + jj * ab_dim1], &c__1);
1147                 }
1148 /* L170: */
1149             }
1150 /* L180: */
1151         }
1152     }
1153
1154     return 0;
1155
1156 /*     End of ZGBTRF */
1157
1158 } /* zgbtrf_ */
1159