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__1 = 1;
517 /* > \brief \b DORBDB */
519 /* =========== DOCUMENTATION =========== */
521 /* Online html documentation available at */
522 /* http://www.netlib.org/lapack/explore-html/ */
525 /* > Download DORBDB + dependencies */
526 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorbdb.
529 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorbdb.
532 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorbdb.
540 /* SUBROUTINE DORBDB( TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12, */
541 /* X21, LDX21, X22, LDX22, THETA, PHI, TAUP1, */
542 /* TAUP2, TAUQ1, TAUQ2, WORK, LWORK, INFO ) */
544 /* CHARACTER SIGNS, TRANS */
545 /* INTEGER INFO, LDX11, LDX12, LDX21, LDX22, LWORK, M, P, */
547 /* DOUBLE PRECISION PHI( * ), THETA( * ) */
548 /* DOUBLE PRECISION TAUP1( * ), TAUP2( * ), TAUQ1( * ), TAUQ2( * ), */
549 /* $ WORK( * ), X11( LDX11, * ), X12( LDX12, * ), */
550 /* $ X21( LDX21, * ), X22( LDX22, * ) */
553 /* > \par Purpose: */
558 /* > DORBDB simultaneously bidiagonalizes the blocks of an M-by-M */
559 /* > partitioned orthogonal matrix X: */
561 /* > [ B11 | B12 0 0 ] */
562 /* > [ X11 | X12 ] [ P1 | ] [ 0 | 0 -I 0 ] [ Q1 | ]**T */
563 /* > X = [-----------] = [---------] [----------------] [---------] . */
564 /* > [ X21 | X22 ] [ | P2 ] [ B21 | B22 0 0 ] [ | Q2 ] */
565 /* > [ 0 | 0 0 I ] */
567 /* > X11 is P-by-Q. Q must be no larger than P, M-P, or M-Q. (If this is */
568 /* > not the case, then X must be transposed and/or permuted. This can be */
569 /* > done in constant time using the TRANS and SIGNS options. See DORCSD */
570 /* > for details.) */
572 /* > The orthogonal matrices P1, P2, Q1, and Q2 are P-by-P, (M-P)-by- */
573 /* > (M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. They are */
574 /* > represented implicitly by Householder vectors. */
576 /* > B11, B12, B21, and B22 are Q-by-Q bidiagonal matrices represented */
577 /* > implicitly by angles THETA, PHI. */
583 /* > \param[in] TRANS */
585 /* > TRANS is CHARACTER */
586 /* > = 'T': X, U1, U2, V1T, and V2T are stored in row-major */
588 /* > otherwise: X, U1, U2, V1T, and V2T are stored in column- */
592 /* > \param[in] SIGNS */
594 /* > SIGNS is CHARACTER */
595 /* > = 'O': The lower-left block is made nonpositive (the */
596 /* > "other" convention); */
597 /* > otherwise: The upper-right block is made nonpositive (the */
598 /* > "default" convention). */
604 /* > The number of rows and columns in X. */
610 /* > The number of rows in X11 and X12. 0 <= P <= M. */
616 /* > The number of columns in X11 and X21. 0 <= Q <= */
617 /* > MIN(P,M-P,M-Q). */
620 /* > \param[in,out] X11 */
622 /* > X11 is DOUBLE PRECISION array, dimension (LDX11,Q) */
623 /* > On entry, the top-left block of the orthogonal matrix to be */
624 /* > reduced. On exit, the form depends on TRANS: */
625 /* > If TRANS = 'N', then */
626 /* > the columns of tril(X11) specify reflectors for P1, */
627 /* > the rows of triu(X11,1) specify reflectors for Q1; */
628 /* > else TRANS = 'T', and */
629 /* > the rows of triu(X11) specify reflectors for P1, */
630 /* > the columns of tril(X11,-1) specify reflectors for Q1. */
633 /* > \param[in] LDX11 */
635 /* > LDX11 is INTEGER */
636 /* > The leading dimension of X11. If TRANS = 'N', then LDX11 >= */
637 /* > P; else LDX11 >= Q. */
640 /* > \param[in,out] X12 */
642 /* > X12 is DOUBLE PRECISION array, dimension (LDX12,M-Q) */
643 /* > On entry, the top-right block of the orthogonal matrix to */
644 /* > be reduced. On exit, the form depends on TRANS: */
645 /* > If TRANS = 'N', then */
646 /* > the rows of triu(X12) specify the first P reflectors for */
648 /* > else TRANS = 'T', and */
649 /* > the columns of tril(X12) specify the first P reflectors */
653 /* > \param[in] LDX12 */
655 /* > LDX12 is INTEGER */
656 /* > The leading dimension of X12. If TRANS = 'N', then LDX12 >= */
657 /* > P; else LDX11 >= M-Q. */
660 /* > \param[in,out] X21 */
662 /* > X21 is DOUBLE PRECISION array, dimension (LDX21,Q) */
663 /* > On entry, the bottom-left block of the orthogonal matrix to */
664 /* > be reduced. On exit, the form depends on TRANS: */
665 /* > If TRANS = 'N', then */
666 /* > the columns of tril(X21) specify reflectors for P2; */
667 /* > else TRANS = 'T', and */
668 /* > the rows of triu(X21) specify reflectors for P2. */
671 /* > \param[in] LDX21 */
673 /* > LDX21 is INTEGER */
674 /* > The leading dimension of X21. If TRANS = 'N', then LDX21 >= */
675 /* > M-P; else LDX21 >= Q. */
678 /* > \param[in,out] X22 */
680 /* > X22 is DOUBLE PRECISION array, dimension (LDX22,M-Q) */
681 /* > On entry, the bottom-right block of the orthogonal matrix to */
682 /* > be reduced. On exit, the form depends on TRANS: */
683 /* > If TRANS = 'N', then */
684 /* > the rows of triu(X22(Q+1:M-P,P+1:M-Q)) specify the last */
685 /* > M-P-Q reflectors for Q2, */
686 /* > else TRANS = 'T', and */
687 /* > the columns of tril(X22(P+1:M-Q,Q+1:M-P)) specify the last */
688 /* > M-P-Q reflectors for P2. */
691 /* > \param[in] LDX22 */
693 /* > LDX22 is INTEGER */
694 /* > The leading dimension of X22. If TRANS = 'N', then LDX22 >= */
695 /* > M-P; else LDX22 >= M-Q. */
698 /* > \param[out] THETA */
700 /* > THETA is DOUBLE PRECISION array, dimension (Q) */
701 /* > The entries of the bidiagonal blocks B11, B12, B21, B22 can */
702 /* > be computed from the angles THETA and PHI. See Further */
706 /* > \param[out] PHI */
708 /* > PHI is DOUBLE PRECISION array, dimension (Q-1) */
709 /* > The entries of the bidiagonal blocks B11, B12, B21, B22 can */
710 /* > be computed from the angles THETA and PHI. See Further */
714 /* > \param[out] TAUP1 */
716 /* > TAUP1 is DOUBLE PRECISION array, dimension (P) */
717 /* > The scalar factors of the elementary reflectors that define */
721 /* > \param[out] TAUP2 */
723 /* > TAUP2 is DOUBLE PRECISION array, dimension (M-P) */
724 /* > The scalar factors of the elementary reflectors that define */
728 /* > \param[out] TAUQ1 */
730 /* > TAUQ1 is DOUBLE PRECISION array, dimension (Q) */
731 /* > The scalar factors of the elementary reflectors that define */
735 /* > \param[out] TAUQ2 */
737 /* > TAUQ2 is DOUBLE PRECISION array, dimension (M-Q) */
738 /* > The scalar factors of the elementary reflectors that define */
742 /* > \param[out] WORK */
744 /* > WORK is DOUBLE PRECISION array, dimension (LWORK) */
747 /* > \param[in] LWORK */
749 /* > LWORK is INTEGER */
750 /* > The dimension of the array WORK. LWORK >= M-Q. */
752 /* > If LWORK = -1, then a workspace query is assumed; the routine */
753 /* > only calculates the optimal size of the WORK array, returns */
754 /* > this value as the first entry of the WORK array, and no error */
755 /* > message related to LWORK is issued by XERBLA. */
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. */
768 /* > \author Univ. of Tennessee */
769 /* > \author Univ. of California Berkeley */
770 /* > \author Univ. of Colorado Denver */
771 /* > \author NAG Ltd. */
773 /* > \date December 2016 */
775 /* > \ingroup doubleOTHERcomputational */
777 /* > \par Further Details: */
778 /* ===================== */
782 /* > The bidiagonal blocks B11, B12, B21, and B22 are represented */
783 /* > implicitly by angles THETA(1), ..., THETA(Q) and PHI(1), ..., */
784 /* > PHI(Q-1). B11 and B21 are upper bidiagonal, while B21 and B22 are */
785 /* > lower bidiagonal. Every entry in each bidiagonal band is a product */
786 /* > of a sine or cosine of a THETA with a sine or cosine of a PHI. See */
787 /* > [1] or DORCSD for details. */
789 /* > P1, P2, Q1, and Q2 are represented as products of elementary */
790 /* > reflectors. See DORCSD for details on generating P1, P2, Q1, and Q2 */
791 /* > using DORGQR and DORGLQ. */
794 /* > \par References: */
795 /* ================ */
797 /* > [1] Brian D. Sutton. Computing the complete CS decomposition. Numer. */
798 /* > Algorithms, 50(1):33-65, 2009. */
800 /* ===================================================================== */
801 /* Subroutine */ int dorbdb_(char *trans, char *signs, integer *m, integer *p,
802 integer *q, doublereal *x11, integer *ldx11, doublereal *x12,
803 integer *ldx12, doublereal *x21, integer *ldx21, doublereal *x22,
804 integer *ldx22, doublereal *theta, doublereal *phi, doublereal *taup1,
805 doublereal *taup2, doublereal *tauq1, doublereal *tauq2, doublereal *
806 work, integer *lwork, integer *info)
808 /* System generated locals */
809 integer x11_dim1, x11_offset, x12_dim1, x12_offset, x21_dim1, x21_offset,
810 x22_dim1, x22_offset, i__1, i__2, i__3;
813 /* Local variables */
816 extern doublereal dnrm2_(integer *, doublereal *, integer *);
817 integer lworkopt, i__;
818 extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *,
819 integer *), dlarf_(char *, integer *, integer *, doublereal *,
820 integer *, doublereal *, doublereal *, integer *, doublereal *);
821 extern logical lsame_(char *, char *);
822 extern /* Subroutine */ int daxpy_(integer *, doublereal *, doublereal *,
823 integer *, doublereal *, integer *);
824 doublereal z1, z2, z3, z4;
825 extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
827 extern /* Subroutine */ int dlarfgp_(integer *, doublereal *, doublereal *
828 , integer *, doublereal *);
831 /* -- LAPACK computational routine (version 3.7.0) -- */
832 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
833 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
837 /* ==================================================================== */
840 /* Test input arguments */
842 /* Parameter adjustments */
844 x11_offset = 1 + x11_dim1 * 1;
847 x12_offset = 1 + x12_dim1 * 1;
850 x21_offset = 1 + x21_dim1 * 1;
853 x22_offset = 1 + x22_dim1 * 1;
865 colmajor = ! lsame_(trans, "T");
866 if (! lsame_(signs, "O")) {
877 lquery = *lwork == -1;
881 } else if (*p < 0 || *p > *m) {
883 } else if (*q < 0 || *q > *p || *q > *m - *p || *q > *m - *q) {
885 } else if (colmajor && *ldx11 < f2cmax(1,*p)) {
887 } else if (! colmajor && *ldx11 < f2cmax(1,*q)) {
889 } else if (colmajor && *ldx12 < f2cmax(1,*p)) {
891 } else /* if(complicated condition) */ {
893 i__1 = 1, i__2 = *m - *q;
894 if (! colmajor && *ldx12 < f2cmax(i__1,i__2)) {
896 } else /* if(complicated condition) */ {
898 i__1 = 1, i__2 = *m - *p;
899 if (colmajor && *ldx21 < f2cmax(i__1,i__2)) {
901 } else if (! colmajor && *ldx21 < f2cmax(1,*q)) {
903 } else /* if(complicated condition) */ {
905 i__1 = 1, i__2 = *m - *p;
906 if (colmajor && *ldx22 < f2cmax(i__1,i__2)) {
908 } else /* if(complicated condition) */ {
910 i__1 = 1, i__2 = *m - *q;
911 if (! colmajor && *ldx22 < f2cmax(i__1,i__2)) {
919 /* Compute workspace */
924 work[1] = (doublereal) lworkopt;
925 if (*lwork < lworkmin && ! lquery) {
931 xerbla_("xORBDB", &i__1, (ftnlen)6);
937 /* Handle column-major and row-major separately */
941 /* Reduce columns 1, ..., Q of X11, X12, X21, and X22 */
944 for (i__ = 1; i__ <= i__1; ++i__) {
948 dscal_(&i__2, &z1, &x11[i__ + i__ * x11_dim1], &c__1);
951 d__1 = z1 * cos(phi[i__ - 1]);
952 dscal_(&i__2, &d__1, &x11[i__ + i__ * x11_dim1], &c__1);
954 d__1 = -z1 * z3 * z4 * sin(phi[i__ - 1]);
955 daxpy_(&i__2, &d__1, &x12[i__ + (i__ - 1) * x12_dim1], &c__1,
956 &x11[i__ + i__ * x11_dim1], &c__1);
959 i__2 = *m - *p - i__ + 1;
960 dscal_(&i__2, &z2, &x21[i__ + i__ * x21_dim1], &c__1);
962 i__2 = *m - *p - i__ + 1;
963 d__1 = z2 * cos(phi[i__ - 1]);
964 dscal_(&i__2, &d__1, &x21[i__ + i__ * x21_dim1], &c__1);
965 i__2 = *m - *p - i__ + 1;
966 d__1 = -z2 * z3 * z4 * sin(phi[i__ - 1]);
967 daxpy_(&i__2, &d__1, &x22[i__ + (i__ - 1) * x22_dim1], &c__1,
968 &x21[i__ + i__ * x21_dim1], &c__1);
971 i__2 = *m - *p - i__ + 1;
973 theta[i__] = atan2(dnrm2_(&i__2, &x21[i__ + i__ * x21_dim1], &
974 c__1), dnrm2_(&i__3, &x11[i__ + i__ * x11_dim1], &c__1));
978 dlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + 1 +
979 i__ * x11_dim1], &c__1, &taup1[i__]);
980 } else if (*p == i__) {
982 dlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + i__ *
983 x11_dim1], &c__1, &taup1[i__]);
985 x11[i__ + i__ * x11_dim1] = 1.;
987 i__2 = *m - *p - i__ + 1;
988 dlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + 1 +
989 i__ * x21_dim1], &c__1, &taup2[i__]);
990 } else if (*m - *p == i__) {
991 i__2 = *m - *p - i__ + 1;
992 dlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + i__ *
993 x21_dim1], &c__1, &taup2[i__]);
995 x21[i__ + i__ * x21_dim1] = 1.;
1000 dlarf_("L", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], &c__1, &
1001 taup1[i__], &x11[i__ + (i__ + 1) * x11_dim1], ldx11, &
1004 if (*m - *q + 1 > i__) {
1005 i__2 = *p - i__ + 1;
1006 i__3 = *m - *q - i__ + 1;
1007 dlarf_("L", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], &c__1, &
1008 taup1[i__], &x12[i__ + i__ * x12_dim1], ldx12, &work[
1012 i__2 = *m - *p - i__ + 1;
1014 dlarf_("L", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], &c__1, &
1015 taup2[i__], &x21[i__ + (i__ + 1) * x21_dim1], ldx21, &
1018 if (*m - *q + 1 > i__) {
1019 i__2 = *m - *p - i__ + 1;
1020 i__3 = *m - *q - i__ + 1;
1021 dlarf_("L", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], &c__1, &
1022 taup2[i__], &x22[i__ + i__ * x22_dim1], ldx22, &work[
1028 d__1 = -z1 * z3 * sin(theta[i__]);
1029 dscal_(&i__2, &d__1, &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
1031 d__1 = z2 * z3 * cos(theta[i__]);
1032 daxpy_(&i__2, &d__1, &x21[i__ + (i__ + 1) * x21_dim1], ldx21,
1033 &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
1035 i__2 = *m - *q - i__ + 1;
1036 d__1 = -z1 * z4 * sin(theta[i__]);
1037 dscal_(&i__2, &d__1, &x12[i__ + i__ * x12_dim1], ldx12);
1038 i__2 = *m - *q - i__ + 1;
1039 d__1 = z2 * z4 * cos(theta[i__]);
1040 daxpy_(&i__2, &d__1, &x22[i__ + i__ * x22_dim1], ldx22, &x12[i__
1041 + i__ * x12_dim1], ldx12);
1045 i__3 = *m - *q - i__ + 1;
1046 phi[i__] = atan2(dnrm2_(&i__2, &x11[i__ + (i__ + 1) *
1047 x11_dim1], ldx11), dnrm2_(&i__3, &x12[i__ + i__ *
1052 if (*q - i__ == 1) {
1054 dlarfgp_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], &x11[
1055 i__ + (i__ + 1) * x11_dim1], ldx11, &tauq1[i__]);
1058 dlarfgp_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], &x11[
1059 i__ + (i__ + 2) * x11_dim1], ldx11, &tauq1[i__]);
1061 x11[i__ + (i__ + 1) * x11_dim1] = 1.;
1063 if (*q + i__ - 1 < *m) {
1064 if (*m - *q == i__) {
1065 i__2 = *m - *q - i__ + 1;
1066 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ +
1067 i__ * x12_dim1], ldx12, &tauq2[i__]);
1069 i__2 = *m - *q - i__ + 1;
1070 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + (
1071 i__ + 1) * x12_dim1], ldx12, &tauq2[i__]);
1074 x12[i__ + i__ * x12_dim1] = 1.;
1079 dlarf_("R", &i__2, &i__3, &x11[i__ + (i__ + 1) * x11_dim1],
1080 ldx11, &tauq1[i__], &x11[i__ + 1 + (i__ + 1) *
1081 x11_dim1], ldx11, &work[1]);
1082 i__2 = *m - *p - i__;
1084 dlarf_("R", &i__2, &i__3, &x11[i__ + (i__ + 1) * x11_dim1],
1085 ldx11, &tauq1[i__], &x21[i__ + 1 + (i__ + 1) *
1086 x21_dim1], ldx21, &work[1]);
1090 i__3 = *m - *q - i__ + 1;
1091 dlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
1092 tauq2[i__], &x12[i__ + 1 + i__ * x12_dim1], ldx12, &
1095 if (*m - *p > i__) {
1096 i__2 = *m - *p - i__;
1097 i__3 = *m - *q - i__ + 1;
1098 dlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
1099 tauq2[i__], &x22[i__ + 1 + i__ * x22_dim1], ldx22, &
1105 /* Reduce columns Q + 1, ..., P of X12, X22 */
1108 for (i__ = *q + 1; i__ <= i__1; ++i__) {
1110 i__2 = *m - *q - i__ + 1;
1112 dscal_(&i__2, &d__1, &x12[i__ + i__ * x12_dim1], ldx12);
1113 if (i__ >= *m - *q) {
1114 i__2 = *m - *q - i__ + 1;
1115 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + i__ *
1116 x12_dim1], ldx12, &tauq2[i__]);
1118 i__2 = *m - *q - i__ + 1;
1119 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + (i__ +
1120 1) * x12_dim1], ldx12, &tauq2[i__]);
1122 x12[i__ + i__ * x12_dim1] = 1.;
1126 i__3 = *m - *q - i__ + 1;
1127 dlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
1128 tauq2[i__], &x12[i__ + 1 + i__ * x12_dim1], ldx12, &
1131 if (*m - *p - *q >= 1) {
1132 i__2 = *m - *p - *q;
1133 i__3 = *m - *q - i__ + 1;
1134 dlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
1135 tauq2[i__], &x22[*q + 1 + i__ * x22_dim1], ldx22, &
1141 /* Reduce columns P + 1, ..., M - Q of X12, X22 */
1143 i__1 = *m - *p - *q;
1144 for (i__ = 1; i__ <= i__1; ++i__) {
1146 i__2 = *m - *p - *q - i__ + 1;
1148 dscal_(&i__2, &d__1, &x22[*q + i__ + (*p + i__) * x22_dim1],
1150 if (i__ == *m - *p - *q) {
1151 i__2 = *m - *p - *q - i__ + 1;
1152 dlarfgp_(&i__2, &x22[*q + i__ + (*p + i__) * x22_dim1], &x22[*
1153 q + i__ + (*p + i__) * x22_dim1], ldx22, &tauq2[*p +
1156 i__2 = *m - *p - *q - i__ + 1;
1157 dlarfgp_(&i__2, &x22[*q + i__ + (*p + i__) * x22_dim1], &x22[*
1158 q + i__ + (*p + i__ + 1) * x22_dim1], ldx22, &tauq2[*
1161 x22[*q + i__ + (*p + i__) * x22_dim1] = 1.;
1162 if (i__ < *m - *p - *q) {
1163 i__2 = *m - *p - *q - i__;
1164 i__3 = *m - *p - *q - i__ + 1;
1165 dlarf_("R", &i__2, &i__3, &x22[*q + i__ + (*p + i__) *
1166 x22_dim1], ldx22, &tauq2[*p + i__], &x22[*q + i__ + 1
1167 + (*p + i__) * x22_dim1], ldx22, &work[1]);
1174 /* Reduce columns 1, ..., Q of X11, X12, X21, X22 */
1177 for (i__ = 1; i__ <= i__1; ++i__) {
1180 i__2 = *p - i__ + 1;
1181 dscal_(&i__2, &z1, &x11[i__ + i__ * x11_dim1], ldx11);
1183 i__2 = *p - i__ + 1;
1184 d__1 = z1 * cos(phi[i__ - 1]);
1185 dscal_(&i__2, &d__1, &x11[i__ + i__ * x11_dim1], ldx11);
1186 i__2 = *p - i__ + 1;
1187 d__1 = -z1 * z3 * z4 * sin(phi[i__ - 1]);
1188 daxpy_(&i__2, &d__1, &x12[i__ - 1 + i__ * x12_dim1], ldx12, &
1189 x11[i__ + i__ * x11_dim1], ldx11);
1192 i__2 = *m - *p - i__ + 1;
1193 dscal_(&i__2, &z2, &x21[i__ + i__ * x21_dim1], ldx21);
1195 i__2 = *m - *p - i__ + 1;
1196 d__1 = z2 * cos(phi[i__ - 1]);
1197 dscal_(&i__2, &d__1, &x21[i__ + i__ * x21_dim1], ldx21);
1198 i__2 = *m - *p - i__ + 1;
1199 d__1 = -z2 * z3 * z4 * sin(phi[i__ - 1]);
1200 daxpy_(&i__2, &d__1, &x22[i__ - 1 + i__ * x22_dim1], ldx22, &
1201 x21[i__ + i__ * x21_dim1], ldx21);
1204 i__2 = *m - *p - i__ + 1;
1205 i__3 = *p - i__ + 1;
1206 theta[i__] = atan2(dnrm2_(&i__2, &x21[i__ + i__ * x21_dim1],
1207 ldx21), dnrm2_(&i__3, &x11[i__ + i__ * x11_dim1], ldx11));
1209 i__2 = *p - i__ + 1;
1210 dlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + (i__ + 1) *
1211 x11_dim1], ldx11, &taup1[i__]);
1212 x11[i__ + i__ * x11_dim1] = 1.;
1213 if (i__ == *m - *p) {
1214 i__2 = *m - *p - i__ + 1;
1215 dlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + i__ *
1216 x21_dim1], ldx21, &taup2[i__]);
1218 i__2 = *m - *p - i__ + 1;
1219 dlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + (i__ +
1220 1) * x21_dim1], ldx21, &taup2[i__]);
1222 x21[i__ + i__ * x21_dim1] = 1.;
1226 i__3 = *p - i__ + 1;
1227 dlarf_("R", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], ldx11, &
1228 taup1[i__], &x11[i__ + 1 + i__ * x11_dim1], ldx11, &
1231 if (*m - *q + 1 > i__) {
1232 i__2 = *m - *q - i__ + 1;
1233 i__3 = *p - i__ + 1;
1234 dlarf_("R", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], ldx11, &
1235 taup1[i__], &x12[i__ + i__ * x12_dim1], ldx12, &work[
1240 i__3 = *m - *p - i__ + 1;
1241 dlarf_("R", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], ldx21, &
1242 taup2[i__], &x21[i__ + 1 + i__ * x21_dim1], ldx21, &
1245 if (*m - *q + 1 > i__) {
1246 i__2 = *m - *q - i__ + 1;
1247 i__3 = *m - *p - i__ + 1;
1248 dlarf_("R", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], ldx21, &
1249 taup2[i__], &x22[i__ + i__ * x22_dim1], ldx22, &work[
1255 d__1 = -z1 * z3 * sin(theta[i__]);
1256 dscal_(&i__2, &d__1, &x11[i__ + 1 + i__ * x11_dim1], &c__1);
1258 d__1 = z2 * z3 * cos(theta[i__]);
1259 daxpy_(&i__2, &d__1, &x21[i__ + 1 + i__ * x21_dim1], &c__1, &
1260 x11[i__ + 1 + i__ * x11_dim1], &c__1);
1262 i__2 = *m - *q - i__ + 1;
1263 d__1 = -z1 * z4 * sin(theta[i__]);
1264 dscal_(&i__2, &d__1, &x12[i__ + i__ * x12_dim1], &c__1);
1265 i__2 = *m - *q - i__ + 1;
1266 d__1 = z2 * z4 * cos(theta[i__]);
1267 daxpy_(&i__2, &d__1, &x22[i__ + i__ * x22_dim1], &c__1, &x12[i__
1268 + i__ * x12_dim1], &c__1);
1272 i__3 = *m - *q - i__ + 1;
1273 phi[i__] = atan2(dnrm2_(&i__2, &x11[i__ + 1 + i__ * x11_dim1],
1274 &c__1), dnrm2_(&i__3, &x12[i__ + i__ * x12_dim1], &
1279 if (*q - i__ == 1) {
1281 dlarfgp_(&i__2, &x11[i__ + 1 + i__ * x11_dim1], &x11[i__
1282 + 1 + i__ * x11_dim1], &c__1, &tauq1[i__]);
1285 dlarfgp_(&i__2, &x11[i__ + 1 + i__ * x11_dim1], &x11[i__
1286 + 2 + i__ * x11_dim1], &c__1, &tauq1[i__]);
1288 x11[i__ + 1 + i__ * x11_dim1] = 1.;
1290 if (*m - *q > i__) {
1291 i__2 = *m - *q - i__ + 1;
1292 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + 1 +
1293 i__ * x12_dim1], &c__1, &tauq2[i__]);
1295 i__2 = *m - *q - i__ + 1;
1296 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + i__ *
1297 x12_dim1], &c__1, &tauq2[i__]);
1299 x12[i__ + i__ * x12_dim1] = 1.;
1304 dlarf_("L", &i__2, &i__3, &x11[i__ + 1 + i__ * x11_dim1], &
1305 c__1, &tauq1[i__], &x11[i__ + 1 + (i__ + 1) *
1306 x11_dim1], ldx11, &work[1]);
1308 i__3 = *m - *p - i__;
1309 dlarf_("L", &i__2, &i__3, &x11[i__ + 1 + i__ * x11_dim1], &
1310 c__1, &tauq1[i__], &x21[i__ + 1 + (i__ + 1) *
1311 x21_dim1], ldx21, &work[1]);
1313 i__2 = *m - *q - i__ + 1;
1315 dlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
1316 tauq2[i__], &x12[i__ + (i__ + 1) * x12_dim1], ldx12, &
1318 if (*m - *p - i__ > 0) {
1319 i__2 = *m - *q - i__ + 1;
1320 i__3 = *m - *p - i__;
1321 dlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
1322 tauq2[i__], &x22[i__ + (i__ + 1) * x22_dim1], ldx22, &
1328 /* Reduce columns Q + 1, ..., P of X12, X22 */
1331 for (i__ = *q + 1; i__ <= i__1; ++i__) {
1333 i__2 = *m - *q - i__ + 1;
1335 dscal_(&i__2, &d__1, &x12[i__ + i__ * x12_dim1], &c__1);
1336 i__2 = *m - *q - i__ + 1;
1337 dlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + 1 + i__ *
1338 x12_dim1], &c__1, &tauq2[i__]);
1339 x12[i__ + i__ * x12_dim1] = 1.;
1342 i__2 = *m - *q - i__ + 1;
1344 dlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
1345 tauq2[i__], &x12[i__ + (i__ + 1) * x12_dim1], ldx12, &
1348 if (*m - *p - *q >= 1) {
1349 i__2 = *m - *q - i__ + 1;
1350 i__3 = *m - *p - *q;
1351 dlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
1352 tauq2[i__], &x22[i__ + (*q + 1) * x22_dim1], ldx22, &
1358 /* Reduce columns P + 1, ..., M - Q of X12, X22 */
1360 i__1 = *m - *p - *q;
1361 for (i__ = 1; i__ <= i__1; ++i__) {
1363 i__2 = *m - *p - *q - i__ + 1;
1365 dscal_(&i__2, &d__1, &x22[*p + i__ + (*q + i__) * x22_dim1], &
1367 if (*m - *p - *q == i__) {
1368 i__2 = *m - *p - *q - i__ + 1;
1369 dlarfgp_(&i__2, &x22[*p + i__ + (*q + i__) * x22_dim1], &x22[*
1370 p + i__ + (*q + i__) * x22_dim1], &c__1, &tauq2[*p +
1373 i__2 = *m - *p - *q - i__ + 1;
1374 dlarfgp_(&i__2, &x22[*p + i__ + (*q + i__) * x22_dim1], &x22[*
1375 p + i__ + 1 + (*q + i__) * x22_dim1], &c__1, &tauq2[*
1377 i__2 = *m - *p - *q - i__ + 1;
1378 i__3 = *m - *p - *q - i__;
1379 dlarf_("L", &i__2, &i__3, &x22[*p + i__ + (*q + i__) *
1380 x22_dim1], &c__1, &tauq2[*p + i__], &x22[*p + i__ + (*
1381 q + i__ + 1) * x22_dim1], ldx22, &work[1]);
1383 x22[*p + i__ + (*q + i__) * x22_dim1] = 1.;