Free Python optimization framework

Thursday, January 10, 2008

Changes to variable names, iterFcn and user-defined callback

Some changes:
  • "nIter", "r.nEvals" have been renamed to "iter", "r.evals"
  • r.evals now has "iter" key, so it looks like
>>> dir(r)
['__doc__', '__module__', 'advanced', 'elapsed', 'evals', 'ff', 'isFeasible', 'istop', 'iterValues', 'msg', 'rf', 'solverInfo', 'stopcase', 'xf']
>>> r.evals
{'c': 285, 'dh': 215, 'f': 285, 'df': 215, 'h': 285, 'dc': 208, 'iter': 248}
>>> r.elapsed
{'plot_time': 3.71, 'solver_cputime': 0.5, 'solver_time': 0.54, 'plot_cputime': 3.44}
>>> r.msg
'|| gradient F(X[k]) || < gradtol'
>>> r.solverInfo
{'alg': 'Augmented Lagrangian Multipliers', 'homepage': 'http://www.ime.usp.br/~egbirgin/tango/', 'license': 'GPL', 'authors': 'J. M. Martinez martinezimecc [at] gmail.com, Ernesto G. Birgin egbirgin [at] ime.usp.br, Jan Marcel Paiva Gentil jgmarcel [at] ime.usp.br'}
  • new field p.rk: current max residual have been added (can be used in user-defined callback function(s))
  • bugfix related to NLSP and LSP classes ("struct has no classIterFuncs field")
  • For solvers w/o native iterfcn (iter-to-iter callback function) using p.connectIterFcn('df') is no longer required (it will be done automatically, however, user can connect it to other func).
  • now all stop cases except ftol and xtol can be handled in artificial connected iterfcn (like ALGENCAN, scipy_slsqp) - for example, it can be MaxCPUTime, maxTime, fEnough, maxFunEvals, maxIter
Example of user-provided callback function(s) have been updated according to latest changes.

No comments: