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 slasq5_(integer *i0, integer *n0, real *z__, integer *pp,
00017 real *tau, real *dmin__, real *dmin1, real *dmin2, real *dn, real *
00018 dnm1, real *dnm2, logical *ieee)
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
00029
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
00101
00102 --z__;
00103
00104
00105 if (*n0 - *i0 - 1 <= 0) {
00106 return 0;
00107 }
00108
00109 j4 = (*i0 << 2) + *pp - 3;
00110 emin = z__[j4 + 4];
00111 d__ = z__[j4] - *tau;
00112 *dmin__ = d__;
00113 *dmin1 = -z__[j4];
00114
00115 if (*ieee) {
00116
00117
00118
00119 if (*pp == 0) {
00120 i__1 = *n0 - 3 << 2;
00121 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00122 z__[j4 - 2] = d__ + z__[j4 - 1];
00123 temp = z__[j4 + 1] / z__[j4 - 2];
00124 d__ = d__ * temp - *tau;
00125 *dmin__ = dmin(*dmin__,d__);
00126 z__[j4] = z__[j4 - 1] * temp;
00127
00128 r__1 = z__[j4];
00129 emin = dmin(r__1,emin);
00130
00131 }
00132 } else {
00133 i__1 = *n0 - 3 << 2;
00134 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00135 z__[j4 - 3] = d__ + z__[j4];
00136 temp = z__[j4 + 2] / z__[j4 - 3];
00137 d__ = d__ * temp - *tau;
00138 *dmin__ = dmin(*dmin__,d__);
00139 z__[j4 - 1] = z__[j4] * temp;
00140
00141 r__1 = z__[j4 - 1];
00142 emin = dmin(r__1,emin);
00143
00144 }
00145 }
00146
00147
00148
00149 *dnm2 = d__;
00150 *dmin2 = *dmin__;
00151 j4 = (*n0 - 2 << 2) - *pp;
00152 j4p2 = j4 + (*pp << 1) - 1;
00153 z__[j4 - 2] = *dnm2 + z__[j4p2];
00154 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00155 *dnm1 = z__[j4p2 + 2] * (*dnm2 / z__[j4 - 2]) - *tau;
00156 *dmin__ = dmin(*dmin__,*dnm1);
00157
00158 *dmin1 = *dmin__;
00159 j4 += 4;
00160 j4p2 = j4 + (*pp << 1) - 1;
00161 z__[j4 - 2] = *dnm1 + z__[j4p2];
00162 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00163 *dn = z__[j4p2 + 2] * (*dnm1 / z__[j4 - 2]) - *tau;
00164 *dmin__ = dmin(*dmin__,*dn);
00165
00166 } else {
00167
00168
00169
00170 if (*pp == 0) {
00171 i__1 = *n0 - 3 << 2;
00172 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00173 z__[j4 - 2] = d__ + z__[j4 - 1];
00174 if (d__ < 0.f) {
00175 return 0;
00176 } else {
00177 z__[j4] = z__[j4 + 1] * (z__[j4 - 1] / z__[j4 - 2]);
00178 d__ = z__[j4 + 1] * (d__ / z__[j4 - 2]) - *tau;
00179 }
00180 *dmin__ = dmin(*dmin__,d__);
00181
00182 r__1 = emin, r__2 = z__[j4];
00183 emin = dmin(r__1,r__2);
00184
00185 }
00186 } else {
00187 i__1 = *n0 - 3 << 2;
00188 for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) {
00189 z__[j4 - 3] = d__ + z__[j4];
00190 if (d__ < 0.f) {
00191 return 0;
00192 } else {
00193 z__[j4 - 1] = z__[j4 + 2] * (z__[j4] / z__[j4 - 3]);
00194 d__ = z__[j4 + 2] * (d__ / z__[j4 - 3]) - *tau;
00195 }
00196 *dmin__ = dmin(*dmin__,d__);
00197
00198 r__1 = emin, r__2 = z__[j4 - 1];
00199 emin = dmin(r__1,r__2);
00200
00201 }
00202 }
00203
00204
00205
00206 *dnm2 = d__;
00207 *dmin2 = *dmin__;
00208 j4 = (*n0 - 2 << 2) - *pp;
00209 j4p2 = j4 + (*pp << 1) - 1;
00210 z__[j4 - 2] = *dnm2 + z__[j4p2];
00211 if (*dnm2 < 0.f) {
00212 return 0;
00213 } else {
00214 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00215 *dnm1 = z__[j4p2 + 2] * (*dnm2 / z__[j4 - 2]) - *tau;
00216 }
00217 *dmin__ = dmin(*dmin__,*dnm1);
00218
00219 *dmin1 = *dmin__;
00220 j4 += 4;
00221 j4p2 = j4 + (*pp << 1) - 1;
00222 z__[j4 - 2] = *dnm1 + z__[j4p2];
00223 if (*dnm1 < 0.f) {
00224 return 0;
00225 } else {
00226 z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]);
00227 *dn = z__[j4p2 + 2] * (*dnm1 / z__[j4 - 2]) - *tau;
00228 }
00229 *dmin__ = dmin(*dmin__,*dn);
00230
00231 }
00232
00233 z__[j4 + 2] = *dn;
00234 z__[(*n0 << 2) - *pp] = emin;
00235 return 0;
00236
00237
00238
00239 }