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__2 = 2;
00019
00020 int clatb4_(char *path, integer *imat, integer *m, integer *
00021 n, char *type__, integer *kl, integer *ku, real *anorm, integer *mode,
00022 real *cndnum, char *dist)
00023 {
00024
00025
00026 static logical first = TRUE_;
00027
00028
00029 integer i__1;
00030
00031
00032 double sqrt(doublereal);
00033 int s_copy(char *, char *, ftnlen, ftnlen);
00034
00035
00036 char c2[2];
00037 integer mat;
00038 static real eps, badc1, badc2, large, small;
00039 extern int slabad_(real *, real *);
00040 extern doublereal slamch_(char *);
00041 extern logical lsamen_(integer *, char *, char *);
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 if (first) {
00121 first = FALSE_;
00122 eps = slamch_("Precision");
00123 badc2 = .1f / eps;
00124 badc1 = sqrt(badc2);
00125 small = slamch_("Safe minimum");
00126 large = 1.f / small;
00127
00128
00129
00130
00131 slabad_(&small, &large);
00132 small = small / eps * .25f;
00133 large = 1.f / small;
00134 }
00135
00136 s_copy(c2, path + 1, (ftnlen)2, (ftnlen)2);
00137
00138
00139
00140 *(unsigned char *)dist = 'S';
00141 *mode = 3;
00142
00143
00144
00145
00146 if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2,
00147 "LQ") || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) {
00148
00149
00150
00151 *(unsigned char *)type__ = 'N';
00152
00153
00154
00155 if (*imat == 1) {
00156 *kl = 0;
00157 *ku = 0;
00158 } else if (*imat == 2) {
00159 *kl = 0;
00160
00161 i__1 = *n - 1;
00162 *ku = max(i__1,0);
00163 } else if (*imat == 3) {
00164
00165 i__1 = *m - 1;
00166 *kl = max(i__1,0);
00167 *ku = 0;
00168 } else {
00169
00170 i__1 = *m - 1;
00171 *kl = max(i__1,0);
00172
00173 i__1 = *n - 1;
00174 *ku = max(i__1,0);
00175 }
00176
00177
00178
00179 if (*imat == 5) {
00180 *cndnum = badc1;
00181 } else if (*imat == 6) {
00182 *cndnum = badc2;
00183 } else {
00184 *cndnum = 2.f;
00185 }
00186
00187 if (*imat == 7) {
00188 *anorm = small;
00189 } else if (*imat == 8) {
00190 *anorm = large;
00191 } else {
00192 *anorm = 1.f;
00193 }
00194
00195 } else if (lsamen_(&c__2, c2, "GE")) {
00196
00197
00198
00199
00200
00201 *(unsigned char *)type__ = 'N';
00202
00203
00204
00205 if (*imat == 1) {
00206 *kl = 0;
00207 *ku = 0;
00208 } else if (*imat == 2) {
00209 *kl = 0;
00210
00211 i__1 = *n - 1;
00212 *ku = max(i__1,0);
00213 } else if (*imat == 3) {
00214
00215 i__1 = *m - 1;
00216 *kl = max(i__1,0);
00217 *ku = 0;
00218 } else {
00219
00220 i__1 = *m - 1;
00221 *kl = max(i__1,0);
00222
00223 i__1 = *n - 1;
00224 *ku = max(i__1,0);
00225 }
00226
00227
00228
00229 if (*imat == 8) {
00230 *cndnum = badc1;
00231 } else if (*imat == 9) {
00232 *cndnum = badc2;
00233 } else {
00234 *cndnum = 2.f;
00235 }
00236
00237 if (*imat == 10) {
00238 *anorm = small;
00239 } else if (*imat == 11) {
00240 *anorm = large;
00241 } else {
00242 *anorm = 1.f;
00243 }
00244
00245 } else if (lsamen_(&c__2, c2, "GB")) {
00246
00247
00248
00249
00250
00251 *(unsigned char *)type__ = 'N';
00252
00253
00254
00255 if (*imat == 5) {
00256 *cndnum = badc1;
00257 } else if (*imat == 6) {
00258 *cndnum = badc2 * .1f;
00259 } else {
00260 *cndnum = 2.f;
00261 }
00262
00263 if (*imat == 7) {
00264 *anorm = small;
00265 } else if (*imat == 8) {
00266 *anorm = large;
00267 } else {
00268 *anorm = 1.f;
00269 }
00270
00271 } else if (lsamen_(&c__2, c2, "GT")) {
00272
00273
00274
00275
00276
00277 *(unsigned char *)type__ = 'N';
00278
00279
00280
00281 if (*imat == 1) {
00282 *kl = 0;
00283 } else {
00284 *kl = 1;
00285 }
00286 *ku = *kl;
00287
00288
00289
00290 if (*imat == 3) {
00291 *cndnum = badc1;
00292 } else if (*imat == 4) {
00293 *cndnum = badc2;
00294 } else {
00295 *cndnum = 2.f;
00296 }
00297
00298 if (*imat == 5 || *imat == 11) {
00299 *anorm = small;
00300 } else if (*imat == 6 || *imat == 12) {
00301 *anorm = large;
00302 } else {
00303 *anorm = 1.f;
00304 }
00305
00306 } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&
00307 c__2, c2, "PP") || lsamen_(&c__2, c2, "HE") || lsamen_(&c__2, c2, "HP") || lsamen_(&c__2, c2, "SY") ||
00308 lsamen_(&c__2, c2, "SP")) {
00309
00310
00311
00312
00313
00314
00315 *(unsigned char *)type__ = *(unsigned char *)c2;
00316
00317
00318
00319 if (*imat == 1) {
00320 *kl = 0;
00321 } else {
00322
00323 i__1 = *n - 1;
00324 *kl = max(i__1,0);
00325 }
00326 *ku = *kl;
00327
00328
00329
00330 if (*imat == 6) {
00331 *cndnum = badc1;
00332 } else if (*imat == 7) {
00333 *cndnum = badc2;
00334 } else {
00335 *cndnum = 2.f;
00336 }
00337
00338 if (*imat == 8) {
00339 *anorm = small;
00340 } else if (*imat == 9) {
00341 *anorm = large;
00342 } else {
00343 *anorm = 1.f;
00344 }
00345
00346 } else if (lsamen_(&c__2, c2, "PB")) {
00347
00348
00349
00350
00351
00352 *(unsigned char *)type__ = 'P';
00353
00354
00355
00356 if (*imat == 5) {
00357 *cndnum = badc1;
00358 } else if (*imat == 6) {
00359 *cndnum = badc2;
00360 } else {
00361 *cndnum = 2.f;
00362 }
00363
00364 if (*imat == 7) {
00365 *anorm = small;
00366 } else if (*imat == 8) {
00367 *anorm = large;
00368 } else {
00369 *anorm = 1.f;
00370 }
00371
00372 } else if (lsamen_(&c__2, c2, "PT")) {
00373
00374
00375
00376
00377 *(unsigned char *)type__ = 'P';
00378 if (*imat == 1) {
00379 *kl = 0;
00380 } else {
00381 *kl = 1;
00382 }
00383 *ku = *kl;
00384
00385
00386
00387 if (*imat == 3) {
00388 *cndnum = badc1;
00389 } else if (*imat == 4) {
00390 *cndnum = badc2;
00391 } else {
00392 *cndnum = 2.f;
00393 }
00394
00395 if (*imat == 5 || *imat == 11) {
00396 *anorm = small;
00397 } else if (*imat == 6 || *imat == 12) {
00398 *anorm = large;
00399 } else {
00400 *anorm = 1.f;
00401 }
00402
00403 } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&
00404 c__2, c2, "TP")) {
00405
00406
00407
00408
00409
00410 *(unsigned char *)type__ = 'N';
00411
00412
00413
00414 mat = abs(*imat);
00415 if (mat == 1 || mat == 7) {
00416 *kl = 0;
00417 *ku = 0;
00418 } else if (*imat < 0) {
00419
00420 i__1 = *n - 1;
00421 *kl = max(i__1,0);
00422 *ku = 0;
00423 } else {
00424 *kl = 0;
00425
00426 i__1 = *n - 1;
00427 *ku = max(i__1,0);
00428 }
00429
00430
00431
00432 if (mat == 3 || mat == 9) {
00433 *cndnum = badc1;
00434 } else if (mat == 4 || mat == 10) {
00435 *cndnum = badc2;
00436 } else {
00437 *cndnum = 2.f;
00438 }
00439
00440 if (mat == 5) {
00441 *anorm = small;
00442 } else if (mat == 6) {
00443 *anorm = large;
00444 } else {
00445 *anorm = 1.f;
00446 }
00447
00448 } else if (lsamen_(&c__2, c2, "TB")) {
00449
00450
00451
00452
00453
00454 *(unsigned char *)type__ = 'N';
00455
00456
00457
00458 if (*imat == 2 || *imat == 8) {
00459 *cndnum = badc1;
00460 } else if (*imat == 3 || *imat == 9) {
00461 *cndnum = badc2;
00462 } else {
00463 *cndnum = 2.f;
00464 }
00465
00466 if (*imat == 4) {
00467 *anorm = small;
00468 } else if (*imat == 5) {
00469 *anorm = large;
00470 } else {
00471 *anorm = 1.f;
00472 }
00473 }
00474 if (*n <= 1) {
00475 *cndnum = 1.f;
00476 }
00477
00478 return 0;
00479
00480
00481
00482 }