icyb

    Home    About    Documentation    Install    Newsline    Links    Feedback    Appeal    Guestbook

free html hit
counter
since 2007/10/24

OpenOpt result structure fields

Solving of every problem in OpenOpt is performed via
r = p.solve(nameOfSolver) # nameOfSolver is string like 'ralg', 'nssolve', 'scipy_fsolve' etc

Let's check typical r fields:

>>> dir(r)

['__doc__', '__module__', 'advanced', 'elapsed', 'evals', 'ff', 'isFeasible', 'istop', 'iterValues', 'msg', 'rf', 'solverInfo', 'stopcase', 'xf']

xf and ff are final point and objFun value (i.e. optimal ones, if solver has really obtained solution required).
rf is maximal residual of point xf. If r.rf > p.contol, OpenOpt treats the solution as infeasible: r.isFeasible = False; otherwise True.
istop is stop case (integer or float number), msg is stop case message, like

|| gradient F(X[k]) || < gradtol

r.elapsed and r.evals are Python dictionaries of elapsed functions evaluations and [cpu]time, for example
{'plot_time': 4.8099999999999996, 'solver_cputime': 0.44999999999999929, 'solver_time': 1.0900000000000007, 'plot_cputime': 3.9600000000000009} and
{'c': 285, 'dh': 215, 'f': 285, 'df': 215, 'h': 285, 'dc': 208, 'iter': 248}
if some fields from (df, dc, dh) are negative, it means they were not supplied by user and have been obtained via finite-difference approximation. In the case we take into account for r.evalsf? all f calls - both from objFunc and from finite-difference derivatives approximation.

r.iterValues currently has fields 'f', 'x', 'r', 'rt', 'ri'. r.iterValues.f is Python list of objFun values (iter 0, iter1, ...), r.iterValues.x is similar Python list for points, r.iterValues.r is list of residuals, r.iterValues.rt and r.iterValues.ri are residuals type ('c', 'h', 'lb' etc) and index (nonnegative integer).

stopcase can be -1 (solver failed to solve the problem), +1 (solver reports he has solved the problem, and solution (checked by OO Kernel) is feasible), or 0 (maxIter, maxFuncEvals, maxTime or maxCPUTime have been exceeded, or the situation is unclear somehow else; currently it is 0 for both feasible and infeasible xf, but it may be changed in future, so you'd better to check it by yourself).

'solverInfo' is Python dictionary with alg, authors, license, homepage (and may be other) fields:

>>> 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'}

'advanced' is reserved for future purposes.