14 typedef long long BLASLONG;
15 typedef unsigned long long BLASULONG;
17 typedef long BLASLONG;
18 typedef unsigned long BLASULONG;
22 typedef BLASLONG blasint;
24 #define blasabs(x) llabs(x)
26 #define blasabs(x) labs(x)
30 #define blasabs(x) abs(x)
33 typedef blasint integer;
35 typedef unsigned int uinteger;
36 typedef char *address;
37 typedef short int shortint;
39 typedef double doublereal;
40 typedef struct { real r, i; } complex;
41 typedef struct { doublereal r, i; } doublecomplex;
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;}
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;}
53 #define pCf(z) (*_pCf(z))
54 #define pCd(z) (*_pCd(z))
56 typedef short int shortlogical;
57 typedef char logical1;
58 typedef char integer1;
63 /* Extern is for use with -E */
74 /*external read, write*/
83 /*internal read, write*/
113 /*rewind, backspace, endfile*/
125 ftnint *inex; /*parameters in standard's order*/
151 union Multitype { /* for multiple entry points */
162 typedef union Multitype Multitype;
164 struct Vardesc { /* for Namelist */
170 typedef struct Vardesc Vardesc;
177 typedef struct Namelist Namelist;
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)))
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)); }
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]);}
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);}
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)}
261 /* procedure parameter types for -A and -C++ */
263 #define F2C_proc_par_types 1
265 typedef logical (*L_fp)(...);
267 typedef logical (*L_fp)();
270 static float spow_ui(float x, integer n) {
271 float pow=1.0; unsigned long int u;
273 if(n < 0) n = -n, x = 1/x;
282 static double dpow_ui(double x, integer n) {
283 double pow=1.0; unsigned long int u;
285 if(n < 0) n = -n, x = 1/x;
295 static _Fcomplex cpow_ui(complex x, integer n) {
296 complex pow={1.0,0.0}; unsigned long int u;
298 if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
300 if(u & 01) pow.r *= x.r, pow.i *= x.i;
301 if(u >>= 1) x.r *= x.r, x.i *= x.i;
305 _Fcomplex p={pow.r, pow.i};
309 static _Complex float cpow_ui(_Complex float x, integer n) {
310 _Complex float pow=1.0; unsigned long int u;
312 if(n < 0) n = -n, x = 1/x;
323 static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
324 _Dcomplex pow={1.0,0.0}; unsigned long int u;
326 if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
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];
333 _Dcomplex p = {pow._Val[0], pow._Val[1]};
337 static _Complex double zpow_ui(_Complex double x, integer n) {
338 _Complex double pow=1.0; unsigned long int u;
340 if(n < 0) n = -n, x = 1/x;
350 static integer pow_ii(integer x, integer n) {
351 integer pow; unsigned long int u;
353 if (n == 0 || x == 1) pow = 1;
354 else if (x != -1) pow = x == 0 ? 1/x : 0;
357 if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
367 static integer dmaxloc_(double *w, integer s, integer e, integer *n)
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];
374 static integer smaxloc_(float *w, integer s, integer e, integer *n)
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];
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;
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];
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];
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]);
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]);
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;
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];
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];
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]);
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]);
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;
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];
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];
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]);
467 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
468 zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
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;
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];
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];
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]);
498 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
499 zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
505 /* -- translated by f2c (version 20000121).
506 You must link the resulting object file with the libraries:
507 -lf2c -lm (in that order)
513 /* Table of constant values */
515 static complex c_b1 = {0.f,0.f};
516 static integer c__6 = 6;
517 static integer c__0 = 0;
518 static integer c__2 = 2;
519 static integer c__1 = 1;
520 static integer c_n1 = -1;
522 /* > \brief <b> CGESVDX computes the singular value decomposition (SVD) for GE matrices</b> */
524 /* =========== DOCUMENTATION =========== */
526 /* Online html documentation available at */
527 /* http://www.netlib.org/lapack/explore-html/ */
530 /* > Download CGESVDX + dependencies */
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgesvdx
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cgesvdx
537 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgesvdx
545 /* SUBROUTINE CGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, */
546 /* $ IL, IU, NS, S, U, LDU, VT, LDVT, WORK, */
547 /* $ LWORK, RWORK, IWORK, INFO ) */
550 /* CHARACTER JOBU, JOBVT, RANGE */
551 /* INTEGER IL, INFO, IU, LDA, LDU, LDVT, LWORK, M, N, NS */
553 /* INTEGER IWORK( * ) */
554 /* REAL S( * ), RWORK( * ) */
555 /* COMPLEX A( LDA, * ), U( LDU, * ), VT( LDVT, * ), */
559 /* > \par Purpose: */
564 /* > CGESVDX computes the singular value decomposition (SVD) of a complex */
565 /* > M-by-N matrix A, optionally computing the left and/or right singular */
566 /* > vectors. The SVD is written */
568 /* > A = U * SIGMA * transpose(V) */
570 /* > where SIGMA is an M-by-N matrix which is zero except for its */
571 /* > f2cmin(m,n) diagonal elements, U is an M-by-M unitary matrix, and */
572 /* > V is an N-by-N unitary matrix. The diagonal elements of SIGMA */
573 /* > are the singular values of A; they are real and non-negative, and */
574 /* > are returned in descending order. The first f2cmin(m,n) columns of */
575 /* > U and V are the left and right singular vectors of A. */
577 /* > CGESVDX uses an eigenvalue problem for obtaining the SVD, which */
578 /* > allows for the computation of a subset of singular values and */
579 /* > vectors. See SBDSVDX for details. */
581 /* > Note that the routine returns V**T, not V. */
587 /* > \param[in] JOBU */
589 /* > JOBU is CHARACTER*1 */
590 /* > Specifies options for computing all or part of the matrix U: */
591 /* > = 'V': the first f2cmin(m,n) columns of U (the left singular */
592 /* > vectors) or as specified by RANGE are returned in */
594 /* > = 'N': no columns of U (no left singular vectors) are */
598 /* > \param[in] JOBVT */
600 /* > JOBVT is CHARACTER*1 */
601 /* > Specifies options for computing all or part of the matrix */
603 /* > = 'V': the first f2cmin(m,n) rows of V**T (the right singular */
604 /* > vectors) or as specified by RANGE are returned in */
605 /* > the array VT; */
606 /* > = 'N': no rows of V**T (no right singular vectors) are */
610 /* > \param[in] RANGE */
612 /* > RANGE is CHARACTER*1 */
613 /* > = 'A': all singular values will be found. */
614 /* > = 'V': all singular values in the half-open interval (VL,VU] */
615 /* > will be found. */
616 /* > = 'I': the IL-th through IU-th singular values will be found. */
622 /* > The number of rows of the input matrix A. M >= 0. */
628 /* > The number of columns of the input matrix A. N >= 0. */
631 /* > \param[in,out] A */
633 /* > A is COMPLEX array, dimension (LDA,N) */
634 /* > On entry, the M-by-N matrix A. */
635 /* > On exit, the contents of A are destroyed. */
638 /* > \param[in] LDA */
640 /* > LDA is INTEGER */
641 /* > The leading dimension of the array A. LDA >= f2cmax(1,M). */
644 /* > \param[in] VL */
647 /* > If RANGE='V', the lower bound of the interval to */
648 /* > be searched for singular values. VU > VL. */
649 /* > Not referenced if RANGE = 'A' or 'I'. */
652 /* > \param[in] VU */
655 /* > If RANGE='V', the upper bound of the interval to */
656 /* > be searched for singular values. VU > VL. */
657 /* > Not referenced if RANGE = 'A' or 'I'. */
660 /* > \param[in] IL */
662 /* > IL is INTEGER */
663 /* > If RANGE='I', the index of the */
664 /* > smallest singular value to be returned. */
665 /* > 1 <= IL <= IU <= f2cmin(M,N), if f2cmin(M,N) > 0. */
666 /* > Not referenced if RANGE = 'A' or 'V'. */
669 /* > \param[in] IU */
671 /* > IU is INTEGER */
672 /* > If RANGE='I', the index of the */
673 /* > largest singular value to be returned. */
674 /* > 1 <= IL <= IU <= f2cmin(M,N), if f2cmin(M,N) > 0. */
675 /* > Not referenced if RANGE = 'A' or 'V'. */
678 /* > \param[out] NS */
680 /* > NS is INTEGER */
681 /* > The total number of singular values found, */
682 /* > 0 <= NS <= f2cmin(M,N). */
683 /* > If RANGE = 'A', NS = f2cmin(M,N); if RANGE = 'I', NS = IU-IL+1. */
686 /* > \param[out] S */
688 /* > S is REAL array, dimension (f2cmin(M,N)) */
689 /* > The singular values of A, sorted so that S(i) >= S(i+1). */
692 /* > \param[out] U */
694 /* > U is COMPLEX array, dimension (LDU,UCOL) */
695 /* > If JOBU = 'V', U contains columns of U (the left singular */
696 /* > vectors, stored columnwise) as specified by RANGE; if */
697 /* > JOBU = 'N', U is not referenced. */
698 /* > Note: The user must ensure that UCOL >= NS; if RANGE = 'V', */
699 /* > the exact value of NS is not known in advance and an upper */
700 /* > bound must be used. */
703 /* > \param[in] LDU */
705 /* > LDU is INTEGER */
706 /* > The leading dimension of the array U. LDU >= 1; if */
707 /* > JOBU = 'V', LDU >= M. */
710 /* > \param[out] VT */
712 /* > VT is COMPLEX array, dimension (LDVT,N) */
713 /* > If JOBVT = 'V', VT contains the rows of V**T (the right singular */
714 /* > vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N', */
715 /* > VT is not referenced. */
716 /* > Note: The user must ensure that LDVT >= NS; if RANGE = 'V', */
717 /* > the exact value of NS is not known in advance and an upper */
718 /* > bound must be used. */
721 /* > \param[in] LDVT */
723 /* > LDVT is INTEGER */
724 /* > The leading dimension of the array VT. LDVT >= 1; if */
725 /* > JOBVT = 'V', LDVT >= NS (see above). */
728 /* > \param[out] WORK */
730 /* > WORK is COMPLEX array, dimension (MAX(1,LWORK)) */
731 /* > On exit, if INFO = 0, WORK(1) returns the optimal LWORK; */
734 /* > \param[in] LWORK */
736 /* > LWORK is INTEGER */
737 /* > The dimension of the array WORK. */
738 /* > LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see */
739 /* > comments inside the code): */
740 /* > - PATH 1 (M much larger than N) */
741 /* > - PATH 1t (N much larger than M) */
742 /* > LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths. */
743 /* > For good performance, LWORK should generally be larger. */
745 /* > If LWORK = -1, then a workspace query is assumed; the routine */
746 /* > only calculates the optimal size of the WORK array, returns */
747 /* > this value as the first entry of the WORK array, and no error */
748 /* > message related to LWORK is issued by XERBLA. */
751 /* > \param[out] RWORK */
753 /* > RWORK is REAL array, dimension (MAX(1,LRWORK)) */
754 /* > LRWORK >= MIN(M,N)*(MIN(M,N)*2+15*MIN(M,N)). */
757 /* > \param[out] IWORK */
759 /* > IWORK is INTEGER array, dimension (12*MIN(M,N)) */
760 /* > If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0, */
761 /* > then IWORK contains the indices of the eigenvectors that failed */
762 /* > to converge in SBDSVDX/SSTEVX. */
765 /* > \param[out] INFO */
767 /* > INFO is INTEGER */
768 /* > = 0: successful exit */
769 /* > < 0: if INFO = -i, the i-th argument had an illegal value */
770 /* > > 0: if INFO = i, then i eigenvectors failed to converge */
771 /* > in SBDSVDX/SSTEVX. */
772 /* > if INFO = N*2 + 1, an internal error occurred in */
779 /* > \author Univ. of Tennessee */
780 /* > \author Univ. of California Berkeley */
781 /* > \author Univ. of Colorado Denver */
782 /* > \author NAG Ltd. */
784 /* > \date June 2016 */
786 /* > \ingroup complexGEsing */
788 /* ===================================================================== */
789 /* Subroutine */ int cgesvdx_(char *jobu, char *jobvt, char *range, integer *
790 m, integer *n, complex *a, integer *lda, real *vl, real *vu, integer *
791 il, integer *iu, integer *ns, real *s, complex *u, integer *ldu,
792 complex *vt, integer *ldvt, complex *work, integer *lwork, real *
793 rwork, integer *iwork, integer *info)
795 /* System generated locals */
797 integer a_dim1, a_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1[2],
798 i__2, i__3, i__4, i__5;
803 /* Local variables */
808 integer ierr, iqrf, itau;
812 extern logical lsame_(char *, char *);
813 integer iltgk, itemp, minmn, itaup, itauq, iutgk, itgkz, mnthr;
816 extern /* Subroutine */ int cgebrd_(integer *, integer *, complex *,
817 integer *, real *, real *, complex *, complex *, complex *,
818 integer *, integer *);
819 extern real clange_(char *, integer *, integer *, complex *, integer *,
821 extern /* Subroutine */ int cgelqf_(integer *, integer *, complex *,
822 integer *, complex *, complex *, integer *, integer *), clascl_(
823 char *, integer *, integer *, real *, real *, integer *, integer *
824 , complex *, integer *, integer *), cgeqrf_(integer *,
825 integer *, complex *, integer *, complex *, complex *, integer *,
827 extern real slamch_(char *);
828 extern /* Subroutine */ int claset_(char *, integer *, integer *, complex
829 *, complex *, complex *, integer *), clacpy_(char *,
830 integer *, integer *, complex *, integer *, complex *, integer *), xerbla_(char *, integer *, ftnlen);
831 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
832 integer *, integer *, ftnlen, ftnlen);
834 extern /* Subroutine */ int slascl_(char *, integer *, integer *, real *,
835 real *, integer *, integer *, real *, integer *, integer *);
837 extern /* Subroutine */ int cunmbr_(char *, char *, char *, integer *,
838 integer *, integer *, complex *, integer *, complex *, complex *,
839 integer *, complex *, integer *, integer *);
841 extern /* Subroutine */ int cunmlq_(char *, char *, integer *, integer *,
842 integer *, complex *, integer *, complex *, complex *, integer *,
843 complex *, integer *, integer *);
845 extern /* Subroutine */ int cunmqr_(char *, char *, integer *, integer *,
846 integer *, complex *, integer *, complex *, complex *, integer *,
847 complex *, integer *, integer *);
848 integer minwrk, maxwrk;
850 logical lquery, wantvt;
852 extern /* Subroutine */ int sbdsvdx_(char *, char *, char *, integer *,
853 real *, real *, real *, real *, integer *, integer *, integer *,
854 real *, real *, integer *, real *, integer *, integer *);
857 /* -- LAPACK driver routine (version 3.8.0) -- */
858 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
859 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
863 /* ===================================================================== */
866 /* Test the input arguments. */
868 /* Parameter adjustments */
870 a_offset = 1 + a_dim1 * 1;
874 u_offset = 1 + u_dim1 * 1;
877 vt_offset = 1 + vt_dim1 * 1;
886 abstol = slamch_("S") * 2;
887 lquery = *lwork == -1;
888 minmn = f2cmin(*m,*n);
889 wantu = lsame_(jobu, "V");
890 wantvt = lsame_(jobvt, "V");
891 if (wantu || wantvt) {
892 *(unsigned char *)jobz = 'V';
894 *(unsigned char *)jobz = 'N';
896 alls = lsame_(range, "A");
897 vals = lsame_(range, "V");
898 inds = lsame_(range, "I");
901 if (! lsame_(jobu, "V") && ! lsame_(jobu, "N")) {
903 } else if (! lsame_(jobvt, "V") && ! lsame_(jobvt,
906 } else if (! (alls || vals || inds)) {
912 } else if (*m > *lda) {
914 } else if (minmn > 0) {
918 } else if (*vu <= *vl) {
922 if (*il < 1 || *il > f2cmax(1,minmn)) {
924 } else if (*iu < f2cmin(minmn,*il) || *iu > minmn) {
929 if (wantu && *ldu < *m) {
933 if (*ldvt < *iu - *il + 1) {
936 } else if (*ldvt < minmn) {
943 /* Compute workspace */
944 /* (Note: Comments in the code beginning "Workspace:" describe the */
945 /* minimal amount of workspace needed at that point in the code, */
946 /* as well as the preferred amount for good performance. */
947 /* NB refers to the optimal block size for the immediately */
948 /* following subroutine, as returned by ILAENV.) */
955 /* Writing concatenation */
956 i__1[0] = 1, a__1[0] = jobu;
957 i__1[1] = 1, a__1[1] = jobvt;
958 s_cat(ch__1, a__1, i__1, &c__2, (ftnlen)2);
959 mnthr = ilaenv_(&c__6, "CGESVD", ch__1, m, n, &c__0, &c__0, (
960 ftnlen)6, (ftnlen)2);
963 /* Path 1 (M much larger than N) */
965 minwrk = *n * (*n + 5);
966 maxwrk = *n + *n * ilaenv_(&c__1, "CGEQRF", " ", m, n, &
967 c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
969 i__2 = maxwrk, i__3 = *n * *n + (*n << 1) + (*n << 1) *
970 ilaenv_(&c__1, "CGEBRD", " ", n, n, &c_n1, &c_n1,
971 (ftnlen)6, (ftnlen)1);
972 maxwrk = f2cmax(i__2,i__3);
973 if (wantu || wantvt) {
975 i__2 = maxwrk, i__3 = *n * *n + (*n << 1) + *n *
976 ilaenv_(&c__1, "CUNMQR", "LN", n, n, n, &c_n1,
977 (ftnlen)6, (ftnlen)2);
978 maxwrk = f2cmax(i__2,i__3);
982 /* Path 2 (M at least N, but not much larger) */
984 minwrk = *n * 3 + *m;
985 maxwrk = (*n << 1) + (*m + *n) * ilaenv_(&c__1, "CGEBRD",
986 " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
987 if (wantu || wantvt) {
989 i__2 = maxwrk, i__3 = (*n << 1) + *n * ilaenv_(&c__1,
990 "CUNMQR", "LN", n, n, n, &c_n1, (ftnlen)6, (
992 maxwrk = f2cmax(i__2,i__3);
996 /* Writing concatenation */
997 i__1[0] = 1, a__1[0] = jobu;
998 i__1[1] = 1, a__1[1] = jobvt;
999 s_cat(ch__1, a__1, i__1, &c__2, (ftnlen)2);
1000 mnthr = ilaenv_(&c__6, "CGESVD", ch__1, m, n, &c__0, &c__0, (
1001 ftnlen)6, (ftnlen)2);
1004 /* Path 1t (N much larger than M) */
1006 minwrk = *m * (*m + 5);
1007 maxwrk = *m + *m * ilaenv_(&c__1, "CGELQF", " ", m, n, &
1008 c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
1010 i__2 = maxwrk, i__3 = *m * *m + (*m << 1) + (*m << 1) *
1011 ilaenv_(&c__1, "CGEBRD", " ", m, m, &c_n1, &c_n1,
1012 (ftnlen)6, (ftnlen)1);
1013 maxwrk = f2cmax(i__2,i__3);
1014 if (wantu || wantvt) {
1016 i__2 = maxwrk, i__3 = *m * *m + (*m << 1) + *m *
1017 ilaenv_(&c__1, "CUNMQR", "LN", m, m, m, &c_n1,
1018 (ftnlen)6, (ftnlen)2);
1019 maxwrk = f2cmax(i__2,i__3);
1023 /* Path 2t (N greater than M, but not much larger) */
1026 minwrk = *m * 3 + *n;
1027 maxwrk = (*m << 1) + (*m + *n) * ilaenv_(&c__1, "CGEBRD",
1028 " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
1029 if (wantu || wantvt) {
1031 i__2 = maxwrk, i__3 = (*m << 1) + *m * ilaenv_(&c__1,
1032 "CUNMQR", "LN", m, m, m, &c_n1, (ftnlen)6, (
1034 maxwrk = f2cmax(i__2,i__3);
1039 maxwrk = f2cmax(maxwrk,minwrk);
1040 r__1 = (real) maxwrk;
1041 q__1.r = r__1, q__1.i = 0.f;
1042 work[1].r = q__1.r, work[1].i = q__1.i;
1044 if (*lwork < minwrk && ! lquery) {
1051 xerbla_("CGESVDX", &i__2, (ftnlen)7);
1053 } else if (lquery) {
1057 /* Quick return if possible */
1059 if (*m == 0 || *n == 0) {
1063 /* Set singular values indices accord to RANGE='A'. */
1066 *(unsigned char *)rngtgk = 'I';
1068 iutgk = f2cmin(*m,*n);
1070 *(unsigned char *)rngtgk = 'I';
1074 *(unsigned char *)rngtgk = 'V';
1079 /* Get machine constants */
1082 smlnum = sqrt(slamch_("S")) / eps;
1083 bignum = 1.f / smlnum;
1085 /* Scale A if f2cmax element outside range [SMLNUM,BIGNUM] */
1087 anrm = clange_("M", m, n, &a[a_offset], lda, dum);
1089 if (anrm > 0.f && anrm < smlnum) {
1091 clascl_("G", &c__0, &c__0, &anrm, &smlnum, m, n, &a[a_offset], lda,
1093 } else if (anrm > bignum) {
1095 clascl_("G", &c__0, &c__0, &anrm, &bignum, m, n, &a[a_offset], lda,
1101 /* A has at least as many rows as columns. If A has sufficiently */
1102 /* more rows than columns, first reduce A using the QR */
1103 /* decomposition. */
1107 /* Path 1 (M much larger than N): */
1108 /* A = Q * R = Q * ( QB * B * PB**T ) */
1109 /* = Q * ( QB * ( UB * S * VB**T ) * PB**T ) */
1110 /* U = Q * QB * UB; V**T = VB**T * PB**T */
1113 /* (Workspace: need 2*N, prefer N+N*NB) */
1117 i__2 = *lwork - itemp + 1;
1118 cgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[itemp], &i__2,
1121 /* Copy R into WORK and bidiagonalize it: */
1122 /* (Workspace: need N*N+3*N, prefer N*N+N+2*N*NB) */
1125 itauq = itemp + *n * *n;
1131 clacpy_("U", n, n, &a[a_offset], lda, &work[iqrf], n);
1134 claset_("L", &i__2, &i__3, &c_b1, &c_b1, &work[iqrf + 1], n);
1135 i__2 = *lwork - itemp + 1;
1136 cgebrd_(n, n, &work[iqrf], n, &rwork[id], &rwork[ie], &work[itauq]
1137 , &work[itaup], &work[itemp], &i__2, info);
1138 itempr = itgkz + *n * ((*n << 1) + 1);
1140 /* Solve eigenvalue problem TGK*Z=Z*S. */
1141 /* (Workspace: need 2*N*N+14*N) */
1144 sbdsvdx_("U", jobz, rngtgk, n, &rwork[id], &rwork[ie], vl, vu, &
1145 iltgk, &iutgk, ns, &s[1], &rwork[itgkz], &i__2, &rwork[
1146 itempr], &iwork[1], info)
1149 /* If needed, compute left singular vectors. */
1154 for (i__ = 1; i__ <= i__2; ++i__) {
1156 for (j = 1; j <= i__3; ++j) {
1157 i__4 = j + i__ * u_dim1;
1159 q__1.r = rwork[i__5], q__1.i = 0.f;
1160 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
1166 claset_("A", &i__2, ns, &c_b1, &c_b1, &u[*n + 1 + u_dim1],
1169 /* Call CUNMBR to compute QB*UB. */
1170 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1172 i__2 = *lwork - itemp + 1;
1173 cunmbr_("Q", "L", "N", n, ns, n, &work[iqrf], n, &work[itauq],
1174 &u[u_offset], ldu, &work[itemp], &i__2, info);
1176 /* Call CUNMQR to compute Q*(QB*UB). */
1177 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1179 i__2 = *lwork - itemp + 1;
1180 cunmqr_("L", "N", m, ns, n, &a[a_offset], lda, &work[itau], &
1181 u[u_offset], ldu, &work[itemp], &i__2, info);
1184 /* If needed, compute right singular vectors. */
1189 for (i__ = 1; i__ <= i__2; ++i__) {
1191 for (j = 1; j <= i__3; ++j) {
1192 i__4 = i__ + j * vt_dim1;
1194 q__1.r = rwork[i__5], q__1.i = 0.f;
1195 vt[i__4].r = q__1.r, vt[i__4].i = q__1.i;
1201 /* Call CUNMBR to compute VB**T * PB**T */
1202 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1204 i__2 = *lwork - itemp + 1;
1205 cunmbr_("P", "R", "C", ns, n, n, &work[iqrf], n, &work[itaup],
1206 &vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1210 /* Path 2 (M at least N, but not much larger) */
1211 /* Reduce A to bidiagonal form without QR decomposition */
1212 /* A = QB * B * PB**T = QB * ( UB * S * VB**T ) * PB**T */
1213 /* U = QB * UB; V**T = VB**T * PB**T */
1215 /* Bidiagonalize A */
1216 /* (Workspace: need 2*N+M, prefer 2*N+(M+N)*NB) */
1224 i__2 = *lwork - itemp + 1;
1225 cgebrd_(m, n, &a[a_offset], lda, &rwork[id], &rwork[ie], &work[
1226 itauq], &work[itaup], &work[itemp], &i__2, info);
1227 itempr = itgkz + *n * ((*n << 1) + 1);
1229 /* Solve eigenvalue problem TGK*Z=Z*S. */
1230 /* (Workspace: need 2*N*N+14*N) */
1233 sbdsvdx_("U", jobz, rngtgk, n, &rwork[id], &rwork[ie], vl, vu, &
1234 iltgk, &iutgk, ns, &s[1], &rwork[itgkz], &i__2, &rwork[
1235 itempr], &iwork[1], info)
1238 /* If needed, compute left singular vectors. */
1243 for (i__ = 1; i__ <= i__2; ++i__) {
1245 for (j = 1; j <= i__3; ++j) {
1246 i__4 = j + i__ * u_dim1;
1248 q__1.r = rwork[i__5], q__1.i = 0.f;
1249 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
1255 claset_("A", &i__2, ns, &c_b1, &c_b1, &u[*n + 1 + u_dim1],
1258 /* Call CUNMBR to compute QB*UB. */
1259 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1261 i__2 = *lwork - itemp + 1;
1262 cunmbr_("Q", "L", "N", m, ns, n, &a[a_offset], lda, &work[
1263 itauq], &u[u_offset], ldu, &work[itemp], &i__2, &ierr);
1266 /* If needed, compute right singular vectors. */
1271 for (i__ = 1; i__ <= i__2; ++i__) {
1273 for (j = 1; j <= i__3; ++j) {
1274 i__4 = i__ + j * vt_dim1;
1276 q__1.r = rwork[i__5], q__1.i = 0.f;
1277 vt[i__4].r = q__1.r, vt[i__4].i = q__1.i;
1283 /* Call CUNMBR to compute VB**T * PB**T */
1284 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1286 i__2 = *lwork - itemp + 1;
1287 cunmbr_("P", "R", "C", ns, n, n, &a[a_offset], lda, &work[
1288 itaup], &vt[vt_offset], ldvt, &work[itemp], &i__2, &
1294 /* A has more columns than rows. If A has sufficiently more */
1295 /* columns than rows, first reduce A using the LQ decomposition. */
1299 /* Path 1t (N much larger than M): */
1300 /* A = L * Q = ( QB * B * PB**T ) * Q */
1301 /* = ( QB * ( UB * S * VB**T ) * PB**T ) * Q */
1302 /* U = QB * UB ; V**T = VB**T * PB**T * Q */
1305 /* (Workspace: need 2*M, prefer M+M*NB) */
1309 i__2 = *lwork - itemp + 1;
1310 cgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[itemp], &i__2,
1312 /* Copy L into WORK and bidiagonalize it: */
1313 /* (Workspace in WORK( ITEMP ): need M*M+3*M, prefer M*M+M+2*M*NB) */
1316 itauq = ilqf + *m * *m;
1322 clacpy_("L", m, m, &a[a_offset], lda, &work[ilqf], m);
1325 claset_("U", &i__2, &i__3, &c_b1, &c_b1, &work[ilqf + *m], m);
1326 i__2 = *lwork - itemp + 1;
1327 cgebrd_(m, m, &work[ilqf], m, &rwork[id], &rwork[ie], &work[itauq]
1328 , &work[itaup], &work[itemp], &i__2, info);
1329 itempr = itgkz + *m * ((*m << 1) + 1);
1331 /* Solve eigenvalue problem TGK*Z=Z*S. */
1332 /* (Workspace: need 2*M*M+14*M) */
1335 sbdsvdx_("U", jobz, rngtgk, m, &rwork[id], &rwork[ie], vl, vu, &
1336 iltgk, &iutgk, ns, &s[1], &rwork[itgkz], &i__2, &rwork[
1337 itempr], &iwork[1], info)
1340 /* If needed, compute left singular vectors. */
1345 for (i__ = 1; i__ <= i__2; ++i__) {
1347 for (j = 1; j <= i__3; ++j) {
1348 i__4 = j + i__ * u_dim1;
1350 q__1.r = rwork[i__5], q__1.i = 0.f;
1351 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
1357 /* Call CUNMBR to compute QB*UB. */
1358 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1360 i__2 = *lwork - itemp + 1;
1361 cunmbr_("Q", "L", "N", m, ns, m, &work[ilqf], m, &work[itauq],
1362 &u[u_offset], ldu, &work[itemp], &i__2, info);
1365 /* If needed, compute right singular vectors. */
1370 for (i__ = 1; i__ <= i__2; ++i__) {
1372 for (j = 1; j <= i__3; ++j) {
1373 i__4 = i__ + j * vt_dim1;
1375 q__1.r = rwork[i__5], q__1.i = 0.f;
1376 vt[i__4].r = q__1.r, vt[i__4].i = q__1.i;
1382 claset_("A", ns, &i__2, &c_b1, &c_b1, &vt[(*m + 1) * vt_dim1
1385 /* Call CUNMBR to compute (VB**T)*(PB**T) */
1386 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1388 i__2 = *lwork - itemp + 1;
1389 cunmbr_("P", "R", "C", ns, m, m, &work[ilqf], m, &work[itaup],
1390 &vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1392 /* Call CUNMLQ to compute ((VB**T)*(PB**T))*Q. */
1393 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1395 i__2 = *lwork - itemp + 1;
1396 cunmlq_("R", "N", ns, n, m, &a[a_offset], lda, &work[itau], &
1397 vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1401 /* Path 2t (N greater than M, but not much larger) */
1402 /* Reduce to bidiagonal form without LQ decomposition */
1403 /* A = QB * B * PB**T = QB * ( UB * S * VB**T ) * PB**T */
1404 /* U = QB * UB; V**T = VB**T * PB**T */
1406 /* Bidiagonalize A */
1407 /* (Workspace: need 2*M+N, prefer 2*M+(M+N)*NB) */
1415 i__2 = *lwork - itemp + 1;
1416 cgebrd_(m, n, &a[a_offset], lda, &rwork[id], &rwork[ie], &work[
1417 itauq], &work[itaup], &work[itemp], &i__2, info);
1418 itempr = itgkz + *m * ((*m << 1) + 1);
1420 /* Solve eigenvalue problem TGK*Z=Z*S. */
1421 /* (Workspace: need 2*M*M+14*M) */
1424 sbdsvdx_("L", jobz, rngtgk, m, &rwork[id], &rwork[ie], vl, vu, &
1425 iltgk, &iutgk, ns, &s[1], &rwork[itgkz], &i__2, &rwork[
1426 itempr], &iwork[1], info)
1429 /* If needed, compute left singular vectors. */
1434 for (i__ = 1; i__ <= i__2; ++i__) {
1436 for (j = 1; j <= i__3; ++j) {
1437 i__4 = j + i__ * u_dim1;
1439 q__1.r = rwork[i__5], q__1.i = 0.f;
1440 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
1446 /* Call CUNMBR to compute QB*UB. */
1447 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1449 i__2 = *lwork - itemp + 1;
1450 cunmbr_("Q", "L", "N", m, ns, n, &a[a_offset], lda, &work[
1451 itauq], &u[u_offset], ldu, &work[itemp], &i__2, info);
1454 /* If needed, compute right singular vectors. */
1459 for (i__ = 1; i__ <= i__2; ++i__) {
1461 for (j = 1; j <= i__3; ++j) {
1462 i__4 = i__ + j * vt_dim1;
1464 q__1.r = rwork[i__5], q__1.i = 0.f;
1465 vt[i__4].r = q__1.r, vt[i__4].i = q__1.i;
1471 claset_("A", ns, &i__2, &c_b1, &c_b1, &vt[(*m + 1) * vt_dim1
1474 /* Call CUNMBR to compute VB**T * PB**T */
1475 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1477 i__2 = *lwork - itemp + 1;
1478 cunmbr_("P", "R", "C", ns, n, m, &a[a_offset], lda, &work[
1479 itaup], &vt[vt_offset], ldvt, &work[itemp], &i__2,
1485 /* Undo scaling if necessary */
1488 if (anrm > bignum) {
1489 slascl_("G", &c__0, &c__0, &bignum, &anrm, &minmn, &c__1, &s[1], &
1492 if (anrm < smlnum) {
1493 slascl_("G", &c__0, &c__0, &smlnum, &anrm, &minmn, &c__1, &s[1], &
1498 /* Return optimal workspace in WORK(1) */
1500 r__1 = (real) maxwrk;
1501 q__1.r = r__1, q__1.i = 0.f;
1502 work[1].r = q__1.r, work[1].i = q__1.i;
1506 /* End of CGESVDX */