Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016 int slasq6_(integer *i0, integer *n0, real *z__, integer *pp,
00017 real *dmin__, real *dmin1, real *dmin2, real *dn, real *dnm1, real *
00018 dnm2)
00019 {
00020
00021 integer i__1;
00022 real r__1, r__2;
00023
00024
00025 real d__;
00026 integer j4, j4p2;
00027 real emin, temp;
00028 extern doublereal slamch_(char *);
00029 real safmin;
00030
00031
00032
00033
00034
00035
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 --z__;
00101
00102
00103 if (*n0 - *i0 - 1 <= 0) {
00104 return 0;
00105 }
00106
00107 safmin = slamch_("Safe minimum");
00108 j4 = (*i0 << 2) + *pp - 3;
00109 emin = z__[j4 + 4];
00110 d__ = z__[j4];
00111 *dmin__ = d__;
00112
00113 if (*pp == 0) {
00114 i__1 = *n0 - 3 << 2;
00115 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00116 z__[j4 - 2] = d__ + z__[j4 - 1];
00117 if (z__[j4 - 2] == 0.f) {
00118 z__[j4] = 0.f;
00119 d__ = z__[j4 + 1];
00120 *dmin__ = d__;
00121 emin = 0.f;
00122 } else if (safmin * z__[j4 + 1] < z__[j4 - 2] && safmin * z__[j4
00123 - 2] < z__[j4 + 1]) {
00124 temp = z__[j4 + 1] / z__[j4 - 2];
00125 z__[j4] = z__[j4 - 1] * temp;
00126 d__ *= temp;
00127 } else {
00128 z__[j4] = z__[j4 + 1] * (z__[j4 - 1] / z__[j4 - 2]);
00129 d__ = z__[j4 + 1] * (d__ / z__[j4 - 2]);
00130 }
00131 *dmin__ = dmin(*dmin__,d__);
00132
00133 r__1 = emin, r__2 = z__[j4];
00134 emin = dmin(r__1,r__2);
00135
00136 }
00137 } else {
00138 i__1 = *n0 - 3 << 2;
00139 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00140 z__[j4 - 3] = d__ + z__[j4];
00141 if (z__[j4 - 3] == 0.f) {
00142 z__[j4 - 1] = 0.f;
00143 d__ = z__[j4 + 2];
00144 *dmin__ = d__;
00145 emin = 0.f;
00146 } else if (safmin * z__[j4 + 2] < z__[j4 - 3] && safmin * z__[j4
00147 - 3] < z__[j4 + 2]) {
00148 temp = z__[j4 + 2] / z__[j4 - 3];
00149 z__[j4 - 1] = z__[j4] * temp;
00150 d__ *= temp;
00151 } else {
00152 z__[j4 - 1] = z__[j4 + 2] * (z__[j4] / z__[j4 - 3]);
00153 d__ = z__[j4 + 2] * (d__ / z__[j4 - 3]);
00154 }
00155 *dmin__ = dmin(*dmin__,d__);
00156
00157 r__1 = emin, r__2 = z__[j4 - 1];
00158 emin = dmin(r__1,r__2);
00159
00160 }
00161 }
00162
00163
00164
00165 *dnm2 = d__;
00166 *dmin2 = *dmin__;
00167 j4 = (*n0 - 2 << 2) - *pp;
00168 j4p2 = j4 + (*pp << 1) - 1;
00169 z__[j4 - 2] = *dnm2 + z__[j4p2];
00170 if (z__[j4 - 2] == 0.f) {
00171 z__[j4] = 0.f;
00172 *dnm1 = z__[j4p2 + 2];
00173 *dmin__ = *dnm1;
00174 emin = 0.f;
00175 } else if (safmin * z__[j4p2 + 2] < z__[j4 - 2] && safmin * z__[j4 - 2] <
00176 z__[j4p2 + 2]) {
00177 temp = z__[j4p2 + 2] / z__[j4 - 2];
00178 z__[j4] = z__[j4p2] * temp;
00179 *dnm1 = *dnm2 * temp;
00180 } else {
00181 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00182 *dnm1 = z__[j4p2 + 2] * (*dnm2 / z__[j4 - 2]);
00183 }
00184 *dmin__ = dmin(*dmin__,*dnm1);
00185
00186 *dmin1 = *dmin__;
00187 j4 += 4;
00188 j4p2 = j4 + (*pp << 1) - 1;
00189 z__[j4 - 2] = *dnm1 + z__[j4p2];
00190 if (z__[j4 - 2] == 0.f) {
00191 z__[j4] = 0.f;
00192 *dn = z__[j4p2 + 2];
00193 *dmin__ = *dn;
00194 emin = 0.f;
00195 } else if (safmin * z__[j4p2 + 2] < z__[j4 - 2] && safmin * z__[j4 - 2] <
00196 z__[j4p2 + 2]) {
00197 temp = z__[j4p2 + 2] / z__[j4 - 2];
00198 z__[j4] = z__[j4p2] * temp;
00199 *dn = *dnm1 * temp;
00200 } else {
00201 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00202 *dn = z__[j4p2 + 2] * (*dnm1 / z__[j4 - 2]);
00203 }
00204 *dmin__ = dmin(*dmin__,*dn);
00205
00206 z__[j4 + 2] = *dn;
00207 z__[(*n0 << 2) - *pp] = emin;
00208 return 0;
00209
00210
00211
00212 }