1 # This file was automatically generated by SWIG (http://www.swig.org).
4 # Do not make changes to this file unless you know what you are doing--modify
5 # the SWIG interface file instead.
11 NLopt is a multi-language library for nonlinear optimization (local or
12 global, with or without derivatives, and supporting nonlinear
13 constraints). Complete documentation, including a Python tutorial,
14 can be found at the NLopt web page: http://ab-initio.mit.edu/nlopt
18 from sys import version_info
19 if version_info >= (2,6,0):
20 def swig_import_helper():
21 from os.path import dirname
25 fp, pathname, description = imp.find_module('_nlopt', [dirname(__file__)])
31 _mod = imp.load_module('_nlopt', fp, pathname, description)
35 _nlopt = swig_import_helper()
36 del swig_import_helper
41 _swig_property = property
43 pass # Python < 2.2 doesn't have 'property'.
44 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
45 if (name == "thisown"): return self.this.own(value)
47 if type(value).__name__ == 'SwigPyObject':
48 self.__dict__[name] = value
50 method = class_type.__swig_setmethods__.get(name,None)
51 if method: return method(self,value)
53 self.__dict__[name] = value
55 raise AttributeError("You cannot add attributes to %s" % self)
57 def _swig_setattr(self,class_type,name,value):
58 return _swig_setattr_nondynamic(self,class_type,name,value,0)
60 def _swig_getattr(self,class_type,name):
61 if (name == "thisown"): return self.this.own()
62 method = class_type.__swig_getmethods__.get(name,None)
63 if method: return method(self)
64 raise AttributeError(name)
67 try: strthis = "proxy of " + self.this.__repr__()
69 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
74 except AttributeError:
79 class SwigPyIterator(_object):
80 __swig_setmethods__ = {}
81 __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
82 __swig_getmethods__ = {}
83 __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
84 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
86 __swig_destroy__ = _nlopt.delete_SwigPyIterator
87 __del__ = lambda self : None;
88 def value(self): return _nlopt.SwigPyIterator_value(self)
89 def incr(self, n=1): return _nlopt.SwigPyIterator_incr(self, n)
90 def decr(self, n=1): return _nlopt.SwigPyIterator_decr(self, n)
91 def distance(self, *args): return _nlopt.SwigPyIterator_distance(self, *args)
92 def equal(self, *args): return _nlopt.SwigPyIterator_equal(self, *args)
93 def copy(self): return _nlopt.SwigPyIterator_copy(self)
94 def next(self): return _nlopt.SwigPyIterator_next(self)
95 def __next__(self): return _nlopt.SwigPyIterator___next__(self)
96 def previous(self): return _nlopt.SwigPyIterator_previous(self)
97 def advance(self, *args): return _nlopt.SwigPyIterator_advance(self, *args)
98 def __eq__(self, *args): return _nlopt.SwigPyIterator___eq__(self, *args)
99 def __ne__(self, *args): return _nlopt.SwigPyIterator___ne__(self, *args)
100 def __iadd__(self, *args): return _nlopt.SwigPyIterator___iadd__(self, *args)
101 def __isub__(self, *args): return _nlopt.SwigPyIterator___isub__(self, *args)
102 def __add__(self, *args): return _nlopt.SwigPyIterator___add__(self, *args)
103 def __sub__(self, *args): return _nlopt.SwigPyIterator___sub__(self, *args)
104 def __iter__(self): return self
105 SwigPyIterator_swigregister = _nlopt.SwigPyIterator_swigregister
106 SwigPyIterator_swigregister(SwigPyIterator)
108 class nlopt_doublevector(_object):
109 __swig_setmethods__ = {}
110 __setattr__ = lambda self, name, value: _swig_setattr(self, nlopt_doublevector, name, value)
111 __swig_getmethods__ = {}
112 __getattr__ = lambda self, name: _swig_getattr(self, nlopt_doublevector, name)
113 __repr__ = _swig_repr
114 def iterator(self): return _nlopt.nlopt_doublevector_iterator(self)
115 def __iter__(self): return self.iterator()
116 def __nonzero__(self): return _nlopt.nlopt_doublevector___nonzero__(self)
117 def __bool__(self): return _nlopt.nlopt_doublevector___bool__(self)
118 def __len__(self): return _nlopt.nlopt_doublevector___len__(self)
119 def pop(self): return _nlopt.nlopt_doublevector_pop(self)
120 def __getslice__(self, *args): return _nlopt.nlopt_doublevector___getslice__(self, *args)
121 def __setslice__(self, *args): return _nlopt.nlopt_doublevector___setslice__(self, *args)
122 def __delslice__(self, *args): return _nlopt.nlopt_doublevector___delslice__(self, *args)
123 def __delitem__(self, *args): return _nlopt.nlopt_doublevector___delitem__(self, *args)
124 def __getitem__(self, *args): return _nlopt.nlopt_doublevector___getitem__(self, *args)
125 def __setitem__(self, *args): return _nlopt.nlopt_doublevector___setitem__(self, *args)
126 def append(self, *args): return _nlopt.nlopt_doublevector_append(self, *args)
127 def empty(self): return _nlopt.nlopt_doublevector_empty(self)
128 def size(self): return _nlopt.nlopt_doublevector_size(self)
129 def clear(self): return _nlopt.nlopt_doublevector_clear(self)
130 def swap(self, *args): return _nlopt.nlopt_doublevector_swap(self, *args)
131 def get_allocator(self): return _nlopt.nlopt_doublevector_get_allocator(self)
132 def begin(self): return _nlopt.nlopt_doublevector_begin(self)
133 def end(self): return _nlopt.nlopt_doublevector_end(self)
134 def rbegin(self): return _nlopt.nlopt_doublevector_rbegin(self)
135 def rend(self): return _nlopt.nlopt_doublevector_rend(self)
136 def pop_back(self): return _nlopt.nlopt_doublevector_pop_back(self)
137 def erase(self, *args): return _nlopt.nlopt_doublevector_erase(self, *args)
138 def __init__(self, *args):
139 this = _nlopt.new_nlopt_doublevector(*args)
140 try: self.this.append(this)
141 except: self.this = this
142 def push_back(self, *args): return _nlopt.nlopt_doublevector_push_back(self, *args)
143 def front(self): return _nlopt.nlopt_doublevector_front(self)
144 def back(self): return _nlopt.nlopt_doublevector_back(self)
145 def assign(self, *args): return _nlopt.nlopt_doublevector_assign(self, *args)
146 def resize(self, *args): return _nlopt.nlopt_doublevector_resize(self, *args)
147 def insert(self, *args): return _nlopt.nlopt_doublevector_insert(self, *args)
148 def reserve(self, *args): return _nlopt.nlopt_doublevector_reserve(self, *args)
149 def capacity(self): return _nlopt.nlopt_doublevector_capacity(self)
150 __swig_destroy__ = _nlopt.delete_nlopt_doublevector
151 __del__ = lambda self : None;
152 nlopt_doublevector_swigregister = _nlopt.nlopt_doublevector_swigregister
153 nlopt_doublevector_swigregister(nlopt_doublevector)
155 ForcedStop = _nlopt.ForcedStop
156 RoundoffLimited = _nlopt.RoundoffLimited
157 __version__ = str(_nlopt.version_major())+'.'+str(_nlopt.version_minor())+'.'+str(_nlopt.version_bugfix())
160 def nlopt_get_initial_step(*args):
161 return _nlopt.nlopt_get_initial_step(*args)
162 nlopt_get_initial_step = _nlopt.nlopt_get_initial_step
163 GN_DIRECT = _nlopt.GN_DIRECT
164 GN_DIRECT_L = _nlopt.GN_DIRECT_L
165 GN_DIRECT_L_RAND = _nlopt.GN_DIRECT_L_RAND
166 GN_DIRECT_NOSCAL = _nlopt.GN_DIRECT_NOSCAL
167 GN_DIRECT_L_NOSCAL = _nlopt.GN_DIRECT_L_NOSCAL
168 GN_DIRECT_L_RAND_NOSCAL = _nlopt.GN_DIRECT_L_RAND_NOSCAL
169 GN_ORIG_DIRECT = _nlopt.GN_ORIG_DIRECT
170 GN_ORIG_DIRECT_L = _nlopt.GN_ORIG_DIRECT_L
171 GD_STOGO = _nlopt.GD_STOGO
172 GD_STOGO_RAND = _nlopt.GD_STOGO_RAND
173 LD_LBFGS_NOCEDAL = _nlopt.LD_LBFGS_NOCEDAL
174 LD_LBFGS = _nlopt.LD_LBFGS
175 LN_PRAXIS = _nlopt.LN_PRAXIS
176 LD_VAR1 = _nlopt.LD_VAR1
177 LD_VAR2 = _nlopt.LD_VAR2
178 LD_TNEWTON = _nlopt.LD_TNEWTON
179 LD_TNEWTON_RESTART = _nlopt.LD_TNEWTON_RESTART
180 LD_TNEWTON_PRECOND = _nlopt.LD_TNEWTON_PRECOND
181 LD_TNEWTON_PRECOND_RESTART = _nlopt.LD_TNEWTON_PRECOND_RESTART
182 GN_CRS2_LM = _nlopt.GN_CRS2_LM
183 GN_MLSL = _nlopt.GN_MLSL
184 GD_MLSL = _nlopt.GD_MLSL
185 GN_MLSL_LDS = _nlopt.GN_MLSL_LDS
186 GD_MLSL_LDS = _nlopt.GD_MLSL_LDS
187 LD_MMA = _nlopt.LD_MMA
188 LN_COBYLA = _nlopt.LN_COBYLA
189 LN_NEWUOA = _nlopt.LN_NEWUOA
190 LN_NEWUOA_BOUND = _nlopt.LN_NEWUOA_BOUND
191 LN_NELDERMEAD = _nlopt.LN_NELDERMEAD
192 LN_SBPLX = _nlopt.LN_SBPLX
193 LN_AUGLAG = _nlopt.LN_AUGLAG
194 LD_AUGLAG = _nlopt.LD_AUGLAG
195 LN_AUGLAG_EQ = _nlopt.LN_AUGLAG_EQ
196 LD_AUGLAG_EQ = _nlopt.LD_AUGLAG_EQ
197 LN_BOBYQA = _nlopt.LN_BOBYQA
198 GN_ISRES = _nlopt.GN_ISRES
199 AUGLAG = _nlopt.AUGLAG
200 AUGLAG_EQ = _nlopt.AUGLAG_EQ
201 G_MLSL = _nlopt.G_MLSL
202 G_MLSL_LDS = _nlopt.G_MLSL_LDS
203 LD_SLSQP = _nlopt.LD_SLSQP
204 LD_CCSAQ = _nlopt.LD_CCSAQ
205 GN_ESCH = _nlopt.GN_ESCH
206 NUM_ALGORITHMS = _nlopt.NUM_ALGORITHMS
207 FAILURE = _nlopt.FAILURE
208 INVALID_ARGS = _nlopt.INVALID_ARGS
209 OUT_OF_MEMORY = _nlopt.OUT_OF_MEMORY
210 ROUNDOFF_LIMITED = _nlopt.ROUNDOFF_LIMITED
211 FORCED_STOP = _nlopt.FORCED_STOP
212 SUCCESS = _nlopt.SUCCESS
213 STOPVAL_REACHED = _nlopt.STOPVAL_REACHED
214 FTOL_REACHED = _nlopt.FTOL_REACHED
215 XTOL_REACHED = _nlopt.XTOL_REACHED
216 MAXEVAL_REACHED = _nlopt.MAXEVAL_REACHED
217 MAXTIME_REACHED = _nlopt.MAXTIME_REACHED
218 class roundoff_limited(Exception):
219 __swig_setmethods__ = {}
220 __setattr__ = lambda self, name, value: _swig_setattr(self, roundoff_limited, name, value)
221 __swig_getmethods__ = {}
222 __getattr__ = lambda self, name: _swig_getattr(self, roundoff_limited, name)
223 __repr__ = _swig_repr
225 this = _nlopt.new_roundoff_limited()
226 try: self.this.append(this)
227 except: self.this = this
228 __swig_destroy__ = _nlopt.delete_roundoff_limited
229 __del__ = lambda self : None;
230 roundoff_limited_swigregister = _nlopt.roundoff_limited_swigregister
231 roundoff_limited_swigregister(roundoff_limited)
233 class forced_stop(Exception):
234 __swig_setmethods__ = {}
235 __setattr__ = lambda self, name, value: _swig_setattr(self, forced_stop, name, value)
236 __swig_getmethods__ = {}
237 __getattr__ = lambda self, name: _swig_getattr(self, forced_stop, name)
238 __repr__ = _swig_repr
240 this = _nlopt.new_forced_stop()
241 try: self.this.append(this)
242 except: self.this = this
243 __swig_destroy__ = _nlopt.delete_forced_stop
244 __del__ = lambda self : None;
245 forced_stop_swigregister = _nlopt.forced_stop_swigregister
246 forced_stop_swigregister(forced_stop)
249 __swig_setmethods__ = {}
250 __setattr__ = lambda self, name, value: _swig_setattr(self, opt, name, value)
251 __swig_getmethods__ = {}
252 __getattr__ = lambda self, name: _swig_getattr(self, opt, name)
253 __repr__ = _swig_repr
254 __swig_destroy__ = _nlopt.delete_opt
255 __del__ = lambda self : None;
256 def __init__(self, *args):
257 this = _nlopt.new_opt(*args)
258 try: self.this.append(this)
259 except: self.this = this
260 def optimize(self, *args): return _nlopt.opt_optimize(self, *args)
261 def last_optimize_result(self): return _nlopt.opt_last_optimize_result(self)
262 def last_optimum_value(self): return _nlopt.opt_last_optimum_value(self)
263 def get_algorithm(self): return _nlopt.opt_get_algorithm(self)
264 def get_algorithm_name(self): return _nlopt.opt_get_algorithm_name(self)
265 def get_dimension(self): return _nlopt.opt_get_dimension(self)
266 def set_min_objective(self, *args): return _nlopt.opt_set_min_objective(self, *args)
267 def set_max_objective(self, *args): return _nlopt.opt_set_max_objective(self, *args)
268 def remove_inequality_constraints(self): return _nlopt.opt_remove_inequality_constraints(self)
269 def remove_equality_constraints(self): return _nlopt.opt_remove_equality_constraints(self)
270 def add_inequality_constraint(self, *args): return _nlopt.opt_add_inequality_constraint(self, *args)
271 def add_equality_constraint(self, *args): return _nlopt.opt_add_equality_constraint(self, *args)
272 def add_inequality_mconstraint(self, *args): return _nlopt.opt_add_inequality_mconstraint(self, *args)
273 def add_equality_mconstraint(self, *args): return _nlopt.opt_add_equality_mconstraint(self, *args)
274 def get_lower_bounds(self, *args): return _nlopt.opt_get_lower_bounds(self, *args)
275 def set_lower_bounds(self, *args): return _nlopt.opt_set_lower_bounds(self, *args)
276 def get_upper_bounds(self, *args): return _nlopt.opt_get_upper_bounds(self, *args)
277 def set_upper_bounds(self, *args): return _nlopt.opt_set_upper_bounds(self, *args)
278 def get_stopval(self): return _nlopt.opt_get_stopval(self)
279 def set_stopval(self, *args): return _nlopt.opt_set_stopval(self, *args)
280 def get_ftol_rel(self): return _nlopt.opt_get_ftol_rel(self)
281 def set_ftol_rel(self, *args): return _nlopt.opt_set_ftol_rel(self, *args)
282 def get_ftol_abs(self): return _nlopt.opt_get_ftol_abs(self)
283 def set_ftol_abs(self, *args): return _nlopt.opt_set_ftol_abs(self, *args)
284 def get_xtol_rel(self): return _nlopt.opt_get_xtol_rel(self)
285 def set_xtol_rel(self, *args): return _nlopt.opt_set_xtol_rel(self, *args)
286 def get_xtol_abs(self, *args): return _nlopt.opt_get_xtol_abs(self, *args)
287 def set_xtol_abs(self, *args): return _nlopt.opt_set_xtol_abs(self, *args)
288 def get_maxeval(self): return _nlopt.opt_get_maxeval(self)
289 def set_maxeval(self, *args): return _nlopt.opt_set_maxeval(self, *args)
290 def get_maxtime(self): return _nlopt.opt_get_maxtime(self)
291 def set_maxtime(self, *args): return _nlopt.opt_set_maxtime(self, *args)
292 def get_force_stop(self): return _nlopt.opt_get_force_stop(self)
293 def set_force_stop(self, *args): return _nlopt.opt_set_force_stop(self, *args)
294 def force_stop(self): return _nlopt.opt_force_stop(self)
295 def set_local_optimizer(self, *args): return _nlopt.opt_set_local_optimizer(self, *args)
296 def get_population(self): return _nlopt.opt_get_population(self)
297 def set_population(self, *args): return _nlopt.opt_set_population(self, *args)
298 def get_vector_storage(self): return _nlopt.opt_get_vector_storage(self)
299 def set_vector_storage(self, *args): return _nlopt.opt_set_vector_storage(self, *args)
300 def set_initial_step(self, *args): return _nlopt.opt_set_initial_step(self, *args)
301 def set_default_initial_step(self, *args): return _nlopt.opt_set_default_initial_step(self, *args)
302 def get_initial_step(self, *args): return _nlopt.opt_get_initial_step(self, *args)
303 def get_initial_step_(self, *args): return _nlopt.opt_get_initial_step_(self, *args)
304 opt_swigregister = _nlopt.opt_swigregister
305 opt_swigregister(opt)
309 return _nlopt.srand(*args)
313 return _nlopt.srand_time()
314 srand_time = _nlopt.srand_time
317 return _nlopt.version(*args)
318 version = _nlopt.version
321 return _nlopt.version_major()
322 version_major = _nlopt.version_major
325 return _nlopt.version_minor()
326 version_minor = _nlopt.version_minor
328 def version_bugfix():
329 return _nlopt.version_bugfix()
330 version_bugfix = _nlopt.version_bugfix
332 def algorithm_name(*args):
333 return _nlopt.algorithm_name(*args)
334 algorithm_name = _nlopt.algorithm_name
335 # This file is compatible with both classic and new-style classes.