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 integer c__6 = 6;
516 static integer c__0 = 0;
517 static integer c__2 = 2;
518 static integer c__1 = 1;
519 static integer c_n1 = -1;
520 static doublereal c_b109 = 0.;
522 /* > \brief <b> DGESVDX 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 DGESVDX + dependencies */
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgesvdx
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgesvdx
537 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesvdx
545 /* SUBROUTINE DGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, */
546 /* $ IL, IU, NS, S, U, LDU, VT, LDVT, WORK, */
547 /* $ LWORK, IWORK, INFO ) */
550 /* CHARACTER JOBU, JOBVT, RANGE */
551 /* INTEGER IL, INFO, IU, LDA, LDU, LDVT, LWORK, M, N, NS */
552 /* DOUBLE PRECISION VL, VU */
553 /* INTEGER IWORK( * ) */
554 /* DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ), */
555 /* $ VT( LDVT, * ), WORK( * ) */
558 /* > \par Purpose: */
563 /* > DGESVDX computes the singular value decomposition (SVD) of a real */
564 /* > M-by-N matrix A, optionally computing the left and/or right singular */
565 /* > vectors. The SVD is written */
567 /* > A = U * SIGMA * transpose(V) */
569 /* > where SIGMA is an M-by-N matrix which is zero except for its */
570 /* > f2cmin(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and */
571 /* > V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA */
572 /* > are the singular values of A; they are real and non-negative, and */
573 /* > are returned in descending order. The first f2cmin(m,n) columns of */
574 /* > U and V are the left and right singular vectors of A. */
576 /* > DGESVDX uses an eigenvalue problem for obtaining the SVD, which */
577 /* > allows for the computation of a subset of singular values and */
578 /* > vectors. See DBDSVDX for details. */
580 /* > Note that the routine returns V**T, not V. */
586 /* > \param[in] JOBU */
588 /* > JOBU is CHARACTER*1 */
589 /* > Specifies options for computing all or part of the matrix U: */
590 /* > = 'V': the first f2cmin(m,n) columns of U (the left singular */
591 /* > vectors) or as specified by RANGE are returned in */
593 /* > = 'N': no columns of U (no left singular vectors) are */
597 /* > \param[in] JOBVT */
599 /* > JOBVT is CHARACTER*1 */
600 /* > Specifies options for computing all or part of the matrix */
602 /* > = 'V': the first f2cmin(m,n) rows of V**T (the right singular */
603 /* > vectors) or as specified by RANGE are returned in */
604 /* > the array VT; */
605 /* > = 'N': no rows of V**T (no right singular vectors) are */
609 /* > \param[in] RANGE */
611 /* > RANGE is CHARACTER*1 */
612 /* > = 'A': all singular values will be found. */
613 /* > = 'V': all singular values in the half-open interval (VL,VU] */
614 /* > will be found. */
615 /* > = 'I': the IL-th through IU-th singular values will be found. */
621 /* > The number of rows of the input matrix A. M >= 0. */
627 /* > The number of columns of the input matrix A. N >= 0. */
630 /* > \param[in,out] A */
632 /* > A is DOUBLE PRECISION array, dimension (LDA,N) */
633 /* > On entry, the M-by-N matrix A. */
634 /* > On exit, the contents of A are destroyed. */
637 /* > \param[in] LDA */
639 /* > LDA is INTEGER */
640 /* > The leading dimension of the array A. LDA >= f2cmax(1,M). */
643 /* > \param[in] VL */
645 /* > VL is DOUBLE PRECISION */
646 /* > If RANGE='V', the lower bound of the interval to */
647 /* > be searched for singular values. VU > VL. */
648 /* > Not referenced if RANGE = 'A' or 'I'. */
651 /* > \param[in] VU */
653 /* > VU is DOUBLE PRECISION */
654 /* > If RANGE='V', the upper bound of the interval to */
655 /* > be searched for singular values. VU > VL. */
656 /* > Not referenced if RANGE = 'A' or 'I'. */
659 /* > \param[in] IL */
661 /* > IL is INTEGER */
662 /* > If RANGE='I', the index of the */
663 /* > smallest singular value to be returned. */
664 /* > 1 <= IL <= IU <= f2cmin(M,N), if f2cmin(M,N) > 0. */
665 /* > Not referenced if RANGE = 'A' or 'V'. */
668 /* > \param[in] IU */
670 /* > IU is INTEGER */
671 /* > If RANGE='I', the index of the */
672 /* > largest singular value to be returned. */
673 /* > 1 <= IL <= IU <= f2cmin(M,N), if f2cmin(M,N) > 0. */
674 /* > Not referenced if RANGE = 'A' or 'V'. */
677 /* > \param[out] NS */
679 /* > NS is INTEGER */
680 /* > The total number of singular values found, */
681 /* > 0 <= NS <= f2cmin(M,N). */
682 /* > If RANGE = 'A', NS = f2cmin(M,N); if RANGE = 'I', NS = IU-IL+1. */
685 /* > \param[out] S */
687 /* > S is DOUBLE PRECISION array, dimension (f2cmin(M,N)) */
688 /* > The singular values of A, sorted so that S(i) >= S(i+1). */
691 /* > \param[out] U */
693 /* > U is DOUBLE PRECISION array, dimension (LDU,UCOL) */
694 /* > If JOBU = 'V', U contains columns of U (the left singular */
695 /* > vectors, stored columnwise) as specified by RANGE; if */
696 /* > JOBU = 'N', U is not referenced. */
697 /* > Note: The user must ensure that UCOL >= NS; if RANGE = 'V', */
698 /* > the exact value of NS is not known in advance and an upper */
699 /* > bound must be used. */
702 /* > \param[in] LDU */
704 /* > LDU is INTEGER */
705 /* > The leading dimension of the array U. LDU >= 1; if */
706 /* > JOBU = 'V', LDU >= M. */
709 /* > \param[out] VT */
711 /* > VT is DOUBLE PRECISION array, dimension (LDVT,N) */
712 /* > If JOBVT = 'V', VT contains the rows of V**T (the right singular */
713 /* > vectors, stored rowwise) as specified by RANGE; if JOBVT = 'N', */
714 /* > VT is not referenced. */
715 /* > Note: The user must ensure that LDVT >= NS; if RANGE = 'V', */
716 /* > the exact value of NS is not known in advance and an upper */
717 /* > bound must be used. */
720 /* > \param[in] LDVT */
722 /* > LDVT is INTEGER */
723 /* > The leading dimension of the array VT. LDVT >= 1; if */
724 /* > JOBVT = 'V', LDVT >= NS (see above). */
727 /* > \param[out] WORK */
729 /* > WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) */
730 /* > On exit, if INFO = 0, WORK(1) returns the optimal LWORK; */
733 /* > \param[in] LWORK */
735 /* > LWORK is INTEGER */
736 /* > The dimension of the array WORK. */
737 /* > LWORK >= MAX(1,MIN(M,N)*(MIN(M,N)+4)) for the paths (see */
738 /* > comments inside the code): */
739 /* > - PATH 1 (M much larger than N) */
740 /* > - PATH 1t (N much larger than M) */
741 /* > LWORK >= MAX(1,MIN(M,N)*2+MAX(M,N)) for the other paths. */
742 /* > For good performance, LWORK should generally be larger. */
744 /* > If LWORK = -1, then a workspace query is assumed; the routine */
745 /* > only calculates the optimal size of the WORK array, returns */
746 /* > this value as the first entry of the WORK array, and no error */
747 /* > message related to LWORK is issued by XERBLA. */
750 /* > \param[out] IWORK */
752 /* > IWORK is INTEGER array, dimension (12*MIN(M,N)) */
753 /* > If INFO = 0, the first NS elements of IWORK are zero. If INFO > 0, */
754 /* > then IWORK contains the indices of the eigenvectors that failed */
755 /* > to converge in DBDSVDX/DSTEVX. */
758 /* > \param[out] INFO */
760 /* > INFO is INTEGER */
761 /* > = 0: successful exit */
762 /* > < 0: if INFO = -i, the i-th argument had an illegal value */
763 /* > > 0: if INFO = i, then i eigenvectors failed to converge */
764 /* > in DBDSVDX/DSTEVX. */
765 /* > if INFO = N*2 + 1, an internal error occurred in */
772 /* > \author Univ. of Tennessee */
773 /* > \author Univ. of California Berkeley */
774 /* > \author Univ. of Colorado Denver */
775 /* > \author NAG Ltd. */
777 /* > \date June 2016 */
779 /* > \ingroup doubleGEsing */
781 /* ===================================================================== */
782 /* Subroutine */ int dgesvdx_(char *jobu, char *jobvt, char *range, integer *
783 m, integer *n, doublereal *a, integer *lda, doublereal *vl,
784 doublereal *vu, integer *il, integer *iu, integer *ns, doublereal *s,
785 doublereal *u, integer *ldu, doublereal *vt, integer *ldvt,
786 doublereal *work, integer *lwork, integer *iwork, integer *info)
788 /* System generated locals */
790 integer a_dim1, a_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1[2],
794 /* Local variables */
799 integer ierr, iqrf, itau;
803 extern logical lsame_(char *, char *);
804 integer iltgk, itemp, minmn;
805 extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *,
806 doublereal *, integer *);
807 integer itaup, itauq, iutgk, itgkz, mnthr;
810 extern /* Subroutine */ int dgebrd_(integer *, integer *, doublereal *,
811 integer *, doublereal *, doublereal *, doublereal *, doublereal *,
812 doublereal *, integer *, integer *);
813 extern doublereal dlamch_(char *), dlange_(char *, integer *,
814 integer *, doublereal *, integer *, doublereal *);
815 extern /* Subroutine */ int dgelqf_(integer *, integer *, doublereal *,
816 integer *, doublereal *, doublereal *, integer *, integer *),
817 dlascl_(char *, integer *, integer *, doublereal *, doublereal *,
818 integer *, integer *, doublereal *, integer *, integer *),
819 dgeqrf_(integer *, integer *, doublereal *, integer *,
820 doublereal *, doublereal *, integer *, integer *), dlacpy_(char *,
821 integer *, integer *, doublereal *, integer *, doublereal *,
822 integer *), dlaset_(char *, integer *, integer *,
823 doublereal *, doublereal *, doublereal *, integer *),
824 xerbla_(char *, integer *, ftnlen);
825 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
826 integer *, integer *, ftnlen, ftnlen);
827 doublereal bignum, abstol;
828 extern /* Subroutine */ int dormbr_(char *, char *, char *, integer *,
829 integer *, integer *, doublereal *, integer *, doublereal *,
830 doublereal *, integer *, doublereal *, integer *, integer *);
832 extern /* Subroutine */ int dormlq_(char *, char *, integer *, integer *,
833 integer *, doublereal *, integer *, doublereal *, doublereal *,
834 integer *, doublereal *, integer *, integer *),
835 dormqr_(char *, char *, integer *, integer *, integer *,
836 doublereal *, integer *, doublereal *, doublereal *, integer *,
837 doublereal *, integer *, integer *);
838 integer minwrk, maxwrk;
840 logical lquery, wantvt;
841 doublereal dum[1], eps;
842 extern /* Subroutine */ int dbdsvdx_(char *, char *, char *, integer *,
843 doublereal *, doublereal *, doublereal *, doublereal *, integer *,
844 integer *, integer *, doublereal *, doublereal *, integer *,
845 doublereal *, integer *, integer *);
848 /* -- LAPACK driver routine (version 3.8.0) -- */
849 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
850 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
854 /* ===================================================================== */
857 /* Test the input arguments. */
859 /* Parameter adjustments */
861 a_offset = 1 + a_dim1 * 1;
865 u_offset = 1 + u_dim1 * 1;
868 vt_offset = 1 + vt_dim1 * 1;
876 abstol = dlamch_("S") * 2;
877 lquery = *lwork == -1;
878 minmn = f2cmin(*m,*n);
879 wantu = lsame_(jobu, "V");
880 wantvt = lsame_(jobvt, "V");
881 if (wantu || wantvt) {
882 *(unsigned char *)jobz = 'V';
884 *(unsigned char *)jobz = 'N';
886 alls = lsame_(range, "A");
887 vals = lsame_(range, "V");
888 inds = lsame_(range, "I");
891 if (! lsame_(jobu, "V") && ! lsame_(jobu, "N")) {
893 } else if (! lsame_(jobvt, "V") && ! lsame_(jobvt,
896 } else if (! (alls || vals || inds)) {
902 } else if (*m > *lda) {
904 } else if (minmn > 0) {
908 } else if (*vu <= *vl) {
912 if (*il < 1 || *il > f2cmax(1,minmn)) {
914 } else if (*iu < f2cmin(minmn,*il) || *iu > minmn) {
919 if (wantu && *ldu < *m) {
923 if (*ldvt < *iu - *il + 1) {
926 } else if (*ldvt < minmn) {
933 /* Compute workspace */
934 /* (Note: Comments in the code beginning "Workspace:" describe the */
935 /* minimal amount of workspace needed at that point in the code, */
936 /* as well as the preferred amount for good performance. */
937 /* NB refers to the optimal block size for the immediately */
938 /* following subroutine, as returned by ILAENV.) */
945 /* Writing concatenation */
946 i__1[0] = 1, a__1[0] = jobu;
947 i__1[1] = 1, a__1[1] = jobvt;
948 s_cat(ch__1, a__1, i__1, &c__2, (ftnlen)2);
949 mnthr = ilaenv_(&c__6, "DGESVD", ch__1, m, n, &c__0, &c__0, (
950 ftnlen)6, (ftnlen)2);
953 /* Path 1 (M much larger than N) */
955 maxwrk = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, &
956 c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
958 i__2 = maxwrk, i__3 = *n * (*n + 5) + (*n << 1) * ilaenv_(
959 &c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)
961 maxwrk = f2cmax(i__2,i__3);
964 i__2 = maxwrk, i__3 = *n * (*n * 3 + 6) + *n *
965 ilaenv_(&c__1, "DORMQR", " ", n, n, &c_n1, &
966 c_n1, (ftnlen)6, (ftnlen)1);
967 maxwrk = f2cmax(i__2,i__3);
971 i__2 = maxwrk, i__3 = *n * (*n * 3 + 6) + *n *
972 ilaenv_(&c__1, "DORMLQ", " ", n, n, &c_n1, &
973 c_n1, (ftnlen)6, (ftnlen)1);
974 maxwrk = f2cmax(i__2,i__3);
976 minwrk = *n * (*n * 3 + 20);
979 /* Path 2 (M at least N, but not much larger) */
981 maxwrk = (*n << 2) + (*m + *n) * ilaenv_(&c__1, "DGEBRD",
982 " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
985 i__2 = maxwrk, i__3 = *n * ((*n << 1) + 5) + *n *
986 ilaenv_(&c__1, "DORMQR", " ", n, n, &c_n1, &
987 c_n1, (ftnlen)6, (ftnlen)1);
988 maxwrk = f2cmax(i__2,i__3);
992 i__2 = maxwrk, i__3 = *n * ((*n << 1) + 5) + *n *
993 ilaenv_(&c__1, "DORMLQ", " ", n, n, &c_n1, &
994 c_n1, (ftnlen)6, (ftnlen)1);
995 maxwrk = f2cmax(i__2,i__3);
998 i__2 = *n * ((*n << 1) + 19), i__3 = (*n << 2) + *m;
999 minwrk = f2cmax(i__2,i__3);
1002 /* Writing concatenation */
1003 i__1[0] = 1, a__1[0] = jobu;
1004 i__1[1] = 1, a__1[1] = jobvt;
1005 s_cat(ch__1, a__1, i__1, &c__2, (ftnlen)2);
1006 mnthr = ilaenv_(&c__6, "DGESVD", ch__1, m, n, &c__0, &c__0, (
1007 ftnlen)6, (ftnlen)2);
1010 /* Path 1t (N much larger than M) */
1012 maxwrk = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, &
1013 c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
1015 i__2 = maxwrk, i__3 = *m * (*m + 5) + (*m << 1) * ilaenv_(
1016 &c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)
1018 maxwrk = f2cmax(i__2,i__3);
1021 i__2 = maxwrk, i__3 = *m * (*m * 3 + 6) + *m *
1022 ilaenv_(&c__1, "DORMQR", " ", m, m, &c_n1, &
1023 c_n1, (ftnlen)6, (ftnlen)1);
1024 maxwrk = f2cmax(i__2,i__3);
1028 i__2 = maxwrk, i__3 = *m * (*m * 3 + 6) + *m *
1029 ilaenv_(&c__1, "DORMLQ", " ", m, m, &c_n1, &
1030 c_n1, (ftnlen)6, (ftnlen)1);
1031 maxwrk = f2cmax(i__2,i__3);
1033 minwrk = *m * (*m * 3 + 20);
1036 /* Path 2t (N at least M, but not much larger) */
1038 maxwrk = (*m << 2) + (*m + *n) * ilaenv_(&c__1, "DGEBRD",
1039 " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1);
1042 i__2 = maxwrk, i__3 = *m * ((*m << 1) + 5) + *m *
1043 ilaenv_(&c__1, "DORMQR", " ", m, m, &c_n1, &
1044 c_n1, (ftnlen)6, (ftnlen)1);
1045 maxwrk = f2cmax(i__2,i__3);
1049 i__2 = maxwrk, i__3 = *m * ((*m << 1) + 5) + *m *
1050 ilaenv_(&c__1, "DORMLQ", " ", m, m, &c_n1, &
1051 c_n1, (ftnlen)6, (ftnlen)1);
1052 maxwrk = f2cmax(i__2,i__3);
1055 i__2 = *m * ((*m << 1) + 19), i__3 = (*m << 2) + *n;
1056 minwrk = f2cmax(i__2,i__3);
1060 maxwrk = f2cmax(maxwrk,minwrk);
1061 work[1] = (doublereal) maxwrk;
1063 if (*lwork < minwrk && ! lquery) {
1070 xerbla_("DGESVDX", &i__2, (ftnlen)7);
1072 } else if (lquery) {
1076 /* Quick return if possible */
1078 if (*m == 0 || *n == 0) {
1082 /* Set singular values indices accord to RANGE. */
1085 *(unsigned char *)rngtgk = 'I';
1087 iutgk = f2cmin(*m,*n);
1089 *(unsigned char *)rngtgk = 'I';
1093 *(unsigned char *)rngtgk = 'V';
1098 /* Get machine constants */
1101 smlnum = sqrt(dlamch_("S")) / eps;
1102 bignum = 1. / smlnum;
1104 /* Scale A if f2cmax element outside range [SMLNUM,BIGNUM] */
1106 anrm = dlange_("M", m, n, &a[a_offset], lda, dum);
1108 if (anrm > 0. && anrm < smlnum) {
1110 dlascl_("G", &c__0, &c__0, &anrm, &smlnum, m, n, &a[a_offset], lda,
1112 } else if (anrm > bignum) {
1114 dlascl_("G", &c__0, &c__0, &anrm, &bignum, m, n, &a[a_offset], lda,
1120 /* A has at least as many rows as columns. If A has sufficiently */
1121 /* more rows than columns, first reduce A using the QR */
1122 /* decomposition. */
1126 /* Path 1 (M much larger than N): */
1127 /* A = Q * R = Q * ( QB * B * PB**T ) */
1128 /* = Q * ( QB * ( UB * S * VB**T ) * PB**T ) */
1129 /* U = Q * QB * UB; V**T = VB**T * PB**T */
1132 /* (Workspace: need 2*N, prefer N+N*NB) */
1136 i__2 = *lwork - itemp + 1;
1137 dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[itemp], &i__2,
1140 /* Copy R into WORK and bidiagonalize it: */
1141 /* (Workspace: need N*N+5*N, prefer N*N+4*N+2*N*NB) */
1144 id = iqrf + *n * *n;
1149 dlacpy_("U", n, n, &a[a_offset], lda, &work[iqrf], n);
1152 dlaset_("L", &i__2, &i__3, &c_b109, &c_b109, &work[iqrf + 1], n);
1153 i__2 = *lwork - itemp + 1;
1154 dgebrd_(n, n, &work[iqrf], n, &work[id], &work[ie], &work[itauq],
1155 &work[itaup], &work[itemp], &i__2, info);
1157 /* Solve eigenvalue problem TGK*Z=Z*S. */
1158 /* (Workspace: need 14*N + 2*N*(N+1)) */
1161 itemp = itgkz + *n * ((*n << 1) + 1);
1163 dbdsvdx_("U", jobz, rngtgk, n, &work[id], &work[ie], vl, vu, &
1164 iltgk, &iutgk, ns, &s[1], &work[itgkz], &i__2, &work[
1165 itemp], &iwork[1], info);
1167 /* If needed, compute left singular vectors. */
1172 for (i__ = 1; i__ <= i__2; ++i__) {
1173 dcopy_(n, &work[j], &c__1, &u[i__ * u_dim1 + 1], &c__1);
1177 dlaset_("A", &i__2, ns, &c_b109, &c_b109, &u[*n + 1 + u_dim1],
1180 /* Call DORMBR to compute QB*UB. */
1181 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1183 i__2 = *lwork - itemp + 1;
1184 dormbr_("Q", "L", "N", n, ns, n, &work[iqrf], n, &work[itauq],
1185 &u[u_offset], ldu, &work[itemp], &i__2, info);
1187 /* Call DORMQR to compute Q*(QB*UB). */
1188 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1190 i__2 = *lwork - itemp + 1;
1191 dormqr_("L", "N", m, ns, n, &a[a_offset], lda, &work[itau], &
1192 u[u_offset], ldu, &work[itemp], &i__2, info);
1195 /* If needed, compute right singular vectors. */
1200 for (i__ = 1; i__ <= i__2; ++i__) {
1201 dcopy_(n, &work[j], &c__1, &vt[i__ + vt_dim1], ldvt);
1205 /* Call DORMBR to compute VB**T * PB**T */
1206 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1208 i__2 = *lwork - itemp + 1;
1209 dormbr_("P", "R", "T", ns, n, n, &work[iqrf], n, &work[itaup],
1210 &vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1214 /* Path 2 (M at least N, but not much larger) */
1215 /* Reduce A to bidiagonal form without QR decomposition */
1216 /* A = QB * B * PB**T = QB * ( UB * S * VB**T ) * PB**T */
1217 /* U = QB * UB; V**T = VB**T * PB**T */
1219 /* Bidiagonalize A */
1220 /* (Workspace: need 4*N+M, prefer 4*N+(M+N)*NB) */
1227 i__2 = *lwork - itemp + 1;
1228 dgebrd_(m, n, &a[a_offset], lda, &work[id], &work[ie], &work[
1229 itauq], &work[itaup], &work[itemp], &i__2, info);
1231 /* Solve eigenvalue problem TGK*Z=Z*S. */
1232 /* (Workspace: need 14*N + 2*N*(N+1)) */
1235 itemp = itgkz + *n * ((*n << 1) + 1);
1237 dbdsvdx_("U", jobz, rngtgk, n, &work[id], &work[ie], vl, vu, &
1238 iltgk, &iutgk, ns, &s[1], &work[itgkz], &i__2, &work[
1239 itemp], &iwork[1], info);
1241 /* If needed, compute left singular vectors. */
1246 for (i__ = 1; i__ <= i__2; ++i__) {
1247 dcopy_(n, &work[j], &c__1, &u[i__ * u_dim1 + 1], &c__1);
1251 dlaset_("A", &i__2, ns, &c_b109, &c_b109, &u[*n + 1 + u_dim1],
1254 /* Call DORMBR to compute QB*UB. */
1255 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1257 i__2 = *lwork - itemp + 1;
1258 dormbr_("Q", "L", "N", m, ns, n, &a[a_offset], lda, &work[
1259 itauq], &u[u_offset], ldu, &work[itemp], &i__2, &ierr);
1262 /* If needed, compute right singular vectors. */
1267 for (i__ = 1; i__ <= i__2; ++i__) {
1268 dcopy_(n, &work[j], &c__1, &vt[i__ + vt_dim1], ldvt);
1272 /* Call DORMBR to compute VB**T * PB**T */
1273 /* (Workspace in WORK( ITEMP ): need N, prefer N*NB) */
1275 i__2 = *lwork - itemp + 1;
1276 dormbr_("P", "R", "T", ns, n, n, &a[a_offset], lda, &work[
1277 itaup], &vt[vt_offset], ldvt, &work[itemp], &i__2, &
1283 /* A has more columns than rows. If A has sufficiently more */
1284 /* columns than rows, first reduce A using the LQ decomposition. */
1288 /* Path 1t (N much larger than M): */
1289 /* A = L * Q = ( QB * B * PB**T ) * Q */
1290 /* = ( QB * ( UB * S * VB**T ) * PB**T ) * Q */
1291 /* U = QB * UB ; V**T = VB**T * PB**T * Q */
1294 /* (Workspace: need 2*M, prefer M+M*NB) */
1298 i__2 = *lwork - itemp + 1;
1299 dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[itemp], &i__2,
1301 /* Copy L into WORK and bidiagonalize it: */
1302 /* (Workspace in WORK( ITEMP ): need M*M+5*N, prefer M*M+4*M+2*M*NB) */
1305 id = ilqf + *m * *m;
1310 dlacpy_("L", m, m, &a[a_offset], lda, &work[ilqf], m);
1313 dlaset_("U", &i__2, &i__3, &c_b109, &c_b109, &work[ilqf + *m], m);
1314 i__2 = *lwork - itemp + 1;
1315 dgebrd_(m, m, &work[ilqf], m, &work[id], &work[ie], &work[itauq],
1316 &work[itaup], &work[itemp], &i__2, info);
1318 /* Solve eigenvalue problem TGK*Z=Z*S. */
1319 /* (Workspace: need 2*M*M+14*M) */
1322 itemp = itgkz + *m * ((*m << 1) + 1);
1324 dbdsvdx_("U", jobz, rngtgk, m, &work[id], &work[ie], vl, vu, &
1325 iltgk, &iutgk, ns, &s[1], &work[itgkz], &i__2, &work[
1326 itemp], &iwork[1], info);
1328 /* If needed, compute left singular vectors. */
1333 for (i__ = 1; i__ <= i__2; ++i__) {
1334 dcopy_(m, &work[j], &c__1, &u[i__ * u_dim1 + 1], &c__1);
1338 /* Call DORMBR to compute QB*UB. */
1339 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1341 i__2 = *lwork - itemp + 1;
1342 dormbr_("Q", "L", "N", m, ns, m, &work[ilqf], m, &work[itauq],
1343 &u[u_offset], ldu, &work[itemp], &i__2, info);
1346 /* If needed, compute right singular vectors. */
1351 for (i__ = 1; i__ <= i__2; ++i__) {
1352 dcopy_(m, &work[j], &c__1, &vt[i__ + vt_dim1], ldvt);
1356 dlaset_("A", ns, &i__2, &c_b109, &c_b109, &vt[(*m + 1) *
1357 vt_dim1 + 1], ldvt);
1359 /* Call DORMBR to compute (VB**T)*(PB**T) */
1360 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1362 i__2 = *lwork - itemp + 1;
1363 dormbr_("P", "R", "T", ns, m, m, &work[ilqf], m, &work[itaup],
1364 &vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1366 /* Call DORMLQ to compute ((VB**T)*(PB**T))*Q. */
1367 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1369 i__2 = *lwork - itemp + 1;
1370 dormlq_("R", "N", ns, n, m, &a[a_offset], lda, &work[itau], &
1371 vt[vt_offset], ldvt, &work[itemp], &i__2, info);
1375 /* Path 2t (N greater than M, but not much larger) */
1376 /* Reduce to bidiagonal form without LQ decomposition */
1377 /* A = QB * B * PB**T = QB * ( UB * S * VB**T ) * PB**T */
1378 /* U = QB * UB; V**T = VB**T * PB**T */
1380 /* Bidiagonalize A */
1381 /* (Workspace: need 4*M+N, prefer 4*M+(M+N)*NB) */
1388 i__2 = *lwork - itemp + 1;
1389 dgebrd_(m, n, &a[a_offset], lda, &work[id], &work[ie], &work[
1390 itauq], &work[itaup], &work[itemp], &i__2, info);
1392 /* Solve eigenvalue problem TGK*Z=Z*S. */
1393 /* (Workspace: need 2*M*M+14*M) */
1396 itemp = itgkz + *m * ((*m << 1) + 1);
1398 dbdsvdx_("L", jobz, rngtgk, m, &work[id], &work[ie], vl, vu, &
1399 iltgk, &iutgk, ns, &s[1], &work[itgkz], &i__2, &work[
1400 itemp], &iwork[1], info);
1402 /* If needed, compute left singular vectors. */
1407 for (i__ = 1; i__ <= i__2; ++i__) {
1408 dcopy_(m, &work[j], &c__1, &u[i__ * u_dim1 + 1], &c__1);
1412 /* Call DORMBR to compute QB*UB. */
1413 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1415 i__2 = *lwork - itemp + 1;
1416 dormbr_("Q", "L", "N", m, ns, n, &a[a_offset], lda, &work[
1417 itauq], &u[u_offset], ldu, &work[itemp], &i__2, info);
1420 /* If needed, compute right singular vectors. */
1425 for (i__ = 1; i__ <= i__2; ++i__) {
1426 dcopy_(m, &work[j], &c__1, &vt[i__ + vt_dim1], ldvt);
1430 dlaset_("A", ns, &i__2, &c_b109, &c_b109, &vt[(*m + 1) *
1431 vt_dim1 + 1], ldvt);
1433 /* Call DORMBR to compute VB**T * PB**T */
1434 /* (Workspace in WORK( ITEMP ): need M, prefer M*NB) */
1436 i__2 = *lwork - itemp + 1;
1437 dormbr_("P", "R", "T", ns, n, m, &a[a_offset], lda, &work[
1438 itaup], &vt[vt_offset], ldvt, &work[itemp], &i__2,
1444 /* Undo scaling if necessary */
1447 if (anrm > bignum) {
1448 dlascl_("G", &c__0, &c__0, &bignum, &anrm, &minmn, &c__1, &s[1], &
1451 if (anrm < smlnum) {
1452 dlascl_("G", &c__0, &c__0, &smlnum, &anrm, &minmn, &c__1, &s[1], &
1457 /* Return optimal workspace in WORK(1) */
1459 work[1] = (doublereal) maxwrk;
1463 /* End of DGESVDX */