MCPcopy Create free account
hub / github.com/davisking/dlib / altmov_

Method altmov_

dlib/optimization/optimization_bobyqa.h:1329–1762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327 // ----------------------------------------------------------------------------------------
1328
1329 void altmov_(
1330 const integer n,
1331 const integer npt,
1332 const doublereal *xpt,
1333 const doublereal *xopt,
1334 const doublereal *bmat,
1335 const doublereal *zmat,
1336 const integer ndim,
1337 const doublereal *sl,
1338 const doublereal *su,
1339 const integer kopt,
1340 const integer knew,
1341 const doublereal adelt,
1342 doublereal *xnew,
1343 doublereal *xalt,
1344 doublereal& alpha,
1345 doublereal& cauchy,
1346 doublereal *glag,
1347 doublereal *hcol,
1348 doublereal *w
1349 ) const
1350 {
1351 /* System generated locals */
1352 integer xpt_dim1, xpt_offset, bmat_dim1, bmat_offset, zmat_dim1,
1353 zmat_offset, i__1, i__2;
1354 doublereal d__1, d__2, d__3, d__4;
1355
1356
1357 /* Local variables */
1358 integer i__, j, k;
1359 doublereal ha, gw, one, diff, half;
1360 integer ilbd, isbd;
1361 doublereal slbd;
1362 integer iubd;
1363 doublereal vlag, subd, temp;
1364 integer ksav = 0;
1365 doublereal step = 0, zero = 0, curv = 0;
1366 integer iflag;
1367 doublereal scale = 0, csave = 0, tempa = 0, tempb = 0, tempd = 0, const__ = 0, sumin = 0,
1368 ggfree = 0;
1369 integer ibdsav = 0;
1370 doublereal dderiv = 0, bigstp = 0, predsq = 0, presav = 0, distsq = 0, stpsav = 0, wfixsq = 0, wsqsav = 0;
1371
1372
1373 /* The arguments N, NPT, XPT, XOPT, BMAT, ZMAT, NDIM, SL and SU all have */
1374 /* the same meanings as the corresponding arguments of BOBYQB. */
1375 /* KOPT is the index of the optimal interpolation point. */
1376 /* KNEW is the index of the interpolation point that is going to be moved. */
1377 /* ADELT is the current trust region bound. */
1378 /* XNEW will be set to a suitable new position for the interpolation point */
1379 /* XPT(KNEW,.). Specifically, it satisfies the SL, SU and trust region */
1380 /* bounds and it should provide a large denominator in the next call of */
1381 /* UPDATE. The step XNEW-XOPT from XOPT is restricted to moves along the */
1382 /* straight lines through XOPT and another interpolation point. */
1383 /* XALT also provides a large value of the modulus of the KNEW-th Lagrange */
1384 /* function subject to the constraints that have been mentioned, its main */
1385 /* difference from XNEW being that XALT-XOPT is a constrained version of */
1386 /* the Cauchy step within the trust region. An exception is that XALT is */

Callers

nothing calls this directly

Calls 4

absFunction · 0.85
sqrtFunction · 0.50
minFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected