| |
| |
| |
| |
| |
| #include <string.h> |
| #include "f2c.h" |
| |
| |
| |
| static integer c__2 = 2; |
| |
| int zlatb4_(char *path, integer *imat, integer *m, integer * |
| n, char *type, integer *kl, integer *ku, doublereal *anorm, integer * |
| mode, doublereal *cndnum, char *dist) |
| { |
| |
| |
| static logical first = TRUE_; |
| |
| |
| integer i__1; |
| |
| |
| double sqrt(doublereal); |
| |
| |
| |
| static doublereal badc1, badc2, large, small; |
| static char c2[2]; |
| extern int dlabad_(doublereal *, doublereal *); |
| extern doublereal dlamch_(char *); |
| extern logical lsamen_(integer *, char *, char *); |
| static integer mat; |
| static doublereal eps; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if (first) { |
| first = FALSE_; |
| eps = dlamch_("Precision"); |
| badc2 = .1 / eps; |
| badc1 = sqrt(badc2); |
| small = dlamch_("Safe minimum"); |
| large = 1. / small; |
| |
| |
| |
| |
| dlabad_(&small, &large); |
| small = small / eps * .25; |
| large = 1. / small; |
| } |
| |
| |
| strncpy(c2, path + 1, 2); |
| |
| |
| |
| *(unsigned char *)dist = 'S'; |
| *mode = 3; |
| |
| |
| |
| |
| if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2, "LQ") |
| || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) { |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| if (*imat == 1) { |
| *kl = 0; |
| *ku = 0; |
| } else if (*imat == 2) { |
| *kl = 0; |
| |
| i__1 = *n - 1; |
| *ku = max(i__1,0); |
| } else if (*imat == 3) { |
| |
| i__1 = *m - 1; |
| *kl = max(i__1,0); |
| *ku = 0; |
| } else { |
| |
| i__1 = *m - 1; |
| *kl = max(i__1,0); |
| |
| i__1 = *n - 1; |
| *ku = max(i__1,0); |
| } |
| |
| |
| |
| if (*imat == 5) { |
| *cndnum = badc1; |
| } else if (*imat == 6) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 7) { |
| *anorm = small; |
| } else if (*imat == 8) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "GE")) { |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| if (*imat == 1) { |
| *kl = 0; |
| *ku = 0; |
| } else if (*imat == 2) { |
| *kl = 0; |
| |
| i__1 = *n - 1; |
| *ku = max(i__1,0); |
| } else if (*imat == 3) { |
| |
| i__1 = *m - 1; |
| *kl = max(i__1,0); |
| *ku = 0; |
| } else { |
| |
| i__1 = *m - 1; |
| *kl = max(i__1,0); |
| |
| i__1 = *n - 1; |
| *ku = max(i__1,0); |
| } |
| |
| |
| |
| if (*imat == 8) { |
| *cndnum = badc1; |
| } else if (*imat == 9) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 10) { |
| *anorm = small; |
| } else if (*imat == 11) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "GB")) { |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| if (*imat == 5) { |
| *cndnum = badc1; |
| } else if (*imat == 6) { |
| *cndnum = badc2 * .1; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 7) { |
| *anorm = small; |
| } else if (*imat == 8) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "GT")) { |
| |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| if (*imat == 1) { |
| *kl = 0; |
| } else { |
| *kl = 1; |
| } |
| *ku = *kl; |
| |
| |
| |
| if (*imat == 3) { |
| *cndnum = badc1; |
| } else if (*imat == 4) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 5 || *imat == 11) { |
| *anorm = small; |
| } else if (*imat == 6 || *imat == 12) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&c__2, c2, "PP") || lsamen_(&c__2, c2, "HE") || lsamen_(&c__2, c2, |
| "HP") || lsamen_(&c__2, c2, "SY") || lsamen_(& |
| c__2, c2, "SP")) { |
| |
| |
| |
| |
| |
| |
| |
| *(unsigned char *)type = *(unsigned char *)c2; |
| |
| |
| |
| if (*imat == 1) { |
| *kl = 0; |
| } else { |
| |
| i__1 = *n - 1; |
| *kl = max(i__1,0); |
| } |
| *ku = *kl; |
| |
| |
| |
| if (*imat == 6) { |
| *cndnum = badc1; |
| } else if (*imat == 7) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 8) { |
| *anorm = small; |
| } else if (*imat == 9) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "PB")) { |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'P'; |
| |
| |
| |
| if (*imat == 5) { |
| *cndnum = badc1; |
| } else if (*imat == 6) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 7) { |
| *anorm = small; |
| } else if (*imat == 8) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "PT")) { |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'P'; |
| if (*imat == 1) { |
| *kl = 0; |
| } else { |
| *kl = 1; |
| } |
| *ku = *kl; |
| |
| |
| |
| if (*imat == 3) { |
| *cndnum = badc1; |
| } else if (*imat == 4) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 5 || *imat == 11) { |
| *anorm = small; |
| } else if (*imat == 6 || *imat == 12) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&c__2, c2, "TP")) { |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| mat = abs(*imat); |
| if (mat == 1 || mat == 7) { |
| *kl = 0; |
| *ku = 0; |
| } else if (*imat < 0) { |
| |
| i__1 = *n - 1; |
| *kl = max(i__1,0); |
| *ku = 0; |
| } else { |
| *kl = 0; |
| |
| i__1 = *n - 1; |
| *ku = max(i__1,0); |
| } |
| |
| |
| |
| if (mat == 3 || mat == 9) { |
| *cndnum = badc1; |
| } else if (mat == 4 || mat == 10) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (mat == 5) { |
| *anorm = small; |
| } else if (mat == 6) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| |
| } else if (lsamen_(&c__2, c2, "TB")) { |
| |
| |
| |
| |
| |
| |
| *(unsigned char *)type = 'N'; |
| |
| |
| |
| if (*imat == 2 || *imat == 8) { |
| *cndnum = badc1; |
| } else if (*imat == 3 || *imat == 9) { |
| *cndnum = badc2; |
| } else { |
| *cndnum = 2.; |
| } |
| |
| if (*imat == 4) { |
| *anorm = small; |
| } else if (*imat == 5) { |
| *anorm = large; |
| } else { |
| *anorm = 1.; |
| } |
| } |
| if (*n <= 1) { |
| *cndnum = 1.; |
| } |
| |
| return 0; |
| |
| |
| |
| } |
| |