00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__1 = 1;
00019 static integer c__2 = 2;
00020
00021 int strexc_(char *compq, integer *n, real *t, integer *ldt,
00022 real *q, integer *ldq, integer *ifst, integer *ilst, real *work,
00023 integer *info)
00024 {
00025
00026 integer q_dim1, q_offset, t_dim1, t_offset, i__1;
00027
00028
00029 integer nbf, nbl, here;
00030 extern logical lsame_(char *, char *);
00031 logical wantq;
00032 extern int xerbla_(char *, integer *), slaexc_(
00033 logical *, integer *, real *, integer *, real *, integer *,
00034 integer *, integer *, integer *, real *, integer *);
00035 integer nbnext;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 t_dim1 = *ldt;
00130 t_offset = 1 + t_dim1;
00131 t -= t_offset;
00132 q_dim1 = *ldq;
00133 q_offset = 1 + q_dim1;
00134 q -= q_offset;
00135 --work;
00136
00137
00138 *info = 0;
00139 wantq = lsame_(compq, "V");
00140 if (! wantq && ! lsame_(compq, "N")) {
00141 *info = -1;
00142 } else if (*n < 0) {
00143 *info = -2;
00144 } else if (*ldt < max(1,*n)) {
00145 *info = -4;
00146 } else if (*ldq < 1 || wantq && *ldq < max(1,*n)) {
00147 *info = -6;
00148 } else if (*ifst < 1 || *ifst > *n) {
00149 *info = -7;
00150 } else if (*ilst < 1 || *ilst > *n) {
00151 *info = -8;
00152 }
00153 if (*info != 0) {
00154 i__1 = -(*info);
00155 xerbla_("STREXC", &i__1);
00156 return 0;
00157 }
00158
00159
00160
00161 if (*n <= 1) {
00162 return 0;
00163 }
00164
00165
00166
00167
00168 if (*ifst > 1) {
00169 if (t[*ifst + (*ifst - 1) * t_dim1] != 0.f) {
00170 --(*ifst);
00171 }
00172 }
00173 nbf = 1;
00174 if (*ifst < *n) {
00175 if (t[*ifst + 1 + *ifst * t_dim1] != 0.f) {
00176 nbf = 2;
00177 }
00178 }
00179
00180
00181
00182
00183 if (*ilst > 1) {
00184 if (t[*ilst + (*ilst - 1) * t_dim1] != 0.f) {
00185 --(*ilst);
00186 }
00187 }
00188 nbl = 1;
00189 if (*ilst < *n) {
00190 if (t[*ilst + 1 + *ilst * t_dim1] != 0.f) {
00191 nbl = 2;
00192 }
00193 }
00194
00195 if (*ifst == *ilst) {
00196 return 0;
00197 }
00198
00199 if (*ifst < *ilst) {
00200
00201
00202
00203 if (nbf == 2 && nbl == 1) {
00204 --(*ilst);
00205 }
00206 if (nbf == 1 && nbl == 2) {
00207 ++(*ilst);
00208 }
00209
00210 here = *ifst;
00211
00212 L10:
00213
00214
00215
00216 if (nbf == 1 || nbf == 2) {
00217
00218
00219
00220 nbnext = 1;
00221 if (here + nbf + 1 <= *n) {
00222 if (t[here + nbf + 1 + (here + nbf) * t_dim1] != 0.f) {
00223 nbnext = 2;
00224 }
00225 }
00226 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &here, &
00227 nbf, &nbnext, &work[1], info);
00228 if (*info != 0) {
00229 *ilst = here;
00230 return 0;
00231 }
00232 here += nbnext;
00233
00234
00235
00236 if (nbf == 2) {
00237 if (t[here + 1 + here * t_dim1] == 0.f) {
00238 nbf = 3;
00239 }
00240 }
00241
00242 } else {
00243
00244
00245
00246
00247 nbnext = 1;
00248 if (here + 3 <= *n) {
00249 if (t[here + 3 + (here + 2) * t_dim1] != 0.f) {
00250 nbnext = 2;
00251 }
00252 }
00253 i__1 = here + 1;
00254 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &i__1, &
00255 c__1, &nbnext, &work[1], info);
00256 if (*info != 0) {
00257 *ilst = here;
00258 return 0;
00259 }
00260 if (nbnext == 1) {
00261
00262
00263
00264 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00265 here, &c__1, &nbnext, &work[1], info);
00266 ++here;
00267 } else {
00268
00269
00270
00271 if (t[here + 2 + (here + 1) * t_dim1] == 0.f) {
00272 nbnext = 1;
00273 }
00274 if (nbnext == 2) {
00275
00276
00277
00278 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00279 here, &c__1, &nbnext, &work[1], info);
00280 if (*info != 0) {
00281 *ilst = here;
00282 return 0;
00283 }
00284 here += 2;
00285 } else {
00286
00287
00288
00289 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00290 here, &c__1, &c__1, &work[1], info);
00291 i__1 = here + 1;
00292 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00293 i__1, &c__1, &c__1, &work[1], info);
00294 here += 2;
00295 }
00296 }
00297 }
00298 if (here < *ilst) {
00299 goto L10;
00300 }
00301
00302 } else {
00303
00304 here = *ifst;
00305 L20:
00306
00307
00308
00309 if (nbf == 1 || nbf == 2) {
00310
00311
00312
00313 nbnext = 1;
00314 if (here >= 3) {
00315 if (t[here - 1 + (here - 2) * t_dim1] != 0.f) {
00316 nbnext = 2;
00317 }
00318 }
00319 i__1 = here - nbnext;
00320 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &i__1, &
00321 nbnext, &nbf, &work[1], info);
00322 if (*info != 0) {
00323 *ilst = here;
00324 return 0;
00325 }
00326 here -= nbnext;
00327
00328
00329
00330 if (nbf == 2) {
00331 if (t[here + 1 + here * t_dim1] == 0.f) {
00332 nbf = 3;
00333 }
00334 }
00335
00336 } else {
00337
00338
00339
00340
00341 nbnext = 1;
00342 if (here >= 3) {
00343 if (t[here - 1 + (here - 2) * t_dim1] != 0.f) {
00344 nbnext = 2;
00345 }
00346 }
00347 i__1 = here - nbnext;
00348 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &i__1, &
00349 nbnext, &c__1, &work[1], info);
00350 if (*info != 0) {
00351 *ilst = here;
00352 return 0;
00353 }
00354 if (nbnext == 1) {
00355
00356
00357
00358 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00359 here, &nbnext, &c__1, &work[1], info);
00360 --here;
00361 } else {
00362
00363
00364
00365 if (t[here + (here - 1) * t_dim1] == 0.f) {
00366 nbnext = 1;
00367 }
00368 if (nbnext == 2) {
00369
00370
00371
00372 i__1 = here - 1;
00373 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00374 i__1, &c__2, &c__1, &work[1], info);
00375 if (*info != 0) {
00376 *ilst = here;
00377 return 0;
00378 }
00379 here += -2;
00380 } else {
00381
00382
00383
00384 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00385 here, &c__1, &c__1, &work[1], info);
00386 i__1 = here - 1;
00387 slaexc_(&wantq, n, &t[t_offset], ldt, &q[q_offset], ldq, &
00388 i__1, &c__1, &c__1, &work[1], info);
00389 here += -2;
00390 }
00391 }
00392 }
00393 if (here > *ilst) {
00394 goto L20;
00395 }
00396 }
00397 *ilst = here;
00398
00399 return 0;
00400
00401
00402
00403 }