| 3203 | // ---------------------------------------------------------------------------------------- |
| 3204 | |
| 3205 | void update_( |
| 3206 | const integer n, |
| 3207 | const integer npt, |
| 3208 | doublereal *bmat, |
| 3209 | doublereal *zmat, |
| 3210 | const integer ndim, |
| 3211 | doublereal *vlag, |
| 3212 | const doublereal beta, |
| 3213 | const doublereal denom, |
| 3214 | const integer knew, |
| 3215 | doublereal *w |
| 3216 | ) const |
| 3217 | { |
| 3218 | /* System generated locals */ |
| 3219 | integer bmat_dim1, bmat_offset, zmat_dim1, zmat_offset, i__1, i__2; |
| 3220 | doublereal d__1, d__2, d__3; |
| 3221 | |
| 3222 | /* Local variables */ |
| 3223 | integer i__, j, k, jp; |
| 3224 | doublereal one, tau, temp; |
| 3225 | integer nptm; |
| 3226 | doublereal zero, alpha, tempa, tempb, ztest; |
| 3227 | |
| 3228 | |
| 3229 | /* The arrays BMAT and ZMAT are updated, as required by the new position */ |
| 3230 | /* of the interpolation point that has the index KNEW. The vector VLAG has */ |
| 3231 | /* N+NPT components, set on entry to the first NPT and last N components */ |
| 3232 | /* of the product Hw in equation (4.11) of the Powell (2006) paper on */ |
| 3233 | /* NEWUOA. Further, BETA is set on entry to the value of the parameter */ |
| 3234 | /* with that name, and DENOM is set to the denominator of the updating */ |
| 3235 | /* formula. Elements of ZMAT may be treated as zero if their moduli are */ |
| 3236 | /* at most ZTEST. The first NDIM elements of W are used for working space. */ |
| 3237 | |
| 3238 | /* Set some constants. */ |
| 3239 | |
| 3240 | /* Parameter adjustments */ |
| 3241 | zmat_dim1 = npt; |
| 3242 | zmat_offset = 1 + zmat_dim1; |
| 3243 | zmat -= zmat_offset; |
| 3244 | bmat_dim1 = ndim; |
| 3245 | bmat_offset = 1 + bmat_dim1; |
| 3246 | bmat -= bmat_offset; |
| 3247 | --vlag; |
| 3248 | --w; |
| 3249 | |
| 3250 | /* Function Body */ |
| 3251 | one = 1.; |
| 3252 | zero = 0.; |
| 3253 | nptm = npt - n - 1; |
| 3254 | ztest = zero; |
| 3255 | i__1 = npt; |
| 3256 | for (k = 1; k <= i__1; ++k) { |
| 3257 | i__2 = nptm; |
| 3258 | for (j = 1; j <= i__2; ++j) { |
| 3259 | /* L10: */ |
| 3260 | /* Computing MAX */ |
| 3261 | d__2 = ztest, d__3 = (d__1 = zmat[k + j * zmat_dim1], std::abs(d__1)); |
| 3262 | ztest = std::max(d__2,d__3); |