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