/usr/lib/python2.7/dist-packages/openopt/tests/oosolver.py is in python-openopt 0.38+svn1589-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 | from openopt import oosolver, NLP
ipopt = oosolver('ipopt', color='r') # oosolver can hanlde prob parameters
ralg = oosolver('ralg', color='k', alp = 4.0) # as well as solver parameters
solvers = [ralg, ipopt]
for solver in solvers:
assert solver.isInstalled, 'solver ' + solver.__name__ + ' is not installed'
p = NLP(x0 = 15, f = lambda x: x**4, df = lambda x: 4 * x**3, iprint = 0)
r = p.solve(solver, plot=1, show = solver == solvers[-1])
|