You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
338 lines
15 KiB
Python
338 lines
15 KiB
Python
|
5 years ago
|
# This file was automatically generated by SWIG (http://www.swig.org).
|
||
|
|
# Version 2.0.12
|
||
|
|
#
|
||
|
|
# Do not make changes to this file unless you know what you are doing--modify
|
||
|
|
# the SWIG interface file instead.
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
"""
|
||
|
|
NLopt is a multi-language library for nonlinear optimization (local or
|
||
|
|
global, with or without derivatives, and supporting nonlinear
|
||
|
|
constraints). Complete documentation, including a Python tutorial,
|
||
|
|
can be found at the NLopt web page: http://ab-initio.mit.edu/nlopt
|
||
|
|
"""
|
||
|
|
|
||
|
|
|
||
|
|
from sys import version_info
|
||
|
|
if version_info >= (2,6,0):
|
||
|
|
def swig_import_helper():
|
||
|
|
from os.path import dirname
|
||
|
|
import imp
|
||
|
|
fp = None
|
||
|
|
try:
|
||
|
|
fp, pathname, description = imp.find_module('_nlopt', [dirname(__file__)])
|
||
|
|
except ImportError:
|
||
|
|
import _nlopt
|
||
|
|
return _nlopt
|
||
|
|
if fp is not None:
|
||
|
|
try:
|
||
|
|
_mod = imp.load_module('_nlopt', fp, pathname, description)
|
||
|
|
finally:
|
||
|
|
fp.close()
|
||
|
|
return _mod
|
||
|
|
_nlopt = swig_import_helper()
|
||
|
|
del swig_import_helper
|
||
|
|
else:
|
||
|
|
import _nlopt
|
||
|
|
del version_info
|
||
|
|
try:
|
||
|
|
_swig_property = property
|
||
|
|
except NameError:
|
||
|
|
pass # Python < 2.2 doesn't have 'property'.
|
||
|
|
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||
|
|
if (name == "thisown"): return self.this.own(value)
|
||
|
|
if (name == "this"):
|
||
|
|
if type(value).__name__ == 'SwigPyObject':
|
||
|
|
self.__dict__[name] = value
|
||
|
|
return
|
||
|
|
method = class_type.__swig_setmethods__.get(name,None)
|
||
|
|
if method: return method(self,value)
|
||
|
|
if (not static):
|
||
|
|
self.__dict__[name] = value
|
||
|
|
else:
|
||
|
|
raise AttributeError("You cannot add attributes to %s" % self)
|
||
|
|
|
||
|
|
def _swig_setattr(self,class_type,name,value):
|
||
|
|
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||
|
|
|
||
|
|
def _swig_getattr(self,class_type,name):
|
||
|
|
if (name == "thisown"): return self.this.own()
|
||
|
|
method = class_type.__swig_getmethods__.get(name,None)
|
||
|
|
if method: return method(self)
|
||
|
|
raise AttributeError(name)
|
||
|
|
|
||
|
|
def _swig_repr(self):
|
||
|
|
try: strthis = "proxy of " + self.this.__repr__()
|
||
|
|
except: strthis = ""
|
||
|
|
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||
|
|
|
||
|
|
try:
|
||
|
|
_object = object
|
||
|
|
_newclass = 1
|
||
|
|
except AttributeError:
|
||
|
|
class _object : pass
|
||
|
|
_newclass = 0
|
||
|
|
|
||
|
|
|
||
|
|
class SwigPyIterator(_object):
|
||
|
|
__swig_setmethods__ = {}
|
||
|
|
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
|
||
|
|
__swig_getmethods__ = {}
|
||
|
|
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
|
||
|
|
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
|
||
|
|
__repr__ = _swig_repr
|
||
|
|
__swig_destroy__ = _nlopt.delete_SwigPyIterator
|
||
|
|
__del__ = lambda self : None;
|
||
|
|
def value(self): return _nlopt.SwigPyIterator_value(self)
|
||
|
|
def incr(self, n=1): return _nlopt.SwigPyIterator_incr(self, n)
|
||
|
|
def decr(self, n=1): return _nlopt.SwigPyIterator_decr(self, n)
|
||
|
|
def distance(self, *args): return _nlopt.SwigPyIterator_distance(self, *args)
|
||
|
|
def equal(self, *args): return _nlopt.SwigPyIterator_equal(self, *args)
|
||
|
|
def copy(self): return _nlopt.SwigPyIterator_copy(self)
|
||
|
|
def next(self): return _nlopt.SwigPyIterator_next(self)
|
||
|
|
def __next__(self): return _nlopt.SwigPyIterator___next__(self)
|
||
|
|
def previous(self): return _nlopt.SwigPyIterator_previous(self)
|
||
|
|
def advance(self, *args): return _nlopt.SwigPyIterator_advance(self, *args)
|
||
|
|
def __eq__(self, *args): return _nlopt.SwigPyIterator___eq__(self, *args)
|
||
|
|
def __ne__(self, *args): return _nlopt.SwigPyIterator___ne__(self, *args)
|
||
|
|
def __iadd__(self, *args): return _nlopt.SwigPyIterator___iadd__(self, *args)
|
||
|
|
def __isub__(self, *args): return _nlopt.SwigPyIterator___isub__(self, *args)
|
||
|
|
def __add__(self, *args): return _nlopt.SwigPyIterator___add__(self, *args)
|
||
|
|
def __sub__(self, *args): return _nlopt.SwigPyIterator___sub__(self, *args)
|
||
|
|
def __iter__(self): return self
|
||
|
|
SwigPyIterator_swigregister = _nlopt.SwigPyIterator_swigregister
|
||
|
|
SwigPyIterator_swigregister(SwigPyIterator)
|
||
|
|
|
||
|
|
class nlopt_doublevector(_object):
|
||
|
|
__swig_setmethods__ = {}
|
||
|
|
__setattr__ = lambda self, name, value: _swig_setattr(self, nlopt_doublevector, name, value)
|
||
|
|
__swig_getmethods__ = {}
|
||
|
|
__getattr__ = lambda self, name: _swig_getattr(self, nlopt_doublevector, name)
|
||
|
|
__repr__ = _swig_repr
|
||
|
|
def iterator(self): return _nlopt.nlopt_doublevector_iterator(self)
|
||
|
|
def __iter__(self): return self.iterator()
|
||
|
|
def __nonzero__(self): return _nlopt.nlopt_doublevector___nonzero__(self)
|
||
|
|
def __bool__(self): return _nlopt.nlopt_doublevector___bool__(self)
|
||
|
|
def __len__(self): return _nlopt.nlopt_doublevector___len__(self)
|
||
|
|
def pop(self): return _nlopt.nlopt_doublevector_pop(self)
|
||
|
|
def __getslice__(self, *args): return _nlopt.nlopt_doublevector___getslice__(self, *args)
|
||
|
|
def __setslice__(self, *args): return _nlopt.nlopt_doublevector___setslice__(self, *args)
|
||
|
|
def __delslice__(self, *args): return _nlopt.nlopt_doublevector___delslice__(self, *args)
|
||
|
|
def __delitem__(self, *args): return _nlopt.nlopt_doublevector___delitem__(self, *args)
|
||
|
|
def __getitem__(self, *args): return _nlopt.nlopt_doublevector___getitem__(self, *args)
|
||
|
|
def __setitem__(self, *args): return _nlopt.nlopt_doublevector___setitem__(self, *args)
|
||
|
|
def append(self, *args): return _nlopt.nlopt_doublevector_append(self, *args)
|
||
|
|
def empty(self): return _nlopt.nlopt_doublevector_empty(self)
|
||
|
|
def size(self): return _nlopt.nlopt_doublevector_size(self)
|
||
|
|
def clear(self): return _nlopt.nlopt_doublevector_clear(self)
|
||
|
|
def swap(self, *args): return _nlopt.nlopt_doublevector_swap(self, *args)
|
||
|
|
def get_allocator(self): return _nlopt.nlopt_doublevector_get_allocator(self)
|
||
|
|
def begin(self): return _nlopt.nlopt_doublevector_begin(self)
|
||
|
|
def end(self): return _nlopt.nlopt_doublevector_end(self)
|
||
|
|
def rbegin(self): return _nlopt.nlopt_doublevector_rbegin(self)
|
||
|
|
def rend(self): return _nlopt.nlopt_doublevector_rend(self)
|
||
|
|
def pop_back(self): return _nlopt.nlopt_doublevector_pop_back(self)
|
||
|
|
def erase(self, *args): return _nlopt.nlopt_doublevector_erase(self, *args)
|
||
|
|
def __init__(self, *args):
|
||
|
|
this = _nlopt.new_nlopt_doublevector(*args)
|
||
|
|
try: self.this.append(this)
|
||
|
|
except: self.this = this
|
||
|
|
def push_back(self, *args): return _nlopt.nlopt_doublevector_push_back(self, *args)
|
||
|
|
def front(self): return _nlopt.nlopt_doublevector_front(self)
|
||
|
|
def back(self): return _nlopt.nlopt_doublevector_back(self)
|
||
|
|
def assign(self, *args): return _nlopt.nlopt_doublevector_assign(self, *args)
|
||
|
|
def resize(self, *args): return _nlopt.nlopt_doublevector_resize(self, *args)
|
||
|
|
def insert(self, *args): return _nlopt.nlopt_doublevector_insert(self, *args)
|
||
|
|
def reserve(self, *args): return _nlopt.nlopt_doublevector_reserve(self, *args)
|
||
|
|
def capacity(self): return _nlopt.nlopt_doublevector_capacity(self)
|
||
|
|
__swig_destroy__ = _nlopt.delete_nlopt_doublevector
|
||
|
|
__del__ = lambda self : None;
|
||
|
|
nlopt_doublevector_swigregister = _nlopt.nlopt_doublevector_swigregister
|
||
|
|
nlopt_doublevector_swigregister(nlopt_doublevector)
|
||
|
|
|
||
|
|
ForcedStop = _nlopt.ForcedStop
|
||
|
|
RoundoffLimited = _nlopt.RoundoffLimited
|
||
|
|
__version__ = str(_nlopt.version_major())+'.'+str(_nlopt.version_minor())+'.'+str(_nlopt.version_bugfix())
|
||
|
|
|
||
|
|
|
||
|
|
def nlopt_get_initial_step(*args):
|
||
|
|
return _nlopt.nlopt_get_initial_step(*args)
|
||
|
|
nlopt_get_initial_step = _nlopt.nlopt_get_initial_step
|
||
|
|
GN_DIRECT = _nlopt.GN_DIRECT
|
||
|
|
GN_DIRECT_L = _nlopt.GN_DIRECT_L
|
||
|
|
GN_DIRECT_L_RAND = _nlopt.GN_DIRECT_L_RAND
|
||
|
|
GN_DIRECT_NOSCAL = _nlopt.GN_DIRECT_NOSCAL
|
||
|
|
GN_DIRECT_L_NOSCAL = _nlopt.GN_DIRECT_L_NOSCAL
|
||
|
|
GN_DIRECT_L_RAND_NOSCAL = _nlopt.GN_DIRECT_L_RAND_NOSCAL
|
||
|
|
GN_ORIG_DIRECT = _nlopt.GN_ORIG_DIRECT
|
||
|
|
GN_ORIG_DIRECT_L = _nlopt.GN_ORIG_DIRECT_L
|
||
|
|
GD_STOGO = _nlopt.GD_STOGO
|
||
|
|
GD_STOGO_RAND = _nlopt.GD_STOGO_RAND
|
||
|
|
LD_LBFGS_NOCEDAL = _nlopt.LD_LBFGS_NOCEDAL
|
||
|
|
LD_LBFGS = _nlopt.LD_LBFGS
|
||
|
|
LN_PRAXIS = _nlopt.LN_PRAXIS
|
||
|
|
LD_VAR1 = _nlopt.LD_VAR1
|
||
|
|
LD_VAR2 = _nlopt.LD_VAR2
|
||
|
|
LD_TNEWTON = _nlopt.LD_TNEWTON
|
||
|
|
LD_TNEWTON_RESTART = _nlopt.LD_TNEWTON_RESTART
|
||
|
|
LD_TNEWTON_PRECOND = _nlopt.LD_TNEWTON_PRECOND
|
||
|
|
LD_TNEWTON_PRECOND_RESTART = _nlopt.LD_TNEWTON_PRECOND_RESTART
|
||
|
|
GN_CRS2_LM = _nlopt.GN_CRS2_LM
|
||
|
|
GN_MLSL = _nlopt.GN_MLSL
|
||
|
|
GD_MLSL = _nlopt.GD_MLSL
|
||
|
|
GN_MLSL_LDS = _nlopt.GN_MLSL_LDS
|
||
|
|
GD_MLSL_LDS = _nlopt.GD_MLSL_LDS
|
||
|
|
LD_MMA = _nlopt.LD_MMA
|
||
|
|
LN_COBYLA = _nlopt.LN_COBYLA
|
||
|
|
LN_NEWUOA = _nlopt.LN_NEWUOA
|
||
|
|
LN_NEWUOA_BOUND = _nlopt.LN_NEWUOA_BOUND
|
||
|
|
LN_NELDERMEAD = _nlopt.LN_NELDERMEAD
|
||
|
|
LN_SBPLX = _nlopt.LN_SBPLX
|
||
|
|
LN_AUGLAG = _nlopt.LN_AUGLAG
|
||
|
|
LD_AUGLAG = _nlopt.LD_AUGLAG
|
||
|
|
LN_AUGLAG_EQ = _nlopt.LN_AUGLAG_EQ
|
||
|
|
LD_AUGLAG_EQ = _nlopt.LD_AUGLAG_EQ
|
||
|
|
LN_BOBYQA = _nlopt.LN_BOBYQA
|
||
|
|
GN_ISRES = _nlopt.GN_ISRES
|
||
|
|
AUGLAG = _nlopt.AUGLAG
|
||
|
|
AUGLAG_EQ = _nlopt.AUGLAG_EQ
|
||
|
|
G_MLSL = _nlopt.G_MLSL
|
||
|
|
G_MLSL_LDS = _nlopt.G_MLSL_LDS
|
||
|
|
LD_SLSQP = _nlopt.LD_SLSQP
|
||
|
|
LD_CCSAQ = _nlopt.LD_CCSAQ
|
||
|
|
GN_ESCH = _nlopt.GN_ESCH
|
||
|
|
NUM_ALGORITHMS = _nlopt.NUM_ALGORITHMS
|
||
|
|
FAILURE = _nlopt.FAILURE
|
||
|
|
INVALID_ARGS = _nlopt.INVALID_ARGS
|
||
|
|
OUT_OF_MEMORY = _nlopt.OUT_OF_MEMORY
|
||
|
|
ROUNDOFF_LIMITED = _nlopt.ROUNDOFF_LIMITED
|
||
|
|
FORCED_STOP = _nlopt.FORCED_STOP
|
||
|
|
SUCCESS = _nlopt.SUCCESS
|
||
|
|
STOPVAL_REACHED = _nlopt.STOPVAL_REACHED
|
||
|
|
FTOL_REACHED = _nlopt.FTOL_REACHED
|
||
|
|
XTOL_REACHED = _nlopt.XTOL_REACHED
|
||
|
|
MAXEVAL_REACHED = _nlopt.MAXEVAL_REACHED
|
||
|
|
MAXTIME_REACHED = _nlopt.MAXTIME_REACHED
|
||
|
|
class roundoff_limited(Exception):
|
||
|
|
__swig_setmethods__ = {}
|
||
|
|
__setattr__ = lambda self, name, value: _swig_setattr(self, roundoff_limited, name, value)
|
||
|
|
__swig_getmethods__ = {}
|
||
|
|
__getattr__ = lambda self, name: _swig_getattr(self, roundoff_limited, name)
|
||
|
|
__repr__ = _swig_repr
|
||
|
|
def __init__(self):
|
||
|
|
this = _nlopt.new_roundoff_limited()
|
||
|
|
try: self.this.append(this)
|
||
|
|
except: self.this = this
|
||
|
|
__swig_destroy__ = _nlopt.delete_roundoff_limited
|
||
|
|
__del__ = lambda self : None;
|
||
|
|
roundoff_limited_swigregister = _nlopt.roundoff_limited_swigregister
|
||
|
|
roundoff_limited_swigregister(roundoff_limited)
|
||
|
|
|
||
|
|
class forced_stop(Exception):
|
||
|
|
__swig_setmethods__ = {}
|
||
|
|
__setattr__ = lambda self, name, value: _swig_setattr(self, forced_stop, name, value)
|
||
|
|
__swig_getmethods__ = {}
|
||
|
|
__getattr__ = lambda self, name: _swig_getattr(self, forced_stop, name)
|
||
|
|
__repr__ = _swig_repr
|
||
|
|
def __init__(self):
|
||
|
|
this = _nlopt.new_forced_stop()
|
||
|
|
try: self.this.append(this)
|
||
|
|
except: self.this = this
|
||
|
|
__swig_destroy__ = _nlopt.delete_forced_stop
|
||
|
|
__del__ = lambda self : None;
|
||
|
|
forced_stop_swigregister = _nlopt.forced_stop_swigregister
|
||
|
|
forced_stop_swigregister(forced_stop)
|
||
|
|
|
||
|
|
class opt(_object):
|
||
|
|
__swig_setmethods__ = {}
|
||
|
|
__setattr__ = lambda self, name, value: _swig_setattr(self, opt, name, value)
|
||
|
|
__swig_getmethods__ = {}
|
||
|
|
__getattr__ = lambda self, name: _swig_getattr(self, opt, name)
|
||
|
|
__repr__ = _swig_repr
|
||
|
|
__swig_destroy__ = _nlopt.delete_opt
|
||
|
|
__del__ = lambda self : None;
|
||
|
|
def __init__(self, *args):
|
||
|
|
this = _nlopt.new_opt(*args)
|
||
|
|
try: self.this.append(this)
|
||
|
|
except: self.this = this
|
||
|
|
def optimize(self, *args): return _nlopt.opt_optimize(self, *args)
|
||
|
|
def last_optimize_result(self): return _nlopt.opt_last_optimize_result(self)
|
||
|
|
def last_optimum_value(self): return _nlopt.opt_last_optimum_value(self)
|
||
|
|
def get_algorithm(self): return _nlopt.opt_get_algorithm(self)
|
||
|
|
def get_algorithm_name(self): return _nlopt.opt_get_algorithm_name(self)
|
||
|
|
def get_dimension(self): return _nlopt.opt_get_dimension(self)
|
||
|
|
def set_min_objective(self, *args): return _nlopt.opt_set_min_objective(self, *args)
|
||
|
|
def set_max_objective(self, *args): return _nlopt.opt_set_max_objective(self, *args)
|
||
|
|
def remove_inequality_constraints(self): return _nlopt.opt_remove_inequality_constraints(self)
|
||
|
|
def remove_equality_constraints(self): return _nlopt.opt_remove_equality_constraints(self)
|
||
|
|
def add_inequality_constraint(self, *args): return _nlopt.opt_add_inequality_constraint(self, *args)
|
||
|
|
def add_equality_constraint(self, *args): return _nlopt.opt_add_equality_constraint(self, *args)
|
||
|
|
def add_inequality_mconstraint(self, *args): return _nlopt.opt_add_inequality_mconstraint(self, *args)
|
||
|
|
def add_equality_mconstraint(self, *args): return _nlopt.opt_add_equality_mconstraint(self, *args)
|
||
|
|
def get_lower_bounds(self, *args): return _nlopt.opt_get_lower_bounds(self, *args)
|
||
|
|
def set_lower_bounds(self, *args): return _nlopt.opt_set_lower_bounds(self, *args)
|
||
|
|
def get_upper_bounds(self, *args): return _nlopt.opt_get_upper_bounds(self, *args)
|
||
|
|
def set_upper_bounds(self, *args): return _nlopt.opt_set_upper_bounds(self, *args)
|
||
|
|
def get_stopval(self): return _nlopt.opt_get_stopval(self)
|
||
|
|
def set_stopval(self, *args): return _nlopt.opt_set_stopval(self, *args)
|
||
|
|
def get_ftol_rel(self): return _nlopt.opt_get_ftol_rel(self)
|
||
|
|
def set_ftol_rel(self, *args): return _nlopt.opt_set_ftol_rel(self, *args)
|
||
|
|
def get_ftol_abs(self): return _nlopt.opt_get_ftol_abs(self)
|
||
|
|
def set_ftol_abs(self, *args): return _nlopt.opt_set_ftol_abs(self, *args)
|
||
|
|
def get_xtol_rel(self): return _nlopt.opt_get_xtol_rel(self)
|
||
|
|
def set_xtol_rel(self, *args): return _nlopt.opt_set_xtol_rel(self, *args)
|
||
|
|
def get_xtol_abs(self, *args): return _nlopt.opt_get_xtol_abs(self, *args)
|
||
|
|
def set_xtol_abs(self, *args): return _nlopt.opt_set_xtol_abs(self, *args)
|
||
|
|
def get_maxeval(self): return _nlopt.opt_get_maxeval(self)
|
||
|
|
def set_maxeval(self, *args): return _nlopt.opt_set_maxeval(self, *args)
|
||
|
|
def get_maxtime(self): return _nlopt.opt_get_maxtime(self)
|
||
|
|
def set_maxtime(self, *args): return _nlopt.opt_set_maxtime(self, *args)
|
||
|
|
def get_force_stop(self): return _nlopt.opt_get_force_stop(self)
|
||
|
|
def set_force_stop(self, *args): return _nlopt.opt_set_force_stop(self, *args)
|
||
|
|
def force_stop(self): return _nlopt.opt_force_stop(self)
|
||
|
|
def set_local_optimizer(self, *args): return _nlopt.opt_set_local_optimizer(self, *args)
|
||
|
|
def get_population(self): return _nlopt.opt_get_population(self)
|
||
|
|
def set_population(self, *args): return _nlopt.opt_set_population(self, *args)
|
||
|
|
def get_vector_storage(self): return _nlopt.opt_get_vector_storage(self)
|
||
|
|
def set_vector_storage(self, *args): return _nlopt.opt_set_vector_storage(self, *args)
|
||
|
|
def set_initial_step(self, *args): return _nlopt.opt_set_initial_step(self, *args)
|
||
|
|
def set_default_initial_step(self, *args): return _nlopt.opt_set_default_initial_step(self, *args)
|
||
|
|
def get_initial_step(self, *args): return _nlopt.opt_get_initial_step(self, *args)
|
||
|
|
def get_initial_step_(self, *args): return _nlopt.opt_get_initial_step_(self, *args)
|
||
|
|
opt_swigregister = _nlopt.opt_swigregister
|
||
|
|
opt_swigregister(opt)
|
||
|
|
|
||
|
|
|
||
|
|
def srand(*args):
|
||
|
|
return _nlopt.srand(*args)
|
||
|
|
srand = _nlopt.srand
|
||
|
|
|
||
|
|
def srand_time():
|
||
|
|
return _nlopt.srand_time()
|
||
|
|
srand_time = _nlopt.srand_time
|
||
|
|
|
||
|
|
def version(*args):
|
||
|
|
return _nlopt.version(*args)
|
||
|
|
version = _nlopt.version
|
||
|
|
|
||
|
|
def version_major():
|
||
|
|
return _nlopt.version_major()
|
||
|
|
version_major = _nlopt.version_major
|
||
|
|
|
||
|
|
def version_minor():
|
||
|
|
return _nlopt.version_minor()
|
||
|
|
version_minor = _nlopt.version_minor
|
||
|
|
|
||
|
|
def version_bugfix():
|
||
|
|
return _nlopt.version_bugfix()
|
||
|
|
version_bugfix = _nlopt.version_bugfix
|
||
|
|
|
||
|
|
def algorithm_name(*args):
|
||
|
|
return _nlopt.algorithm_name(*args)
|
||
|
|
algorithm_name = _nlopt.algorithm_name
|
||
|
|
# This file is compatible with both classic and new-style classes.
|
||
|
|
|
||
|
|
|