/usr/share/pyshared/openopt/solvers/nlopt/stogo_oo.py is in python-openopt 0.38+svn1589-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 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | from NLOPT_AUX import NLOPT_AUX
from NLOPT_BASE import NLOPT_BASE
import nlopt
from numpy import isinf
class stogo(NLOPT_BASE):
__name__ = 'stogo'
__alg__ = ""
__optionalDataThatCanBeHandled__ = ['lb', 'ub']
__isIterPointAlwaysFeasible__ = lambda self, p: True
_requiresFiniteBoxBounds = True
#properTextOutput = True
#TODO: check it!
#_canHandleScipySparse = True
funcForIterFcnConnection = 'f'
# _requiresBestPointDetection = True
useRand = True
__cannotHandleExceptions__ = True
def __init__(self): pass
def __solver__(self, p):
#p.f_iter = 1
p.maxNonSuccess = 1e10
p.maxIter = 1e10
if isinf(p.maxTime):
s= """currently due to some Python <-> C++ code connection issues
the solver stogo requires finite user-defined maxTime;
since you have not provided it, 15 sec will be used"""
p.pWarn(s)
p.maxTime = 15
solver = nlopt.GD_STOGO_RAND if self.useRand else nlopt.GD_STOGO
NLOPT_AUX(p, solver)
#NLOPT_AUX(p, nlopt.GD_MLSL_LDS)
|