1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18 struct SwigMovePointer {
20 SwigMovePointer(T *p) : ptr(p) { }
21 ~SwigMovePointer() { delete ptr; }
22 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
24 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
27 SwigValueWrapper() : pointer(0) { }
28 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
29 operator T&() const { return *pointer.ptr; }
30 T *operator&() { return pointer.ptr; }
33 template <typename T> T SwigValueInit() {
38 /* -----------------------------------------------------------------------------
39 * This section contains generic SWIG labels for method/variable
40 * declarations/attributes, and other compiler dependent labels.
41 * ----------------------------------------------------------------------------- */
43 /* template workaround for compilers that cannot correctly implement the C++ standard */
44 #ifndef SWIGTEMPLATEDISAMBIGUATOR
45 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46 # define SWIGTEMPLATEDISAMBIGUATOR template
47 # elif defined(__HP_aCC)
48 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50 # define SWIGTEMPLATEDISAMBIGUATOR template
52 # define SWIGTEMPLATEDISAMBIGUATOR
56 /* inline attribute */
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 # define SWIGINLINE inline
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
67 # if defined(__GNUC__)
68 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 # define SWIGUNUSED __attribute__ ((__unused__))
74 # define SWIGUNUSED __attribute__ ((__unused__))
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
86 #ifndef SWIGUNUSEDPARM
88 # define SWIGUNUSEDPARM(p)
90 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
94 /* internal SWIG method */
96 # define SWIGINTERN static SWIGUNUSED
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 # ifndef GCC_HASCLASSVISIBILITY
107 # define GCC_HASCLASSVISIBILITY
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 # if defined(STATIC_LINKED)
116 # define SWIGEXPORT __declspec(dllexport)
119 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 # define SWIGEXPORT __attribute__ ((visibility("default")))
127 /* calling conventions for Windows */
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 # define SWIGSTDCALL __stdcall
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
148 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
149 /* Use debug wrappers with the Python release dll */
157 /* -----------------------------------------------------------------------------
160 * This file contains generic C API SWIG runtime support for pointer
162 * ----------------------------------------------------------------------------- */
164 /* This should only be incremented when either the layout of swig_type_info changes,
165 or for whatever reason, the runtime changes incompatibly */
166 #define SWIG_RUNTIME_VERSION "4"
168 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
169 #ifdef SWIG_TYPE_TABLE
170 # define SWIG_QUOTE_STRING(x) #x
171 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
172 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
174 # define SWIG_TYPE_TABLE_NAME
178 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
179 creating a static or dynamic library from the SWIG runtime code.
180 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
182 But only do this if strictly necessary, ie, if you have problems
183 with your compiler or suchlike.
187 # define SWIGRUNTIME SWIGINTERN
190 #ifndef SWIGRUNTIMEINLINE
191 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
194 /* Generic buffer size */
195 #ifndef SWIG_BUFFER_SIZE
196 # define SWIG_BUFFER_SIZE 1024
199 /* Flags for pointer conversions */
200 #define SWIG_POINTER_DISOWN 0x1
201 #define SWIG_CAST_NEW_MEMORY 0x2
203 /* Flags for new pointer objects */
204 #define SWIG_POINTER_OWN 0x1
208 Flags/methods for returning states.
210 The SWIG conversion methods, as ConvertPtr, return an integer
211 that tells if the conversion was successful or not. And if not,
212 an error code can be returned (see swigerrors.swg for the codes).
214 Use the following macros/flags to set or process the returning
217 In old versions of SWIG, code such as the following was usually written:
219 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
225 Now you can be more explicit:
227 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
228 if (SWIG_IsOK(res)) {
234 which is the same really, but now you can also do
237 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
238 if (SWIG_IsOK(res)) {
240 if (SWIG_IsNewObj(res) {
250 I.e., now SWIG_ConvertPtr can return new objects and you can
251 identify the case and take care of the deallocation. Of course that
252 also requires SWIG_ConvertPtr to return new result values, such as
254 int SWIG_ConvertPtr(obj, ptr,...) {
256 if (<need new object>) {
257 *ptr = <ptr to new allocated object>;
260 *ptr = <ptr to old object>;
268 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
269 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
272 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
273 allows to return the 'cast rank', for example, if you have this
280 food(1) // cast rank '1' (1 -> 1.0)
281 fooi(1) // cast rank '0'
283 just use the SWIG_AddCast()/SWIG_CheckState()
287 #define SWIG_ERROR (-1)
288 #define SWIG_IsOK(r) (r >= 0)
289 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
291 /* The CastRankLimit says how many bits are used for the cast rank */
292 #define SWIG_CASTRANKLIMIT (1 << 8)
293 /* The NewMask denotes the object was created (using new/malloc) */
294 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
295 /* The TmpMask is for in/out typemaps that use temporal objects */
296 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
297 /* Simple returning values */
298 #define SWIG_BADOBJ (SWIG_ERROR)
299 #define SWIG_OLDOBJ (SWIG_OK)
300 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
301 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
302 /* Check, add and del mask methods */
303 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
304 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
305 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
306 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
307 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
308 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
311 #if defined(SWIG_CASTRANK_MODE)
312 # ifndef SWIG_TypeRank
313 # define SWIG_TypeRank unsigned long
315 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
316 # define SWIG_MAXCASTRANK (2)
318 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
319 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
320 SWIGINTERNINLINE int SWIG_AddCast(int r) {
321 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
323 SWIGINTERNINLINE int SWIG_CheckState(int r) {
324 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
326 #else /* no cast-rank mode */
327 # define SWIG_AddCast(r) (r)
328 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
338 typedef void *(*swig_converter_func)(void *, int *);
339 typedef struct swig_type_info *(*swig_dycast_func)(void **);
341 /* Structure to store information on one type */
342 typedef struct swig_type_info {
343 const char *name; /* mangled name of this type */
344 const char *str; /* human readable name of this type */
345 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
346 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
347 void *clientdata; /* language specific type data */
348 int owndata; /* flag if the structure owns the clientdata */
351 /* Structure to store a type and conversion function used for casting */
352 typedef struct swig_cast_info {
353 swig_type_info *type; /* pointer to type that is equivalent to this type */
354 swig_converter_func converter; /* function to cast the void pointers */
355 struct swig_cast_info *next; /* pointer to next cast in linked list */
356 struct swig_cast_info *prev; /* pointer to the previous cast */
359 /* Structure used to store module information
360 * Each module generates one structure like this, and the runtime collects
361 * all of these structures and stores them in a circularly linked list.*/
362 typedef struct swig_module_info {
363 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
364 size_t size; /* Number of types in this module */
365 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
366 swig_type_info **type_initial; /* Array of initially generated type structures */
367 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
368 void *clientdata; /* Language specific module data */
372 Compare two type names skipping the space characters, therefore
373 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
375 Return 0 when the two name types are equivalent, as in
376 strncmp, but skipping ' '.
379 SWIG_TypeNameComp(const char *f1, const char *l1,
380 const char *f2, const char *l2) {
381 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
382 while ((*f1 == ' ') && (f1 != l1)) ++f1;
383 while ((*f2 == ' ') && (f2 != l2)) ++f2;
384 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
386 return (int)((l1 - f1) - (l2 - f2));
390 Check type equivalence in a name list like <name1>|<name2>|...
391 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
394 SWIG_TypeCmp(const char *nb, const char *tb) {
396 const char* te = tb + strlen(tb);
398 while (equiv != 0 && *ne) {
399 for (nb = ne; *ne; ++ne) {
400 if (*ne == '|') break;
402 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
409 Check type equivalence in a name list like <name1>|<name2>|...
410 Return 0 if not equal, 1 if equal
413 SWIG_TypeEquiv(const char *nb, const char *tb) {
414 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
420 SWIGRUNTIME swig_cast_info *
421 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
423 swig_cast_info *iter = ty->cast;
425 if (strcmp(iter->type->name, c) == 0) {
426 if (iter == ty->cast)
428 /* Move iter to the top of the linked list */
429 iter->prev->next = iter->next;
431 iter->next->prev = iter->prev;
432 iter->next = ty->cast;
434 if (ty->cast) ty->cast->prev = iter;
445 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
447 SWIGRUNTIME swig_cast_info *
448 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
450 swig_cast_info *iter = ty->cast;
452 if (iter->type == from) {
453 if (iter == ty->cast)
455 /* Move iter to the top of the linked list */
456 iter->prev->next = iter->next;
458 iter->next->prev = iter->prev;
459 iter->next = ty->cast;
461 if (ty->cast) ty->cast->prev = iter;
472 Cast a pointer up an inheritance hierarchy
474 SWIGRUNTIMEINLINE void *
475 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
476 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
480 Dynamic pointer casting. Down an inheritance hierarchy
482 SWIGRUNTIME swig_type_info *
483 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
484 swig_type_info *lastty = ty;
485 if (!ty || !ty->dcast) return ty;
486 while (ty && (ty->dcast)) {
487 ty = (*ty->dcast)(ptr);
494 Return the name associated with this type
496 SWIGRUNTIMEINLINE const char *
497 SWIG_TypeName(const swig_type_info *ty) {
502 Return the pretty name associated with this type,
503 that is an unmangled type name in a form presentable to the user.
505 SWIGRUNTIME const char *
506 SWIG_TypePrettyName(const swig_type_info *type) {
507 /* The "str" field contains the equivalent pretty names of the
508 type, separated by vertical-bar characters. We choose
509 to print the last name, as it is often (?) the most
511 if (!type) return NULL;
512 if (type->str != NULL) {
513 const char *last_name = type->str;
515 for (s = type->str; *s; s++)
516 if (*s == '|') last_name = s+1;
524 Set the clientdata field for a type
527 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
528 swig_cast_info *cast = ti->cast;
529 /* if (ti->clientdata == clientdata) return; */
530 ti->clientdata = clientdata;
533 if (!cast->converter) {
534 swig_type_info *tc = cast->type;
535 if (!tc->clientdata) {
536 SWIG_TypeClientData(tc, clientdata);
543 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
544 SWIG_TypeClientData(ti, clientdata);
549 Search for a swig_type_info structure only by mangled name
550 Search is a O(log #types)
552 We start searching at module start, and finish searching when start == end.
553 Note: if start == end at the beginning of the function, we go all the way around
556 SWIGRUNTIME swig_type_info *
557 SWIG_MangledTypeQueryModule(swig_module_info *start,
558 swig_module_info *end,
560 swig_module_info *iter = start;
563 register size_t l = 0;
564 register size_t r = iter->size - 1;
566 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
567 register size_t i = (l + r) >> 1;
568 const char *iname = iter->types[i]->name;
570 register int compare = strcmp(name, iname);
572 return iter->types[i];
573 } else if (compare < 0) {
579 } else if (compare > 0) {
583 break; /* should never happen */
588 } while (iter != end);
593 Search for a swig_type_info structure for either a mangled name or a human readable name.
594 It first searches the mangled names of the types, which is a O(log #types)
595 If a type is not found it then searches the human readable names, which is O(#types).
597 We start searching at module start, and finish searching when start == end.
598 Note: if start == end at the beginning of the function, we go all the way around
601 SWIGRUNTIME swig_type_info *
602 SWIG_TypeQueryModule(swig_module_info *start,
603 swig_module_info *end,
605 /* STEP 1: Search the name field using binary search */
606 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
610 /* STEP 2: If the type hasn't been found, do a complete search
611 of the str field (the human readable name) */
612 swig_module_info *iter = start;
614 register size_t i = 0;
615 for (; i < iter->size; ++i) {
616 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
617 return iter->types[i];
620 } while (iter != end);
623 /* neither found a match */
628 Pack binary data into a string
631 SWIG_PackData(char *c, void *ptr, size_t sz) {
632 static const char hex[17] = "0123456789abcdef";
633 register const unsigned char *u = (unsigned char *) ptr;
634 register const unsigned char *eu = u + sz;
635 for (; u != eu; ++u) {
636 register unsigned char uu = *u;
637 *(c++) = hex[(uu & 0xf0) >> 4];
638 *(c++) = hex[uu & 0xf];
644 Unpack binary data from a string
646 SWIGRUNTIME const char *
647 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
648 register unsigned char *u = (unsigned char *) ptr;
649 register const unsigned char *eu = u + sz;
650 for (; u != eu; ++u) {
651 register char d = *(c++);
652 register unsigned char uu;
653 if ((d >= '0') && (d <= '9'))
654 uu = ((d - '0') << 4);
655 else if ((d >= 'a') && (d <= 'f'))
656 uu = ((d - ('a'-10)) << 4);
660 if ((d >= '0') && (d <= '9'))
662 else if ((d >= 'a') && (d <= 'f'))
663 uu |= (d - ('a'-10));
672 Pack 'void *' into a string buffer.
675 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
677 if ((2*sizeof(void *) + 2) > bsz) return 0;
679 r = SWIG_PackData(r,&ptr,sizeof(void *));
680 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
685 SWIGRUNTIME const char *
686 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
688 if (strcmp(c,"NULL") == 0) {
695 return SWIG_UnpackData(++c,ptr,sizeof(void *));
699 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
701 size_t lname = (name ? strlen(name) : 0);
702 if ((2*sz + 2 + lname) > bsz) return 0;
704 r = SWIG_PackData(r,ptr,sz);
706 strncpy(r,name,lname+1);
713 SWIGRUNTIME const char *
714 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
716 if (strcmp(c,"NULL") == 0) {
723 return SWIG_UnpackData(++c,ptr,sz);
731 #define SWIG_UnknownError -1
732 #define SWIG_IOError -2
733 #define SWIG_RuntimeError -3
734 #define SWIG_IndexError -4
735 #define SWIG_TypeError -5
736 #define SWIG_DivisionByZero -6
737 #define SWIG_OverflowError -7
738 #define SWIG_SyntaxError -8
739 #define SWIG_ValueError -9
740 #define SWIG_SystemError -10
741 #define SWIG_AttributeError -11
742 #define SWIG_MemoryError -12
743 #define SWIG_NullReferenceError -13
747 /* Compatibility macros for Python 3 */
748 #if PY_VERSION_HEX >= 0x03000000
750 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
751 #define PyInt_Check(x) PyLong_Check(x)
752 #define PyInt_AsLong(x) PyLong_AsLong(x)
753 #define PyInt_FromLong(x) PyLong_FromLong(x)
754 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
755 #define PyString_Check(name) PyBytes_Check(name)
756 #define PyString_FromString(x) PyUnicode_FromString(x)
757 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
758 #define PyString_AsString(str) PyBytes_AsString(str)
759 #define PyString_Size(str) PyBytes_Size(str)
760 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
761 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
762 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
763 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
768 # define Py_TYPE(op) ((op)->ob_type)
771 /* SWIG APIs for compatibility of both Python 2 & 3 */
773 #if PY_VERSION_HEX >= 0x03000000
774 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
776 # define SWIG_Python_str_FromFormat PyString_FromFormat
780 /* Warning: This function will allocate a new string in Python 3,
781 * so please call SWIG_Python_str_DelForPy3(x) to free the space.
784 SWIG_Python_str_AsChar(PyObject *str)
786 #if PY_VERSION_HEX >= 0x03000000
790 str = PyUnicode_AsUTF8String(str);
791 PyBytes_AsStringAndSize(str, &cstr, &len);
792 newstr = (char *) malloc(len+1);
793 memcpy(newstr, cstr, len+1);
797 return PyString_AsString(str);
801 #if PY_VERSION_HEX >= 0x03000000
802 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
804 # define SWIG_Python_str_DelForPy3(x)
809 SWIG_Python_str_FromChar(const char *c)
811 #if PY_VERSION_HEX >= 0x03000000
812 return PyUnicode_FromString(c);
814 return PyString_FromString(c);
818 /* Add PyOS_snprintf for old Pythons */
819 #if PY_VERSION_HEX < 0x02020000
820 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
821 # define PyOS_snprintf _snprintf
823 # define PyOS_snprintf snprintf
827 /* A crude PyString_FromFormat implementation for old Pythons */
828 #if PY_VERSION_HEX < 0x02020000
830 #ifndef SWIG_PYBUFFER_SIZE
831 # define SWIG_PYBUFFER_SIZE 1024
835 PyString_FromFormat(const char *fmt, ...) {
837 char buf[SWIG_PYBUFFER_SIZE * 2];
840 res = vsnprintf(buf, sizeof(buf), fmt, ap);
842 return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
846 /* Add PyObject_Del for old Pythons */
847 #if PY_VERSION_HEX < 0x01060000
848 # define PyObject_Del(op) PyMem_DEL((op))
851 # define PyObject_DEL PyObject_Del
854 /* A crude PyExc_StopIteration exception for old Pythons */
855 #if PY_VERSION_HEX < 0x02020000
856 # ifndef PyExc_StopIteration
857 # define PyExc_StopIteration PyExc_RuntimeError
859 # ifndef PyObject_GenericGetAttr
860 # define PyObject_GenericGetAttr 0
864 /* Py_NotImplemented is defined in 2.1 and up. */
865 #if PY_VERSION_HEX < 0x02010000
866 # ifndef Py_NotImplemented
867 # define Py_NotImplemented PyExc_RuntimeError
871 /* A crude PyString_AsStringAndSize implementation for old Pythons */
872 #if PY_VERSION_HEX < 0x02010000
873 # ifndef PyString_AsStringAndSize
874 # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
878 /* PySequence_Size for old Pythons */
879 #if PY_VERSION_HEX < 0x02000000
880 # ifndef PySequence_Size
881 # define PySequence_Size PySequence_Length
885 /* PyBool_FromLong for old Pythons */
886 #if PY_VERSION_HEX < 0x02030000
888 PyObject *PyBool_FromLong(long ok)
890 PyObject *result = ok ? Py_True : Py_False;
896 /* Py_ssize_t for old Pythons */
897 /* This code is as recommended by: */
898 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
899 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
900 typedef int Py_ssize_t;
901 # define PY_SSIZE_T_MAX INT_MAX
902 # define PY_SSIZE_T_MIN INT_MIN
903 typedef inquiry lenfunc;
904 typedef intargfunc ssizeargfunc;
905 typedef intintargfunc ssizessizeargfunc;
906 typedef intobjargproc ssizeobjargproc;
907 typedef intintobjargproc ssizessizeobjargproc;
908 typedef getreadbufferproc readbufferproc;
909 typedef getwritebufferproc writebufferproc;
910 typedef getsegcountproc segcountproc;
911 typedef getcharbufferproc charbufferproc;
912 static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
915 PyObject *i = PyNumber_Int(x);
917 result = PyInt_AsLong(i);
924 #if PY_VERSION_HEX < 0x02050000
925 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
928 #if PY_VERSION_HEX < 0x02040000
929 #define Py_VISIT(op) \
932 int vret = visit((op), arg); \
939 #if PY_VERSION_HEX < 0x02030000
942 PyNumberMethods as_number;
943 PyMappingMethods as_mapping;
944 PySequenceMethods as_sequence;
945 PyBufferProcs as_buffer;
946 PyObject *name, *slots;
950 #if PY_VERSION_HEX < 0x02030000
951 typedef destructor freefunc;
954 #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
955 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
956 (PY_MAJOR_VERSION > 3))
957 # define SWIGPY_USE_CAPSULE
958 # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
961 #if PY_VERSION_HEX < 0x03020000
962 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
963 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
966 /* -----------------------------------------------------------------------------
968 * ----------------------------------------------------------------------------- */
970 SWIGRUNTIME PyObject*
971 SWIG_Python_ErrorType(int code) {
974 case SWIG_MemoryError:
975 type = PyExc_MemoryError;
978 type = PyExc_IOError;
980 case SWIG_RuntimeError:
981 type = PyExc_RuntimeError;
983 case SWIG_IndexError:
984 type = PyExc_IndexError;
987 type = PyExc_TypeError;
989 case SWIG_DivisionByZero:
990 type = PyExc_ZeroDivisionError;
992 case SWIG_OverflowError:
993 type = PyExc_OverflowError;
995 case SWIG_SyntaxError:
996 type = PyExc_SyntaxError;
998 case SWIG_ValueError:
999 type = PyExc_ValueError;
1001 case SWIG_SystemError:
1002 type = PyExc_SystemError;
1004 case SWIG_AttributeError:
1005 type = PyExc_AttributeError;
1008 type = PyExc_RuntimeError;
1015 SWIG_Python_AddErrorMsg(const char* mesg)
1018 PyObject *value = 0;
1019 PyObject *traceback = 0;
1021 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1024 PyObject *old_str = PyObject_Str(value);
1028 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1029 SWIG_Python_str_DelForPy3(tmp);
1033 PyErr_SetString(PyExc_RuntimeError, mesg);
1037 #if defined(SWIG_PYTHON_NO_THREADS)
1038 # if defined(SWIG_PYTHON_THREADS)
1039 # undef SWIG_PYTHON_THREADS
1042 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1043 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1044 # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1045 # define SWIG_PYTHON_USE_GIL
1048 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1049 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
1050 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
1052 # ifdef __cplusplus /* C++ code */
1053 class SWIG_Python_Thread_Block {
1055 PyGILState_STATE state;
1057 void end() { if (status) { PyGILState_Release(state); status = false;} }
1058 SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
1059 ~SWIG_Python_Thread_Block() { end(); }
1061 class SWIG_Python_Thread_Allow {
1063 PyThreadState *save;
1065 void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1066 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1067 ~SWIG_Python_Thread_Allow() { end(); }
1069 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1070 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1071 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1072 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1074 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1075 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1076 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1077 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1079 # else /* Old thread way, not implemented, user must provide it */
1080 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1081 # define SWIG_PYTHON_INITIALIZE_THREADS
1083 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1084 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1086 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1087 # define SWIG_PYTHON_THREAD_END_BLOCK
1089 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1090 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1092 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1093 # define SWIG_PYTHON_THREAD_END_ALLOW
1096 #else /* No thread support */
1097 # define SWIG_PYTHON_INITIALIZE_THREADS
1098 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1099 # define SWIG_PYTHON_THREAD_END_BLOCK
1100 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1101 # define SWIG_PYTHON_THREAD_END_ALLOW
1104 /* -----------------------------------------------------------------------------
1105 * Python API portion that goes into the runtime
1106 * ----------------------------------------------------------------------------- */
1112 /* -----------------------------------------------------------------------------
1113 * Constant declarations
1114 * ----------------------------------------------------------------------------- */
1116 /* Constant Types */
1117 #define SWIG_PY_POINTER 4
1118 #define SWIG_PY_BINARY 5
1120 /* Constant information structure */
1121 typedef struct swig_const_info {
1127 swig_type_info **ptype;
1131 /* -----------------------------------------------------------------------------
1132 * Wrapper of PyInstanceMethod_New() used in Python 3
1133 * It is exported to the generated module, used for -fastproxy
1134 * ----------------------------------------------------------------------------- */
1135 #if PY_VERSION_HEX >= 0x03000000
1136 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1138 return PyInstanceMethod_New(func);
1141 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1152 /* -----------------------------------------------------------------------------
1155 * This file contains the runtime support for Python modules
1156 * and includes code for managing global variables and pointer
1159 * ----------------------------------------------------------------------------- */
1161 /* Common SWIG API */
1163 /* for raw pointers */
1164 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1165 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1166 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1168 #ifdef SWIGPYTHON_BUILTIN
1169 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1171 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1174 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1176 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1177 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1178 #define swig_owntype int
1180 /* for raw packed data */
1181 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1182 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1184 /* for class or struct pointers */
1185 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1186 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1188 /* for C or C++ function pointers */
1189 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1190 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1192 /* for C++ member pointers, ie, member methods */
1193 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1194 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1199 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1200 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1201 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1203 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1204 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1205 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1206 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1207 #define SWIG_fail goto fail
1210 /* Runtime API implementation */
1212 /* Error manipulation */
1215 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1216 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1217 PyErr_SetObject(errtype, obj);
1219 SWIG_PYTHON_THREAD_END_BLOCK;
1223 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1224 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1225 PyErr_SetString(errtype, msg);
1226 SWIG_PYTHON_THREAD_END_BLOCK;
1229 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1231 /* Set a constant value */
1233 #if defined(SWIGPYTHON_BUILTIN)
1236 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1237 PyObject *s = PyString_InternFromString(key);
1238 PyList_Append(seq, s);
1243 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1244 #if PY_VERSION_HEX < 0x02030000
1245 PyDict_SetItemString(d, (char *)name, obj);
1247 PyDict_SetItemString(d, name, obj);
1250 if (public_interface)
1251 SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1257 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1258 #if PY_VERSION_HEX < 0x02030000
1259 PyDict_SetItemString(d, (char *)name, obj);
1261 PyDict_SetItemString(d, name, obj);
1268 /* Append a value to the result obj */
1270 SWIGINTERN PyObject*
1271 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1272 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1275 } else if (result == Py_None) {
1279 if (!PyList_Check(result)) {
1280 PyObject *o2 = result;
1281 result = PyList_New(1);
1282 PyList_SetItem(result, 0, o2);
1284 PyList_Append(result,obj);
1293 } else if (result == Py_None) {
1297 if (!PyTuple_Check(result)) {
1299 result = PyTuple_New(1);
1300 PyTuple_SET_ITEM(result, 0, o2);
1302 o3 = PyTuple_New(1);
1303 PyTuple_SET_ITEM(o3, 0, obj);
1305 result = PySequence_Concat(o2, o3);
1313 /* Unpack the argument tuple */
1316 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1322 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1323 name, (min == max ? "" : "at least "), (int)min);
1327 if (!PyTuple_Check(args)) {
1328 if (min <= 1 && max >= 1) {
1331 for (i = 1; i < max; ++i) {
1336 PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1339 register Py_ssize_t l = PyTuple_GET_SIZE(args);
1341 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1342 name, (min == max ? "" : "at least "), (int)min, (int)l);
1344 } else if (l > max) {
1345 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1346 name, (min == max ? "" : "at most "), (int)max, (int)l);
1350 for (i = 0; i < l; ++i) {
1351 objs[i] = PyTuple_GET_ITEM(args, i);
1353 for (; l < max; ++l) {
1361 /* A functor is a function object with one single object argument */
1362 #if PY_VERSION_HEX >= 0x02020000
1363 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1365 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1369 Helper for static pointer initialization for both C and C++ code, for example
1370 static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1373 #define SWIG_STATIC_POINTER(var) var
1375 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1378 /* -----------------------------------------------------------------------------
1379 * Pointer declarations
1380 * ----------------------------------------------------------------------------- */
1382 /* Flags for new pointer objects */
1383 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1384 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1386 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1388 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1389 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1395 /* How to access Py_None */
1396 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1397 # ifndef SWIG_PYTHON_NO_BUILD_NONE
1398 # ifndef SWIG_PYTHON_BUILD_NONE
1399 # define SWIG_PYTHON_BUILD_NONE
1404 #ifdef SWIG_PYTHON_BUILD_NONE
1407 # define Py_None SWIG_Py_None()
1409 SWIGRUNTIMEINLINE PyObject *
1412 PyObject *none = Py_BuildValue((char*)"");
1416 SWIGRUNTIME PyObject *
1419 static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1424 /* The python void return value */
1426 SWIGRUNTIMEINLINE PyObject *
1429 PyObject *none = Py_None;
1434 /* SwigPyClientData */
1443 PyTypeObject *pytype;
1446 SWIGRUNTIMEINLINE int
1447 SWIG_Python_CheckImplicit(swig_type_info *ty)
1449 SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1450 return data ? data->implicitconv : 0;
1453 SWIGRUNTIMEINLINE PyObject *
1454 SWIG_Python_ExceptionType(swig_type_info *desc) {
1455 SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1456 PyObject *klass = data ? data->klass : 0;
1457 return (klass ? klass : PyExc_RuntimeError);
1461 SWIGRUNTIME SwigPyClientData *
1462 SwigPyClientData_New(PyObject* obj)
1467 SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1468 /* the klass element */
1470 Py_INCREF(data->klass);
1471 /* the newraw method and newargs arguments used to create a new raw instance */
1472 if (PyClass_Check(obj)) {
1474 data->newargs = obj;
1477 #if (PY_VERSION_HEX < 0x02020000)
1480 data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1483 Py_INCREF(data->newraw);
1484 data->newargs = PyTuple_New(1);
1485 PyTuple_SetItem(data->newargs, 0, obj);
1487 data->newargs = obj;
1489 Py_INCREF(data->newargs);
1491 /* the destroy method, aka as the C++ delete method */
1492 data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1493 if (PyErr_Occurred()) {
1497 if (data->destroy) {
1499 Py_INCREF(data->destroy);
1500 flags = PyCFunction_GET_FLAGS(data->destroy);
1502 data->delargs = !(flags & (METH_O));
1509 data->implicitconv = 0;
1516 SwigPyClientData_Del(SwigPyClientData *data) {
1517 Py_XDECREF(data->newraw);
1518 Py_XDECREF(data->newargs);
1519 Py_XDECREF(data->destroy);
1522 /* =============== SwigPyObject =====================*/
1530 #ifdef SWIGPYTHON_BUILTIN
1535 SWIGRUNTIME PyObject *
1536 SwigPyObject_long(SwigPyObject *v)
1538 return PyLong_FromVoidPtr(v->ptr);
1541 SWIGRUNTIME PyObject *
1542 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1544 PyObject *res = NULL;
1545 PyObject *args = PyTuple_New(1);
1547 if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1548 PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1550 #if PY_VERSION_HEX >= 0x03000000
1551 res = PyUnicode_Format(ofmt,args);
1553 res = PyString_Format(ofmt,args);
1563 SWIGRUNTIME PyObject *
1564 SwigPyObject_oct(SwigPyObject *v)
1566 return SwigPyObject_format("%o",v);
1569 SWIGRUNTIME PyObject *
1570 SwigPyObject_hex(SwigPyObject *v)
1572 return SwigPyObject_format("%x",v);
1575 SWIGRUNTIME PyObject *
1577 SwigPyObject_repr(SwigPyObject *v)
1579 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1582 const char *name = SWIG_TypePrettyName(v->ty);
1583 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1586 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1588 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1590 # if PY_VERSION_HEX >= 0x03000000
1591 PyObject *joined = PyUnicode_Concat(repr, nrep);
1596 PyString_ConcatAndDel(&repr,nrep);
1603 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1607 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1610 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1611 SWIGRUNTIME PyObject*
1612 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1615 if( op != Py_EQ && op != Py_NE ) {
1616 Py_INCREF(Py_NotImplemented);
1617 return Py_NotImplemented;
1619 res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1624 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1626 #ifdef SWIGPYTHON_BUILTIN
1627 static swig_type_info *SwigPyObject_stype = 0;
1628 SWIGRUNTIME PyTypeObject*
1629 SwigPyObject_type(void) {
1630 SwigPyClientData *cd;
1631 assert(SwigPyObject_stype);
1632 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1638 SWIGRUNTIME PyTypeObject*
1639 SwigPyObject_type(void) {
1640 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1645 SWIGRUNTIMEINLINE int
1646 SwigPyObject_Check(PyObject *op) {
1647 #ifdef SWIGPYTHON_BUILTIN
1648 PyTypeObject *target_tp = SwigPyObject_type();
1649 if (PyType_IsSubtype(op->ob_type, target_tp))
1651 return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1653 return (Py_TYPE(op) == SwigPyObject_type())
1654 || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1658 SWIGRUNTIME PyObject *
1659 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1662 SwigPyObject_dealloc(PyObject *v)
1664 SwigPyObject *sobj = (SwigPyObject *) v;
1665 PyObject *next = sobj->next;
1666 if (sobj->own == SWIG_POINTER_OWN) {
1667 swig_type_info *ty = sobj->ty;
1668 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1669 PyObject *destroy = data ? data->destroy : 0;
1671 /* destroy is always a VARARGS method */
1673 if (data->delargs) {
1674 /* we need to create a temporary object to carry the destroy operation */
1675 PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1676 res = SWIG_Python_CallFunctor(destroy, tmp);
1679 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1680 PyObject *mself = PyCFunction_GET_SELF(destroy);
1681 res = ((*meth)(mself, v));
1685 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1687 const char *name = SWIG_TypePrettyName(ty);
1688 printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1696 SWIGRUNTIME PyObject*
1697 SwigPyObject_append(PyObject* v, PyObject* next)
1699 SwigPyObject *sobj = (SwigPyObject *) v;
1702 if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1705 if (!SwigPyObject_Check(next)) {
1710 return SWIG_Py_Void();
1713 SWIGRUNTIME PyObject*
1715 SwigPyObject_next(PyObject* v)
1717 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1720 SwigPyObject *sobj = (SwigPyObject *) v;
1722 Py_INCREF(sobj->next);
1725 return SWIG_Py_Void();
1729 SWIGINTERN PyObject*
1731 SwigPyObject_disown(PyObject *v)
1733 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1736 SwigPyObject *sobj = (SwigPyObject *)v;
1738 return SWIG_Py_Void();
1741 SWIGINTERN PyObject*
1743 SwigPyObject_acquire(PyObject *v)
1745 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1748 SwigPyObject *sobj = (SwigPyObject *)v;
1749 sobj->own = SWIG_POINTER_OWN;
1750 return SWIG_Py_Void();
1753 SWIGINTERN PyObject*
1754 SwigPyObject_own(PyObject *v, PyObject *args)
1757 #if (PY_VERSION_HEX < 0x02020000)
1758 if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1759 #elif (PY_VERSION_HEX < 0x02050000)
1760 if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1762 if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1769 SwigPyObject *sobj = (SwigPyObject *)v;
1770 PyObject *obj = PyBool_FromLong(sobj->own);
1773 if (PyObject_IsTrue(val)) {
1774 SwigPyObject_acquire(v);
1776 SwigPyObject_disown(v);
1779 if (PyObject_IsTrue(val)) {
1780 SwigPyObject_acquire(v,args);
1782 SwigPyObject_disown(v,args);
1792 swigobject_methods[] = {
1793 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1794 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
1795 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1796 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1797 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1798 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1803 swigobject_methods[] = {
1804 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1805 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1806 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1807 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1808 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1809 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1814 #if PY_VERSION_HEX < 0x02020000
1815 SWIGINTERN PyObject *
1816 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1818 return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1822 SWIGRUNTIME PyTypeObject*
1823 SwigPyObject_TypeOnce(void) {
1824 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1826 static PyNumberMethods SwigPyObject_as_number = {
1827 (binaryfunc)0, /*nb_add*/
1828 (binaryfunc)0, /*nb_subtract*/
1829 (binaryfunc)0, /*nb_multiply*/
1830 /* nb_divide removed in Python 3 */
1831 #if PY_VERSION_HEX < 0x03000000
1832 (binaryfunc)0, /*nb_divide*/
1834 (binaryfunc)0, /*nb_remainder*/
1835 (binaryfunc)0, /*nb_divmod*/
1836 (ternaryfunc)0,/*nb_power*/
1837 (unaryfunc)0, /*nb_negative*/
1838 (unaryfunc)0, /*nb_positive*/
1839 (unaryfunc)0, /*nb_absolute*/
1840 (inquiry)0, /*nb_nonzero*/
1847 #if PY_VERSION_HEX < 0x03000000
1850 (unaryfunc)SwigPyObject_long, /*nb_int*/
1851 #if PY_VERSION_HEX < 0x03000000
1852 (unaryfunc)SwigPyObject_long, /*nb_long*/
1856 (unaryfunc)0, /*nb_float*/
1857 #if PY_VERSION_HEX < 0x03000000
1858 (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1859 (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1861 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1862 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1863 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1864 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1865 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1866 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1867 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1868 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1872 static PyTypeObject swigpyobject_type;
1873 static int type_init = 0;
1875 const PyTypeObject tmp = {
1876 /* PyObject header changed in Python 3 */
1877 #if PY_VERSION_HEX >= 0x03000000
1878 PyVarObject_HEAD_INIT(NULL, 0)
1880 PyObject_HEAD_INIT(NULL)
1883 (char *)"SwigPyObject", /* tp_name */
1884 sizeof(SwigPyObject), /* tp_basicsize */
1885 0, /* tp_itemsize */
1886 (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1888 #if PY_VERSION_HEX < 0x02020000
1889 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1891 (getattrfunc)0, /* tp_getattr */
1893 (setattrfunc)0, /* tp_setattr */
1894 #if PY_VERSION_HEX >= 0x03000000
1895 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1897 (cmpfunc)SwigPyObject_compare, /* tp_compare */
1899 (reprfunc)SwigPyObject_repr, /* tp_repr */
1900 &SwigPyObject_as_number, /* tp_as_number */
1901 0, /* tp_as_sequence */
1902 0, /* tp_as_mapping */
1903 (hashfunc)0, /* tp_hash */
1904 (ternaryfunc)0, /* tp_call */
1906 PyObject_GenericGetAttr, /* tp_getattro */
1907 0, /* tp_setattro */
1908 0, /* tp_as_buffer */
1909 Py_TPFLAGS_DEFAULT, /* tp_flags */
1910 swigobject_doc, /* tp_doc */
1911 0, /* tp_traverse */
1913 (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1914 0, /* tp_weaklistoffset */
1915 #if PY_VERSION_HEX >= 0x02020000
1917 0, /* tp_iternext */
1918 swigobject_methods, /* tp_methods */
1923 0, /* tp_descr_get */
1924 0, /* tp_descr_set */
1925 0, /* tp_dictoffset */
1934 0, /* tp_subclasses */
1935 0, /* tp_weaklist */
1937 #if PY_VERSION_HEX >= 0x02030000
1940 #if PY_VERSION_HEX >= 0x02060000
1944 0,0,0,0 /* tp_alloc -> tp_next */
1947 swigpyobject_type = tmp;
1949 #if PY_VERSION_HEX < 0x02020000
1950 swigpyobject_type.ob_type = &PyType_Type;
1952 if (PyType_Ready(&swigpyobject_type) < 0)
1956 return &swigpyobject_type;
1959 SWIGRUNTIME PyObject *
1960 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1962 SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1969 return (PyObject *)sobj;
1972 /* -----------------------------------------------------------------------------
1973 * Implements a simple Swig Packed type, and use it instead of string
1974 * ----------------------------------------------------------------------------- */
1984 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1986 char result[SWIG_BUFFER_SIZE];
1987 fputs("<Swig Packed ", fp);
1988 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1992 fputs(v->ty->name,fp);
1997 SWIGRUNTIME PyObject *
1998 SwigPyPacked_repr(SwigPyPacked *v)
2000 char result[SWIG_BUFFER_SIZE];
2001 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2002 return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2004 return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2008 SWIGRUNTIME PyObject *
2009 SwigPyPacked_str(SwigPyPacked *v)
2011 char result[SWIG_BUFFER_SIZE];
2012 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2013 return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2015 return SWIG_Python_str_FromChar(v->ty->name);
2020 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2024 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2025 return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2028 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2030 SWIGRUNTIME PyTypeObject*
2031 SwigPyPacked_type(void) {
2032 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2036 SWIGRUNTIMEINLINE int
2037 SwigPyPacked_Check(PyObject *op) {
2038 return ((op)->ob_type == SwigPyPacked_TypeOnce())
2039 || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2043 SwigPyPacked_dealloc(PyObject *v)
2045 if (SwigPyPacked_Check(v)) {
2046 SwigPyPacked *sobj = (SwigPyPacked *) v;
2052 SWIGRUNTIME PyTypeObject*
2053 SwigPyPacked_TypeOnce(void) {
2054 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2055 static PyTypeObject swigpypacked_type;
2056 static int type_init = 0;
2058 const PyTypeObject tmp = {
2059 /* PyObject header changed in Python 3 */
2060 #if PY_VERSION_HEX>=0x03000000
2061 PyVarObject_HEAD_INIT(NULL, 0)
2063 PyObject_HEAD_INIT(NULL)
2066 (char *)"SwigPyPacked", /* tp_name */
2067 sizeof(SwigPyPacked), /* tp_basicsize */
2068 0, /* tp_itemsize */
2069 (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2070 (printfunc)SwigPyPacked_print, /* tp_print */
2071 (getattrfunc)0, /* tp_getattr */
2072 (setattrfunc)0, /* tp_setattr */
2073 #if PY_VERSION_HEX>=0x03000000
2074 0, /* tp_reserved in 3.0.1 */
2076 (cmpfunc)SwigPyPacked_compare, /* tp_compare */
2078 (reprfunc)SwigPyPacked_repr, /* tp_repr */
2079 0, /* tp_as_number */
2080 0, /* tp_as_sequence */
2081 0, /* tp_as_mapping */
2082 (hashfunc)0, /* tp_hash */
2083 (ternaryfunc)0, /* tp_call */
2084 (reprfunc)SwigPyPacked_str, /* tp_str */
2085 PyObject_GenericGetAttr, /* tp_getattro */
2086 0, /* tp_setattro */
2087 0, /* tp_as_buffer */
2088 Py_TPFLAGS_DEFAULT, /* tp_flags */
2089 swigpacked_doc, /* tp_doc */
2090 0, /* tp_traverse */
2092 0, /* tp_richcompare */
2093 0, /* tp_weaklistoffset */
2094 #if PY_VERSION_HEX >= 0x02020000
2096 0, /* tp_iternext */
2102 0, /* tp_descr_get */
2103 0, /* tp_descr_set */
2104 0, /* tp_dictoffset */
2113 0, /* tp_subclasses */
2114 0, /* tp_weaklist */
2116 #if PY_VERSION_HEX >= 0x02030000
2119 #if PY_VERSION_HEX >= 0x02060000
2123 0,0,0,0 /* tp_alloc -> tp_next */
2126 swigpypacked_type = tmp;
2128 #if PY_VERSION_HEX < 0x02020000
2129 swigpypacked_type.ob_type = &PyType_Type;
2131 if (PyType_Ready(&swigpypacked_type) < 0)
2135 return &swigpypacked_type;
2138 SWIGRUNTIME PyObject *
2139 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2141 SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2143 void *pack = malloc(size);
2145 memcpy(pack, ptr, size);
2150 PyObject_DEL((PyObject *) sobj);
2154 return (PyObject *) sobj;
2157 SWIGRUNTIME swig_type_info *
2158 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2160 if (SwigPyPacked_Check(obj)) {
2161 SwigPyPacked *sobj = (SwigPyPacked *)obj;
2162 if (sobj->size != size) return 0;
2163 memcpy(ptr, sobj->pack, size);
2170 /* -----------------------------------------------------------------------------
2171 * pointers/data manipulation
2172 * ----------------------------------------------------------------------------- */
2174 SWIGRUNTIMEINLINE PyObject *
2177 return SWIG_Python_str_FromChar("this");
2180 static PyObject *swig_this = NULL;
2182 SWIGRUNTIME PyObject *
2185 if (swig_this == NULL)
2186 swig_this = _SWIG_This();
2190 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2192 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2193 #if PY_VERSION_HEX>=0x03000000
2194 #define SWIG_PYTHON_SLOW_GETSET_THIS
2197 SWIGRUNTIME SwigPyObject *
2198 SWIG_Python_GetSwigThis(PyObject *pyobj)
2202 if (SwigPyObject_Check(pyobj))
2203 return (SwigPyObject *) pyobj;
2205 #ifdef SWIGPYTHON_BUILTIN
2207 # ifdef PyWeakref_CheckProxy
2208 if (PyWeakref_CheckProxy(pyobj)) {
2209 pyobj = PyWeakref_GET_OBJECT(pyobj);
2210 if (pyobj && SwigPyObject_Check(pyobj))
2211 return (SwigPyObject*) pyobj;
2219 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2220 if (PyInstance_Check(pyobj)) {
2221 obj = _PyInstance_Lookup(pyobj, SWIG_This());
2223 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2224 if (dictptr != NULL) {
2225 PyObject *dict = *dictptr;
2226 obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2228 #ifdef PyWeakref_CheckProxy
2229 if (PyWeakref_CheckProxy(pyobj)) {
2230 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2231 return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2234 obj = PyObject_GetAttr(pyobj,SWIG_This());
2238 if (PyErr_Occurred()) PyErr_Clear();
2244 obj = PyObject_GetAttr(pyobj,SWIG_This());
2248 if (PyErr_Occurred()) PyErr_Clear();
2252 if (obj && !SwigPyObject_Check(obj)) {
2253 /* a PyObject is called 'this', try to get the 'real this'
2254 SwigPyObject from it */
2255 return SWIG_Python_GetSwigThis(obj);
2257 return (SwigPyObject *)obj;
2261 /* Acquire a pointer value */
2264 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2265 if (own == SWIG_POINTER_OWN) {
2266 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2268 int oldown = sobj->own;
2276 /* Convert a pointer value */
2279 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2282 int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2286 if (obj == Py_None && !implicit_conv) {
2294 sobj = SWIG_Python_GetSwigThis(obj);
2298 void *vptr = sobj->ptr;
2300 swig_type_info *to = sobj->ty;
2302 /* no type cast needed */
2303 if (ptr) *ptr = vptr;
2306 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2308 sobj = (SwigPyObject *)sobj->next;
2312 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2313 if (newmemory == SWIG_CAST_NEW_MEMORY) {
2314 assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2316 *own = *own | SWIG_CAST_NEW_MEMORY;
2323 if (ptr) *ptr = vptr;
2329 *own = *own | sobj->own;
2330 if (flags & SWIG_POINTER_DISOWN) {
2335 if (implicit_conv) {
2336 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2337 if (data && !data->implicitconv) {
2338 PyObject *klass = data->klass;
2341 data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2342 impconv = SWIG_Python_CallFunctor(klass, obj);
2343 data->implicitconv = 0;
2344 if (PyErr_Occurred()) {
2349 SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2352 res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2353 if (SWIG_IsOK(res)) {
2356 /* transfer the ownership to 'ptr' */
2358 res = SWIG_AddCast(res);
2359 res = SWIG_AddNewMask(res);
2361 res = SWIG_AddCast(res);
2370 if (!SWIG_IsOK(res) && obj == Py_None) {
2373 if (PyErr_Occurred())
2381 /* Convert a function ptr value */
2384 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2385 if (!PyCFunction_Check(obj)) {
2386 return SWIG_ConvertPtr(obj, ptr, ty, 0);
2390 /* here we get the method pointer for callbacks */
2391 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2392 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2394 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2398 swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2401 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2402 assert(!newmemory); /* newmemory handling not yet implemented */
2413 /* Convert a packed value value */
2416 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2417 swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2418 if (!to) return SWIG_ERROR;
2421 /* check type cast? */
2422 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2423 if (!tc) return SWIG_ERROR;
2429 /* -----------------------------------------------------------------------------
2430 * Create a new pointer object
2431 * ----------------------------------------------------------------------------- */
2434 Create a new instance object, without calling __init__, and set the
2438 SWIGRUNTIME PyObject*
2439 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2441 #if (PY_VERSION_HEX >= 0x02020000)
2443 PyObject *newraw = data->newraw;
2445 inst = PyObject_Call(newraw, data->newargs, NULL);
2447 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2448 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2449 if (dictptr != NULL) {
2450 PyObject *dict = *dictptr;
2452 dict = PyDict_New();
2454 PyDict_SetItem(dict, SWIG_This(), swig_this);
2458 PyObject *key = SWIG_This();
2459 PyObject_SetAttr(inst, key, swig_this);
2463 #if PY_VERSION_HEX >= 0x03000000
2464 inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2466 PyObject_SetAttr(inst, SWIG_This(), swig_this);
2467 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2470 PyObject *dict = PyDict_New();
2472 PyDict_SetItem(dict, SWIG_This(), swig_this);
2473 inst = PyInstance_NewRaw(data->newargs, dict);
2480 #if (PY_VERSION_HEX >= 0x02010000)
2482 PyObject *dict = PyDict_New();
2484 PyDict_SetItem(dict, SWIG_This(), swig_this);
2485 inst = PyInstance_NewRaw(data->newargs, dict);
2488 return (PyObject *) inst;
2490 PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2494 inst->in_class = (PyClassObject *)data->newargs;
2495 Py_INCREF(inst->in_class);
2496 inst->in_dict = PyDict_New();
2497 if (inst->in_dict == NULL) {
2501 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2502 inst->in_weakreflist = NULL;
2504 #ifdef Py_TPFLAGS_GC
2505 PyObject_GC_Init(inst);
2507 PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2508 return (PyObject *) inst;
2514 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2517 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2518 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2519 if (dictptr != NULL) {
2522 dict = PyDict_New();
2525 PyDict_SetItem(dict, SWIG_This(), swig_this);
2529 dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2530 PyDict_SetItem(dict, SWIG_This(), swig_this);
2535 SWIGINTERN PyObject *
2536 SWIG_Python_InitShadowInstance(PyObject *args) {
2538 if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2541 SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2543 SwigPyObject_append((PyObject*) sthis, obj[1]);
2545 SWIG_Python_SetSwigThis(obj[0], obj[1]);
2547 return SWIG_Py_Void();
2551 /* Create a new pointer object */
2553 SWIGRUNTIME PyObject *
2554 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2555 SwigPyClientData *clientdata;
2560 return SWIG_Py_Void();
2562 clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2563 own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2564 if (clientdata && clientdata->pytype) {
2565 SwigPyObject *newobj;
2566 if (flags & SWIG_BUILTIN_TP_INIT) {
2567 newobj = (SwigPyObject*) self;
2569 PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2570 while (newobj->next)
2571 newobj = (SwigPyObject *) newobj->next;
2572 newobj->next = next_self;
2573 newobj = (SwigPyObject *)next_self;
2576 newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2583 #ifdef SWIGPYTHON_BUILTIN
2586 return (PyObject*) newobj;
2588 return SWIG_Py_Void();
2591 assert(!(flags & SWIG_BUILTIN_TP_INIT));
2593 robj = SwigPyObject_New(ptr, type, own);
2594 if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2595 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2602 /* Create a new packed object */
2604 SWIGRUNTIMEINLINE PyObject *
2605 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2606 return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2609 /* -----------------------------------------------------------------------------*
2611 * -----------------------------------------------------------------------------*/
2613 #ifdef SWIG_LINK_RUNTIME
2614 void *SWIG_ReturnGlobalTypeList(void *);
2617 SWIGRUNTIME swig_module_info *
2618 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2619 static void *type_pointer = (void *)0;
2620 /* first check if module already created */
2621 if (!type_pointer) {
2622 #ifdef SWIG_LINK_RUNTIME
2623 type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2625 # ifdef SWIGPY_USE_CAPSULE
2626 type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2628 type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2629 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2631 if (PyErr_Occurred()) {
2633 type_pointer = (void *)0;
2637 return (swig_module_info *) type_pointer;
2640 #if PY_MAJOR_VERSION < 2
2641 /* PyModule_AddObject function was introduced in Python 2.0. The following function
2642 is copied out of Python/modsupport.c in python version 2.3.4 */
2644 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2647 if (!PyModule_Check(m)) {
2648 PyErr_SetString(PyExc_TypeError,
2649 "PyModule_AddObject() needs module as first arg");
2653 PyErr_SetString(PyExc_TypeError,
2654 "PyModule_AddObject() needs non-NULL value");
2658 dict = PyModule_GetDict(m);
2660 /* Internal error -- modules must have a dict! */
2661 PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2662 PyModule_GetName(m));
2665 if (PyDict_SetItemString(dict, name, o))
2673 #ifdef SWIGPY_USE_CAPSULE
2674 SWIG_Python_DestroyModule(PyObject *obj)
2676 SWIG_Python_DestroyModule(void *vptr)
2679 #ifdef SWIGPY_USE_CAPSULE
2680 swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2682 swig_module_info *swig_module = (swig_module_info *) vptr;
2684 swig_type_info **types = swig_module->types;
2686 for (i =0; i < swig_module->size; ++i) {
2687 swig_type_info *ty = types[i];
2689 SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2690 if (data) SwigPyClientData_Del(data);
2693 Py_DECREF(SWIG_This());
2698 SWIG_Python_SetModule(swig_module_info *swig_module) {
2699 #if PY_VERSION_HEX >= 0x03000000
2700 /* Add a dummy module object into sys.modules */
2701 PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2703 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2704 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2706 #ifdef SWIGPY_USE_CAPSULE
2707 PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2708 if (pointer && module) {
2709 PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2711 Py_XDECREF(pointer);
2714 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2715 if (pointer && module) {
2716 PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2718 Py_XDECREF(pointer);
2723 /* The python cached type query */
2724 SWIGRUNTIME PyObject *
2725 SWIG_Python_TypeCache(void) {
2726 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2730 SWIGRUNTIME swig_type_info *
2731 SWIG_Python_TypeQuery(const char *type)
2733 PyObject *cache = SWIG_Python_TypeCache();
2734 PyObject *key = SWIG_Python_str_FromChar(type);
2735 PyObject *obj = PyDict_GetItem(cache, key);
2736 swig_type_info *descriptor;
2738 #ifdef SWIGPY_USE_CAPSULE
2739 descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2741 descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2744 swig_module_info *swig_module = SWIG_GetModule(0);
2745 descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2747 #ifdef SWIGPY_USE_CAPSULE
2748 obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2750 obj = PyCObject_FromVoidPtr(descriptor, NULL);
2752 PyDict_SetItem(cache, key, obj);
2761 For backward compatibility only
2763 #define SWIG_POINTER_EXCEPTION 0
2764 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2765 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2768 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2770 if (PyErr_Occurred()) {
2772 PyObject *value = 0;
2773 PyObject *traceback = 0;
2774 PyErr_Fetch(&type, &value, &traceback);
2777 PyObject *old_str = PyObject_Str(value);
2781 PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2783 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2785 SWIG_Python_str_DelForPy3(tmp);
2795 SWIG_Python_ArgFail(int argnum)
2797 if (PyErr_Occurred()) {
2798 /* add information about failing argument */
2800 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2801 return SWIG_Python_AddErrMesg(mesg, 1);
2807 SWIGRUNTIMEINLINE const char *
2808 SwigPyObject_GetDesc(PyObject *self)
2810 SwigPyObject *v = (SwigPyObject *)self;
2811 swig_type_info *ty = v ? v->ty : 0;
2812 return ty ? ty->str : "";
2816 SWIG_Python_TypeError(const char *type, PyObject *obj)
2819 #if defined(SWIG_COBJECT_TYPES)
2820 if (obj && SwigPyObject_Check(obj)) {
2821 const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2823 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2830 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2832 PyObject *str = PyObject_Str(obj);
2833 const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2835 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2837 SWIG_Python_str_DelForPy3(cstr);
2839 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2846 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2848 PyErr_Format(PyExc_TypeError, "unexpected type is received");
2853 /* Convert a pointer value, signal an exception on a type mismatch */
2855 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2857 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2859 #if SWIG_POINTER_EXCEPTION
2861 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2862 SWIG_Python_ArgFail(argnum);
2869 #ifdef SWIGPYTHON_BUILTIN
2871 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2872 PyTypeObject *tp = obj->ob_type;
2874 PyObject *encoded_name;
2878 # ifdef Py_USING_UNICODE
2879 if (PyString_Check(name)) {
2880 name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2883 } else if (!PyUnicode_Check(name))
2885 if (!PyString_Check(name))
2888 PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2895 if (PyType_Ready(tp) < 0)
2899 descr = _PyType_Lookup(tp, name);
2902 f = descr->ob_type->tp_descr_set;
2904 if (PyString_Check(name)) {
2905 encoded_name = name;
2908 encoded_name = PyUnicode_AsUTF8String(name);
2910 PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2911 Py_DECREF(encoded_name);
2913 res = f(descr, obj, value);
2929 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2931 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2935 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2938 /* -------- TYPES TABLE (BEGIN) -------- */
2940 #define SWIGTYPE_p_allocator_type swig_types[0]
2941 #define SWIGTYPE_p_char swig_types[1]
2942 #define SWIGTYPE_p_difference_type swig_types[2]
2943 #define SWIGTYPE_p_double swig_types[3]
2944 #define SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double swig_types[4]
2945 #define SWIGTYPE_p_int swig_types[5]
2946 #define SWIGTYPE_p_nlopt__forced_stop swig_types[6]
2947 #define SWIGTYPE_p_nlopt__opt swig_types[7]
2948 #define SWIGTYPE_p_nlopt__roundoff_limited swig_types[8]
2949 #define SWIGTYPE_p_nlopt_func swig_types[9]
2950 #define SWIGTYPE_p_nlopt_mfunc swig_types[10]
2951 #define SWIGTYPE_p_nlopt_opt swig_types[11]
2952 #define SWIGTYPE_p_nlopt_result swig_types[12]
2953 #define SWIGTYPE_p_p_PyObject swig_types[13]
2954 #define SWIGTYPE_p_size_type swig_types[14]
2955 #define SWIGTYPE_p_std__allocatorT_double_t swig_types[15]
2956 #define SWIGTYPE_p_std__invalid_argument swig_types[16]
2957 #define SWIGTYPE_p_std__runtime_error swig_types[17]
2958 #define SWIGTYPE_p_std__vectorT__Tp__Alloc_t swig_types[18]
2959 #define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[19]
2960 #define SWIGTYPE_p_swig__SwigPyIterator swig_types[20]
2961 #define SWIGTYPE_p_value_type swig_types[21]
2962 static swig_type_info *swig_types[23];
2963 static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0};
2964 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2965 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2967 /* -------- TYPES TABLE (END) -------- */
2969 #if (PY_VERSION_HEX <= 0x02000000)
2970 # if !defined(SWIG_PYTHON_CLASSIC)
2971 # error "This python version requires swig to be run with the '-classic' option"
2975 /*-----------------------------------------------
2976 @(target):= _nlopt.so
2977 ------------------------------------------------*/
2978 #if PY_VERSION_HEX >= 0x03000000
2979 # define SWIG_init PyInit__nlopt
2982 # define SWIG_init init_nlopt
2985 #define SWIG_name "_nlopt"
2987 #define SWIGVERSION 0x020012
2988 #define SWIG_VERSION SWIGVERSION
2991 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2992 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2995 #include <stdexcept>
2999 class SwigPtr_PyObject {
3004 SwigPtr_PyObject() :_obj(0)
3008 SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3013 SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3020 SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3022 Py_XINCREF(item._obj);
3033 operator PyObject *() const
3038 PyObject *operator->() const
3047 struct SwigVar_PyObject : SwigPtr_PyObject {
3048 SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3050 SwigVar_PyObject & operator = (PyObject* obj)
3060 #include "nlopt.hpp"
3065 #if PY_VERSION_HEX >= 0x03020000
3066 # define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
3068 # define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
3072 #include <stdexcept>
3075 #if defined(__GNUC__)
3076 # if __GNUC__ == 2 && __GNUC_MINOR <= 96
3077 # define SWIG_STD_NOMODERN_STL
3083 #include <stdexcept>
3091 struct stop_iteration {
3094 struct SwigPyIterator {
3096 SwigPtr_PyObject _seq;
3099 SwigPyIterator(PyObject *seq) : _seq(seq)
3104 virtual ~SwigPyIterator() {}
3106 // Access iterator method, required by Python
3107 virtual PyObject *value() const = 0;
3109 // Forward iterator method, required by Python
3110 virtual SwigPyIterator *incr(size_t n = 1) = 0;
3112 // Backward iterator method, very common in C++, but not required in Python
3113 virtual SwigPyIterator *decr(size_t /*n*/ = 1)
3115 throw stop_iteration();
3118 // Random access iterator methods, but not required in Python
3119 virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
3121 throw std::invalid_argument("operation not supported");
3124 virtual bool equal (const SwigPyIterator &/*x*/) const
3126 throw std::invalid_argument("operation not supported");
3129 // C++ common/needed methods
3130 virtual SwigPyIterator *copy() const = 0;
3134 SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
3135 PyObject *obj = value();
3137 SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3141 /* Make an alias for Python 3.x */
3142 PyObject *__next__()
3147 PyObject *previous()
3149 SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
3151 PyObject *obj = value();
3152 SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3156 SwigPyIterator *advance(ptrdiff_t n)
3158 return (n > 0) ? incr(n) : decr(-n);
3161 bool operator == (const SwigPyIterator& x) const
3166 bool operator != (const SwigPyIterator& x) const
3168 return ! operator==(x);
3171 SwigPyIterator& operator += (ptrdiff_t n)
3176 SwigPyIterator& operator -= (ptrdiff_t n)
3178 return *advance(-n);
3181 SwigPyIterator* operator + (ptrdiff_t n) const
3183 return copy()->advance(n);
3186 SwigPyIterator* operator - (ptrdiff_t n) const
3188 return copy()->advance(-n);
3191 ptrdiff_t operator - (const SwigPyIterator& x) const
3193 return x.distance(*this);
3196 static swig_type_info* descriptor() {
3197 static int init = 0;
3198 static swig_type_info* desc = 0;
3200 desc = SWIG_TypeQuery("swig::SwigPyIterator *");
3207 #if defined(SWIGPYTHON_BUILTIN)
3208 inline PyObject* make_output_iterator_builtin (PyObject *pyself)
3218 SWIG_AsVal_double (PyObject *obj, double *val)
3220 int res = SWIG_TypeError;
3221 if (PyFloat_Check(obj)) {
3222 if (val) *val = PyFloat_AsDouble(obj);
3224 } else if (PyInt_Check(obj)) {
3225 if (val) *val = PyInt_AsLong(obj);
3227 } else if (PyLong_Check(obj)) {
3228 double v = PyLong_AsDouble(obj);
3229 if (!PyErr_Occurred()) {
3236 #ifdef SWIG_PYTHON_CAST_MODE
3239 double d = PyFloat_AsDouble(obj);
3240 if (!PyErr_Occurred()) {
3242 return SWIG_AddCast(SWIG_OK);
3247 long v = PyLong_AsLong(obj);
3248 if (!PyErr_Occurred()) {
3250 return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3267 SWIGINTERNINLINE int
3268 SWIG_CanCastAsInteger(double *d, double min, double max) {
3270 if ((min <= x && x <= max)) {
3271 double fx = floor(x);
3272 double cx = ceil(x);
3273 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3274 if ((errno == EDOM) || (errno == ERANGE)) {
3277 double summ, reps, diff;
3280 } else if (rd > x) {
3287 if (reps < 8*DBL_EPSILON) {
3298 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
3300 #if PY_VERSION_HEX < 0x03000000
3301 if (PyInt_Check(obj)) {
3302 long v = PyInt_AsLong(obj);
3307 return SWIG_OverflowError;
3311 if (PyLong_Check(obj)) {
3312 unsigned long v = PyLong_AsUnsignedLong(obj);
3313 if (!PyErr_Occurred()) {
3318 #if PY_VERSION_HEX >= 0x03000000
3320 long v = PyLong_AsLong(obj);
3321 if (!PyErr_Occurred()) {
3323 return SWIG_OverflowError;
3332 #ifdef SWIG_PYTHON_CAST_MODE
3335 unsigned long v = PyLong_AsUnsignedLong(obj);
3336 if (!PyErr_Occurred()) {
3338 return SWIG_AddCast(SWIG_OK);
3344 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3345 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3346 if (val) *val = (unsigned long)(d);
3352 return SWIG_TypeError;
3356 SWIGINTERNINLINE int
3357 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3360 int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3361 if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3366 #define SWIG_From_long PyLong_FromLong
3369 SWIGINTERNINLINE PyObject *
3370 SWIG_From_ptrdiff_t (ptrdiff_t value)
3372 return SWIG_From_long (static_cast< long >(value));
3376 SWIGINTERNINLINE PyObject*
3377 SWIG_From_bool (bool value)
3379 return PyBool_FromLong(value ? 1 : 0);
3384 SWIG_AsVal_long (PyObject *obj, long* val)
3386 if (PyInt_Check(obj)) {
3387 if (val) *val = PyInt_AsLong(obj);
3389 } else if (PyLong_Check(obj)) {
3390 long v = PyLong_AsLong(obj);
3391 if (!PyErr_Occurred()) {
3398 #ifdef SWIG_PYTHON_CAST_MODE
3401 long v = PyInt_AsLong(obj);
3402 if (!PyErr_Occurred()) {
3404 return SWIG_AddCast(SWIG_OK);
3410 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3411 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3412 if (val) *val = (long)(d);
3418 return SWIG_TypeError;
3422 SWIGINTERNINLINE int
3423 SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
3426 int res = SWIG_AsVal_long (obj, val ? &v : 0);
3427 if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
3432 #include <stdexcept>
3435 #include <algorithm>
3442 template <class Type>
3443 struct noconst_traits {
3444 typedef Type noconst_type;
3447 template <class Type>
3448 struct noconst_traits<const Type> {
3449 typedef Type noconst_type;
3455 struct pointer_category { };
3456 struct value_category { };
3459 General traits that provides type_name and type_info
3461 template <class Type> struct traits { };
3463 template <class Type>
3464 inline const char* type_name() {
3465 return traits<typename noconst_traits<Type >::noconst_type >::type_name();
3468 template <class Type>
3469 struct traits_info {
3470 static swig_type_info *type_query(std::string name) {
3472 return SWIG_TypeQuery(name.c_str());
3474 static swig_type_info *type_info() {
3475 static swig_type_info *info = type_query(type_name<Type>());
3480 template <class Type>
3481 inline swig_type_info *type_info() {
3482 return traits_info<Type>::type_info();
3486 Partial specialization for pointers
3488 template <class Type> struct traits <Type *> {
3489 typedef pointer_category category;
3490 static std::string make_ptr_name(const char* name) {
3491 std::string ptrname = name;
3495 static const char* type_name() {
3496 static std::string name = make_ptr_name(swig::type_name<Type>());
3497 return name.c_str();
3501 template <class Type, class Category>
3502 struct traits_as { };
3504 template <class Type, class Category>
3505 struct traits_check { };
3512 Traits that provides the from method
3514 template <class Type> struct traits_from_ptr {
3515 static PyObject *from(Type *val, int owner = 0) {
3516 return SWIG_InternalNewPointerObj(val, type_info<Type>(), owner);
3520 template <class Type> struct traits_from {
3521 static PyObject *from(const Type& val) {
3522 return traits_from_ptr<Type>::from(new Type(val), 1);
3526 template <class Type> struct traits_from<Type *> {
3527 static PyObject *from(Type* val) {
3528 return traits_from_ptr<Type>::from(val, 0);
3532 template <class Type> struct traits_from<const Type *> {
3533 static PyObject *from(const Type* val) {
3534 return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
3539 template <class Type>
3540 inline PyObject *from(const Type& val) {
3541 return traits_from<Type>::from(val);
3544 template <class Type>
3545 inline PyObject *from_ptr(Type* val, int owner) {
3546 return traits_from_ptr<Type>::from(val, owner);
3550 Traits that provides the asval/as/check method
3552 template <class Type>
3553 struct traits_asptr {
3554 static int asptr(PyObject *obj, Type **val) {
3556 int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
3557 if (SWIG_IsOK(res)) {
3564 template <class Type>
3565 inline int asptr(PyObject *obj, Type **vptr) {
3566 return traits_asptr<Type>::asptr(obj, vptr);
3569 template <class Type>
3570 struct traits_asval {
3571 static int asval(PyObject *obj, Type *val) {
3574 int res = traits_asptr<Type>::asptr(obj, &p);
3575 if (!SWIG_IsOK(res)) return res;
3577 typedef typename noconst_traits<Type>::noconst_type noconst_type;
3578 *(const_cast<noconst_type*>(val)) = *p;
3579 if (SWIG_IsNewObj(res)){
3581 res = SWIG_DelNewMask(res);
3588 return traits_asptr<Type>::asptr(obj, (Type **)(0));
3593 template <class Type> struct traits_asval<Type*> {
3594 static int asval(PyObject *obj, Type **val) {
3596 typedef typename noconst_traits<Type>::noconst_type noconst_type;
3597 noconst_type *p = 0;
3598 int res = traits_asptr<noconst_type>::asptr(obj, &p);
3599 if (SWIG_IsOK(res)) {
3600 *(const_cast<noconst_type**>(val)) = p;
3604 return traits_asptr<Type>::asptr(obj, (Type **)(0));
3609 template <class Type>
3610 inline int asval(PyObject *obj, Type *val) {
3611 return traits_asval<Type>::asval(obj, val);
3614 template <class Type>
3615 struct traits_as<Type, value_category> {
3616 static Type as(PyObject *obj, bool throw_error) {
3618 int res = asval(obj, &v);
3619 if (!obj || !SWIG_IsOK(res)) {
3620 if (!PyErr_Occurred()) {
3621 ::SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
3623 if (throw_error) throw std::invalid_argument("bad type");
3629 template <class Type>
3630 struct traits_as<Type, pointer_category> {
3631 static Type as(PyObject *obj, bool throw_error) {
3633 int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3634 if (SWIG_IsOK(res) && v) {
3635 if (SWIG_IsNewObj(res)) {
3643 // Uninitialized return value, no Type() constructor required.
3644 static Type *v_def = (Type*) malloc(sizeof(Type));
3645 if (!PyErr_Occurred()) {
3646 SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
3648 if (throw_error) throw std::invalid_argument("bad type");
3649 memset(v_def,0,sizeof(Type));
3655 template <class Type>
3656 struct traits_as<Type*, pointer_category> {
3657 static Type* as(PyObject *obj, bool throw_error) {
3659 int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3660 if (SWIG_IsOK(res)) {
3663 if (!PyErr_Occurred()) {
3664 SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
3666 if (throw_error) throw std::invalid_argument("bad type");
3672 template <class Type>
3673 inline Type as(PyObject *obj, bool te = false) {
3674 return traits_as<Type, typename traits<Type>::category>::as(obj, te);
3677 template <class Type>
3678 struct traits_check<Type, value_category> {
3679 static bool check(PyObject *obj) {
3680 int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
3681 return SWIG_IsOK(res) ? true : false;
3685 template <class Type>
3686 struct traits_check<Type, pointer_category> {
3687 static bool check(PyObject *obj) {
3688 int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR;
3689 return SWIG_IsOK(res) ? true : false;
3693 template <class Type>
3694 inline bool check(PyObject *obj) {
3695 return traits_check<Type, typename traits<Type>::category>::check(obj);
3700 #include <functional>
3704 struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool>
3707 operator()(PyObject * v, PyObject *w) const
3710 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3711 res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false;
3712 /* This may fall into a case of inconsistent
3713 eg. ObjA > ObjX > ObjB
3716 if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
3718 /* Objects can't be compared, this mostly occurred in Python 3.0 */
3719 /* Compare their ptr directly for a workaround */
3723 SWIG_PYTHON_THREAD_END_BLOCK;
3729 struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool>
3732 operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const
3734 return std::less<PyObject *>()(v, w);
3739 struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool>
3742 operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const
3744 return std::less<PyObject *>()(v, w);
3751 template <> struct traits<PyObject *> {
3752 typedef value_category category;
3753 static const char* type_name() { return "PyObject *"; }
3756 template <> struct traits_asval<PyObject * > {
3757 typedef PyObject * value_type;
3758 static int asval(PyObject *obj, value_type *val) {
3759 if (val) *val = obj;
3765 struct traits_check<PyObject *, value_category> {
3766 static bool check(PyObject *) {
3771 template <> struct traits_from<PyObject *> {
3772 typedef PyObject * value_type;
3773 static PyObject *from(const value_type& val) {
3782 template <class Difference>
3784 check_index(Difference i, size_t size, bool insert = false) {
3786 if ((size_t) (-i) <= size)
3787 return (size_t) (i + size);
3788 } else if ( (size_t) i < size ) {
3790 } else if (insert && ((size_t) i == size)) {
3793 throw std::out_of_range("index out of range");
3796 template <class Difference>
3798 slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) {
3800 throw std::invalid_argument("slice step cannot be zero");
3801 } else if (step > 0) {
3802 // Required range: 0 <= i < size, 0 <= j < size
3805 } else if (i < (Difference)size) {
3807 } else if (insert && (i >= (Difference)size)) {
3808 ii = (Difference)size;
3813 jj = (j < (Difference)size) ? j : (Difference)size;
3816 // Required range: -1 <= i < size-1, -1 <= j < size-1
3819 } else if (i < (Difference) size) {
3821 } else if (i >= (Difference)(size-1)) {
3822 ii = (Difference)(size-1);
3827 jj = (j < (Difference)size ) ? j : (Difference)(size-1);
3832 template <class Sequence, class Difference>
3833 inline typename Sequence::iterator
3834 getpos(Sequence* self, Difference i) {
3835 typename Sequence::iterator pos = self->begin();
3836 std::advance(pos, check_index(i,self->size()));
3840 template <class Sequence, class Difference>
3841 inline typename Sequence::const_iterator
3842 cgetpos(const Sequence* self, Difference i) {
3843 typename Sequence::const_iterator pos = self->begin();
3844 std::advance(pos, check_index(i,self->size()));
3848 template <class Sequence, class Difference>
3850 getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) {
3851 typename Sequence::size_type size = self->size();
3854 swig::slice_adjust(i, j, step, size, ii, jj);
3857 typename Sequence::const_iterator sb = self->begin();
3858 typename Sequence::const_iterator se = self->begin();
3859 std::advance(sb,ii);
3860 std::advance(se,jj);
3862 return new Sequence(sb, se);
3864 Sequence *sequence = new Sequence();
3865 typename Sequence::const_iterator it = sb;
3867 sequence->push_back(*it);
3868 for (Py_ssize_t c=0; c<step && it!=se; ++c)
3874 Sequence *sequence = new Sequence();
3876 typename Sequence::const_reverse_iterator sb = self->rbegin();
3877 typename Sequence::const_reverse_iterator se = self->rbegin();
3878 std::advance(sb,size-ii-1);
3879 std::advance(se,size-jj-1);
3880 typename Sequence::const_reverse_iterator it = sb;
3882 sequence->push_back(*it);
3883 for (Py_ssize_t c=0; c<-step && it!=se; ++c)
3891 template <class Sequence, class Difference, class InputSeq>
3893 setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) {
3894 typename Sequence::size_type size = self->size();
3897 swig::slice_adjust(i, j, step, size, ii, jj, true);
3902 size_t ssize = jj - ii;
3903 if (ssize <= is.size()) {
3904 // expanding/staying the same size
3905 typename Sequence::iterator sb = self->begin();
3906 typename InputSeq::const_iterator isit = is.begin();
3907 std::advance(sb,ii);
3908 std::advance(isit, jj - ii);
3909 self->insert(std::copy(is.begin(), isit, sb), isit, is.end());
3912 typename Sequence::iterator sb = self->begin();
3913 typename Sequence::iterator se = self->begin();
3914 std::advance(sb,ii);
3915 std::advance(se,jj);
3918 std::advance(sb,ii);
3919 self->insert(sb, is.begin(), is.end());
3922 size_t replacecount = (jj - ii + step - 1) / step;
3923 if (is.size() != replacecount) {
3925 sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount);
3926 throw std::invalid_argument(msg);
3928 typename Sequence::const_iterator isit = is.begin();
3929 typename Sequence::iterator it = self->begin();
3930 std::advance(it,ii);
3931 for (size_t rc=0; rc<replacecount; ++rc) {
3933 for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
3940 size_t replacecount = (ii - jj - step - 1) / -step;
3941 if (is.size() != replacecount) {
3943 sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount);
3944 throw std::invalid_argument(msg);
3946 typename Sequence::const_iterator isit = is.begin();
3947 typename Sequence::reverse_iterator it = self->rbegin();
3948 std::advance(it,size-ii-1);
3949 for (size_t rc=0; rc<replacecount; ++rc) {
3951 for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
3957 template <class Sequence, class Difference>
3959 delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) {
3960 typename Sequence::size_type size = self->size();
3963 swig::slice_adjust(i, j, step, size, ii, jj, true);
3966 typename Sequence::iterator sb = self->begin();
3967 std::advance(sb,ii);
3969 typename Sequence::iterator se = self->begin();
3970 std::advance(se,jj);
3973 typename Sequence::iterator it = sb;
3974 size_t delcount = (jj - ii + step - 1) / step;
3976 it = self->erase(it);
3977 for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
3985 typename Sequence::reverse_iterator sb = self->rbegin();
3986 std::advance(sb,size-ii-1);
3987 typename Sequence::reverse_iterator it = sb;
3988 size_t delcount = (ii - jj - step - 1) / -step;
3990 it = typename Sequence::reverse_iterator(self->erase((++it).base()));
3991 for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
4001 #if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
4002 # if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
4003 # define SWIG_STD_NOITERATOR_TRAITS_STL
4007 #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
4011 template <class Iterator>
4012 struct iterator_traits {
4013 typedef ptrdiff_t difference_type;
4014 typedef typename Iterator::value_type value_type;
4017 template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
4018 struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
4019 typedef Distance difference_type;
4020 typedef T value_type;
4024 struct iterator_traits<T*> {
4025 typedef T value_type;
4026 typedef ptrdiff_t difference_type;
4029 template<typename _InputIterator>
4030 inline typename iterator_traits<_InputIterator>::difference_type
4031 distance(_InputIterator __first, _InputIterator __last)
4033 typename iterator_traits<_InputIterator>::difference_type __n = 0;
4034 while (__first != __last) {
4044 template<typename OutIterator>
4045 class SwigPyIterator_T : public SwigPyIterator
4048 typedef OutIterator out_iterator;
4049 typedef typename std::iterator_traits<out_iterator>::value_type value_type;
4050 typedef SwigPyIterator_T<out_iterator> self_type;
4052 SwigPyIterator_T(out_iterator curr, PyObject *seq)
4053 : SwigPyIterator(seq), current(curr)
4057 const out_iterator& get_current() const
4063 bool equal (const SwigPyIterator &iter) const
4065 const self_type *iters = dynamic_cast<const self_type *>(&iter);
4067 return (current == iters->get_current());
4069 throw std::invalid_argument("bad iterator type");
4073 ptrdiff_t distance(const SwigPyIterator &iter) const
4075 const self_type *iters = dynamic_cast<const self_type *>(&iter);
4077 return std::distance(current, iters->get_current());
4079 throw std::invalid_argument("bad iterator type");
4084 out_iterator current;
4087 template <class ValueType>
4090 typedef const ValueType& argument_type;
4091 typedef PyObject *result_type;
4092 result_type operator()(argument_type v) const
4094 return swig::from(v);
4098 template<typename OutIterator,
4099 typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
4100 typename FromOper = from_oper<ValueType> >
4101 class SwigPyIteratorOpen_T : public SwigPyIterator_T<OutIterator>
4105 typedef OutIterator out_iterator;
4106 typedef ValueType value_type;
4107 typedef SwigPyIterator_T<out_iterator> base;
4108 typedef SwigPyIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
4110 SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq)
4111 : SwigPyIterator_T<OutIterator>(curr, seq)
4115 PyObject *value() const {
4116 return from(static_cast<const value_type&>(*(base::current)));
4119 SwigPyIterator *copy() const
4121 return new self_type(*this);
4124 SwigPyIterator *incr(size_t n = 1)
4132 SwigPyIterator *decr(size_t n = 1)
4141 template<typename OutIterator,
4142 typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
4143 typename FromOper = from_oper<ValueType> >
4144 class SwigPyIteratorClosed_T : public SwigPyIterator_T<OutIterator>
4148 typedef OutIterator out_iterator;
4149 typedef ValueType value_type;
4150 typedef SwigPyIterator_T<out_iterator> base;
4151 typedef SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
4153 SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq)
4154 : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last)
4158 PyObject *value() const {
4159 if (base::current == end) {
4160 throw stop_iteration();
4162 return from(static_cast<const value_type&>(*(base::current)));
4166 SwigPyIterator *copy() const
4168 return new self_type(*this);
4171 SwigPyIterator *incr(size_t n = 1)
4174 if (base::current == end) {
4175 throw stop_iteration();
4183 SwigPyIterator *decr(size_t n = 1)
4186 if (base::current == begin) {
4187 throw stop_iteration();
4200 template<typename OutIter>
4201 inline SwigPyIterator*
4202 make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0)
4204 return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
4207 template<typename OutIter>
4208 inline SwigPyIterator*
4209 make_output_iterator(const OutIter& current, PyObject *seq = 0)
4211 return new SwigPyIteratorOpen_T<OutIter>(current, seq);
4220 struct SwigPySequence_Ref
4222 SwigPySequence_Ref(PyObject* seq, int index)
4223 : _seq(seq), _index(index)
4229 swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
4231 return swig::as<T>(item, true);
4232 } catch (std::exception& e) {
4234 sprintf(msg, "in sequence element %d ", _index);
4235 if (!PyErr_Occurred()) {
4236 ::SWIG_Error(SWIG_TypeError, swig::type_name<T>());
4238 SWIG_Python_AddErrorMsg(msg);
4239 SWIG_Python_AddErrorMsg(e.what());
4244 SwigPySequence_Ref& operator=(const T& v)
4246 PySequence_SetItem(_seq, _index, swig::from<T>(v));
4256 struct SwigPySequence_ArrowProxy
4258 SwigPySequence_ArrowProxy(const T& x): m_value(x) {}
4259 const T* operator->() const { return &m_value; }
4260 operator const T*() const { return &m_value; }
4264 template <class T, class Reference >
4265 struct SwigPySequence_InputIterator
4267 typedef SwigPySequence_InputIterator<T, Reference > self;
4269 typedef std::random_access_iterator_tag iterator_category;
4270 typedef Reference reference;
4271 typedef T value_type;
4273 typedef int difference_type;
4275 SwigPySequence_InputIterator()
4279 SwigPySequence_InputIterator(PyObject* seq, int index)
4280 : _seq(seq), _index(index)
4284 reference operator*() const
4286 return reference(_seq, _index);
4289 SwigPySequence_ArrowProxy<T>
4290 operator->() const {
4291 return SwigPySequence_ArrowProxy<T>(operator*());
4294 bool operator==(const self& ri) const
4296 return (_index == ri._index) && (_seq == ri._seq);
4299 bool operator!=(const self& ri) const
4301 return !(operator==(ri));
4304 self& operator ++ ()
4310 self& operator -- ()
4316 self& operator += (difference_type n)
4322 self operator +(difference_type n) const
4324 return self(_seq, _index + n);
4327 self& operator -= (difference_type n)
4333 self operator -(difference_type n) const
4335 return self(_seq, _index - n);
4338 difference_type operator - (const self& ri) const
4340 return _index - ri._index;
4343 bool operator < (const self& ri) const
4345 return _index < ri._index;
4349 operator[](difference_type n) const
4351 return reference(_seq, _index + n);
4356 difference_type _index;
4360 struct SwigPySequence_Cont
4362 typedef SwigPySequence_Ref<T> reference;
4363 typedef const SwigPySequence_Ref<T> const_reference;
4364 typedef T value_type;
4366 typedef int difference_type;
4367 typedef int size_type;
4368 typedef const pointer const_pointer;
4369 typedef SwigPySequence_InputIterator<T, reference> iterator;
4370 typedef SwigPySequence_InputIterator<T, const_reference> const_iterator;
4372 SwigPySequence_Cont(PyObject* seq) : _seq(0)
4374 if (!PySequence_Check(seq)) {
4375 throw std::invalid_argument("a sequence is expected");
4381 ~SwigPySequence_Cont()
4386 size_type size() const
4388 return static_cast<size_type>(PySequence_Size(_seq));
4398 return iterator(_seq, 0);
4401 const_iterator begin() const
4403 return const_iterator(_seq, 0);
4408 return iterator(_seq, size());
4411 const_iterator end() const
4413 return const_iterator(_seq, size());
4416 reference operator[](difference_type n)
4418 return reference(_seq, n);
4421 const_reference operator[](difference_type n) const
4423 return const_reference(_seq, n);
4426 bool check(bool set_err = true) const
4429 for (int i = 0; i < s; ++i) {
4430 swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
4431 if (!swig::check<value_type>(item)) {
4434 sprintf(msg, "in sequence element %d", i);
4435 SWIG_Error(SWIG_RuntimeError, msg);
4450 #define SWIG_From_double PyFloat_FromDouble
4454 template <> struct traits<double > {
4455 typedef value_category category;
4456 static const char* type_name() { return"double"; }
4458 template <> struct traits_asval<double > {
4459 typedef double value_type;
4460 static int asval(PyObject *obj, value_type *val) {
4461 return SWIG_AsVal_double (obj, val);
4464 template <> struct traits_from<double > {
4465 typedef double value_type;
4466 static PyObject *from(const value_type& val) {
4467 return SWIG_From_double (val);
4474 template <class SwigPySeq, class Seq>
4476 assign(const SwigPySeq& swigpyseq, Seq* seq) {
4477 // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
4478 typedef typename SwigPySeq::value_type value_type;
4479 typename SwigPySeq::const_iterator it = swigpyseq.begin();
4480 for (;it != swigpyseq.end(); ++it) {
4481 seq->insert(seq->end(),(value_type)(*it));
4485 template <class Seq, class T = typename Seq::value_type >
4486 struct traits_asptr_stdseq {
4487 typedef Seq sequence;
4488 typedef T value_type;
4490 static int asptr(PyObject *obj, sequence **seq) {
4491 if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) {
4493 if (::SWIG_ConvertPtr(obj,(void**)&p,
4494 swig::type_info<sequence>(),0) == SWIG_OK) {
4498 } else if (PySequence_Check(obj)) {
4500 SwigPySequence_Cont<value_type> swigpyseq(obj);
4502 sequence *pseq = new sequence();
4503 assign(swigpyseq, pseq);
4507 return swigpyseq.check() ? SWIG_OK : SWIG_ERROR;
4509 } catch (std::exception& e) {
4511 if (!PyErr_Occurred()) {
4512 PyErr_SetString(PyExc_TypeError, e.what());
4522 template <class Seq, class T = typename Seq::value_type >
4523 struct traits_from_stdseq {
4524 typedef Seq sequence;
4525 typedef T value_type;
4526 typedef typename Seq::size_type size_type;
4527 typedef typename sequence::const_iterator const_iterator;
4529 static PyObject *from(const sequence& seq) {
4530 #ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS
4531 swig_type_info *desc = swig::type_info<sequence>();
4532 if (desc && desc->clientdata) {
4533 return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN);
4536 size_type size = seq.size();
4537 if (size <= (size_type)INT_MAX) {
4538 PyObject *obj = PyTuple_New((int)size);
4540 for (const_iterator it = seq.begin();
4541 it != seq.end(); ++it, ++i) {
4542 PyTuple_SetItem(obj,i,swig::from<value_type>(*it));
4546 PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python");
4556 struct traits_asptr<std::vector<T> > {
4557 static int asptr(PyObject *obj, std::vector<T> **vec) {
4558 return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec);
4563 struct traits_from<std::vector<T> > {
4564 static PyObject *from(const std::vector<T>& vec) {
4565 return traits_from_stdseq<std::vector<T> >::from(vec);
4572 template <> struct traits<std::vector<double, std::allocator< double > > > {
4573 typedef pointer_category category;
4574 static const char* type_name() {
4575 return "std::vector<" "double" "," "std::allocator< double >" " >";
4580 SWIGINTERN swig::SwigPyIterator *std_vector_Sl_double_Sg__iterator(std::vector< double > *self,PyObject **PYTHON_SELF){
4581 return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
4583 SWIGINTERN bool std_vector_Sl_double_Sg____nonzero__(std::vector< double > const *self){
4584 return !(self->empty());
4586 SWIGINTERN bool std_vector_Sl_double_Sg____bool__(std::vector< double > const *self){
4587 return !(self->empty());
4589 SWIGINTERN std::vector< double >::size_type std_vector_Sl_double_Sg____len__(std::vector< double > const *self){
4590 return self->size();
4593 SWIGINTERNINLINE PyObject*
4594 SWIG_From_unsigned_SS_long (unsigned long value)
4596 return (value > LONG_MAX) ?
4597 PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value));
4601 SWIGINTERNINLINE PyObject *
4602 SWIG_From_size_t (size_t value)
4604 return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
4607 SWIGINTERN std::vector< double >::value_type std_vector_Sl_double_Sg__pop(std::vector< double > *self){
4608 if (self->size() == 0)
4609 throw std::out_of_range("pop from empty container");
4610 std::vector<double,std::allocator< double > >::value_type x = self->back();
4614 SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg____getslice__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
4615 return swig::getslice(self, i, j, 1);
4617 SWIGINTERN void std_vector_Sl_double_Sg____setslice____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j,std::vector< double,std::allocator< double > > const &v=std::vector< double,std::allocator< double > >()){
4618 swig::setslice(self, i, j, 1, v);
4620 SWIGINTERN void std_vector_Sl_double_Sg____delslice__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
4621 swig::delslice(self, i, j, 1);
4623 SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i){
4624 self->erase(swig::getpos(self,i));
4626 SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg____getitem____SWIG_0(std::vector< double > *self,PySliceObject *slice){
4627 Py_ssize_t i, j, step;
4628 if( !PySlice_Check(slice) ) {
4629 SWIG_Error(SWIG_TypeError, "Slice object expected.");
4632 PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step);
4633 std::vector<double,std::allocator< double > >::difference_type id = i;
4634 std::vector<double,std::allocator< double > >::difference_type jd = j;
4635 return swig::getslice(self, id, jd, step);
4637 SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_0(std::vector< double > *self,PySliceObject *slice,std::vector< double,std::allocator< double > > const &v){
4638 Py_ssize_t i, j, step;
4639 if( !PySlice_Check(slice) ) {
4640 SWIG_Error(SWIG_TypeError, "Slice object expected.");
4643 PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step);
4644 std::vector<double,std::allocator< double > >::difference_type id = i;
4645 std::vector<double,std::allocator< double > >::difference_type jd = j;
4646 swig::setslice(self, id, jd, step, v);
4648 SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_1(std::vector< double > *self,PySliceObject *slice){
4649 Py_ssize_t i, j, step;
4650 if( !PySlice_Check(slice) ) {
4651 SWIG_Error(SWIG_TypeError, "Slice object expected.");
4654 PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step);
4655 std::vector<double,std::allocator< double > >::difference_type id = i;
4656 std::vector<double,std::allocator< double > >::difference_type jd = j;
4657 swig::delslice(self, id, jd, step);
4659 SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_1(std::vector< double > *self,PySliceObject *slice){
4660 Py_ssize_t i, j, step;
4661 if( !PySlice_Check(slice) ) {
4662 SWIG_Error(SWIG_TypeError, "Slice object expected.");
4665 PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step);
4666 std::vector<double,std::allocator< double > >::difference_type id = i;
4667 std::vector<double,std::allocator< double > >::difference_type jd = j;
4668 swig::delslice(self, id, jd, step);
4670 SWIGINTERN std::vector< double >::value_type const &std_vector_Sl_double_Sg____getitem____SWIG_1(std::vector< double > const *self,std::vector< double >::difference_type i){
4671 return *(swig::cgetpos(self, i));
4673 SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_2(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::value_type const &x){
4674 *(swig::getpos(self,i)) = x;
4676 SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector< double > *self,std::vector< double >::value_type const &x){
4679 SWIGINTERN std::vector< double >::iterator std_vector_Sl_double_Sg__erase__SWIG_0(std::vector< double > *self,std::vector< double >::iterator pos){ return self->erase(pos); }
4680 SWIGINTERN std::vector< double >::iterator std_vector_Sl_double_Sg__erase__SWIG_1(std::vector< double > *self,std::vector< double >::iterator first,std::vector< double >::iterator last){ return self->erase(first, last); }
4681 SWIGINTERN std::vector< double >::iterator std_vector_Sl_double_Sg__insert__SWIG_0(std::vector< double > *self,std::vector< double >::iterator pos,std::vector< double >::value_type const &x){ return self->insert(pos, x); }
4682 SWIGINTERN void std_vector_Sl_double_Sg__insert__SWIG_1(std::vector< double > *self,std::vector< double >::iterator pos,std::vector< double >::size_type n,std::vector< double >::value_type const &x){ self->insert(pos, n, x); }
4685 #define ExceptionSubclass(EXCNAME, EXCDOC) \
4686 static PyTypeObject MyExc_ ## EXCNAME = { \
4687 PyVarObject_HEAD_INIT(NULL, 0) \
4688 "nlopt." # EXCNAME, \
4689 sizeof(PyBaseExceptionObject), \
4690 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
4691 Py_TPFLAGS_DEFAULT, \
4694 static void init_ ## EXCNAME(PyObject *m) { \
4695 MyExc_ ## EXCNAME .tp_base = (PyTypeObject *) PyExc_Exception; \
4696 PyType_Ready(&MyExc_ ## EXCNAME); \
4697 Py_INCREF(&MyExc_ ## EXCNAME); \
4698 PyModule_AddObject(m, # EXCNAME, (PyObject *) &MyExc_ ## EXCNAME); \
4702 ExceptionSubclass(ForcedStop,
4703 "Python version of nlopt::forced_stop exception.")
4705 ExceptionSubclass(RoundoffLimited,
4706 "Python version of nlopt::roundoff_limited exception.")
4710 #define SWIG_FILE_WITH_INIT
4713 #ifndef SWIG_FILE_WITH_INIT
4714 #define NO_IMPORT_ARRAY
4717 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
4718 #include <numpy/arrayobject.h>
4721 static void *free_pyfunc(void *p) { Py_DECREF((PyObject*) p); return p; }
4722 static void *dup_pyfunc(void *p) { Py_INCREF((PyObject*) p); return p; }
4724 #if NPY_API_VERSION < 0x00000007
4725 # define NPY_ARRAY_C_CONTIGUOUS NPY_C_CONTIGUOUS
4726 # define NPY_ARRAY_ALIGNED NPY_ALIGNED
4729 static double func_python(unsigned n, const double *x, double *grad, void *f)
4731 npy_intp sz = npy_intp(n), sz0 = 0, stride1 = sizeof(double);
4732 PyObject *xpy = PyArray_New(&PyArray_Type, 1, &sz, NPY_DOUBLE, &stride1,
4733 const_cast<double*>(x), // not NPY_WRITEABLE
4734 0, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED, NULL);
4735 PyObject *gradpy = grad
4736 ? PyArray_SimpleNewFromData(1, &sz, NPY_DOUBLE, grad)
4737 : PyArray_SimpleNew(1, &sz0, NPY_DOUBLE);
4739 PyObject *arglist = Py_BuildValue("OO", xpy, gradpy);
4740 PyObject *result = PyEval_CallObject((PyObject *) f, arglist);
4746 double val = HUGE_VAL;
4747 if (PyErr_Occurred()) {
4749 throw nlopt::forced_stop(); // just stop, don't call PyErr_Clear()
4751 else if (result && PyFloat_Check(result)) {
4752 val = PyFloat_AsDouble(result);
4757 throw std::invalid_argument("invalid result passed to nlopt");
4762 static void mfunc_python(unsigned m, double *result,
4763 unsigned n, const double *x, double *grad, void *f)
4765 npy_intp nsz = npy_intp(n), msz = npy_intp(m);
4766 npy_intp mnsz[2] = {msz, nsz};
4767 npy_intp sz0 = 0, stride1 = sizeof(double);
4768 PyObject *xpy = PyArray_New(&PyArray_Type, 1, &nsz, NPY_DOUBLE, &stride1,
4769 const_cast<double*>(x), // not NPY_WRITEABLE
4770 0, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED, NULL);
4771 PyObject *rpy = PyArray_SimpleNewFromData(1, &msz, NPY_DOUBLE, result);
4772 PyObject *gradpy = grad
4773 ? PyArray_SimpleNewFromData(2, mnsz, NPY_DOUBLE, grad)
4774 : PyArray_SimpleNew(1, &sz0, NPY_DOUBLE);
4776 PyObject *arglist = Py_BuildValue("OOO", rpy, xpy, gradpy);
4777 PyObject *res = PyEval_CallObject((PyObject *) f, arglist);
4785 if (PyErr_Occurred()) {
4786 throw nlopt::forced_stop(); // just stop, don't call PyErr_Clear()
4791 SWIGINTERNINLINE PyObject*
4792 SWIG_From_int (int value)
4794 return PyInt_FromLong((long) value);
4799 #if !defined(SWIG_NO_LLONG_MAX)
4800 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
4801 # define LLONG_MAX __LONG_LONG_MAX__
4802 # define LLONG_MIN (-LLONG_MAX - 1LL)
4803 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
4809 SWIG_AsVal_int (PyObject * obj, int *val)
4812 int res = SWIG_AsVal_long (obj, &v);
4813 if (SWIG_IsOK(res)) {
4814 if ((v < INT_MIN || v > INT_MAX)) {
4815 return SWIG_OverflowError;
4817 if (val) *val = static_cast< int >(v);
4825 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
4828 int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
4829 if (SWIG_IsOK(res)) {
4830 if ((v > UINT_MAX)) {
4831 return SWIG_OverflowError;
4833 if (val) *val = static_cast< unsigned int >(v);
4840 #if NPY_API_VERSION < 0x00000007
4841 #define NPY_ARRAY_DEFAULT NPY_DEFAULT
4842 #define NPY_ARRAY_FARRAY NPY_FARRAY
4843 #define NPY_FORTRANORDER NPY_FORTRAN
4847 /* Macros to extract array attributes.
4849 #if NPY_API_VERSION < 0x00000007
4850 #define is_array(a) ((a) && PyArray_Check((PyArrayObject*)a))
4851 #define array_type(a) (int)(PyArray_TYPE((PyArrayObject*)a))
4852 #define array_numdims(a) (((PyArrayObject*)a)->nd)
4853 #define array_dimensions(a) (((PyArrayObject*)a)->dimensions)
4854 #define array_size(a,i) (((PyArrayObject*)a)->dimensions[i])
4855 #define array_strides(a) (((PyArrayObject*)a)->strides)
4856 #define array_stride(a,i) (((PyArrayObject*)a)->strides[i])
4857 #define array_data(a) (((PyArrayObject*)a)->data)
4858 #define array_descr(a) (((PyArrayObject*)a)->descr)
4859 #define array_flags(a) (((PyArrayObject*)a)->flags)
4860 #define array_enableflags(a,f) (((PyArrayObject*)a)->flags) = f
4862 #define is_array(a) ((a) && PyArray_Check(a))
4863 #define array_type(a) PyArray_TYPE((PyArrayObject*)a)
4864 #define array_numdims(a) PyArray_NDIM((PyArrayObject*)a)
4865 #define array_dimensions(a) PyArray_DIMS((PyArrayObject*)a)
4866 #define array_strides(a) PyArray_STRIDES((PyArrayObject*)a)
4867 #define array_stride(a,i) PyArray_STRIDE((PyArrayObject*)a,i)
4868 #define array_size(a,i) PyArray_DIM((PyArrayObject*)a,i)
4869 #define array_data(a) PyArray_DATA((PyArrayObject*)a)
4870 #define array_descr(a) PyArray_DESCR((PyArrayObject*)a)
4871 #define array_flags(a) PyArray_FLAGS((PyArrayObject*)a)
4872 #define array_enableflags(a,f) PyArray_ENABLEFLAGS((PyArrayObject*)a,f)
4874 #define array_is_contiguous(a) (PyArray_ISCONTIGUOUS((PyArrayObject*)a))
4875 #define array_is_native(a) (PyArray_ISNOTSWAPPED((PyArrayObject*)a))
4876 #define array_is_fortran(a) (PyArray_ISFORTRAN((PyArrayObject*)a))
4879 /* Given a PyObject, return a string describing its type.
4881 const char* pytype_string(PyObject* py_obj)
4883 if (py_obj == NULL ) return "C NULL value";
4884 if (py_obj == Py_None ) return "Python None" ;
4885 if (PyCallable_Check(py_obj)) return "callable" ;
4886 if (PyString_Check( py_obj)) return "string" ;
4887 if (PyInt_Check( py_obj)) return "int" ;
4888 if (PyFloat_Check( py_obj)) return "float" ;
4889 if (PyDict_Check( py_obj)) return "dict" ;
4890 if (PyList_Check( py_obj)) return "list" ;
4891 if (PyTuple_Check( py_obj)) return "tuple" ;
4892 #if PY_MAJOR_VERSION < 3
4893 if (PyFile_Check( py_obj)) return "file" ;
4894 if (PyModule_Check( py_obj)) return "module" ;
4895 if (PyInstance_Check(py_obj)) return "instance" ;
4898 return "unknown type";
4901 /* Given a NumPy typecode, return a string describing the type.
4903 const char* typecode_string(int typecode)
4905 static const char* type_names[25] = {"bool",
4915 "unsigned long long",
4921 "complex long double",
4930 return typecode < 24 ? type_names[typecode] : type_names[24];
4933 /* Make sure input has correct numpy type. This now just calls
4934 PyArray_EquivTypenums().
4936 int type_match(int actual_type,
4939 return PyArray_EquivTypenums(actual_type, desired_type);
4942 #ifdef SWIGPY_USE_CAPSULE
4943 void free_cap(PyObject * cap)
4945 void* array = (void*) PyCapsule_GetPointer(cap,SWIGPY_CAPSULE_NAME);
4946 if (array != NULL) free(array);
4953 /* Given a PyObject pointer, cast it to a PyArrayObject pointer if
4954 * legal. If not, set the python error string appropriately and
4957 PyArrayObject* obj_to_array_no_conversion(PyObject* input,
4960 PyArrayObject* ary = NULL;
4961 if (is_array(input) && (typecode == NPY_NOTYPE ||
4962 PyArray_EquivTypenums(array_type(input), typecode)))
4964 ary = (PyArrayObject*) input;
4966 else if is_array(input)
4968 const char* desired_type = typecode_string(typecode);
4969 const char* actual_type = typecode_string(array_type(input));
4970 PyErr_Format(PyExc_TypeError,
4971 "Array of type '%s' required. Array of type '%s' given",
4972 desired_type, actual_type);
4977 const char* desired_type = typecode_string(typecode);
4978 const char* actual_type = pytype_string(input);
4979 PyErr_Format(PyExc_TypeError,
4980 "Array of type '%s' required. A '%s' was given",
4988 /* Convert the given PyObject to a NumPy array with the given
4989 * typecode. On success, return a valid PyArrayObject* with the
4990 * correct type. On failure, the python error string will be set and
4991 * the routine returns NULL.
4993 PyArrayObject* obj_to_array_allow_conversion(PyObject* input,
4997 PyArrayObject* ary = NULL;
4999 if (is_array(input) && (typecode == NPY_NOTYPE ||
5000 PyArray_EquivTypenums(array_type(input),typecode)))
5002 ary = (PyArrayObject*) input;
5007 py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_ARRAY_DEFAULT);
5008 /* If NULL, PyArray_FromObject will have set python error value.*/
5009 ary = (PyArrayObject*) py_obj;
5015 /* Given a PyArrayObject, check to see if it is contiguous. If so,
5016 * return the input pointer and flag it as not a new object. If it is
5017 * not contiguous, create a new PyArrayObject using the original data,
5018 * flag it as a new object and return the pointer.
5020 PyArrayObject* make_contiguous(PyArrayObject* ary,
5025 PyArrayObject* result;
5026 if (array_is_contiguous(ary))
5033 result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary,
5042 /* Given a PyArrayObject, check to see if it is Fortran-contiguous.
5043 * If so, return the input pointer, but do not flag it as not a new
5044 * object. If it is not Fortran-contiguous, create a new
5045 * PyArrayObject using the original data, flag it as a new object
5046 * and return the pointer.
5048 PyArrayObject* make_fortran(PyArrayObject* ary,
5051 PyArrayObject* result;
5052 if (array_is_fortran(ary))
5059 Py_INCREF(array_descr(ary));
5060 result = (PyArrayObject*) PyArray_FromArray(ary,
5068 /* Convert a given PyObject to a contiguous PyArrayObject of the
5069 * specified type. If the input object is not a contiguous
5070 * PyArrayObject, a new one will be created and the new object flag
5073 PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
5079 PyArrayObject* ary2;
5080 PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
5085 ary2 = make_contiguous(ary1, &is_new2, 0, 0);
5086 if ( is_new1 && is_new2)
5092 *is_new_object = is_new1 || is_new2;
5096 /* Convert a given PyObject to a Fortran-ordered PyArrayObject of the
5097 * specified type. If the input object is not a Fortran-ordered
5098 * PyArrayObject, a new one will be created and the new object flag
5101 PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input,
5107 PyArrayObject* ary2;
5108 PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
5113 ary2 = make_fortran(ary1, &is_new2);
5114 if (is_new1 && is_new2)
5120 *is_new_object = is_new1 || is_new2;
5125 /* Test whether a python object is contiguous. If array is
5126 * contiguous, return 1. Otherwise, set the python error string and
5129 int require_contiguous(PyArrayObject* ary)
5132 if (!array_is_contiguous(ary))
5134 PyErr_SetString(PyExc_TypeError,
5135 "Array must be contiguous. A non-contiguous array was given");
5141 /* Require that a numpy array is not byte-swapped. If the array is
5142 * not byte-swapped, return 1. Otherwise, set the python error string
5145 int require_native(PyArrayObject* ary)
5148 if (!array_is_native(ary))
5150 PyErr_SetString(PyExc_TypeError,
5151 "Array must have native byteorder. "
5152 "A byte-swapped array was given");
5158 /* Require the given PyArrayObject to have a specified number of
5159 * dimensions. If the array has the specified number of dimensions,
5160 * return 1. Otherwise, set the python error string and return 0.
5162 int require_dimensions(PyArrayObject* ary,
5163 int exact_dimensions)
5166 if (array_numdims(ary) != exact_dimensions)
5168 PyErr_Format(PyExc_TypeError,
5169 "Array must have %d dimensions. Given array has %d dimensions",
5171 array_numdims(ary));
5177 /* Require the given PyArrayObject to have one of a list of specified
5178 * number of dimensions. If the array has one of the specified number
5179 * of dimensions, return 1. Otherwise, set the python error string
5182 int require_dimensions_n(PyArrayObject* ary,
5183 int* exact_dimensions,
5188 char dims_str[255] = "";
5190 for (i = 0; i < n && !success; i++)
5192 if (array_numdims(ary) == exact_dimensions[i])
5199 for (i = 0; i < n-1; i++)
5201 sprintf(s, "%d, ", exact_dimensions[i]);
5204 sprintf(s, " or %d", exact_dimensions[n-1]);
5206 PyErr_Format(PyExc_TypeError,
5207 "Array must have %s dimensions. Given array has %d dimensions",
5209 array_numdims(ary));
5214 /* Require the given PyArrayObject to have a specified shape. If the
5215 * array has the specified shape, return 1. Otherwise, set the python
5216 * error string and return 0.
5218 int require_size(PyArrayObject* ary,
5225 char desired_dims[255] = "[";
5227 char actual_dims[255] = "[";
5230 if (size[i] != -1 && size[i] != array_size(ary,i))
5237 for (i = 0; i < n; i++)
5245 sprintf(s, "%ld,", (long int)size[i]);
5247 strcat(desired_dims,s);
5249 len = strlen(desired_dims);
5250 desired_dims[len-1] = ']';
5251 for (i = 0; i < n; i++)
5253 sprintf(s, "%ld,", (long int)array_size(ary,i));
5254 strcat(actual_dims,s);
5256 len = strlen(actual_dims);
5257 actual_dims[len-1] = ']';
5258 PyErr_Format(PyExc_TypeError,
5259 "Array must have shape of %s. Given array has shape of %s",
5266 /* Require the given PyArrayObject to to be Fortran ordered. If the
5267 * the PyArrayObject is already Fortran ordered, do nothing. Else,
5268 * set the Fortran ordering flag and recompute the strides.
5270 int require_fortran(PyArrayObject* ary)
5273 int nd = array_numdims(ary);
5275 npy_intp * strides = array_strides(ary);
5276 if (array_is_fortran(ary)) return success;
5277 /* Set the Fortran ordered flag */
5278 array_enableflags(ary,NPY_ARRAY_FARRAY);
5279 /* Recompute the strides */
5280 strides[0] = strides[nd-1];
5281 for (i=1; i < nd; ++i)
5282 strides[i] = strides[i-1] * array_size(ary,i-1);
5289 SWIGINTERN swig_type_info*
5290 SWIG_pchar_descriptor(void)
5292 static int init = 0;
5293 static swig_type_info* info = 0;
5295 info = SWIG_TypeQuery("_p_char");
5302 SWIGINTERNINLINE PyObject *
5303 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
5306 if (size > INT_MAX) {
5307 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
5308 return pchar_descriptor ?
5309 SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
5311 #if PY_VERSION_HEX >= 0x03000000
5312 return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
5314 return PyString_FromStringAndSize(carray, static_cast< int >(size));
5318 return SWIG_Py_Void();
5323 SWIGINTERNINLINE PyObject *
5324 SWIG_FromCharPtr(const char *cptr)
5326 return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
5330 SWIGINTERNINLINE PyObject*
5331 SWIG_From_unsigned_SS_int (unsigned int value)
5333 return PyInt_FromSize_t((size_t) value);
5339 SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5340 PyObject *resultobj = 0;
5341 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5344 PyObject * obj0 = 0 ;
5346 if (!PyArg_ParseTuple(args,(char *)"O:delete_SwigPyIterator",&obj0)) SWIG_fail;
5347 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
5348 if (!SWIG_IsOK(res1)) {
5349 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5351 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5353 resultobj = SWIG_Py_Void();
5360 SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5361 PyObject *resultobj = 0;
5362 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5365 PyObject * obj0 = 0 ;
5366 PyObject *result = 0 ;
5368 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_value",&obj0)) SWIG_fail;
5369 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5370 if (!SWIG_IsOK(res1)) {
5371 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5373 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5375 result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
5377 catch(swig::stop_iteration &_e) {
5380 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5392 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5393 PyObject *resultobj = 0;
5394 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5400 PyObject * obj0 = 0 ;
5401 PyObject * obj1 = 0 ;
5402 swig::SwigPyIterator *result = 0 ;
5404 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_incr",&obj0,&obj1)) SWIG_fail;
5405 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5406 if (!SWIG_IsOK(res1)) {
5407 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5409 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5410 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5411 if (!SWIG_IsOK(ecode2)) {
5412 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'");
5414 arg2 = static_cast< size_t >(val2);
5416 result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
5418 catch(swig::stop_iteration &_e) {
5421 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5426 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5433 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5434 PyObject *resultobj = 0;
5435 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5438 PyObject * obj0 = 0 ;
5439 swig::SwigPyIterator *result = 0 ;
5441 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_incr",&obj0)) SWIG_fail;
5442 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5443 if (!SWIG_IsOK(res1)) {
5444 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5446 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5448 result = (swig::SwigPyIterator *)(arg1)->incr();
5450 catch(swig::stop_iteration &_e) {
5453 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5458 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5465 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
5470 if (!PyTuple_Check(args)) SWIG_fail;
5471 argc = args ? (int)PyObject_Length(args) : 0;
5472 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
5473 argv[ii] = PyTuple_GET_ITEM(args,ii);
5478 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5479 _v = SWIG_CheckState(res);
5481 return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
5487 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5488 _v = SWIG_CheckState(res);
5491 int res = SWIG_AsVal_size_t(argv[1], NULL);
5492 _v = SWIG_CheckState(res);
5495 return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
5501 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_incr'.\n"
5502 " Possible C/C++ prototypes are:\n"
5503 " swig::SwigPyIterator::incr(size_t)\n"
5504 " swig::SwigPyIterator::incr()\n");
5509 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5510 PyObject *resultobj = 0;
5511 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5517 PyObject * obj0 = 0 ;
5518 PyObject * obj1 = 0 ;
5519 swig::SwigPyIterator *result = 0 ;
5521 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_decr",&obj0,&obj1)) SWIG_fail;
5522 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5523 if (!SWIG_IsOK(res1)) {
5524 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5526 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5527 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5528 if (!SWIG_IsOK(ecode2)) {
5529 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'");
5531 arg2 = static_cast< size_t >(val2);
5533 result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
5535 catch(swig::stop_iteration &_e) {
5538 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5543 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5550 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5551 PyObject *resultobj = 0;
5552 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5555 PyObject * obj0 = 0 ;
5556 swig::SwigPyIterator *result = 0 ;
5558 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_decr",&obj0)) SWIG_fail;
5559 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5560 if (!SWIG_IsOK(res1)) {
5561 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5563 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5565 result = (swig::SwigPyIterator *)(arg1)->decr();
5567 catch(swig::stop_iteration &_e) {
5570 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5575 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5582 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
5587 if (!PyTuple_Check(args)) SWIG_fail;
5588 argc = args ? (int)PyObject_Length(args) : 0;
5589 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
5590 argv[ii] = PyTuple_GET_ITEM(args,ii);
5595 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5596 _v = SWIG_CheckState(res);
5598 return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
5604 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5605 _v = SWIG_CheckState(res);
5608 int res = SWIG_AsVal_size_t(argv[1], NULL);
5609 _v = SWIG_CheckState(res);
5612 return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
5618 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_decr'.\n"
5619 " Possible C/C++ prototypes are:\n"
5620 " swig::SwigPyIterator::decr(size_t)\n"
5621 " swig::SwigPyIterator::decr()\n");
5626 SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5627 PyObject *resultobj = 0;
5628 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5629 swig::SwigPyIterator *arg2 = 0 ;
5634 PyObject * obj0 = 0 ;
5635 PyObject * obj1 = 0 ;
5638 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_distance",&obj0,&obj1)) SWIG_fail;
5639 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5640 if (!SWIG_IsOK(res1)) {
5641 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5643 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5644 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
5645 if (!SWIG_IsOK(res2)) {
5646 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5649 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5651 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5653 result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
5655 catch(std::invalid_argument &_e) {
5656 SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
5659 resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
5666 SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5667 PyObject *resultobj = 0;
5668 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5669 swig::SwigPyIterator *arg2 = 0 ;
5674 PyObject * obj0 = 0 ;
5675 PyObject * obj1 = 0 ;
5678 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_equal",&obj0,&obj1)) SWIG_fail;
5679 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5680 if (!SWIG_IsOK(res1)) {
5681 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5683 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5684 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
5685 if (!SWIG_IsOK(res2)) {
5686 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5689 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5691 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5693 result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
5695 catch(std::invalid_argument &_e) {
5696 SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
5699 resultobj = SWIG_From_bool(static_cast< bool >(result));
5706 SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5707 PyObject *resultobj = 0;
5708 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5711 PyObject * obj0 = 0 ;
5712 swig::SwigPyIterator *result = 0 ;
5714 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_copy",&obj0)) SWIG_fail;
5715 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5716 if (!SWIG_IsOK(res1)) {
5717 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5719 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5720 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy();
5721 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
5728 SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5729 PyObject *resultobj = 0;
5730 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5733 PyObject * obj0 = 0 ;
5734 PyObject *result = 0 ;
5736 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_next",&obj0)) SWIG_fail;
5737 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5738 if (!SWIG_IsOK(res1)) {
5739 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5741 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5743 result = (PyObject *)(arg1)->next();
5745 catch(swig::stop_iteration &_e) {
5748 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5760 SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5761 PyObject *resultobj = 0;
5762 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5765 PyObject * obj0 = 0 ;
5766 PyObject *result = 0 ;
5768 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator___next__",&obj0)) SWIG_fail;
5769 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5770 if (!SWIG_IsOK(res1)) {
5771 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5773 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5775 result = (PyObject *)(arg1)->__next__();
5777 catch(swig::stop_iteration &_e) {
5780 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5792 SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5793 PyObject *resultobj = 0;
5794 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5797 PyObject * obj0 = 0 ;
5798 PyObject *result = 0 ;
5800 if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_previous",&obj0)) SWIG_fail;
5801 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5802 if (!SWIG_IsOK(res1)) {
5803 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5805 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5807 result = (PyObject *)(arg1)->previous();
5809 catch(swig::stop_iteration &_e) {
5812 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5824 SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5825 PyObject *resultobj = 0;
5826 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5832 PyObject * obj0 = 0 ;
5833 PyObject * obj1 = 0 ;
5834 swig::SwigPyIterator *result = 0 ;
5836 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_advance",&obj0,&obj1)) SWIG_fail;
5837 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5838 if (!SWIG_IsOK(res1)) {
5839 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5841 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5842 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
5843 if (!SWIG_IsOK(ecode2)) {
5844 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
5846 arg2 = static_cast< ptrdiff_t >(val2);
5848 result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
5850 catch(swig::stop_iteration &_e) {
5853 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5858 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5865 SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5866 PyObject *resultobj = 0;
5867 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5868 swig::SwigPyIterator *arg2 = 0 ;
5873 PyObject * obj0 = 0 ;
5874 PyObject * obj1 = 0 ;
5877 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___eq__",&obj0,&obj1)) SWIG_fail;
5878 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5879 if (!SWIG_IsOK(res1)) {
5880 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5882 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5883 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
5884 if (!SWIG_IsOK(res2)) {
5885 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5888 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5890 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5891 result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2);
5892 resultobj = SWIG_From_bool(static_cast< bool >(result));
5899 SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5900 PyObject *resultobj = 0;
5901 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5902 swig::SwigPyIterator *arg2 = 0 ;
5907 PyObject * obj0 = 0 ;
5908 PyObject * obj1 = 0 ;
5911 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___ne__",&obj0,&obj1)) SWIG_fail;
5912 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5913 if (!SWIG_IsOK(res1)) {
5914 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5916 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5917 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
5918 if (!SWIG_IsOK(res2)) {
5919 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5922 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5924 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5925 result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2);
5926 resultobj = SWIG_From_bool(static_cast< bool >(result));
5933 SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5934 PyObject *resultobj = 0;
5935 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5941 PyObject * obj0 = 0 ;
5942 PyObject * obj1 = 0 ;
5943 swig::SwigPyIterator *result = 0 ;
5945 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___iadd__",&obj0,&obj1)) SWIG_fail;
5946 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
5947 if (!SWIG_IsOK(res1)) {
5948 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5950 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5951 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
5952 if (!SWIG_IsOK(ecode2)) {
5953 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
5955 arg2 = static_cast< ptrdiff_t >(val2);
5957 result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
5959 catch(swig::stop_iteration &_e) {
5962 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5967 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
5974 SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5975 PyObject *resultobj = 0;
5976 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5982 PyObject * obj0 = 0 ;
5983 PyObject * obj1 = 0 ;
5984 swig::SwigPyIterator *result = 0 ;
5986 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___isub__",&obj0,&obj1)) SWIG_fail;
5987 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
5988 if (!SWIG_IsOK(res1)) {
5989 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
5991 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5992 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
5993 if (!SWIG_IsOK(ecode2)) {
5994 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
5996 arg2 = static_cast< ptrdiff_t >(val2);
5998 result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
6000 catch(swig::stop_iteration &_e) {
6003 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6008 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
6015 SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6016 PyObject *resultobj = 0;
6017 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
6023 PyObject * obj0 = 0 ;
6024 PyObject * obj1 = 0 ;
6025 swig::SwigPyIterator *result = 0 ;
6027 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___add__",&obj0,&obj1)) SWIG_fail;
6028 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
6029 if (!SWIG_IsOK(res1)) {
6030 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
6032 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
6033 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6034 if (!SWIG_IsOK(ecode2)) {
6035 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
6037 arg2 = static_cast< ptrdiff_t >(val2);
6039 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
6041 catch(swig::stop_iteration &_e) {
6044 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6049 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
6056 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6057 PyObject *resultobj = 0;
6058 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
6064 PyObject * obj0 = 0 ;
6065 PyObject * obj1 = 0 ;
6066 swig::SwigPyIterator *result = 0 ;
6068 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
6069 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
6070 if (!SWIG_IsOK(res1)) {
6071 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
6073 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
6074 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6075 if (!SWIG_IsOK(ecode2)) {
6076 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
6078 arg2 = static_cast< ptrdiff_t >(val2);
6080 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
6082 catch(swig::stop_iteration &_e) {
6085 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6090 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
6097 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6098 PyObject *resultobj = 0;
6099 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
6100 swig::SwigPyIterator *arg2 = 0 ;
6105 PyObject * obj0 = 0 ;
6106 PyObject * obj1 = 0 ;
6109 if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
6110 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
6111 if (!SWIG_IsOK(res1)) {
6112 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
6114 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
6115 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
6116 if (!SWIG_IsOK(res2)) {
6117 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
6120 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
6122 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
6123 result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2);
6124 resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
6131 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
6136 if (!PyTuple_Check(args)) SWIG_fail;
6137 argc = args ? (int)PyObject_Length(args) : 0;
6138 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
6139 argv[ii] = PyTuple_GET_ITEM(args,ii);
6144 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
6145 _v = SWIG_CheckState(res);
6147 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
6148 _v = SWIG_CheckState(res);
6150 return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
6157 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
6158 _v = SWIG_CheckState(res);
6161 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6162 _v = SWIG_CheckState(res);
6165 return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
6171 Py_INCREF(Py_NotImplemented);
6172 return Py_NotImplemented;
6176 SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6178 if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
6179 SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj));
6180 return SWIG_Py_Void();
6183 SWIGINTERN PyObject *_wrap_nlopt_doublevector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6184 PyObject *resultobj = 0;
6185 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6186 PyObject **arg2 = (PyObject **) 0 ;
6189 PyObject * obj0 = 0 ;
6190 swig::SwigPyIterator *result = 0 ;
6193 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_iterator",&obj0)) SWIG_fail;
6194 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6195 if (!SWIG_IsOK(res1)) {
6196 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_iterator" "', argument " "1"" of type '" "std::vector< double > *""'");
6198 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6199 result = (swig::SwigPyIterator *)std_vector_Sl_double_Sg__iterator(arg1,arg2);
6200 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
6207 SWIGINTERN PyObject *_wrap_nlopt_doublevector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6208 PyObject *resultobj = 0;
6209 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6212 PyObject * obj0 = 0 ;
6215 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector___nonzero__",&obj0)) SWIG_fail;
6216 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6217 if (!SWIG_IsOK(res1)) {
6218 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___nonzero__" "', argument " "1"" of type '" "std::vector< double > const *""'");
6220 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6221 result = (bool)std_vector_Sl_double_Sg____nonzero__((std::vector< double > const *)arg1);
6222 resultobj = SWIG_From_bool(static_cast< bool >(result));
6229 SWIGINTERN PyObject *_wrap_nlopt_doublevector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6230 PyObject *resultobj = 0;
6231 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6234 PyObject * obj0 = 0 ;
6237 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector___bool__",&obj0)) SWIG_fail;
6238 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6239 if (!SWIG_IsOK(res1)) {
6240 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___bool__" "', argument " "1"" of type '" "std::vector< double > const *""'");
6242 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6243 result = (bool)std_vector_Sl_double_Sg____bool__((std::vector< double > const *)arg1);
6244 resultobj = SWIG_From_bool(static_cast< bool >(result));
6251 SWIGINTERN PyObject *_wrap_nlopt_doublevector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6252 PyObject *resultobj = 0;
6253 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6256 PyObject * obj0 = 0 ;
6257 std::vector< double >::size_type result;
6259 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector___len__",&obj0)) SWIG_fail;
6260 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6261 if (!SWIG_IsOK(res1)) {
6262 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___len__" "', argument " "1"" of type '" "std::vector< double > const *""'");
6264 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6265 result = std_vector_Sl_double_Sg____len__((std::vector< double > const *)arg1);
6266 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6273 SWIGINTERN PyObject *_wrap_nlopt_doublevector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6274 PyObject *resultobj = 0;
6275 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6278 PyObject * obj0 = 0 ;
6279 std::vector< double >::value_type result;
6281 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_pop",&obj0)) SWIG_fail;
6282 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6283 if (!SWIG_IsOK(res1)) {
6284 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_pop" "', argument " "1"" of type '" "std::vector< double > *""'");
6286 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6288 result = (std::vector< double >::value_type)std_vector_Sl_double_Sg__pop(arg1);
6290 catch(std::out_of_range &_e) {
6291 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6294 resultobj = SWIG_From_double(static_cast< double >(result));
6301 SWIGINTERN PyObject *_wrap_nlopt_doublevector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6302 PyObject *resultobj = 0;
6303 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6304 std::vector< double >::difference_type arg2 ;
6305 std::vector< double >::difference_type arg3 ;
6312 PyObject * obj0 = 0 ;
6313 PyObject * obj1 = 0 ;
6314 PyObject * obj2 = 0 ;
6315 std::vector< double,std::allocator< double > > *result = 0 ;
6317 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
6318 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6319 if (!SWIG_IsOK(res1)) {
6320 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___getslice__" "', argument " "1"" of type '" "std::vector< double > *""'");
6322 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6323 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6324 if (!SWIG_IsOK(ecode2)) {
6325 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___getslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6327 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6328 ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
6329 if (!SWIG_IsOK(ecode3)) {
6330 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector___getslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
6332 arg3 = static_cast< std::vector< double >::difference_type >(val3);
6334 result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getslice__(arg1,arg2,arg3);
6336 catch(std::out_of_range &_e) {
6337 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6339 catch(std::invalid_argument &_e) {
6340 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6343 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN | 0 );
6350 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6351 PyObject *resultobj = 0;
6352 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6353 std::vector< double >::difference_type arg2 ;
6354 std::vector< double >::difference_type arg3 ;
6355 std::vector< double,std::allocator< double > > *arg4 = 0 ;
6362 int res4 = SWIG_OLDOBJ ;
6363 PyObject * obj0 = 0 ;
6364 PyObject * obj1 = 0 ;
6365 PyObject * obj2 = 0 ;
6366 PyObject * obj3 = 0 ;
6368 if (!PyArg_ParseTuple(args,(char *)"OOOO:nlopt_doublevector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
6369 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6370 if (!SWIG_IsOK(res1)) {
6371 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___setslice__" "', argument " "1"" of type '" "std::vector< double > *""'");
6373 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6374 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6375 if (!SWIG_IsOK(ecode2)) {
6376 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___setslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6378 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6379 ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
6380 if (!SWIG_IsOK(ecode3)) {
6381 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector___setslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
6383 arg3 = static_cast< std::vector< double >::difference_type >(val3);
6385 std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
6386 res4 = swig::asptr(obj3, &ptr);
6387 if (!SWIG_IsOK(res4)) {
6388 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "nlopt_doublevector___setslice__" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'");
6391 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_doublevector___setslice__" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'");
6396 std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
6398 catch(std::out_of_range &_e) {
6399 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6401 catch(std::invalid_argument &_e) {
6402 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6405 resultobj = SWIG_Py_Void();
6406 if (SWIG_IsNewObj(res4)) delete arg4;
6409 if (SWIG_IsNewObj(res4)) delete arg4;
6414 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6415 PyObject *resultobj = 0;
6416 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6417 std::vector< double >::difference_type arg2 ;
6418 std::vector< double >::difference_type arg3 ;
6425 PyObject * obj0 = 0 ;
6426 PyObject * obj1 = 0 ;
6427 PyObject * obj2 = 0 ;
6429 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
6430 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6431 if (!SWIG_IsOK(res1)) {
6432 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___setslice__" "', argument " "1"" of type '" "std::vector< double > *""'");
6434 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6435 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6436 if (!SWIG_IsOK(ecode2)) {
6437 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___setslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6439 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6440 ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
6441 if (!SWIG_IsOK(ecode3)) {
6442 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector___setslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
6444 arg3 = static_cast< std::vector< double >::difference_type >(val3);
6446 std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3);
6448 catch(std::out_of_range &_e) {
6449 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6451 catch(std::invalid_argument &_e) {
6452 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6455 resultobj = SWIG_Py_Void();
6462 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setslice__(PyObject *self, PyObject *args) {
6467 if (!PyTuple_Check(args)) SWIG_fail;
6468 argc = args ? (int)PyObject_Length(args) : 0;
6469 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
6470 argv[ii] = PyTuple_GET_ITEM(args,ii);
6474 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6475 _v = SWIG_CheckState(res);
6478 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6479 _v = SWIG_CheckState(res);
6483 int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
6484 _v = SWIG_CheckState(res);
6487 return _wrap_nlopt_doublevector___setslice____SWIG_1(self, args);
6494 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6495 _v = SWIG_CheckState(res);
6498 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6499 _v = SWIG_CheckState(res);
6503 int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
6504 _v = SWIG_CheckState(res);
6507 int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
6508 _v = SWIG_CheckState(res);
6510 return _wrap_nlopt_doublevector___setslice____SWIG_0(self, args);
6518 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector___setslice__'.\n"
6519 " Possible C/C++ prototypes are:\n"
6520 " std::vector< double >::__setslice__(std::vector< double >::difference_type,std::vector< double >::difference_type,std::vector< double,std::allocator< double > > const &)\n"
6521 " std::vector< double >::__setslice__(std::vector< double >::difference_type,std::vector< double >::difference_type)\n");
6526 SWIGINTERN PyObject *_wrap_nlopt_doublevector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6527 PyObject *resultobj = 0;
6528 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6529 std::vector< double >::difference_type arg2 ;
6530 std::vector< double >::difference_type arg3 ;
6537 PyObject * obj0 = 0 ;
6538 PyObject * obj1 = 0 ;
6539 PyObject * obj2 = 0 ;
6541 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
6542 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6543 if (!SWIG_IsOK(res1)) {
6544 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___delslice__" "', argument " "1"" of type '" "std::vector< double > *""'");
6546 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6547 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6548 if (!SWIG_IsOK(ecode2)) {
6549 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___delslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6551 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6552 ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
6553 if (!SWIG_IsOK(ecode3)) {
6554 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector___delslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
6556 arg3 = static_cast< std::vector< double >::difference_type >(val3);
6558 std_vector_Sl_double_Sg____delslice__(arg1,arg2,arg3);
6560 catch(std::out_of_range &_e) {
6561 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6563 catch(std::invalid_argument &_e) {
6564 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6567 resultobj = SWIG_Py_Void();
6574 SWIGINTERN PyObject *_wrap_nlopt_doublevector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6575 PyObject *resultobj = 0;
6576 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6577 std::vector< double >::difference_type arg2 ;
6582 PyObject * obj0 = 0 ;
6583 PyObject * obj1 = 0 ;
6585 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector___delitem__",&obj0,&obj1)) SWIG_fail;
6586 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6587 if (!SWIG_IsOK(res1)) {
6588 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___delitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6590 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6591 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6592 if (!SWIG_IsOK(ecode2)) {
6593 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___delitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6595 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6597 std_vector_Sl_double_Sg____delitem____SWIG_0(arg1,arg2);
6599 catch(std::out_of_range &_e) {
6600 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6603 resultobj = SWIG_Py_Void();
6610 SWIGINTERN PyObject *_wrap_nlopt_doublevector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6611 PyObject *resultobj = 0;
6612 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6613 PySliceObject *arg2 = (PySliceObject *) 0 ;
6616 PyObject * obj0 = 0 ;
6617 PyObject * obj1 = 0 ;
6618 std::vector< double,std::allocator< double > > *result = 0 ;
6620 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector___getitem__",&obj0,&obj1)) SWIG_fail;
6621 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6622 if (!SWIG_IsOK(res1)) {
6623 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___getitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6625 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6627 if (!PySlice_Check(obj1)) {
6628 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6630 arg2 = (PySliceObject *) obj1;
6633 result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getitem____SWIG_0(arg1,arg2);
6635 catch(std::out_of_range &_e) {
6636 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6638 catch(std::invalid_argument &_e) {
6639 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6642 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN | 0 );
6649 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6650 PyObject *resultobj = 0;
6651 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6652 PySliceObject *arg2 = (PySliceObject *) 0 ;
6653 std::vector< double,std::allocator< double > > *arg3 = 0 ;
6656 int res3 = SWIG_OLDOBJ ;
6657 PyObject * obj0 = 0 ;
6658 PyObject * obj1 = 0 ;
6659 PyObject * obj2 = 0 ;
6661 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
6662 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6663 if (!SWIG_IsOK(res1)) {
6664 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6666 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6668 if (!PySlice_Check(obj1)) {
6669 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6671 arg2 = (PySliceObject *) obj1;
6674 std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
6675 res3 = swig::asptr(obj2, &ptr);
6676 if (!SWIG_IsOK(res3)) {
6677 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "nlopt_doublevector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'");
6680 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_doublevector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'");
6685 std_vector_Sl_double_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
6687 catch(std::out_of_range &_e) {
6688 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6690 catch(std::invalid_argument &_e) {
6691 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6694 resultobj = SWIG_Py_Void();
6695 if (SWIG_IsNewObj(res3)) delete arg3;
6698 if (SWIG_IsNewObj(res3)) delete arg3;
6703 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6704 PyObject *resultobj = 0;
6705 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6706 PySliceObject *arg2 = (PySliceObject *) 0 ;
6709 PyObject * obj0 = 0 ;
6710 PyObject * obj1 = 0 ;
6712 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector___setitem__",&obj0,&obj1)) SWIG_fail;
6713 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6714 if (!SWIG_IsOK(res1)) {
6715 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6717 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6719 if (!PySlice_Check(obj1)) {
6720 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6722 arg2 = (PySliceObject *) obj1;
6725 std_vector_Sl_double_Sg____setitem____SWIG_1(arg1,arg2);
6727 catch(std::out_of_range &_e) {
6728 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6730 catch(std::invalid_argument &_e) {
6731 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6734 resultobj = SWIG_Py_Void();
6741 SWIGINTERN PyObject *_wrap_nlopt_doublevector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6742 PyObject *resultobj = 0;
6743 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6744 PySliceObject *arg2 = (PySliceObject *) 0 ;
6747 PyObject * obj0 = 0 ;
6748 PyObject * obj1 = 0 ;
6750 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector___delitem__",&obj0,&obj1)) SWIG_fail;
6751 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6752 if (!SWIG_IsOK(res1)) {
6753 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___delitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6755 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6757 if (!PySlice_Check(obj1)) {
6758 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6760 arg2 = (PySliceObject *) obj1;
6763 std_vector_Sl_double_Sg____delitem____SWIG_1(arg1,arg2);
6765 catch(std::out_of_range &_e) {
6766 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6768 catch(std::invalid_argument &_e) {
6769 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6772 resultobj = SWIG_Py_Void();
6779 SWIGINTERN PyObject *_wrap_nlopt_doublevector___delitem__(PyObject *self, PyObject *args) {
6784 if (!PyTuple_Check(args)) SWIG_fail;
6785 argc = args ? (int)PyObject_Length(args) : 0;
6786 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
6787 argv[ii] = PyTuple_GET_ITEM(args,ii);
6791 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6792 _v = SWIG_CheckState(res);
6795 _v = PySlice_Check(argv[1]);
6798 return _wrap_nlopt_doublevector___delitem____SWIG_1(self, args);
6804 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6805 _v = SWIG_CheckState(res);
6808 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6809 _v = SWIG_CheckState(res);
6812 return _wrap_nlopt_doublevector___delitem____SWIG_0(self, args);
6818 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector___delitem__'.\n"
6819 " Possible C/C++ prototypes are:\n"
6820 " std::vector< double >::__delitem__(std::vector< double >::difference_type)\n"
6821 " std::vector< double >::__delitem__(PySliceObject *)\n");
6826 SWIGINTERN PyObject *_wrap_nlopt_doublevector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6827 PyObject *resultobj = 0;
6828 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6829 std::vector< double >::difference_type arg2 ;
6834 PyObject * obj0 = 0 ;
6835 PyObject * obj1 = 0 ;
6836 std::vector< double >::value_type *result = 0 ;
6838 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector___getitem__",&obj0,&obj1)) SWIG_fail;
6839 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6840 if (!SWIG_IsOK(res1)) {
6841 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___getitem__" "', argument " "1"" of type '" "std::vector< double > const *""'");
6843 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6844 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6845 if (!SWIG_IsOK(ecode2)) {
6846 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___getitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6848 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6850 result = (std::vector< double >::value_type *) &std_vector_Sl_double_Sg____getitem____SWIG_1((std::vector< double > const *)arg1,arg2);
6852 catch(std::out_of_range &_e) {
6853 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6856 resultobj = SWIG_From_double(static_cast< double >(*result));
6863 SWIGINTERN PyObject *_wrap_nlopt_doublevector___getitem__(PyObject *self, PyObject *args) {
6868 if (!PyTuple_Check(args)) SWIG_fail;
6869 argc = args ? (int)PyObject_Length(args) : 0;
6870 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
6871 argv[ii] = PyTuple_GET_ITEM(args,ii);
6875 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6876 _v = SWIG_CheckState(res);
6879 _v = PySlice_Check(argv[1]);
6882 return _wrap_nlopt_doublevector___getitem____SWIG_0(self, args);
6888 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6889 _v = SWIG_CheckState(res);
6892 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6893 _v = SWIG_CheckState(res);
6896 return _wrap_nlopt_doublevector___getitem____SWIG_1(self, args);
6902 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector___getitem__'.\n"
6903 " Possible C/C++ prototypes are:\n"
6904 " std::vector< double >::__getitem__(PySliceObject *)\n"
6905 " std::vector< double >::__getitem__(std::vector< double >::difference_type) const\n");
6910 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6911 PyObject *resultobj = 0;
6912 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
6913 std::vector< double >::difference_type arg2 ;
6914 std::vector< double >::value_type *arg3 = 0 ;
6919 std::vector< double >::value_type temp3 ;
6922 PyObject * obj0 = 0 ;
6923 PyObject * obj1 = 0 ;
6924 PyObject * obj2 = 0 ;
6926 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
6927 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
6928 if (!SWIG_IsOK(res1)) {
6929 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'");
6931 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6932 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
6933 if (!SWIG_IsOK(ecode2)) {
6934 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector___setitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
6936 arg2 = static_cast< std::vector< double >::difference_type >(val2);
6937 ecode3 = SWIG_AsVal_double(obj2, &val3);
6938 if (!SWIG_IsOK(ecode3)) {
6939 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector___setitem__" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
6941 temp3 = static_cast< std::vector< double >::value_type >(val3);
6944 std_vector_Sl_double_Sg____setitem____SWIG_2(arg1,arg2,(double const &)*arg3);
6946 catch(std::out_of_range &_e) {
6947 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6950 resultobj = SWIG_Py_Void();
6957 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setitem__(PyObject *self, PyObject *args) {
6962 if (!PyTuple_Check(args)) SWIG_fail;
6963 argc = args ? (int)PyObject_Length(args) : 0;
6964 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
6965 argv[ii] = PyTuple_GET_ITEM(args,ii);
6969 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6970 _v = SWIG_CheckState(res);
6973 _v = PySlice_Check(argv[1]);
6976 return _wrap_nlopt_doublevector___setitem____SWIG_1(self, args);
6982 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6983 _v = SWIG_CheckState(res);
6986 _v = PySlice_Check(argv[1]);
6989 int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
6990 _v = SWIG_CheckState(res);
6992 return _wrap_nlopt_doublevector___setitem____SWIG_0(self, args);
6999 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7000 _v = SWIG_CheckState(res);
7003 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
7004 _v = SWIG_CheckState(res);
7008 int res = SWIG_AsVal_double(argv[2], NULL);
7009 _v = SWIG_CheckState(res);
7012 return _wrap_nlopt_doublevector___setitem____SWIG_2(self, args);
7019 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector___setitem__'.\n"
7020 " Possible C/C++ prototypes are:\n"
7021 " std::vector< double >::__setitem__(PySliceObject *,std::vector< double,std::allocator< double > > const &)\n"
7022 " std::vector< double >::__setitem__(PySliceObject *)\n"
7023 " std::vector< double >::__setitem__(std::vector< double >::difference_type,std::vector< double >::value_type const &)\n");
7028 SWIGINTERN PyObject *_wrap_nlopt_doublevector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7029 PyObject *resultobj = 0;
7030 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7031 std::vector< double >::value_type *arg2 = 0 ;
7034 std::vector< double >::value_type temp2 ;
7037 PyObject * obj0 = 0 ;
7038 PyObject * obj1 = 0 ;
7040 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_append",&obj0,&obj1)) SWIG_fail;
7041 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7042 if (!SWIG_IsOK(res1)) {
7043 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_append" "', argument " "1"" of type '" "std::vector< double > *""'");
7045 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7046 ecode2 = SWIG_AsVal_double(obj1, &val2);
7047 if (!SWIG_IsOK(ecode2)) {
7048 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_append" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
7050 temp2 = static_cast< std::vector< double >::value_type >(val2);
7052 std_vector_Sl_double_Sg__append(arg1,(double const &)*arg2);
7053 resultobj = SWIG_Py_Void();
7060 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7061 PyObject *resultobj = 0;
7062 std::vector< double > *result = 0 ;
7064 if (!PyArg_ParseTuple(args,(char *)":new_nlopt_doublevector")) SWIG_fail;
7065 result = (std::vector< double > *)new std::vector< double >();
7066 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW | 0 );
7073 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7074 PyObject *resultobj = 0;
7075 std::vector< double > *arg1 = 0 ;
7076 int res1 = SWIG_OLDOBJ ;
7077 PyObject * obj0 = 0 ;
7078 std::vector< double > *result = 0 ;
7080 if (!PyArg_ParseTuple(args,(char *)"O:new_nlopt_doublevector",&obj0)) SWIG_fail;
7082 std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
7083 res1 = swig::asptr(obj0, &ptr);
7084 if (!SWIG_IsOK(res1)) {
7085 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double > const &""'");
7088 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double > const &""'");
7092 result = (std::vector< double > *)new std::vector< double >((std::vector< double > const &)*arg1);
7093 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW | 0 );
7094 if (SWIG_IsNewObj(res1)) delete arg1;
7097 if (SWIG_IsNewObj(res1)) delete arg1;
7102 SWIGINTERN PyObject *_wrap_nlopt_doublevector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7103 PyObject *resultobj = 0;
7104 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7107 PyObject * obj0 = 0 ;
7110 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_empty",&obj0)) SWIG_fail;
7111 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7112 if (!SWIG_IsOK(res1)) {
7113 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_empty" "', argument " "1"" of type '" "std::vector< double > const *""'");
7115 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7116 result = (bool)((std::vector< double > const *)arg1)->empty();
7117 resultobj = SWIG_From_bool(static_cast< bool >(result));
7124 SWIGINTERN PyObject *_wrap_nlopt_doublevector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7125 PyObject *resultobj = 0;
7126 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7129 PyObject * obj0 = 0 ;
7130 std::vector< double >::size_type result;
7132 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_size",&obj0)) SWIG_fail;
7133 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7134 if (!SWIG_IsOK(res1)) {
7135 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_size" "', argument " "1"" of type '" "std::vector< double > const *""'");
7137 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7138 result = ((std::vector< double > const *)arg1)->size();
7139 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
7146 SWIGINTERN PyObject *_wrap_nlopt_doublevector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7147 PyObject *resultobj = 0;
7148 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7151 PyObject * obj0 = 0 ;
7153 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_clear",&obj0)) SWIG_fail;
7154 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7155 if (!SWIG_IsOK(res1)) {
7156 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_clear" "', argument " "1"" of type '" "std::vector< double > *""'");
7158 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7160 resultobj = SWIG_Py_Void();
7167 SWIGINTERN PyObject *_wrap_nlopt_doublevector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7168 PyObject *resultobj = 0;
7169 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7170 std::vector< double > *arg2 = 0 ;
7175 PyObject * obj0 = 0 ;
7176 PyObject * obj1 = 0 ;
7178 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_swap",&obj0,&obj1)) SWIG_fail;
7179 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7180 if (!SWIG_IsOK(res1)) {
7181 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_swap" "', argument " "1"" of type '" "std::vector< double > *""'");
7183 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7184 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
7185 if (!SWIG_IsOK(res2)) {
7186 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nlopt_doublevector_swap" "', argument " "2"" of type '" "std::vector< double > &""'");
7189 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_doublevector_swap" "', argument " "2"" of type '" "std::vector< double > &""'");
7191 arg2 = reinterpret_cast< std::vector< double > * >(argp2);
7192 (arg1)->swap(*arg2);
7193 resultobj = SWIG_Py_Void();
7200 SWIGINTERN PyObject *_wrap_nlopt_doublevector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7201 PyObject *resultobj = 0;
7202 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7205 PyObject * obj0 = 0 ;
7206 SwigValueWrapper< std::allocator< double > > result;
7208 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_get_allocator",&obj0)) SWIG_fail;
7209 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7210 if (!SWIG_IsOK(res1)) {
7211 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_get_allocator" "', argument " "1"" of type '" "std::vector< double > const *""'");
7213 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7214 result = ((std::vector< double > const *)arg1)->get_allocator();
7215 resultobj = SWIG_NewPointerObj((new std::vector< double >::allocator_type(static_cast< const std::vector< double >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_double_t, SWIG_POINTER_OWN | 0 );
7222 SWIGINTERN PyObject *_wrap_nlopt_doublevector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7223 PyObject *resultobj = 0;
7224 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7227 PyObject * obj0 = 0 ;
7228 std::vector< double >::iterator result;
7230 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_begin",&obj0)) SWIG_fail;
7231 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7232 if (!SWIG_IsOK(res1)) {
7233 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_begin" "', argument " "1"" of type '" "std::vector< double > *""'");
7235 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7236 result = (arg1)->begin();
7237 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
7238 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7245 SWIGINTERN PyObject *_wrap_nlopt_doublevector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7246 PyObject *resultobj = 0;
7247 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7250 PyObject * obj0 = 0 ;
7251 std::vector< double >::iterator result;
7253 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_end",&obj0)) SWIG_fail;
7254 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7255 if (!SWIG_IsOK(res1)) {
7256 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_end" "', argument " "1"" of type '" "std::vector< double > *""'");
7258 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7259 result = (arg1)->end();
7260 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
7261 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7268 SWIGINTERN PyObject *_wrap_nlopt_doublevector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7269 PyObject *resultobj = 0;
7270 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7273 PyObject * obj0 = 0 ;
7274 std::vector< double >::reverse_iterator result;
7276 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_rbegin",&obj0)) SWIG_fail;
7277 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7278 if (!SWIG_IsOK(res1)) {
7279 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_rbegin" "', argument " "1"" of type '" "std::vector< double > *""'");
7281 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7282 result = (arg1)->rbegin();
7283 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result)),
7284 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7291 SWIGINTERN PyObject *_wrap_nlopt_doublevector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7292 PyObject *resultobj = 0;
7293 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7296 PyObject * obj0 = 0 ;
7297 std::vector< double >::reverse_iterator result;
7299 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_rend",&obj0)) SWIG_fail;
7300 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7301 if (!SWIG_IsOK(res1)) {
7302 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_rend" "', argument " "1"" of type '" "std::vector< double > *""'");
7304 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7305 result = (arg1)->rend();
7306 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result)),
7307 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7314 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7315 PyObject *resultobj = 0;
7316 std::vector< double >::size_type arg1 ;
7319 PyObject * obj0 = 0 ;
7320 std::vector< double > *result = 0 ;
7322 if (!PyArg_ParseTuple(args,(char *)"O:new_nlopt_doublevector",&obj0)) SWIG_fail;
7323 ecode1 = SWIG_AsVal_size_t(obj0, &val1);
7324 if (!SWIG_IsOK(ecode1)) {
7325 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double >::size_type""'");
7327 arg1 = static_cast< std::vector< double >::size_type >(val1);
7328 result = (std::vector< double > *)new std::vector< double >(arg1);
7329 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW | 0 );
7336 SWIGINTERN PyObject *_wrap_nlopt_doublevector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7337 PyObject *resultobj = 0;
7338 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7341 PyObject * obj0 = 0 ;
7343 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_pop_back",&obj0)) SWIG_fail;
7344 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7345 if (!SWIG_IsOK(res1)) {
7346 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_pop_back" "', argument " "1"" of type '" "std::vector< double > *""'");
7348 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7350 resultobj = SWIG_Py_Void();
7357 SWIGINTERN PyObject *_wrap_nlopt_doublevector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7358 PyObject *resultobj = 0;
7359 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7360 std::vector< double >::size_type arg2 ;
7365 PyObject * obj0 = 0 ;
7366 PyObject * obj1 = 0 ;
7368 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_resize",&obj0,&obj1)) SWIG_fail;
7369 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7370 if (!SWIG_IsOK(res1)) {
7371 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_resize" "', argument " "1"" of type '" "std::vector< double > *""'");
7373 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7374 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7375 if (!SWIG_IsOK(ecode2)) {
7376 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_resize" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
7378 arg2 = static_cast< std::vector< double >::size_type >(val2);
7379 (arg1)->resize(arg2);
7380 resultobj = SWIG_Py_Void();
7387 SWIGINTERN PyObject *_wrap_nlopt_doublevector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7388 PyObject *resultobj = 0;
7389 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7390 std::vector< double >::iterator arg2 ;
7393 swig::SwigPyIterator *iter2 = 0 ;
7395 PyObject * obj0 = 0 ;
7396 PyObject * obj1 = 0 ;
7397 std::vector< double >::iterator result;
7399 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_erase",&obj0,&obj1)) SWIG_fail;
7400 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7401 if (!SWIG_IsOK(res1)) {
7402 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_erase" "', argument " "1"" of type '" "std::vector< double > *""'");
7404 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7405 res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
7406 if (!SWIG_IsOK(res2) || !iter2) {
7407 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7409 swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7411 arg2 = iter_t->get_current();
7413 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7416 result = std_vector_Sl_double_Sg__erase__SWIG_0(arg1,arg2);
7417 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
7418 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7425 SWIGINTERN PyObject *_wrap_nlopt_doublevector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7426 PyObject *resultobj = 0;
7427 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7428 std::vector< double >::iterator arg2 ;
7429 std::vector< double >::iterator arg3 ;
7432 swig::SwigPyIterator *iter2 = 0 ;
7434 swig::SwigPyIterator *iter3 = 0 ;
7436 PyObject * obj0 = 0 ;
7437 PyObject * obj1 = 0 ;
7438 PyObject * obj2 = 0 ;
7439 std::vector< double >::iterator result;
7441 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
7442 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7443 if (!SWIG_IsOK(res1)) {
7444 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_erase" "', argument " "1"" of type '" "std::vector< double > *""'");
7446 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7447 res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
7448 if (!SWIG_IsOK(res2) || !iter2) {
7449 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7451 swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7453 arg2 = iter_t->get_current();
7455 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7458 res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
7459 if (!SWIG_IsOK(res3) || !iter3) {
7460 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'");
7462 swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter3);
7464 arg3 = iter_t->get_current();
7466 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'");
7469 result = std_vector_Sl_double_Sg__erase__SWIG_1(arg1,arg2,arg3);
7470 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
7471 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7478 SWIGINTERN PyObject *_wrap_nlopt_doublevector_erase(PyObject *self, PyObject *args) {
7483 if (!PyTuple_Check(args)) SWIG_fail;
7484 argc = args ? (int)PyObject_Length(args) : 0;
7485 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
7486 argv[ii] = PyTuple_GET_ITEM(args,ii);
7490 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7491 _v = SWIG_CheckState(res);
7493 swig::SwigPyIterator *iter = 0;
7494 int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
7495 _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
7497 return _wrap_nlopt_doublevector_erase__SWIG_0(self, args);
7503 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7504 _v = SWIG_CheckState(res);
7506 swig::SwigPyIterator *iter = 0;
7507 int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
7508 _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
7510 swig::SwigPyIterator *iter = 0;
7511 int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
7512 _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
7514 return _wrap_nlopt_doublevector_erase__SWIG_1(self, args);
7521 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector_erase'.\n"
7522 " Possible C/C++ prototypes are:\n"
7523 " std::vector< double >::erase(std::vector< double >::iterator)\n"
7524 " std::vector< double >::erase(std::vector< double >::iterator,std::vector< double >::iterator)\n");
7529 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7530 PyObject *resultobj = 0;
7531 std::vector< double >::size_type arg1 ;
7532 std::vector< double >::value_type *arg2 = 0 ;
7535 std::vector< double >::value_type temp2 ;
7538 PyObject * obj0 = 0 ;
7539 PyObject * obj1 = 0 ;
7540 std::vector< double > *result = 0 ;
7542 if (!PyArg_ParseTuple(args,(char *)"OO:new_nlopt_doublevector",&obj0,&obj1)) SWIG_fail;
7543 ecode1 = SWIG_AsVal_size_t(obj0, &val1);
7544 if (!SWIG_IsOK(ecode1)) {
7545 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double >::size_type""'");
7547 arg1 = static_cast< std::vector< double >::size_type >(val1);
7548 ecode2 = SWIG_AsVal_double(obj1, &val2);
7549 if (!SWIG_IsOK(ecode2)) {
7550 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_nlopt_doublevector" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
7552 temp2 = static_cast< std::vector< double >::value_type >(val2);
7554 result = (std::vector< double > *)new std::vector< double >(arg1,(std::vector< double >::value_type const &)*arg2);
7555 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW | 0 );
7562 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector(PyObject *self, PyObject *args) {
7567 if (!PyTuple_Check(args)) SWIG_fail;
7568 argc = args ? (int)PyObject_Length(args) : 0;
7569 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
7570 argv[ii] = PyTuple_GET_ITEM(args,ii);
7573 return _wrap_new_nlopt_doublevector__SWIG_0(self, args);
7578 int res = SWIG_AsVal_size_t(argv[0], NULL);
7579 _v = SWIG_CheckState(res);
7582 return _wrap_new_nlopt_doublevector__SWIG_2(self, args);
7587 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7588 _v = SWIG_CheckState(res);
7590 return _wrap_new_nlopt_doublevector__SWIG_1(self, args);
7596 int res = SWIG_AsVal_size_t(argv[0], NULL);
7597 _v = SWIG_CheckState(res);
7601 int res = SWIG_AsVal_double(argv[1], NULL);
7602 _v = SWIG_CheckState(res);
7605 return _wrap_new_nlopt_doublevector__SWIG_3(self, args);
7611 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_nlopt_doublevector'.\n"
7612 " Possible C/C++ prototypes are:\n"
7613 " std::vector< double >::vector()\n"
7614 " std::vector< double >::vector(std::vector< double > const &)\n"
7615 " std::vector< double >::vector(std::vector< double >::size_type)\n"
7616 " std::vector< double >::vector(std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
7621 SWIGINTERN PyObject *_wrap_nlopt_doublevector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7622 PyObject *resultobj = 0;
7623 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7624 std::vector< double >::value_type *arg2 = 0 ;
7627 std::vector< double >::value_type temp2 ;
7630 PyObject * obj0 = 0 ;
7631 PyObject * obj1 = 0 ;
7633 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_push_back",&obj0,&obj1)) SWIG_fail;
7634 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7635 if (!SWIG_IsOK(res1)) {
7636 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_push_back" "', argument " "1"" of type '" "std::vector< double > *""'");
7638 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7639 ecode2 = SWIG_AsVal_double(obj1, &val2);
7640 if (!SWIG_IsOK(ecode2)) {
7641 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_push_back" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
7643 temp2 = static_cast< std::vector< double >::value_type >(val2);
7645 (arg1)->push_back((std::vector< double >::value_type const &)*arg2);
7646 resultobj = SWIG_Py_Void();
7653 SWIGINTERN PyObject *_wrap_nlopt_doublevector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7654 PyObject *resultobj = 0;
7655 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7658 PyObject * obj0 = 0 ;
7659 std::vector< double >::value_type *result = 0 ;
7661 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_front",&obj0)) SWIG_fail;
7662 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7663 if (!SWIG_IsOK(res1)) {
7664 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_front" "', argument " "1"" of type '" "std::vector< double > const *""'");
7666 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7667 result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->front();
7668 resultobj = SWIG_From_double(static_cast< double >(*result));
7675 SWIGINTERN PyObject *_wrap_nlopt_doublevector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7676 PyObject *resultobj = 0;
7677 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7680 PyObject * obj0 = 0 ;
7681 std::vector< double >::value_type *result = 0 ;
7683 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_back",&obj0)) SWIG_fail;
7684 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7685 if (!SWIG_IsOK(res1)) {
7686 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_back" "', argument " "1"" of type '" "std::vector< double > const *""'");
7688 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7689 result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->back();
7690 resultobj = SWIG_From_double(static_cast< double >(*result));
7697 SWIGINTERN PyObject *_wrap_nlopt_doublevector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7698 PyObject *resultobj = 0;
7699 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7700 std::vector< double >::size_type arg2 ;
7701 std::vector< double >::value_type *arg3 = 0 ;
7706 std::vector< double >::value_type temp3 ;
7709 PyObject * obj0 = 0 ;
7710 PyObject * obj1 = 0 ;
7711 PyObject * obj2 = 0 ;
7713 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
7714 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7715 if (!SWIG_IsOK(res1)) {
7716 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_assign" "', argument " "1"" of type '" "std::vector< double > *""'");
7718 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7719 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7720 if (!SWIG_IsOK(ecode2)) {
7721 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_assign" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
7723 arg2 = static_cast< std::vector< double >::size_type >(val2);
7724 ecode3 = SWIG_AsVal_double(obj2, &val3);
7725 if (!SWIG_IsOK(ecode3)) {
7726 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector_assign" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
7728 temp3 = static_cast< std::vector< double >::value_type >(val3);
7730 (arg1)->assign(arg2,(std::vector< double >::value_type const &)*arg3);
7731 resultobj = SWIG_Py_Void();
7738 SWIGINTERN PyObject *_wrap_nlopt_doublevector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7739 PyObject *resultobj = 0;
7740 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7741 std::vector< double >::size_type arg2 ;
7742 std::vector< double >::value_type *arg3 = 0 ;
7747 std::vector< double >::value_type temp3 ;
7750 PyObject * obj0 = 0 ;
7751 PyObject * obj1 = 0 ;
7752 PyObject * obj2 = 0 ;
7754 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
7755 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7756 if (!SWIG_IsOK(res1)) {
7757 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_resize" "', argument " "1"" of type '" "std::vector< double > *""'");
7759 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7760 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7761 if (!SWIG_IsOK(ecode2)) {
7762 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_resize" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
7764 arg2 = static_cast< std::vector< double >::size_type >(val2);
7765 ecode3 = SWIG_AsVal_double(obj2, &val3);
7766 if (!SWIG_IsOK(ecode3)) {
7767 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector_resize" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
7769 temp3 = static_cast< std::vector< double >::value_type >(val3);
7771 (arg1)->resize(arg2,(std::vector< double >::value_type const &)*arg3);
7772 resultobj = SWIG_Py_Void();
7779 SWIGINTERN PyObject *_wrap_nlopt_doublevector_resize(PyObject *self, PyObject *args) {
7784 if (!PyTuple_Check(args)) SWIG_fail;
7785 argc = args ? (int)PyObject_Length(args) : 0;
7786 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
7787 argv[ii] = PyTuple_GET_ITEM(args,ii);
7791 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7792 _v = SWIG_CheckState(res);
7795 int res = SWIG_AsVal_size_t(argv[1], NULL);
7796 _v = SWIG_CheckState(res);
7799 return _wrap_nlopt_doublevector_resize__SWIG_0(self, args);
7805 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7806 _v = SWIG_CheckState(res);
7809 int res = SWIG_AsVal_size_t(argv[1], NULL);
7810 _v = SWIG_CheckState(res);
7814 int res = SWIG_AsVal_double(argv[2], NULL);
7815 _v = SWIG_CheckState(res);
7818 return _wrap_nlopt_doublevector_resize__SWIG_1(self, args);
7825 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector_resize'.\n"
7826 " Possible C/C++ prototypes are:\n"
7827 " std::vector< double >::resize(std::vector< double >::size_type)\n"
7828 " std::vector< double >::resize(std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
7833 SWIGINTERN PyObject *_wrap_nlopt_doublevector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7834 PyObject *resultobj = 0;
7835 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7836 std::vector< double >::iterator arg2 ;
7837 std::vector< double >::value_type *arg3 = 0 ;
7840 swig::SwigPyIterator *iter2 = 0 ;
7842 std::vector< double >::value_type temp3 ;
7845 PyObject * obj0 = 0 ;
7846 PyObject * obj1 = 0 ;
7847 PyObject * obj2 = 0 ;
7848 std::vector< double >::iterator result;
7850 if (!PyArg_ParseTuple(args,(char *)"OOO:nlopt_doublevector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
7851 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7852 if (!SWIG_IsOK(res1)) {
7853 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_insert" "', argument " "1"" of type '" "std::vector< double > *""'");
7855 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7856 res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
7857 if (!SWIG_IsOK(res2) || !iter2) {
7858 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7860 swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7862 arg2 = iter_t->get_current();
7864 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7867 ecode3 = SWIG_AsVal_double(obj2, &val3);
7868 if (!SWIG_IsOK(ecode3)) {
7869 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector_insert" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
7871 temp3 = static_cast< std::vector< double >::value_type >(val3);
7873 result = std_vector_Sl_double_Sg__insert__SWIG_0(arg1,arg2,(double const &)*arg3);
7874 resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
7875 swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
7882 SWIGINTERN PyObject *_wrap_nlopt_doublevector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7883 PyObject *resultobj = 0;
7884 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
7885 std::vector< double >::iterator arg2 ;
7886 std::vector< double >::size_type arg3 ;
7887 std::vector< double >::value_type *arg4 = 0 ;
7890 swig::SwigPyIterator *iter2 = 0 ;
7894 std::vector< double >::value_type temp4 ;
7897 PyObject * obj0 = 0 ;
7898 PyObject * obj1 = 0 ;
7899 PyObject * obj2 = 0 ;
7900 PyObject * obj3 = 0 ;
7902 if (!PyArg_ParseTuple(args,(char *)"OOOO:nlopt_doublevector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
7903 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
7904 if (!SWIG_IsOK(res1)) {
7905 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_insert" "', argument " "1"" of type '" "std::vector< double > *""'");
7907 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7908 res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
7909 if (!SWIG_IsOK(res2) || !iter2) {
7910 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7912 swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7914 arg2 = iter_t->get_current();
7916 SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7919 ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7920 if (!SWIG_IsOK(ecode3)) {
7921 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlopt_doublevector_insert" "', argument " "3"" of type '" "std::vector< double >::size_type""'");
7923 arg3 = static_cast< std::vector< double >::size_type >(val3);
7924 ecode4 = SWIG_AsVal_double(obj3, &val4);
7925 if (!SWIG_IsOK(ecode4)) {
7926 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "nlopt_doublevector_insert" "', argument " "4"" of type '" "std::vector< double >::value_type""'");
7928 temp4 = static_cast< std::vector< double >::value_type >(val4);
7930 std_vector_Sl_double_Sg__insert__SWIG_1(arg1,arg2,arg3,(double const &)*arg4);
7931 resultobj = SWIG_Py_Void();
7938 SWIGINTERN PyObject *_wrap_nlopt_doublevector_insert(PyObject *self, PyObject *args) {
7943 if (!PyTuple_Check(args)) SWIG_fail;
7944 argc = args ? (int)PyObject_Length(args) : 0;
7945 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
7946 argv[ii] = PyTuple_GET_ITEM(args,ii);
7950 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7951 _v = SWIG_CheckState(res);
7953 swig::SwigPyIterator *iter = 0;
7954 int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
7955 _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
7958 int res = SWIG_AsVal_double(argv[2], NULL);
7959 _v = SWIG_CheckState(res);
7962 return _wrap_nlopt_doublevector_insert__SWIG_0(self, args);
7969 int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7970 _v = SWIG_CheckState(res);
7972 swig::SwigPyIterator *iter = 0;
7973 int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
7974 _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
7977 int res = SWIG_AsVal_size_t(argv[2], NULL);
7978 _v = SWIG_CheckState(res);
7982 int res = SWIG_AsVal_double(argv[3], NULL);
7983 _v = SWIG_CheckState(res);
7986 return _wrap_nlopt_doublevector_insert__SWIG_1(self, args);
7994 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'nlopt_doublevector_insert'.\n"
7995 " Possible C/C++ prototypes are:\n"
7996 " std::vector< double >::insert(std::vector< double >::iterator,std::vector< double >::value_type const &)\n"
7997 " std::vector< double >::insert(std::vector< double >::iterator,std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
8002 SWIGINTERN PyObject *_wrap_nlopt_doublevector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8003 PyObject *resultobj = 0;
8004 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
8005 std::vector< double >::size_type arg2 ;
8010 PyObject * obj0 = 0 ;
8011 PyObject * obj1 = 0 ;
8013 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_doublevector_reserve",&obj0,&obj1)) SWIG_fail;
8014 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
8015 if (!SWIG_IsOK(res1)) {
8016 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_reserve" "', argument " "1"" of type '" "std::vector< double > *""'");
8018 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
8019 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
8020 if (!SWIG_IsOK(ecode2)) {
8021 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlopt_doublevector_reserve" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
8023 arg2 = static_cast< std::vector< double >::size_type >(val2);
8024 (arg1)->reserve(arg2);
8025 resultobj = SWIG_Py_Void();
8032 SWIGINTERN PyObject *_wrap_nlopt_doublevector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8033 PyObject *resultobj = 0;
8034 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
8037 PyObject * obj0 = 0 ;
8038 std::vector< double >::size_type result;
8040 if (!PyArg_ParseTuple(args,(char *)"O:nlopt_doublevector_capacity",&obj0)) SWIG_fail;
8041 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 );
8042 if (!SWIG_IsOK(res1)) {
8043 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_doublevector_capacity" "', argument " "1"" of type '" "std::vector< double > const *""'");
8045 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
8046 result = ((std::vector< double > const *)arg1)->capacity();
8047 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
8054 SWIGINTERN PyObject *_wrap_delete_nlopt_doublevector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8055 PyObject *resultobj = 0;
8056 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
8059 PyObject * obj0 = 0 ;
8061 if (!PyArg_ParseTuple(args,(char *)"O:delete_nlopt_doublevector",&obj0)) SWIG_fail;
8062 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_DISOWN | 0 );
8063 if (!SWIG_IsOK(res1)) {
8064 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double > *""'");
8066 arg1 = reinterpret_cast< std::vector< double > * >(argp1);
8068 resultobj = SWIG_Py_Void();
8075 SWIGINTERN PyObject *nlopt_doublevector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8077 if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8078 SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_NewClientData(obj));
8079 return SWIG_Py_Void();
8082 SWIGINTERN PyObject *_wrap_nlopt_get_initial_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8083 PyObject *resultobj = 0;
8085 double *arg2 = (double *) 0 ;
8090 PyObject * obj0 = 0 ;
8091 PyObject * obj1 = 0 ;
8092 nlopt_result result;
8094 if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_get_initial_step",&obj0,&obj1)) SWIG_fail;
8096 res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_nlopt_opt, 0 | 0);
8097 if (!SWIG_IsOK(res1)) {
8098 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nlopt_get_initial_step" "', argument " "1"" of type '" "nlopt_opt const""'");
8101 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_get_initial_step" "', argument " "1"" of type '" "nlopt_opt const""'");
8103 nlopt_opt * temp = reinterpret_cast< nlopt_opt * >(argp1);
8105 if (SWIG_IsNewObj(res1)) delete temp;
8108 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 );
8109 if (!SWIG_IsOK(res2)) {
8110 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nlopt_get_initial_step" "', argument " "2"" of type '" "double *""'");
8112 arg2 = reinterpret_cast< double * >(argp2);
8113 result = nlopt_get_initial_step(arg1,arg2);
8114 resultobj = SWIG_NewPointerObj((new nlopt_result(static_cast< const nlopt_result& >(result))), SWIGTYPE_p_nlopt_result, SWIG_POINTER_OWN | 0 );
8121 SWIGINTERN PyObject *_wrap_new_roundoff_limited(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8122 PyObject *resultobj = 0;
8123 nlopt::roundoff_limited *result = 0 ;
8125 if (!PyArg_ParseTuple(args,(char *)":new_roundoff_limited")) SWIG_fail;
8126 result = (nlopt::roundoff_limited *)new nlopt::roundoff_limited();
8127 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__roundoff_limited, SWIG_POINTER_NEW | 0 );
8134 SWIGINTERN PyObject *_wrap_delete_roundoff_limited(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8135 PyObject *resultobj = 0;
8136 nlopt::roundoff_limited *arg1 = (nlopt::roundoff_limited *) 0 ;
8139 PyObject * obj0 = 0 ;
8141 if (!PyArg_ParseTuple(args,(char *)"O:delete_roundoff_limited",&obj0)) SWIG_fail;
8142 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__roundoff_limited, SWIG_POINTER_DISOWN | 0 );
8143 if (!SWIG_IsOK(res1)) {
8144 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_roundoff_limited" "', argument " "1"" of type '" "nlopt::roundoff_limited *""'");
8146 arg1 = reinterpret_cast< nlopt::roundoff_limited * >(argp1);
8148 resultobj = SWIG_Py_Void();
8155 SWIGINTERN PyObject *roundoff_limited_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8157 if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8158 SWIG_TypeNewClientData(SWIGTYPE_p_nlopt__roundoff_limited, SWIG_NewClientData(obj));
8159 return SWIG_Py_Void();
8162 SWIGINTERN PyObject *_wrap_new_forced_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8163 PyObject *resultobj = 0;
8164 nlopt::forced_stop *result = 0 ;
8166 if (!PyArg_ParseTuple(args,(char *)":new_forced_stop")) SWIG_fail;
8167 result = (nlopt::forced_stop *)new nlopt::forced_stop();
8168 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__forced_stop, SWIG_POINTER_NEW | 0 );
8175 SWIGINTERN PyObject *_wrap_delete_forced_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8176 PyObject *resultobj = 0;
8177 nlopt::forced_stop *arg1 = (nlopt::forced_stop *) 0 ;
8180 PyObject * obj0 = 0 ;
8182 if (!PyArg_ParseTuple(args,(char *)"O:delete_forced_stop",&obj0)) SWIG_fail;
8183 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__forced_stop, SWIG_POINTER_DISOWN | 0 );
8184 if (!SWIG_IsOK(res1)) {
8185 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_forced_stop" "', argument " "1"" of type '" "nlopt::forced_stop *""'");
8187 arg1 = reinterpret_cast< nlopt::forced_stop * >(argp1);
8189 resultobj = SWIG_Py_Void();
8196 SWIGINTERN PyObject *forced_stop_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8198 if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8199 SWIG_TypeNewClientData(SWIGTYPE_p_nlopt__forced_stop, SWIG_NewClientData(obj));
8200 return SWIG_Py_Void();
8203 SWIGINTERN PyObject *_wrap_new_opt__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8204 PyObject *resultobj = 0;
8205 nlopt::opt *result = 0 ;
8207 if (!PyArg_ParseTuple(args,(char *)":new_opt")) SWIG_fail;
8209 result = (nlopt::opt *)new nlopt::opt();
8211 catch(std::bad_alloc &_e) {
8212 PyErr_SetString(PyExc_MemoryError, (_e).what());
8217 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW | 0 );
8224 SWIGINTERN PyObject *_wrap_delete_opt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8225 PyObject *resultobj = 0;
8226 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8229 PyObject * obj0 = 0 ;
8231 if (!PyArg_ParseTuple(args,(char *)"O:delete_opt",&obj0)) SWIG_fail;
8232 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, SWIG_POINTER_DISOWN | 0 );
8233 if (!SWIG_IsOK(res1)) {
8234 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_opt" "', argument " "1"" of type '" "nlopt::opt *""'");
8236 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8238 resultobj = SWIG_Py_Void();
8245 SWIGINTERN PyObject *_wrap_new_opt__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8246 PyObject *resultobj = 0;
8247 nlopt::algorithm arg1 ;
8253 PyObject * obj0 = 0 ;
8254 PyObject * obj1 = 0 ;
8255 nlopt::opt *result = 0 ;
8257 if (!PyArg_ParseTuple(args,(char *)"OO:new_opt",&obj0,&obj1)) SWIG_fail;
8258 ecode1 = SWIG_AsVal_int(obj0, &val1);
8259 if (!SWIG_IsOK(ecode1)) {
8260 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_opt" "', argument " "1"" of type '" "nlopt::algorithm""'");
8262 arg1 = static_cast< nlopt::algorithm >(val1);
8263 ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
8264 if (!SWIG_IsOK(ecode2)) {
8265 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_opt" "', argument " "2"" of type '" "unsigned int""'");
8267 arg2 = static_cast< unsigned int >(val2);
8269 result = (nlopt::opt *)new nlopt::opt(arg1,arg2);
8271 catch(std::bad_alloc &_e) {
8272 PyErr_SetString(PyExc_MemoryError, (_e).what());
8277 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW | 0 );
8284 SWIGINTERN PyObject *_wrap_new_opt__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8285 PyObject *resultobj = 0;
8286 nlopt::opt *arg1 = 0 ;
8289 PyObject * obj0 = 0 ;
8290 nlopt::opt *result = 0 ;
8292 if (!PyArg_ParseTuple(args,(char *)"O:new_opt",&obj0)) SWIG_fail;
8293 res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_nlopt__opt, 0 | 0);
8294 if (!SWIG_IsOK(res1)) {
8295 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_opt" "', argument " "1"" of type '" "nlopt::opt const &""'");
8298 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_opt" "', argument " "1"" of type '" "nlopt::opt const &""'");
8300 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8302 result = (nlopt::opt *)new nlopt::opt((nlopt::opt const &)*arg1);
8304 catch(std::bad_alloc &_e) {
8305 PyErr_SetString(PyExc_MemoryError, (_e).what());
8310 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW | 0 );
8317 SWIGINTERN PyObject *_wrap_new_opt(PyObject *self, PyObject *args) {
8322 if (!PyTuple_Check(args)) SWIG_fail;
8323 argc = args ? (int)PyObject_Length(args) : 0;
8324 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
8325 argv[ii] = PyTuple_GET_ITEM(args,ii);
8328 return _wrap_new_opt__SWIG_0(self, args);
8332 int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_nlopt__opt, 0);
8333 _v = SWIG_CheckState(res);
8335 return _wrap_new_opt__SWIG_2(self, args);
8341 int res = SWIG_AsVal_int(argv[0], NULL);
8342 _v = SWIG_CheckState(res);
8346 int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
8347 _v = SWIG_CheckState(res);
8350 return _wrap_new_opt__SWIG_1(self, args);
8356 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_opt'.\n"
8357 " Possible C/C++ prototypes are:\n"
8358 " nlopt::opt::opt()\n"
8359 " nlopt::opt::opt(nlopt::algorithm,unsigned int)\n"
8360 " nlopt::opt::opt(nlopt::opt const &)\n");
8365 SWIGINTERN PyObject *_wrap_opt_optimize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8366 PyObject *resultobj = 0;
8367 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8368 std::vector< double,std::allocator< double > > *arg2 = 0 ;
8376 PyObject * obj0 = 0 ;
8377 PyObject * obj1 = 0 ;
8378 PyObject * obj2 = 0 ;
8379 nlopt::result result;
8381 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_optimize",&obj0,&obj1,&obj2)) SWIG_fail;
8382 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8383 if (!SWIG_IsOK(res1)) {
8384 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_optimize" "', argument " "1"" of type '" "nlopt::opt *""'");
8386 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8387 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
8388 if (!SWIG_IsOK(res2)) {
8389 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_optimize" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
8392 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_optimize" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
8394 arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
8395 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_double, 0 );
8396 if (!SWIG_IsOK(res3)) {
8397 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_optimize" "', argument " "3"" of type '" "double &""'");
8400 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_optimize" "', argument " "3"" of type '" "double &""'");
8402 arg3 = reinterpret_cast< double * >(argp3);
8404 result = (nlopt::result)(arg1)->optimize(*arg2,*arg3);
8406 catch(nlopt::roundoff_limited &_e) {
8407 PyErr_SetString((PyObject*)&MyExc_RoundoffLimited, "NLopt roundoff-limited");
8411 catch(nlopt::forced_stop &_e) {
8412 if (!PyErr_Occurred())
8413 PyErr_SetString((PyObject*)&MyExc_ForcedStop, "NLopt forced stop");
8417 catch(std::runtime_error &_e) {
8418 SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
8420 catch(std::bad_alloc &_e) {
8421 PyErr_SetString(PyExc_MemoryError, (_e).what());
8425 catch(std::invalid_argument &_e) {
8426 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8429 resultobj = SWIG_From_int(static_cast< int >(result));
8436 SWIGINTERN PyObject *_wrap_opt_optimize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8437 PyObject *resultobj = 0;
8438 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8439 std::vector< double,std::allocator< double > > *arg2 = 0 ;
8442 PyArrayObject *array2 = NULL ;
8443 int is_new_object2 = 0 ;
8444 std::vector< double > arrayv2 ;
8445 PyObject * obj0 = 0 ;
8446 PyObject * obj1 = 0 ;
8447 std::vector< double,std::allocator< double > > result;
8449 if (!PyArg_ParseTuple(args,(char *)"OO:opt_optimize",&obj0,&obj1)) SWIG_fail;
8450 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8451 if (!SWIG_IsOK(res1)) {
8452 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_optimize" "', argument " "1"" of type '" "nlopt::opt *""'");
8454 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8456 npy_intp size[1] = {
8459 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
8460 if (!array2 || !require_dimensions(array2, 1) ||
8461 !require_size(array2, size, 1)) SWIG_fail;
8462 arrayv2 = std::vector<double>(array_size(array2,0));
8465 double *arr_data = (double *) array_data(array2);
8466 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
8467 int arr_sz = array_size(array2,0);
8468 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
8469 arrayv2[arr_i] = arr_data[arr_i * arr_s];
8473 result = (arg1)->optimize((std::vector< double,std::allocator< double > > const &)*arg2);
8475 catch(nlopt::roundoff_limited &_e) {
8476 PyErr_SetString((PyObject*)&MyExc_RoundoffLimited, "NLopt roundoff-limited");
8480 catch(nlopt::forced_stop &_e) {
8481 if (!PyErr_Occurred())
8482 PyErr_SetString((PyObject*)&MyExc_ForcedStop, "NLopt forced stop");
8486 catch(std::runtime_error &_e) {
8487 SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
8489 catch(std::bad_alloc &_e) {
8490 PyErr_SetString(PyExc_MemoryError, (_e).what());
8494 catch(std::invalid_argument &_e) {
8495 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8499 npy_intp sz = (&result)->size();
8500 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
8501 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
8502 sizeof(double) * sz);
8505 if (is_new_object2 && array2)
8513 if (is_new_object2 && array2)
8522 SWIGINTERN PyObject *_wrap_opt_optimize(PyObject *self, PyObject *args) {
8527 if (!PyTuple_Check(args)) SWIG_fail;
8528 argc = args ? (int)PyObject_Length(args) : 0;
8529 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
8530 argv[ii] = PyTuple_GET_ITEM(args,ii);
8535 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8536 _v = SWIG_CheckState(res);
8539 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
8542 return _wrap_opt_optimize__SWIG_1(self, args);
8549 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8550 _v = SWIG_CheckState(res);
8553 int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
8554 _v = SWIG_CheckState(res);
8557 int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_double, 0);
8558 _v = SWIG_CheckState(res);
8560 return _wrap_opt_optimize__SWIG_0(self, args);
8567 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_optimize'.\n"
8568 " Possible C/C++ prototypes are:\n"
8569 " nlopt::opt::optimize(std::vector< double,std::allocator< double > > &,double &)\n"
8570 " nlopt::opt::optimize(std::vector< double,std::allocator< double > > const &)\n");
8575 SWIGINTERN PyObject *_wrap_opt_last_optimize_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8576 PyObject *resultobj = 0;
8577 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8580 PyObject * obj0 = 0 ;
8581 nlopt::result result;
8583 if (!PyArg_ParseTuple(args,(char *)"O:opt_last_optimize_result",&obj0)) SWIG_fail;
8584 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8585 if (!SWIG_IsOK(res1)) {
8586 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_last_optimize_result" "', argument " "1"" of type '" "nlopt::opt const *""'");
8588 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8589 result = (nlopt::result)((nlopt::opt const *)arg1)->last_optimize_result();
8590 resultobj = SWIG_From_int(static_cast< int >(result));
8597 SWIGINTERN PyObject *_wrap_opt_last_optimum_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8598 PyObject *resultobj = 0;
8599 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8602 PyObject * obj0 = 0 ;
8605 if (!PyArg_ParseTuple(args,(char *)"O:opt_last_optimum_value",&obj0)) SWIG_fail;
8606 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8607 if (!SWIG_IsOK(res1)) {
8608 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_last_optimum_value" "', argument " "1"" of type '" "nlopt::opt const *""'");
8610 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8611 result = (double)((nlopt::opt const *)arg1)->last_optimum_value();
8612 resultobj = SWIG_From_double(static_cast< double >(result));
8619 SWIGINTERN PyObject *_wrap_opt_get_algorithm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8620 PyObject *resultobj = 0;
8621 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8624 PyObject * obj0 = 0 ;
8625 nlopt::algorithm result;
8627 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_algorithm",&obj0)) SWIG_fail;
8628 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8629 if (!SWIG_IsOK(res1)) {
8630 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_algorithm" "', argument " "1"" of type '" "nlopt::opt const *""'");
8632 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8633 result = (nlopt::algorithm)((nlopt::opt const *)arg1)->get_algorithm();
8634 resultobj = SWIG_From_int(static_cast< int >(result));
8641 SWIGINTERN PyObject *_wrap_opt_get_algorithm_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8642 PyObject *resultobj = 0;
8643 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8646 PyObject * obj0 = 0 ;
8649 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_algorithm_name",&obj0)) SWIG_fail;
8650 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8651 if (!SWIG_IsOK(res1)) {
8652 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_algorithm_name" "', argument " "1"" of type '" "nlopt::opt const *""'");
8654 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8655 result = (char *)((nlopt::opt const *)arg1)->get_algorithm_name();
8656 resultobj = SWIG_FromCharPtr((const char *)result);
8663 SWIGINTERN PyObject *_wrap_opt_get_dimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8664 PyObject *resultobj = 0;
8665 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8668 PyObject * obj0 = 0 ;
8669 unsigned int result;
8671 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_dimension",&obj0)) SWIG_fail;
8672 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8673 if (!SWIG_IsOK(res1)) {
8674 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_dimension" "', argument " "1"" of type '" "nlopt::opt const *""'");
8676 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8677 result = (unsigned int)((nlopt::opt const *)arg1)->get_dimension();
8678 resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
8685 SWIGINTERN PyObject *_wrap_opt_set_min_objective__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8686 PyObject *resultobj = 0;
8687 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8689 void *arg3 = (void *) 0 ;
8695 PyObject * obj0 = 0 ;
8696 PyObject * obj1 = 0 ;
8697 PyObject * obj2 = 0 ;
8699 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_set_min_objective",&obj0,&obj1,&obj2)) SWIG_fail;
8700 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8701 if (!SWIG_IsOK(res1)) {
8702 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_min_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
8704 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8706 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
8707 if (!SWIG_IsOK(res2)) {
8708 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_set_min_objective" "', argument " "2"" of type '" "nlopt::func""'");
8711 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_min_objective" "', argument " "2"" of type '" "nlopt::func""'");
8713 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
8715 if (SWIG_IsNewObj(res2)) delete temp;
8718 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
8719 if (!SWIG_IsOK(res3)) {
8720 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_set_min_objective" "', argument " "3"" of type '" "void *""'");
8723 (arg1)->set_min_objective(arg2,arg3);
8725 catch(std::bad_alloc &_e) {
8726 PyErr_SetString(PyExc_MemoryError, (_e).what());
8730 catch(std::invalid_argument &_e) {
8731 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8734 resultobj = SWIG_Py_Void();
8741 SWIGINTERN PyObject *_wrap_opt_set_min_objective__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8742 PyObject *resultobj = 0;
8743 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8744 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
8745 void *arg3 = (void *) 0 ;
8749 PyObject * obj0 = 0 ;
8750 PyObject * obj1 = 0 ;
8751 PyObject * obj2 = 0 ;
8753 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_set_min_objective",&obj0,&obj1,&obj2)) SWIG_fail;
8754 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8755 if (!SWIG_IsOK(res1)) {
8756 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_min_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
8758 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8760 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
8761 if (!SWIG_IsOK(res)) {
8762 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_set_min_objective" "', argument " "2"" of type '" "nlopt::vfunc""'");
8765 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
8766 if (!SWIG_IsOK(res3)) {
8767 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_set_min_objective" "', argument " "3"" of type '" "void *""'");
8770 (arg1)->set_min_objective(arg2,arg3);
8772 catch(std::bad_alloc &_e) {
8773 PyErr_SetString(PyExc_MemoryError, (_e).what());
8777 catch(std::invalid_argument &_e) {
8778 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8781 resultobj = SWIG_Py_Void();
8788 SWIGINTERN PyObject *_wrap_opt_set_max_objective__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8789 PyObject *resultobj = 0;
8790 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8792 void *arg3 = (void *) 0 ;
8798 PyObject * obj0 = 0 ;
8799 PyObject * obj1 = 0 ;
8800 PyObject * obj2 = 0 ;
8802 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_set_max_objective",&obj0,&obj1,&obj2)) SWIG_fail;
8803 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8804 if (!SWIG_IsOK(res1)) {
8805 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_max_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
8807 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8809 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
8810 if (!SWIG_IsOK(res2)) {
8811 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_set_max_objective" "', argument " "2"" of type '" "nlopt::func""'");
8814 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_max_objective" "', argument " "2"" of type '" "nlopt::func""'");
8816 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
8818 if (SWIG_IsNewObj(res2)) delete temp;
8821 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
8822 if (!SWIG_IsOK(res3)) {
8823 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_set_max_objective" "', argument " "3"" of type '" "void *""'");
8826 (arg1)->set_max_objective(arg2,arg3);
8828 catch(std::bad_alloc &_e) {
8829 PyErr_SetString(PyExc_MemoryError, (_e).what());
8833 catch(std::invalid_argument &_e) {
8834 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8837 resultobj = SWIG_Py_Void();
8844 SWIGINTERN PyObject *_wrap_opt_set_max_objective__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8845 PyObject *resultobj = 0;
8846 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8847 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
8848 void *arg3 = (void *) 0 ;
8852 PyObject * obj0 = 0 ;
8853 PyObject * obj1 = 0 ;
8854 PyObject * obj2 = 0 ;
8856 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_set_max_objective",&obj0,&obj1,&obj2)) SWIG_fail;
8857 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8858 if (!SWIG_IsOK(res1)) {
8859 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_max_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
8861 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8863 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
8864 if (!SWIG_IsOK(res)) {
8865 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_set_max_objective" "', argument " "2"" of type '" "nlopt::vfunc""'");
8868 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
8869 if (!SWIG_IsOK(res3)) {
8870 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_set_max_objective" "', argument " "3"" of type '" "void *""'");
8873 (arg1)->set_max_objective(arg2,arg3);
8875 catch(std::bad_alloc &_e) {
8876 PyErr_SetString(PyExc_MemoryError, (_e).what());
8880 catch(std::invalid_argument &_e) {
8881 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8884 resultobj = SWIG_Py_Void();
8891 SWIGINTERN PyObject *_wrap_opt_set_min_objective__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8892 PyObject *resultobj = 0;
8893 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8895 void *arg3 = (void *) 0 ;
8900 PyObject * obj0 = 0 ;
8901 PyObject * obj1 = 0 ;
8903 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_min_objective",&obj0,&obj1)) SWIG_fail;
8904 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
8905 if (!SWIG_IsOK(res1)) {
8906 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_min_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
8908 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8911 arg3 = dup_pyfunc((void*) obj1);
8916 (arg1)->set_min_objective(arg2,arg3,arg4,arg5);
8918 catch(std::bad_alloc &_e) {
8919 PyErr_SetString(PyExc_MemoryError, (_e).what());
8923 catch(std::invalid_argument &_e) {
8924 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8927 resultobj = SWIG_Py_Void();
8934 SWIGINTERN PyObject *_wrap_opt_set_min_objective(PyObject *self, PyObject *args) {
8939 if (!PyTuple_Check(args)) SWIG_fail;
8940 argc = args ? (int)PyObject_Length(args) : 0;
8941 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
8942 argv[ii] = PyTuple_GET_ITEM(args,ii);
8947 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8948 _v = SWIG_CheckState(res);
8951 _v = PyCallable_Check(argv[1]);
8955 return _wrap_opt_set_min_objective__SWIG_2(self, args);
8958 return _wrap_opt_set_min_objective__SWIG_2(self, args);
8961 return _wrap_opt_set_min_objective__SWIG_2(self, args);
8963 return _wrap_opt_set_min_objective__SWIG_2(self, args);
8970 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8971 _v = SWIG_CheckState(res);
8974 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
8975 _v = SWIG_CheckState(res);
8978 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
8979 _v = SWIG_CheckState(res);
8981 return _wrap_opt_set_min_objective__SWIG_1(self, args);
8989 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8990 _v = SWIG_CheckState(res);
8992 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
8993 _v = SWIG_CheckState(res);
8996 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
8997 _v = SWIG_CheckState(res);
8999 return _wrap_opt_set_min_objective__SWIG_0(self, args);
9006 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_min_objective'.\n"
9007 " Possible C/C++ prototypes are:\n"
9008 " nlopt::opt::set_min_objective(nlopt::func,void *)\n"
9009 " nlopt::opt::set_min_objective(nlopt::vfunc,void *)\n"
9010 " nlopt::opt::set_min_objective(nlopt::func,void *,nlopt_munge,nlopt_munge)\n");
9015 SWIGINTERN PyObject *_wrap_opt_set_max_objective__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9016 PyObject *resultobj = 0;
9017 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9019 void *arg3 = (void *) 0 ;
9024 PyObject * obj0 = 0 ;
9025 PyObject * obj1 = 0 ;
9027 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_max_objective",&obj0,&obj1)) SWIG_fail;
9028 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9029 if (!SWIG_IsOK(res1)) {
9030 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_max_objective" "', argument " "1"" of type '" "nlopt::opt *""'");
9032 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9035 arg3 = dup_pyfunc((void*) obj1);
9040 (arg1)->set_max_objective(arg2,arg3,arg4,arg5);
9042 catch(std::bad_alloc &_e) {
9043 PyErr_SetString(PyExc_MemoryError, (_e).what());
9047 catch(std::invalid_argument &_e) {
9048 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9051 resultobj = SWIG_Py_Void();
9058 SWIGINTERN PyObject *_wrap_opt_set_max_objective(PyObject *self, PyObject *args) {
9063 if (!PyTuple_Check(args)) SWIG_fail;
9064 argc = args ? (int)PyObject_Length(args) : 0;
9065 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
9066 argv[ii] = PyTuple_GET_ITEM(args,ii);
9071 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9072 _v = SWIG_CheckState(res);
9075 _v = PyCallable_Check(argv[1]);
9079 return _wrap_opt_set_max_objective__SWIG_2(self, args);
9082 return _wrap_opt_set_max_objective__SWIG_2(self, args);
9085 return _wrap_opt_set_max_objective__SWIG_2(self, args);
9087 return _wrap_opt_set_max_objective__SWIG_2(self, args);
9094 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9095 _v = SWIG_CheckState(res);
9098 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9099 _v = SWIG_CheckState(res);
9102 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9103 _v = SWIG_CheckState(res);
9105 return _wrap_opt_set_max_objective__SWIG_1(self, args);
9113 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9114 _v = SWIG_CheckState(res);
9116 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
9117 _v = SWIG_CheckState(res);
9120 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9121 _v = SWIG_CheckState(res);
9123 return _wrap_opt_set_max_objective__SWIG_0(self, args);
9130 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_max_objective'.\n"
9131 " Possible C/C++ prototypes are:\n"
9132 " nlopt::opt::set_max_objective(nlopt::func,void *)\n"
9133 " nlopt::opt::set_max_objective(nlopt::vfunc,void *)\n"
9134 " nlopt::opt::set_max_objective(nlopt::func,void *,nlopt_munge,nlopt_munge)\n");
9139 SWIGINTERN PyObject *_wrap_opt_remove_inequality_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9140 PyObject *resultobj = 0;
9141 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9144 PyObject * obj0 = 0 ;
9146 if (!PyArg_ParseTuple(args,(char *)"O:opt_remove_inequality_constraints",&obj0)) SWIG_fail;
9147 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9148 if (!SWIG_IsOK(res1)) {
9149 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_remove_inequality_constraints" "', argument " "1"" of type '" "nlopt::opt *""'");
9151 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9153 (arg1)->remove_inequality_constraints();
9155 catch(std::invalid_argument &_e) {
9156 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9159 resultobj = SWIG_Py_Void();
9166 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9167 PyObject *resultobj = 0;
9168 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9170 void *arg3 = (void *) 0 ;
9179 PyObject * obj0 = 0 ;
9180 PyObject * obj1 = 0 ;
9181 PyObject * obj2 = 0 ;
9182 PyObject * obj3 = 0 ;
9184 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_inequality_constraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9185 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9186 if (!SWIG_IsOK(res1)) {
9187 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9189 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9191 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
9192 if (!SWIG_IsOK(res2)) {
9193 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9196 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9198 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9200 if (SWIG_IsNewObj(res2)) delete temp;
9203 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9204 if (!SWIG_IsOK(res3)) {
9205 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_inequality_constraint" "', argument " "3"" of type '" "void *""'");
9207 ecode4 = SWIG_AsVal_double(obj3, &val4);
9208 if (!SWIG_IsOK(ecode4)) {
9209 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "opt_add_inequality_constraint" "', argument " "4"" of type '" "double""'");
9211 arg4 = static_cast< double >(val4);
9213 (arg1)->add_inequality_constraint(arg2,arg3,arg4);
9215 catch(std::bad_alloc &_e) {
9216 PyErr_SetString(PyExc_MemoryError, (_e).what());
9220 catch(std::invalid_argument &_e) {
9221 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9224 resultobj = SWIG_Py_Void();
9231 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9232 PyObject *resultobj = 0;
9233 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9235 void *arg3 = (void *) 0 ;
9241 PyObject * obj0 = 0 ;
9242 PyObject * obj1 = 0 ;
9243 PyObject * obj2 = 0 ;
9245 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_inequality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
9246 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9247 if (!SWIG_IsOK(res1)) {
9248 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9250 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9252 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
9253 if (!SWIG_IsOK(res2)) {
9254 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9257 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9259 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9261 if (SWIG_IsNewObj(res2)) delete temp;
9264 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9265 if (!SWIG_IsOK(res3)) {
9266 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_inequality_constraint" "', argument " "3"" of type '" "void *""'");
9269 (arg1)->add_inequality_constraint(arg2,arg3);
9271 catch(std::bad_alloc &_e) {
9272 PyErr_SetString(PyExc_MemoryError, (_e).what());
9276 catch(std::invalid_argument &_e) {
9277 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9280 resultobj = SWIG_Py_Void();
9287 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9288 PyObject *resultobj = 0;
9289 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9290 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
9291 void *arg3 = (void *) 0 ;
9298 PyObject * obj0 = 0 ;
9299 PyObject * obj1 = 0 ;
9300 PyObject * obj2 = 0 ;
9301 PyObject * obj3 = 0 ;
9303 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_inequality_constraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9304 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9305 if (!SWIG_IsOK(res1)) {
9306 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9308 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9310 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9311 if (!SWIG_IsOK(res)) {
9312 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::vfunc""'");
9315 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9316 if (!SWIG_IsOK(res3)) {
9317 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_inequality_constraint" "', argument " "3"" of type '" "void *""'");
9319 ecode4 = SWIG_AsVal_double(obj3, &val4);
9320 if (!SWIG_IsOK(ecode4)) {
9321 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "opt_add_inequality_constraint" "', argument " "4"" of type '" "double""'");
9323 arg4 = static_cast< double >(val4);
9325 (arg1)->add_inequality_constraint(arg2,arg3,arg4);
9327 catch(std::bad_alloc &_e) {
9328 PyErr_SetString(PyExc_MemoryError, (_e).what());
9332 catch(std::invalid_argument &_e) {
9333 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9336 resultobj = SWIG_Py_Void();
9343 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9344 PyObject *resultobj = 0;
9345 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9346 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
9347 void *arg3 = (void *) 0 ;
9351 PyObject * obj0 = 0 ;
9352 PyObject * obj1 = 0 ;
9353 PyObject * obj2 = 0 ;
9355 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_inequality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
9356 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9357 if (!SWIG_IsOK(res1)) {
9358 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9360 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9362 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9363 if (!SWIG_IsOK(res)) {
9364 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::vfunc""'");
9367 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9368 if (!SWIG_IsOK(res3)) {
9369 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_inequality_constraint" "', argument " "3"" of type '" "void *""'");
9372 (arg1)->add_inequality_constraint(arg2,arg3);
9374 catch(std::bad_alloc &_e) {
9375 PyErr_SetString(PyExc_MemoryError, (_e).what());
9379 catch(std::invalid_argument &_e) {
9380 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9383 resultobj = SWIG_Py_Void();
9390 SWIGINTERN PyObject *_wrap_opt_add_inequality_mconstraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9391 PyObject *resultobj = 0;
9392 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9394 void *arg3 = (void *) 0 ;
9395 std::vector< double,std::allocator< double > > *arg4 = 0 ;
9401 PyArrayObject *array4 = NULL ;
9402 int is_new_object4 = 0 ;
9403 std::vector< double > arrayv4 ;
9404 PyObject * obj0 = 0 ;
9405 PyObject * obj1 = 0 ;
9406 PyObject * obj2 = 0 ;
9407 PyObject * obj3 = 0 ;
9409 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_inequality_mconstraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9410 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9411 if (!SWIG_IsOK(res1)) {
9412 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_mconstraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9414 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9416 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_mfunc, 0 | 0);
9417 if (!SWIG_IsOK(res2)) {
9418 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_inequality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9421 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9423 nlopt::mfunc * temp = reinterpret_cast< nlopt::mfunc * >(argp2);
9425 if (SWIG_IsNewObj(res2)) delete temp;
9428 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9429 if (!SWIG_IsOK(res3)) {
9430 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_inequality_mconstraint" "', argument " "3"" of type '" "void *""'");
9433 npy_intp size[1] = {
9436 array4 = obj_to_array_allow_conversion(obj3, NPY_DOUBLE, &is_new_object4);
9437 if (!array4 || !require_dimensions(array4, 1) ||
9438 !require_size(array4, size, 1)) SWIG_fail;
9439 arrayv4 = std::vector<double>(array_size(array4,0));
9442 double *arr_data = (double *) array_data(array4);
9443 int arr_i, arr_s = array_stride(array4,0) / sizeof(double);
9444 int arr_sz = array_size(array4,0);
9445 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
9446 arrayv4[arr_i] = arr_data[arr_i * arr_s];
9450 (arg1)->add_inequality_mconstraint(arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
9452 catch(std::bad_alloc &_e) {
9453 PyErr_SetString(PyExc_MemoryError, (_e).what());
9457 catch(std::invalid_argument &_e) {
9458 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9461 resultobj = SWIG_Py_Void();
9463 if (is_new_object4 && array4)
9471 if (is_new_object4 && array4)
9480 SWIGINTERN PyObject *_wrap_opt_remove_equality_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9481 PyObject *resultobj = 0;
9482 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9485 PyObject * obj0 = 0 ;
9487 if (!PyArg_ParseTuple(args,(char *)"O:opt_remove_equality_constraints",&obj0)) SWIG_fail;
9488 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9489 if (!SWIG_IsOK(res1)) {
9490 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_remove_equality_constraints" "', argument " "1"" of type '" "nlopt::opt *""'");
9492 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9494 (arg1)->remove_equality_constraints();
9496 catch(std::invalid_argument &_e) {
9497 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9500 resultobj = SWIG_Py_Void();
9507 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9508 PyObject *resultobj = 0;
9509 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9511 void *arg3 = (void *) 0 ;
9520 PyObject * obj0 = 0 ;
9521 PyObject * obj1 = 0 ;
9522 PyObject * obj2 = 0 ;
9523 PyObject * obj3 = 0 ;
9525 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_equality_constraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9526 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9527 if (!SWIG_IsOK(res1)) {
9528 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9530 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9532 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
9533 if (!SWIG_IsOK(res2)) {
9534 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9537 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9539 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9541 if (SWIG_IsNewObj(res2)) delete temp;
9544 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9545 if (!SWIG_IsOK(res3)) {
9546 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_equality_constraint" "', argument " "3"" of type '" "void *""'");
9548 ecode4 = SWIG_AsVal_double(obj3, &val4);
9549 if (!SWIG_IsOK(ecode4)) {
9550 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "opt_add_equality_constraint" "', argument " "4"" of type '" "double""'");
9552 arg4 = static_cast< double >(val4);
9554 (arg1)->add_equality_constraint(arg2,arg3,arg4);
9556 catch(std::bad_alloc &_e) {
9557 PyErr_SetString(PyExc_MemoryError, (_e).what());
9561 catch(std::invalid_argument &_e) {
9562 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9565 resultobj = SWIG_Py_Void();
9572 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9573 PyObject *resultobj = 0;
9574 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9576 void *arg3 = (void *) 0 ;
9582 PyObject * obj0 = 0 ;
9583 PyObject * obj1 = 0 ;
9584 PyObject * obj2 = 0 ;
9586 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_equality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
9587 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9588 if (!SWIG_IsOK(res1)) {
9589 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9591 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9593 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_func, 0 | 0);
9594 if (!SWIG_IsOK(res2)) {
9595 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9598 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9600 nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9602 if (SWIG_IsNewObj(res2)) delete temp;
9605 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9606 if (!SWIG_IsOK(res3)) {
9607 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_equality_constraint" "', argument " "3"" of type '" "void *""'");
9610 (arg1)->add_equality_constraint(arg2,arg3);
9612 catch(std::bad_alloc &_e) {
9613 PyErr_SetString(PyExc_MemoryError, (_e).what());
9617 catch(std::invalid_argument &_e) {
9618 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9621 resultobj = SWIG_Py_Void();
9628 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9629 PyObject *resultobj = 0;
9630 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9631 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
9632 void *arg3 = (void *) 0 ;
9639 PyObject * obj0 = 0 ;
9640 PyObject * obj1 = 0 ;
9641 PyObject * obj2 = 0 ;
9642 PyObject * obj3 = 0 ;
9644 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_equality_constraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9645 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9646 if (!SWIG_IsOK(res1)) {
9647 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9649 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9651 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9652 if (!SWIG_IsOK(res)) {
9653 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::vfunc""'");
9656 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9657 if (!SWIG_IsOK(res3)) {
9658 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_equality_constraint" "', argument " "3"" of type '" "void *""'");
9660 ecode4 = SWIG_AsVal_double(obj3, &val4);
9661 if (!SWIG_IsOK(ecode4)) {
9662 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "opt_add_equality_constraint" "', argument " "4"" of type '" "double""'");
9664 arg4 = static_cast< double >(val4);
9666 (arg1)->add_equality_constraint(arg2,arg3,arg4);
9668 catch(std::bad_alloc &_e) {
9669 PyErr_SetString(PyExc_MemoryError, (_e).what());
9673 catch(std::invalid_argument &_e) {
9674 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9677 resultobj = SWIG_Py_Void();
9684 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9685 PyObject *resultobj = 0;
9686 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9687 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
9688 void *arg3 = (void *) 0 ;
9692 PyObject * obj0 = 0 ;
9693 PyObject * obj1 = 0 ;
9694 PyObject * obj2 = 0 ;
9696 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_equality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
9697 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9698 if (!SWIG_IsOK(res1)) {
9699 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9701 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9703 int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9704 if (!SWIG_IsOK(res)) {
9705 SWIG_exception_fail(SWIG_ArgError(res), "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::vfunc""'");
9708 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9709 if (!SWIG_IsOK(res3)) {
9710 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_equality_constraint" "', argument " "3"" of type '" "void *""'");
9713 (arg1)->add_equality_constraint(arg2,arg3);
9715 catch(std::bad_alloc &_e) {
9716 PyErr_SetString(PyExc_MemoryError, (_e).what());
9720 catch(std::invalid_argument &_e) {
9721 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9724 resultobj = SWIG_Py_Void();
9731 SWIGINTERN PyObject *_wrap_opt_add_equality_mconstraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9732 PyObject *resultobj = 0;
9733 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9735 void *arg3 = (void *) 0 ;
9736 std::vector< double,std::allocator< double > > *arg4 = 0 ;
9742 PyArrayObject *array4 = NULL ;
9743 int is_new_object4 = 0 ;
9744 std::vector< double > arrayv4 ;
9745 PyObject * obj0 = 0 ;
9746 PyObject * obj1 = 0 ;
9747 PyObject * obj2 = 0 ;
9748 PyObject * obj3 = 0 ;
9750 if (!PyArg_ParseTuple(args,(char *)"OOOO:opt_add_equality_mconstraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9751 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9752 if (!SWIG_IsOK(res1)) {
9753 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_mconstraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9755 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9757 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt_mfunc, 0 | 0);
9758 if (!SWIG_IsOK(res2)) {
9759 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_add_equality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9762 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9764 nlopt::mfunc * temp = reinterpret_cast< nlopt::mfunc * >(argp2);
9766 if (SWIG_IsNewObj(res2)) delete temp;
9769 res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
9770 if (!SWIG_IsOK(res3)) {
9771 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_add_equality_mconstraint" "', argument " "3"" of type '" "void *""'");
9774 npy_intp size[1] = {
9777 array4 = obj_to_array_allow_conversion(obj3, NPY_DOUBLE, &is_new_object4);
9778 if (!array4 || !require_dimensions(array4, 1) ||
9779 !require_size(array4, size, 1)) SWIG_fail;
9780 arrayv4 = std::vector<double>(array_size(array4,0));
9783 double *arr_data = (double *) array_data(array4);
9784 int arr_i, arr_s = array_stride(array4,0) / sizeof(double);
9785 int arr_sz = array_size(array4,0);
9786 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
9787 arrayv4[arr_i] = arr_data[arr_i * arr_s];
9791 (arg1)->add_equality_mconstraint(arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
9793 catch(std::bad_alloc &_e) {
9794 PyErr_SetString(PyExc_MemoryError, (_e).what());
9798 catch(std::invalid_argument &_e) {
9799 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9802 resultobj = SWIG_Py_Void();
9804 if (is_new_object4 && array4)
9812 if (is_new_object4 && array4)
9821 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9822 PyObject *resultobj = 0;
9823 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9825 void *arg3 = (void *) 0 ;
9833 PyObject * obj0 = 0 ;
9834 PyObject * obj1 = 0 ;
9835 PyObject * obj2 = 0 ;
9837 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_inequality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
9838 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9839 if (!SWIG_IsOK(res1)) {
9840 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9842 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9845 arg3 = dup_pyfunc((void*) obj1);
9849 ecode6 = SWIG_AsVal_double(obj2, &val6);
9850 if (!SWIG_IsOK(ecode6)) {
9851 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "opt_add_inequality_constraint" "', argument " "6"" of type '" "double""'");
9853 arg6 = static_cast< double >(val6);
9855 (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5,arg6);
9857 catch(std::bad_alloc &_e) {
9858 PyErr_SetString(PyExc_MemoryError, (_e).what());
9862 catch(std::invalid_argument &_e) {
9863 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9866 resultobj = SWIG_Py_Void();
9873 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9874 PyObject *resultobj = 0;
9875 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9877 void *arg3 = (void *) 0 ;
9882 PyObject * obj0 = 0 ;
9883 PyObject * obj1 = 0 ;
9885 if (!PyArg_ParseTuple(args,(char *)"OO:opt_add_inequality_constraint",&obj0,&obj1)) SWIG_fail;
9886 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
9887 if (!SWIG_IsOK(res1)) {
9888 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
9890 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9893 arg3 = dup_pyfunc((void*) obj1);
9898 (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5);
9900 catch(std::bad_alloc &_e) {
9901 PyErr_SetString(PyExc_MemoryError, (_e).what());
9905 catch(std::invalid_argument &_e) {
9906 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9909 resultobj = SWIG_Py_Void();
9916 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint(PyObject *self, PyObject *args) {
9921 if (!PyTuple_Check(args)) SWIG_fail;
9922 argc = args ? (int)PyObject_Length(args) : 0;
9923 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
9924 argv[ii] = PyTuple_GET_ITEM(args,ii);
9929 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9930 _v = SWIG_CheckState(res);
9933 _v = PyCallable_Check(argv[1]);
9937 return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9940 return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9943 return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9945 return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9952 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9953 _v = SWIG_CheckState(res);
9956 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
9957 _v = SWIG_CheckState(res);
9960 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9961 _v = SWIG_CheckState(res);
9963 return _wrap_opt_add_inequality_constraint__SWIG_3(self, args);
9971 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9972 _v = SWIG_CheckState(res);
9975 _v = PyCallable_Check(argv[1]);
9979 int res = SWIG_AsVal_double(argv[2], NULL);
9980 _v = SWIG_CheckState(res);
9983 return _wrap_opt_add_inequality_constraint__SWIG_4(self, args);
9991 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9992 _v = SWIG_CheckState(res);
9994 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
9995 _v = SWIG_CheckState(res);
9998 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9999 _v = SWIG_CheckState(res);
10001 return _wrap_opt_add_inequality_constraint__SWIG_1(self, args);
10009 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10010 _v = SWIG_CheckState(res);
10013 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
10014 _v = SWIG_CheckState(res);
10017 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10018 _v = SWIG_CheckState(res);
10021 int res = SWIG_AsVal_double(argv[3], NULL);
10022 _v = SWIG_CheckState(res);
10025 return _wrap_opt_add_inequality_constraint__SWIG_2(self, args);
10034 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10035 _v = SWIG_CheckState(res);
10037 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10038 _v = SWIG_CheckState(res);
10041 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10042 _v = SWIG_CheckState(res);
10045 int res = SWIG_AsVal_double(argv[3], NULL);
10046 _v = SWIG_CheckState(res);
10049 return _wrap_opt_add_inequality_constraint__SWIG_0(self, args);
10057 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_add_inequality_constraint'.\n"
10058 " Possible C/C++ prototypes are:\n"
10059 " nlopt::opt::add_inequality_constraint(nlopt::func,void *,double)\n"
10060 " nlopt::opt::add_inequality_constraint(nlopt::func,void *)\n"
10061 " nlopt::opt::add_inequality_constraint(nlopt::vfunc,void *,double)\n"
10062 " nlopt::opt::add_inequality_constraint(nlopt::vfunc,void *)\n"
10063 " nlopt::opt::add_inequality_constraint(nlopt::func,void *,nlopt_munge,nlopt_munge,double)\n"
10064 " nlopt::opt::add_inequality_constraint(nlopt::func,void *,nlopt_munge,nlopt_munge)\n");
10069 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10070 PyObject *resultobj = 0;
10071 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10073 void *arg3 = (void *) 0 ;
10081 PyObject * obj0 = 0 ;
10082 PyObject * obj1 = 0 ;
10083 PyObject * obj2 = 0 ;
10085 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_equality_constraint",&obj0,&obj1,&obj2)) SWIG_fail;
10086 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10087 if (!SWIG_IsOK(res1)) {
10088 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
10090 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10092 arg2 = func_python;
10093 arg3 = dup_pyfunc((void*) obj1);
10094 arg4 = free_pyfunc;
10097 ecode6 = SWIG_AsVal_double(obj2, &val6);
10098 if (!SWIG_IsOK(ecode6)) {
10099 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "opt_add_equality_constraint" "', argument " "6"" of type '" "double""'");
10101 arg6 = static_cast< double >(val6);
10103 (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5,arg6);
10105 catch(std::bad_alloc &_e) {
10106 PyErr_SetString(PyExc_MemoryError, (_e).what());
10110 catch(std::invalid_argument &_e) {
10111 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10114 resultobj = SWIG_Py_Void();
10121 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10122 PyObject *resultobj = 0;
10123 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10125 void *arg3 = (void *) 0 ;
10130 PyObject * obj0 = 0 ;
10131 PyObject * obj1 = 0 ;
10133 if (!PyArg_ParseTuple(args,(char *)"OO:opt_add_equality_constraint",&obj0,&obj1)) SWIG_fail;
10134 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10135 if (!SWIG_IsOK(res1)) {
10136 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_constraint" "', argument " "1"" of type '" "nlopt::opt *""'");
10138 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10140 arg2 = func_python;
10141 arg3 = dup_pyfunc((void*) obj1);
10142 arg4 = free_pyfunc;
10146 (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5);
10148 catch(std::bad_alloc &_e) {
10149 PyErr_SetString(PyExc_MemoryError, (_e).what());
10153 catch(std::invalid_argument &_e) {
10154 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10157 resultobj = SWIG_Py_Void();
10164 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint(PyObject *self, PyObject *args) {
10169 if (!PyTuple_Check(args)) SWIG_fail;
10170 argc = args ? (int)PyObject_Length(args) : 0;
10171 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
10172 argv[ii] = PyTuple_GET_ITEM(args,ii);
10177 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10178 _v = SWIG_CheckState(res);
10181 _v = PyCallable_Check(argv[1]);
10185 return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10188 return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10191 return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10193 return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10200 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10201 _v = SWIG_CheckState(res);
10204 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
10205 _v = SWIG_CheckState(res);
10208 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10209 _v = SWIG_CheckState(res);
10211 return _wrap_opt_add_equality_constraint__SWIG_3(self, args);
10219 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10220 _v = SWIG_CheckState(res);
10223 _v = PyCallable_Check(argv[1]);
10227 int res = SWIG_AsVal_double(argv[2], NULL);
10228 _v = SWIG_CheckState(res);
10231 return _wrap_opt_add_equality_constraint__SWIG_4(self, args);
10239 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10240 _v = SWIG_CheckState(res);
10242 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10243 _v = SWIG_CheckState(res);
10246 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10247 _v = SWIG_CheckState(res);
10249 return _wrap_opt_add_equality_constraint__SWIG_1(self, args);
10257 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10258 _v = SWIG_CheckState(res);
10261 int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double);
10262 _v = SWIG_CheckState(res);
10265 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10266 _v = SWIG_CheckState(res);
10269 int res = SWIG_AsVal_double(argv[3], NULL);
10270 _v = SWIG_CheckState(res);
10273 return _wrap_opt_add_equality_constraint__SWIG_2(self, args);
10282 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10283 _v = SWIG_CheckState(res);
10285 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10286 _v = SWIG_CheckState(res);
10289 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10290 _v = SWIG_CheckState(res);
10293 int res = SWIG_AsVal_double(argv[3], NULL);
10294 _v = SWIG_CheckState(res);
10297 return _wrap_opt_add_equality_constraint__SWIG_0(self, args);
10305 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_add_equality_constraint'.\n"
10306 " Possible C/C++ prototypes are:\n"
10307 " nlopt::opt::add_equality_constraint(nlopt::func,void *,double)\n"
10308 " nlopt::opt::add_equality_constraint(nlopt::func,void *)\n"
10309 " nlopt::opt::add_equality_constraint(nlopt::vfunc,void *,double)\n"
10310 " nlopt::opt::add_equality_constraint(nlopt::vfunc,void *)\n"
10311 " nlopt::opt::add_equality_constraint(nlopt::func,void *,nlopt_munge,nlopt_munge,double)\n"
10312 " nlopt::opt::add_equality_constraint(nlopt::func,void *,nlopt_munge,nlopt_munge)\n");
10317 SWIGINTERN PyObject *_wrap_opt_add_inequality_mconstraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10318 PyObject *resultobj = 0;
10319 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10320 nlopt::mfunc arg2 ;
10321 void *arg3 = (void *) 0 ;
10324 std::vector< double,std::allocator< double > > *arg6 = 0 ;
10327 PyArrayObject *array6 = NULL ;
10328 int is_new_object6 = 0 ;
10329 std::vector< double > arrayv6 ;
10330 PyObject * obj0 = 0 ;
10331 PyObject * obj1 = 0 ;
10332 PyObject * obj2 = 0 ;
10334 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_inequality_mconstraint",&obj0,&obj1,&obj2)) SWIG_fail;
10335 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10336 if (!SWIG_IsOK(res1)) {
10337 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_inequality_mconstraint" "', argument " "1"" of type '" "nlopt::opt *""'");
10339 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10341 arg2 = mfunc_python;
10342 arg3 = dup_pyfunc((void*) obj1);
10343 arg4 = free_pyfunc;
10347 npy_intp size[1] = {
10350 array6 = obj_to_array_allow_conversion(obj2, NPY_DOUBLE, &is_new_object6);
10351 if (!array6 || !require_dimensions(array6, 1) ||
10352 !require_size(array6, size, 1)) SWIG_fail;
10353 arrayv6 = std::vector<double>(array_size(array6,0));
10356 double *arr_data = (double *) array_data(array6);
10357 int arr_i, arr_s = array_stride(array6,0) / sizeof(double);
10358 int arr_sz = array_size(array6,0);
10359 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
10360 arrayv6[arr_i] = arr_data[arr_i * arr_s];
10364 (arg1)->add_inequality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double,std::allocator< double > > const &)*arg6);
10366 catch(std::bad_alloc &_e) {
10367 PyErr_SetString(PyExc_MemoryError, (_e).what());
10371 catch(std::invalid_argument &_e) {
10372 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10375 resultobj = SWIG_Py_Void();
10377 if (is_new_object6 && array6)
10385 if (is_new_object6 && array6)
10394 SWIGINTERN PyObject *_wrap_opt_add_inequality_mconstraint(PyObject *self, PyObject *args) {
10399 if (!PyTuple_Check(args)) SWIG_fail;
10400 argc = args ? (int)PyObject_Length(args) : 0;
10401 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
10402 argv[ii] = PyTuple_GET_ITEM(args,ii);
10407 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10408 _v = SWIG_CheckState(res);
10411 _v = PyCallable_Check(argv[1]);
10415 _v = is_array(argv[2]) || PySequence_Check(argv[2]);
10418 return _wrap_opt_add_inequality_mconstraint__SWIG_1(self, args);
10426 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10427 _v = SWIG_CheckState(res);
10429 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_mfunc, 0);
10430 _v = SWIG_CheckState(res);
10433 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10434 _v = SWIG_CheckState(res);
10437 _v = is_array(argv[3]) || PySequence_Check(argv[3]);
10440 return _wrap_opt_add_inequality_mconstraint__SWIG_0(self, args);
10448 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_add_inequality_mconstraint'.\n"
10449 " Possible C/C++ prototypes are:\n"
10450 " nlopt::opt::add_inequality_mconstraint(nlopt::mfunc,void *,std::vector< double,std::allocator< double > > const &)\n"
10451 " nlopt::opt::add_inequality_mconstraint(nlopt::mfunc,void *,nlopt_munge,nlopt_munge,std::vector< double,std::allocator< double > > const &)\n");
10456 SWIGINTERN PyObject *_wrap_opt_add_equality_mconstraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10457 PyObject *resultobj = 0;
10458 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10459 nlopt::mfunc arg2 ;
10460 void *arg3 = (void *) 0 ;
10463 std::vector< double,std::allocator< double > > *arg6 = 0 ;
10466 PyArrayObject *array6 = NULL ;
10467 int is_new_object6 = 0 ;
10468 std::vector< double > arrayv6 ;
10469 PyObject * obj0 = 0 ;
10470 PyObject * obj1 = 0 ;
10471 PyObject * obj2 = 0 ;
10473 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_add_equality_mconstraint",&obj0,&obj1,&obj2)) SWIG_fail;
10474 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10475 if (!SWIG_IsOK(res1)) {
10476 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_add_equality_mconstraint" "', argument " "1"" of type '" "nlopt::opt *""'");
10478 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10480 arg2 = mfunc_python;
10481 arg3 = dup_pyfunc((void*) obj1);
10482 arg4 = free_pyfunc;
10486 npy_intp size[1] = {
10489 array6 = obj_to_array_allow_conversion(obj2, NPY_DOUBLE, &is_new_object6);
10490 if (!array6 || !require_dimensions(array6, 1) ||
10491 !require_size(array6, size, 1)) SWIG_fail;
10492 arrayv6 = std::vector<double>(array_size(array6,0));
10495 double *arr_data = (double *) array_data(array6);
10496 int arr_i, arr_s = array_stride(array6,0) / sizeof(double);
10497 int arr_sz = array_size(array6,0);
10498 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
10499 arrayv6[arr_i] = arr_data[arr_i * arr_s];
10503 (arg1)->add_equality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double,std::allocator< double > > const &)*arg6);
10505 catch(std::bad_alloc &_e) {
10506 PyErr_SetString(PyExc_MemoryError, (_e).what());
10510 catch(std::invalid_argument &_e) {
10511 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10514 resultobj = SWIG_Py_Void();
10516 if (is_new_object6 && array6)
10524 if (is_new_object6 && array6)
10533 SWIGINTERN PyObject *_wrap_opt_add_equality_mconstraint(PyObject *self, PyObject *args) {
10538 if (!PyTuple_Check(args)) SWIG_fail;
10539 argc = args ? (int)PyObject_Length(args) : 0;
10540 for (ii = 0; (ii < 4) && (ii < argc); ii++) {
10541 argv[ii] = PyTuple_GET_ITEM(args,ii);
10546 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10547 _v = SWIG_CheckState(res);
10550 _v = PyCallable_Check(argv[1]);
10554 _v = is_array(argv[2]) || PySequence_Check(argv[2]);
10557 return _wrap_opt_add_equality_mconstraint__SWIG_1(self, args);
10565 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10566 _v = SWIG_CheckState(res);
10568 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_mfunc, 0);
10569 _v = SWIG_CheckState(res);
10572 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10573 _v = SWIG_CheckState(res);
10576 _v = is_array(argv[3]) || PySequence_Check(argv[3]);
10579 return _wrap_opt_add_equality_mconstraint__SWIG_0(self, args);
10587 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_add_equality_mconstraint'.\n"
10588 " Possible C/C++ prototypes are:\n"
10589 " nlopt::opt::add_equality_mconstraint(nlopt::mfunc,void *,std::vector< double,std::allocator< double > > const &)\n"
10590 " nlopt::opt::add_equality_mconstraint(nlopt::mfunc,void *,nlopt_munge,nlopt_munge,std::vector< double,std::allocator< double > > const &)\n");
10595 SWIGINTERN PyObject *_wrap_opt_set_lower_bounds__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10596 PyObject *resultobj = 0;
10597 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10603 PyObject * obj0 = 0 ;
10604 PyObject * obj1 = 0 ;
10606 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_lower_bounds",&obj0,&obj1)) SWIG_fail;
10607 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10608 if (!SWIG_IsOK(res1)) {
10609 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_lower_bounds" "', argument " "1"" of type '" "nlopt::opt *""'");
10611 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10612 ecode2 = SWIG_AsVal_double(obj1, &val2);
10613 if (!SWIG_IsOK(ecode2)) {
10614 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_lower_bounds" "', argument " "2"" of type '" "double""'");
10616 arg2 = static_cast< double >(val2);
10618 (arg1)->set_lower_bounds(arg2);
10620 catch(std::invalid_argument &_e) {
10621 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10624 resultobj = SWIG_Py_Void();
10631 SWIGINTERN PyObject *_wrap_opt_get_lower_bounds__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10632 PyObject *resultobj = 0;
10633 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10634 std::vector< double,std::allocator< double > > *arg2 = 0 ;
10639 PyObject * obj0 = 0 ;
10640 PyObject * obj1 = 0 ;
10642 if (!PyArg_ParseTuple(args,(char *)"OO:opt_get_lower_bounds",&obj0,&obj1)) SWIG_fail;
10643 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10644 if (!SWIG_IsOK(res1)) {
10645 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_lower_bounds" "', argument " "1"" of type '" "nlopt::opt const *""'");
10647 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10648 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
10649 if (!SWIG_IsOK(res2)) {
10650 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_get_lower_bounds" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
10653 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_get_lower_bounds" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
10655 arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
10656 ((nlopt::opt const *)arg1)->get_lower_bounds(*arg2);
10657 resultobj = SWIG_Py_Void();
10664 SWIGINTERN PyObject *_wrap_opt_get_lower_bounds__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10665 PyObject *resultobj = 0;
10666 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10669 PyObject * obj0 = 0 ;
10670 std::vector< double,std::allocator< double > > result;
10672 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_lower_bounds",&obj0)) SWIG_fail;
10673 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10674 if (!SWIG_IsOK(res1)) {
10675 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_lower_bounds" "', argument " "1"" of type '" "nlopt::opt const *""'");
10677 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10678 result = ((nlopt::opt const *)arg1)->get_lower_bounds();
10680 npy_intp sz = (&result)->size();
10681 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
10682 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
10683 sizeof(double) * sz);
10691 SWIGINTERN PyObject *_wrap_opt_get_lower_bounds(PyObject *self, PyObject *args) {
10696 if (!PyTuple_Check(args)) SWIG_fail;
10697 argc = args ? (int)PyObject_Length(args) : 0;
10698 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
10699 argv[ii] = PyTuple_GET_ITEM(args,ii);
10704 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10705 _v = SWIG_CheckState(res);
10707 return _wrap_opt_get_lower_bounds__SWIG_1(self, args);
10713 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10714 _v = SWIG_CheckState(res);
10717 int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
10718 _v = SWIG_CheckState(res);
10720 return _wrap_opt_get_lower_bounds__SWIG_0(self, args);
10726 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_get_lower_bounds'.\n"
10727 " Possible C/C++ prototypes are:\n"
10728 " nlopt::opt::get_lower_bounds(std::vector< double,std::allocator< double > > &) const\n"
10729 " nlopt::opt::get_lower_bounds() const\n");
10734 SWIGINTERN PyObject *_wrap_opt_set_lower_bounds__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10735 PyObject *resultobj = 0;
10736 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10737 std::vector< double,std::allocator< double > > *arg2 = 0 ;
10740 PyArrayObject *array2 = NULL ;
10741 int is_new_object2 = 0 ;
10742 std::vector< double > arrayv2 ;
10743 PyObject * obj0 = 0 ;
10744 PyObject * obj1 = 0 ;
10746 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_lower_bounds",&obj0,&obj1)) SWIG_fail;
10747 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10748 if (!SWIG_IsOK(res1)) {
10749 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_lower_bounds" "', argument " "1"" of type '" "nlopt::opt *""'");
10751 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10753 npy_intp size[1] = {
10756 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
10757 if (!array2 || !require_dimensions(array2, 1) ||
10758 !require_size(array2, size, 1)) SWIG_fail;
10759 arrayv2 = std::vector<double>(array_size(array2,0));
10762 double *arr_data = (double *) array_data(array2);
10763 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
10764 int arr_sz = array_size(array2,0);
10765 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
10766 arrayv2[arr_i] = arr_data[arr_i * arr_s];
10770 (arg1)->set_lower_bounds((std::vector< double,std::allocator< double > > const &)*arg2);
10772 catch(std::invalid_argument &_e) {
10773 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10776 resultobj = SWIG_Py_Void();
10778 if (is_new_object2 && array2)
10786 if (is_new_object2 && array2)
10795 SWIGINTERN PyObject *_wrap_opt_set_lower_bounds(PyObject *self, PyObject *args) {
10800 if (!PyTuple_Check(args)) SWIG_fail;
10801 argc = args ? (int)PyObject_Length(args) : 0;
10802 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
10803 argv[ii] = PyTuple_GET_ITEM(args,ii);
10808 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10809 _v = SWIG_CheckState(res);
10812 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
10815 return _wrap_opt_set_lower_bounds__SWIG_1(self, args);
10822 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10823 _v = SWIG_CheckState(res);
10826 int res = SWIG_AsVal_double(argv[1], NULL);
10827 _v = SWIG_CheckState(res);
10830 return _wrap_opt_set_lower_bounds__SWIG_0(self, args);
10836 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_lower_bounds'.\n"
10837 " Possible C/C++ prototypes are:\n"
10838 " nlopt::opt::set_lower_bounds(double)\n"
10839 " nlopt::opt::set_lower_bounds(std::vector< double,std::allocator< double > > const &)\n");
10844 SWIGINTERN PyObject *_wrap_opt_set_upper_bounds__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10845 PyObject *resultobj = 0;
10846 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10852 PyObject * obj0 = 0 ;
10853 PyObject * obj1 = 0 ;
10855 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_upper_bounds",&obj0,&obj1)) SWIG_fail;
10856 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10857 if (!SWIG_IsOK(res1)) {
10858 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_upper_bounds" "', argument " "1"" of type '" "nlopt::opt *""'");
10860 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10861 ecode2 = SWIG_AsVal_double(obj1, &val2);
10862 if (!SWIG_IsOK(ecode2)) {
10863 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_upper_bounds" "', argument " "2"" of type '" "double""'");
10865 arg2 = static_cast< double >(val2);
10867 (arg1)->set_upper_bounds(arg2);
10869 catch(std::invalid_argument &_e) {
10870 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10873 resultobj = SWIG_Py_Void();
10880 SWIGINTERN PyObject *_wrap_opt_get_upper_bounds__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10881 PyObject *resultobj = 0;
10882 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10883 std::vector< double,std::allocator< double > > *arg2 = 0 ;
10888 PyObject * obj0 = 0 ;
10889 PyObject * obj1 = 0 ;
10891 if (!PyArg_ParseTuple(args,(char *)"OO:opt_get_upper_bounds",&obj0,&obj1)) SWIG_fail;
10892 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10893 if (!SWIG_IsOK(res1)) {
10894 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_upper_bounds" "', argument " "1"" of type '" "nlopt::opt const *""'");
10896 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10897 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
10898 if (!SWIG_IsOK(res2)) {
10899 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_get_upper_bounds" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
10902 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_get_upper_bounds" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
10904 arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
10905 ((nlopt::opt const *)arg1)->get_upper_bounds(*arg2);
10906 resultobj = SWIG_Py_Void();
10913 SWIGINTERN PyObject *_wrap_opt_get_upper_bounds__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10914 PyObject *resultobj = 0;
10915 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10918 PyObject * obj0 = 0 ;
10919 std::vector< double,std::allocator< double > > result;
10921 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_upper_bounds",&obj0)) SWIG_fail;
10922 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10923 if (!SWIG_IsOK(res1)) {
10924 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_upper_bounds" "', argument " "1"" of type '" "nlopt::opt const *""'");
10926 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10927 result = ((nlopt::opt const *)arg1)->get_upper_bounds();
10929 npy_intp sz = (&result)->size();
10930 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
10931 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
10932 sizeof(double) * sz);
10940 SWIGINTERN PyObject *_wrap_opt_get_upper_bounds(PyObject *self, PyObject *args) {
10945 if (!PyTuple_Check(args)) SWIG_fail;
10946 argc = args ? (int)PyObject_Length(args) : 0;
10947 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
10948 argv[ii] = PyTuple_GET_ITEM(args,ii);
10953 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10954 _v = SWIG_CheckState(res);
10956 return _wrap_opt_get_upper_bounds__SWIG_1(self, args);
10962 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10963 _v = SWIG_CheckState(res);
10966 int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
10967 _v = SWIG_CheckState(res);
10969 return _wrap_opt_get_upper_bounds__SWIG_0(self, args);
10975 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_get_upper_bounds'.\n"
10976 " Possible C/C++ prototypes are:\n"
10977 " nlopt::opt::get_upper_bounds(std::vector< double,std::allocator< double > > &) const\n"
10978 " nlopt::opt::get_upper_bounds() const\n");
10983 SWIGINTERN PyObject *_wrap_opt_set_upper_bounds__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10984 PyObject *resultobj = 0;
10985 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
10986 std::vector< double,std::allocator< double > > *arg2 = 0 ;
10989 PyArrayObject *array2 = NULL ;
10990 int is_new_object2 = 0 ;
10991 std::vector< double > arrayv2 ;
10992 PyObject * obj0 = 0 ;
10993 PyObject * obj1 = 0 ;
10995 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_upper_bounds",&obj0,&obj1)) SWIG_fail;
10996 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
10997 if (!SWIG_IsOK(res1)) {
10998 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_upper_bounds" "', argument " "1"" of type '" "nlopt::opt *""'");
11000 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11002 npy_intp size[1] = {
11005 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
11006 if (!array2 || !require_dimensions(array2, 1) ||
11007 !require_size(array2, size, 1)) SWIG_fail;
11008 arrayv2 = std::vector<double>(array_size(array2,0));
11011 double *arr_data = (double *) array_data(array2);
11012 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
11013 int arr_sz = array_size(array2,0);
11014 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
11015 arrayv2[arr_i] = arr_data[arr_i * arr_s];
11019 (arg1)->set_upper_bounds((std::vector< double,std::allocator< double > > const &)*arg2);
11021 catch(std::invalid_argument &_e) {
11022 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11025 resultobj = SWIG_Py_Void();
11027 if (is_new_object2 && array2)
11035 if (is_new_object2 && array2)
11044 SWIGINTERN PyObject *_wrap_opt_set_upper_bounds(PyObject *self, PyObject *args) {
11049 if (!PyTuple_Check(args)) SWIG_fail;
11050 argc = args ? (int)PyObject_Length(args) : 0;
11051 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
11052 argv[ii] = PyTuple_GET_ITEM(args,ii);
11057 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11058 _v = SWIG_CheckState(res);
11061 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
11064 return _wrap_opt_set_upper_bounds__SWIG_1(self, args);
11071 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11072 _v = SWIG_CheckState(res);
11075 int res = SWIG_AsVal_double(argv[1], NULL);
11076 _v = SWIG_CheckState(res);
11079 return _wrap_opt_set_upper_bounds__SWIG_0(self, args);
11085 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_upper_bounds'.\n"
11086 " Possible C/C++ prototypes are:\n"
11087 " nlopt::opt::set_upper_bounds(double)\n"
11088 " nlopt::opt::set_upper_bounds(std::vector< double,std::allocator< double > > const &)\n");
11093 SWIGINTERN PyObject *_wrap_opt_get_stopval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11094 PyObject *resultobj = 0;
11095 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11098 PyObject * obj0 = 0 ;
11101 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_stopval",&obj0)) SWIG_fail;
11102 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11103 if (!SWIG_IsOK(res1)) {
11104 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_stopval" "', argument " "1"" of type '" "nlopt::opt const *""'");
11106 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11107 result = (double)((nlopt::opt const *)arg1)->get_stopval();
11108 resultobj = SWIG_From_double(static_cast< double >(result));
11115 SWIGINTERN PyObject *_wrap_opt_set_stopval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11116 PyObject *resultobj = 0;
11117 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11123 PyObject * obj0 = 0 ;
11124 PyObject * obj1 = 0 ;
11126 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_stopval",&obj0,&obj1)) SWIG_fail;
11127 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11128 if (!SWIG_IsOK(res1)) {
11129 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_stopval" "', argument " "1"" of type '" "nlopt::opt *""'");
11131 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11132 ecode2 = SWIG_AsVal_double(obj1, &val2);
11133 if (!SWIG_IsOK(ecode2)) {
11134 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_stopval" "', argument " "2"" of type '" "double""'");
11136 arg2 = static_cast< double >(val2);
11138 (arg1)->set_stopval(arg2);
11140 catch(std::invalid_argument &_e) {
11141 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11144 resultobj = SWIG_Py_Void();
11151 SWIGINTERN PyObject *_wrap_opt_get_ftol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11152 PyObject *resultobj = 0;
11153 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11156 PyObject * obj0 = 0 ;
11159 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_ftol_rel",&obj0)) SWIG_fail;
11160 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11161 if (!SWIG_IsOK(res1)) {
11162 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_ftol_rel" "', argument " "1"" of type '" "nlopt::opt const *""'");
11164 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11165 result = (double)((nlopt::opt const *)arg1)->get_ftol_rel();
11166 resultobj = SWIG_From_double(static_cast< double >(result));
11173 SWIGINTERN PyObject *_wrap_opt_set_ftol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11174 PyObject *resultobj = 0;
11175 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11181 PyObject * obj0 = 0 ;
11182 PyObject * obj1 = 0 ;
11184 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_ftol_rel",&obj0,&obj1)) SWIG_fail;
11185 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11186 if (!SWIG_IsOK(res1)) {
11187 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_ftol_rel" "', argument " "1"" of type '" "nlopt::opt *""'");
11189 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11190 ecode2 = SWIG_AsVal_double(obj1, &val2);
11191 if (!SWIG_IsOK(ecode2)) {
11192 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_ftol_rel" "', argument " "2"" of type '" "double""'");
11194 arg2 = static_cast< double >(val2);
11196 (arg1)->set_ftol_rel(arg2);
11198 catch(std::invalid_argument &_e) {
11199 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11202 resultobj = SWIG_Py_Void();
11209 SWIGINTERN PyObject *_wrap_opt_get_ftol_abs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11210 PyObject *resultobj = 0;
11211 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11214 PyObject * obj0 = 0 ;
11217 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_ftol_abs",&obj0)) SWIG_fail;
11218 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11219 if (!SWIG_IsOK(res1)) {
11220 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_ftol_abs" "', argument " "1"" of type '" "nlopt::opt const *""'");
11222 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11223 result = (double)((nlopt::opt const *)arg1)->get_ftol_abs();
11224 resultobj = SWIG_From_double(static_cast< double >(result));
11231 SWIGINTERN PyObject *_wrap_opt_set_ftol_abs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11232 PyObject *resultobj = 0;
11233 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11239 PyObject * obj0 = 0 ;
11240 PyObject * obj1 = 0 ;
11242 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_ftol_abs",&obj0,&obj1)) SWIG_fail;
11243 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11244 if (!SWIG_IsOK(res1)) {
11245 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_ftol_abs" "', argument " "1"" of type '" "nlopt::opt *""'");
11247 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11248 ecode2 = SWIG_AsVal_double(obj1, &val2);
11249 if (!SWIG_IsOK(ecode2)) {
11250 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_ftol_abs" "', argument " "2"" of type '" "double""'");
11252 arg2 = static_cast< double >(val2);
11254 (arg1)->set_ftol_abs(arg2);
11256 catch(std::invalid_argument &_e) {
11257 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11260 resultobj = SWIG_Py_Void();
11267 SWIGINTERN PyObject *_wrap_opt_get_xtol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11268 PyObject *resultobj = 0;
11269 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11272 PyObject * obj0 = 0 ;
11275 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_xtol_rel",&obj0)) SWIG_fail;
11276 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11277 if (!SWIG_IsOK(res1)) {
11278 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_xtol_rel" "', argument " "1"" of type '" "nlopt::opt const *""'");
11280 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11281 result = (double)((nlopt::opt const *)arg1)->get_xtol_rel();
11282 resultobj = SWIG_From_double(static_cast< double >(result));
11289 SWIGINTERN PyObject *_wrap_opt_set_xtol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11290 PyObject *resultobj = 0;
11291 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11297 PyObject * obj0 = 0 ;
11298 PyObject * obj1 = 0 ;
11300 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_xtol_rel",&obj0,&obj1)) SWIG_fail;
11301 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11302 if (!SWIG_IsOK(res1)) {
11303 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_xtol_rel" "', argument " "1"" of type '" "nlopt::opt *""'");
11305 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11306 ecode2 = SWIG_AsVal_double(obj1, &val2);
11307 if (!SWIG_IsOK(ecode2)) {
11308 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_xtol_rel" "', argument " "2"" of type '" "double""'");
11310 arg2 = static_cast< double >(val2);
11312 (arg1)->set_xtol_rel(arg2);
11314 catch(std::invalid_argument &_e) {
11315 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11318 resultobj = SWIG_Py_Void();
11325 SWIGINTERN PyObject *_wrap_opt_set_xtol_abs__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11326 PyObject *resultobj = 0;
11327 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11333 PyObject * obj0 = 0 ;
11334 PyObject * obj1 = 0 ;
11336 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_xtol_abs",&obj0,&obj1)) SWIG_fail;
11337 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11338 if (!SWIG_IsOK(res1)) {
11339 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_xtol_abs" "', argument " "1"" of type '" "nlopt::opt *""'");
11341 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11342 ecode2 = SWIG_AsVal_double(obj1, &val2);
11343 if (!SWIG_IsOK(ecode2)) {
11344 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_xtol_abs" "', argument " "2"" of type '" "double""'");
11346 arg2 = static_cast< double >(val2);
11348 (arg1)->set_xtol_abs(arg2);
11350 catch(std::invalid_argument &_e) {
11351 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11354 resultobj = SWIG_Py_Void();
11361 SWIGINTERN PyObject *_wrap_opt_get_xtol_abs__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11362 PyObject *resultobj = 0;
11363 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11364 std::vector< double,std::allocator< double > > *arg2 = 0 ;
11369 PyObject * obj0 = 0 ;
11370 PyObject * obj1 = 0 ;
11372 if (!PyArg_ParseTuple(args,(char *)"OO:opt_get_xtol_abs",&obj0,&obj1)) SWIG_fail;
11373 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11374 if (!SWIG_IsOK(res1)) {
11375 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_xtol_abs" "', argument " "1"" of type '" "nlopt::opt const *""'");
11377 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11378 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
11379 if (!SWIG_IsOK(res2)) {
11380 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_get_xtol_abs" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
11383 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_get_xtol_abs" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
11385 arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
11386 ((nlopt::opt const *)arg1)->get_xtol_abs(*arg2);
11387 resultobj = SWIG_Py_Void();
11394 SWIGINTERN PyObject *_wrap_opt_get_xtol_abs__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11395 PyObject *resultobj = 0;
11396 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11399 PyObject * obj0 = 0 ;
11400 std::vector< double,std::allocator< double > > result;
11402 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_xtol_abs",&obj0)) SWIG_fail;
11403 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11404 if (!SWIG_IsOK(res1)) {
11405 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_xtol_abs" "', argument " "1"" of type '" "nlopt::opt const *""'");
11407 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11408 result = ((nlopt::opt const *)arg1)->get_xtol_abs();
11410 npy_intp sz = (&result)->size();
11411 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
11412 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
11413 sizeof(double) * sz);
11421 SWIGINTERN PyObject *_wrap_opt_get_xtol_abs(PyObject *self, PyObject *args) {
11426 if (!PyTuple_Check(args)) SWIG_fail;
11427 argc = args ? (int)PyObject_Length(args) : 0;
11428 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
11429 argv[ii] = PyTuple_GET_ITEM(args,ii);
11434 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11435 _v = SWIG_CheckState(res);
11437 return _wrap_opt_get_xtol_abs__SWIG_1(self, args);
11443 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11444 _v = SWIG_CheckState(res);
11447 int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
11448 _v = SWIG_CheckState(res);
11450 return _wrap_opt_get_xtol_abs__SWIG_0(self, args);
11456 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_get_xtol_abs'.\n"
11457 " Possible C/C++ prototypes are:\n"
11458 " nlopt::opt::get_xtol_abs(std::vector< double,std::allocator< double > > &) const\n"
11459 " nlopt::opt::get_xtol_abs() const\n");
11464 SWIGINTERN PyObject *_wrap_opt_set_xtol_abs__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11465 PyObject *resultobj = 0;
11466 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11467 std::vector< double,std::allocator< double > > *arg2 = 0 ;
11470 PyArrayObject *array2 = NULL ;
11471 int is_new_object2 = 0 ;
11472 std::vector< double > arrayv2 ;
11473 PyObject * obj0 = 0 ;
11474 PyObject * obj1 = 0 ;
11476 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_xtol_abs",&obj0,&obj1)) SWIG_fail;
11477 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11478 if (!SWIG_IsOK(res1)) {
11479 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_xtol_abs" "', argument " "1"" of type '" "nlopt::opt *""'");
11481 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11483 npy_intp size[1] = {
11486 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
11487 if (!array2 || !require_dimensions(array2, 1) ||
11488 !require_size(array2, size, 1)) SWIG_fail;
11489 arrayv2 = std::vector<double>(array_size(array2,0));
11492 double *arr_data = (double *) array_data(array2);
11493 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
11494 int arr_sz = array_size(array2,0);
11495 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
11496 arrayv2[arr_i] = arr_data[arr_i * arr_s];
11500 (arg1)->set_xtol_abs((std::vector< double,std::allocator< double > > const &)*arg2);
11502 catch(std::invalid_argument &_e) {
11503 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11506 resultobj = SWIG_Py_Void();
11508 if (is_new_object2 && array2)
11516 if (is_new_object2 && array2)
11525 SWIGINTERN PyObject *_wrap_opt_set_xtol_abs(PyObject *self, PyObject *args) {
11530 if (!PyTuple_Check(args)) SWIG_fail;
11531 argc = args ? (int)PyObject_Length(args) : 0;
11532 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
11533 argv[ii] = PyTuple_GET_ITEM(args,ii);
11538 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11539 _v = SWIG_CheckState(res);
11542 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
11545 return _wrap_opt_set_xtol_abs__SWIG_1(self, args);
11552 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11553 _v = SWIG_CheckState(res);
11556 int res = SWIG_AsVal_double(argv[1], NULL);
11557 _v = SWIG_CheckState(res);
11560 return _wrap_opt_set_xtol_abs__SWIG_0(self, args);
11566 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_xtol_abs'.\n"
11567 " Possible C/C++ prototypes are:\n"
11568 " nlopt::opt::set_xtol_abs(double)\n"
11569 " nlopt::opt::set_xtol_abs(std::vector< double,std::allocator< double > > const &)\n");
11574 SWIGINTERN PyObject *_wrap_opt_get_maxeval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11575 PyObject *resultobj = 0;
11576 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11579 PyObject * obj0 = 0 ;
11582 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_maxeval",&obj0)) SWIG_fail;
11583 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11584 if (!SWIG_IsOK(res1)) {
11585 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_maxeval" "', argument " "1"" of type '" "nlopt::opt const *""'");
11587 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11588 result = (int)((nlopt::opt const *)arg1)->get_maxeval();
11589 resultobj = SWIG_From_int(static_cast< int >(result));
11596 SWIGINTERN PyObject *_wrap_opt_set_maxeval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11597 PyObject *resultobj = 0;
11598 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11604 PyObject * obj0 = 0 ;
11605 PyObject * obj1 = 0 ;
11607 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_maxeval",&obj0,&obj1)) SWIG_fail;
11608 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11609 if (!SWIG_IsOK(res1)) {
11610 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_maxeval" "', argument " "1"" of type '" "nlopt::opt *""'");
11612 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11613 ecode2 = SWIG_AsVal_int(obj1, &val2);
11614 if (!SWIG_IsOK(ecode2)) {
11615 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_maxeval" "', argument " "2"" of type '" "int""'");
11617 arg2 = static_cast< int >(val2);
11619 (arg1)->set_maxeval(arg2);
11621 catch(std::invalid_argument &_e) {
11622 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11625 resultobj = SWIG_Py_Void();
11632 SWIGINTERN PyObject *_wrap_opt_get_maxtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11633 PyObject *resultobj = 0;
11634 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11637 PyObject * obj0 = 0 ;
11640 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_maxtime",&obj0)) SWIG_fail;
11641 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11642 if (!SWIG_IsOK(res1)) {
11643 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_maxtime" "', argument " "1"" of type '" "nlopt::opt const *""'");
11645 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11646 result = (double)((nlopt::opt const *)arg1)->get_maxtime();
11647 resultobj = SWIG_From_double(static_cast< double >(result));
11654 SWIGINTERN PyObject *_wrap_opt_set_maxtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11655 PyObject *resultobj = 0;
11656 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11662 PyObject * obj0 = 0 ;
11663 PyObject * obj1 = 0 ;
11665 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_maxtime",&obj0,&obj1)) SWIG_fail;
11666 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11667 if (!SWIG_IsOK(res1)) {
11668 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_maxtime" "', argument " "1"" of type '" "nlopt::opt *""'");
11670 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11671 ecode2 = SWIG_AsVal_double(obj1, &val2);
11672 if (!SWIG_IsOK(ecode2)) {
11673 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_maxtime" "', argument " "2"" of type '" "double""'");
11675 arg2 = static_cast< double >(val2);
11677 (arg1)->set_maxtime(arg2);
11679 catch(std::invalid_argument &_e) {
11680 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11683 resultobj = SWIG_Py_Void();
11690 SWIGINTERN PyObject *_wrap_opt_get_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11691 PyObject *resultobj = 0;
11692 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11695 PyObject * obj0 = 0 ;
11698 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_force_stop",&obj0)) SWIG_fail;
11699 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11700 if (!SWIG_IsOK(res1)) {
11701 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_force_stop" "', argument " "1"" of type '" "nlopt::opt const *""'");
11703 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11704 result = (int)((nlopt::opt const *)arg1)->get_force_stop();
11705 resultobj = SWIG_From_int(static_cast< int >(result));
11712 SWIGINTERN PyObject *_wrap_opt_set_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11713 PyObject *resultobj = 0;
11714 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11720 PyObject * obj0 = 0 ;
11721 PyObject * obj1 = 0 ;
11723 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_force_stop",&obj0,&obj1)) SWIG_fail;
11724 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11725 if (!SWIG_IsOK(res1)) {
11726 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_force_stop" "', argument " "1"" of type '" "nlopt::opt *""'");
11728 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11729 ecode2 = SWIG_AsVal_int(obj1, &val2);
11730 if (!SWIG_IsOK(ecode2)) {
11731 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_force_stop" "', argument " "2"" of type '" "int""'");
11733 arg2 = static_cast< int >(val2);
11735 (arg1)->set_force_stop(arg2);
11737 catch(std::invalid_argument &_e) {
11738 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11741 resultobj = SWIG_Py_Void();
11748 SWIGINTERN PyObject *_wrap_opt_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11749 PyObject *resultobj = 0;
11750 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11753 PyObject * obj0 = 0 ;
11755 if (!PyArg_ParseTuple(args,(char *)"O:opt_force_stop",&obj0)) SWIG_fail;
11756 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11757 if (!SWIG_IsOK(res1)) {
11758 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_force_stop" "', argument " "1"" of type '" "nlopt::opt *""'");
11760 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11762 (arg1)->force_stop();
11764 catch(std::invalid_argument &_e) {
11765 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11768 resultobj = SWIG_Py_Void();
11775 SWIGINTERN PyObject *_wrap_opt_set_local_optimizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11776 PyObject *resultobj = 0;
11777 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11778 nlopt::opt *arg2 = 0 ;
11783 PyObject * obj0 = 0 ;
11784 PyObject * obj1 = 0 ;
11786 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_local_optimizer",&obj0,&obj1)) SWIG_fail;
11787 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11788 if (!SWIG_IsOK(res1)) {
11789 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_local_optimizer" "', argument " "1"" of type '" "nlopt::opt *""'");
11791 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11792 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_nlopt__opt, 0 | 0);
11793 if (!SWIG_IsOK(res2)) {
11794 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_set_local_optimizer" "', argument " "2"" of type '" "nlopt::opt const &""'");
11797 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_local_optimizer" "', argument " "2"" of type '" "nlopt::opt const &""'");
11799 arg2 = reinterpret_cast< nlopt::opt * >(argp2);
11801 (arg1)->set_local_optimizer((nlopt::opt const &)*arg2);
11803 catch(std::bad_alloc &_e) {
11804 PyErr_SetString(PyExc_MemoryError, (_e).what());
11808 catch(std::invalid_argument &_e) {
11809 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11812 resultobj = SWIG_Py_Void();
11819 SWIGINTERN PyObject *_wrap_opt_get_population(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11820 PyObject *resultobj = 0;
11821 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11824 PyObject * obj0 = 0 ;
11825 unsigned int result;
11827 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_population",&obj0)) SWIG_fail;
11828 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11829 if (!SWIG_IsOK(res1)) {
11830 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_population" "', argument " "1"" of type '" "nlopt::opt const *""'");
11832 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11833 result = (unsigned int)((nlopt::opt const *)arg1)->get_population();
11834 resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
11841 SWIGINTERN PyObject *_wrap_opt_set_population(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11842 PyObject *resultobj = 0;
11843 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11844 unsigned int arg2 ;
11847 unsigned int val2 ;
11849 PyObject * obj0 = 0 ;
11850 PyObject * obj1 = 0 ;
11852 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_population",&obj0,&obj1)) SWIG_fail;
11853 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11854 if (!SWIG_IsOK(res1)) {
11855 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_population" "', argument " "1"" of type '" "nlopt::opt *""'");
11857 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11858 ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
11859 if (!SWIG_IsOK(ecode2)) {
11860 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_population" "', argument " "2"" of type '" "unsigned int""'");
11862 arg2 = static_cast< unsigned int >(val2);
11864 (arg1)->set_population(arg2);
11866 catch(std::invalid_argument &_e) {
11867 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11870 resultobj = SWIG_Py_Void();
11877 SWIGINTERN PyObject *_wrap_opt_get_vector_storage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11878 PyObject *resultobj = 0;
11879 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11882 PyObject * obj0 = 0 ;
11883 unsigned int result;
11885 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_vector_storage",&obj0)) SWIG_fail;
11886 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11887 if (!SWIG_IsOK(res1)) {
11888 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_vector_storage" "', argument " "1"" of type '" "nlopt::opt const *""'");
11890 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11891 result = (unsigned int)((nlopt::opt const *)arg1)->get_vector_storage();
11892 resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
11899 SWIGINTERN PyObject *_wrap_opt_set_vector_storage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11900 PyObject *resultobj = 0;
11901 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11902 unsigned int arg2 ;
11905 unsigned int val2 ;
11907 PyObject * obj0 = 0 ;
11908 PyObject * obj1 = 0 ;
11910 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_vector_storage",&obj0,&obj1)) SWIG_fail;
11911 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11912 if (!SWIG_IsOK(res1)) {
11913 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_vector_storage" "', argument " "1"" of type '" "nlopt::opt *""'");
11915 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11916 ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
11917 if (!SWIG_IsOK(ecode2)) {
11918 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_vector_storage" "', argument " "2"" of type '" "unsigned int""'");
11920 arg2 = static_cast< unsigned int >(val2);
11922 (arg1)->set_vector_storage(arg2);
11924 catch(std::invalid_argument &_e) {
11925 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11928 resultobj = SWIG_Py_Void();
11935 SWIGINTERN PyObject *_wrap_opt_set_initial_step__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11936 PyObject *resultobj = 0;
11937 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11943 PyObject * obj0 = 0 ;
11944 PyObject * obj1 = 0 ;
11946 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_initial_step",&obj0,&obj1)) SWIG_fail;
11947 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11948 if (!SWIG_IsOK(res1)) {
11949 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_initial_step" "', argument " "1"" of type '" "nlopt::opt *""'");
11951 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11952 ecode2 = SWIG_AsVal_double(obj1, &val2);
11953 if (!SWIG_IsOK(ecode2)) {
11954 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "opt_set_initial_step" "', argument " "2"" of type '" "double""'");
11956 arg2 = static_cast< double >(val2);
11958 (arg1)->set_initial_step(arg2);
11960 catch(std::invalid_argument &_e) {
11961 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11964 resultobj = SWIG_Py_Void();
11971 SWIGINTERN PyObject *_wrap_opt_get_initial_step__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11972 PyObject *resultobj = 0;
11973 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11974 std::vector< double,std::allocator< double > > *arg2 = 0 ;
11979 PyObject * obj0 = 0 ;
11980 PyObject * obj1 = 0 ;
11982 if (!PyArg_ParseTuple(args,(char *)"OO:opt_get_initial_step",&obj0,&obj1)) SWIG_fail;
11983 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
11984 if (!SWIG_IsOK(res1)) {
11985 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_initial_step" "', argument " "1"" of type '" "nlopt::opt const *""'");
11987 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11988 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
11989 if (!SWIG_IsOK(res2)) {
11990 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "opt_get_initial_step" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
11993 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_get_initial_step" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'");
11995 arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
11996 ((nlopt::opt const *)arg1)->get_initial_step(*arg2);
11997 resultobj = SWIG_Py_Void();
12004 SWIGINTERN PyObject *_wrap_opt_get_initial_step__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12005 PyObject *resultobj = 0;
12006 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
12009 PyObject * obj0 = 0 ;
12010 std::vector< double,std::allocator< double > > result;
12012 if (!PyArg_ParseTuple(args,(char *)"O:opt_get_initial_step",&obj0)) SWIG_fail;
12013 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
12014 if (!SWIG_IsOK(res1)) {
12015 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_initial_step" "', argument " "1"" of type '" "nlopt::opt const *""'");
12017 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12018 result = ((nlopt::opt const *)arg1)->get_initial_step();
12020 npy_intp sz = (&result)->size();
12021 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
12022 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
12023 sizeof(double) * sz);
12031 SWIGINTERN PyObject *_wrap_opt_set_initial_step__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12032 PyObject *resultobj = 0;
12033 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
12034 std::vector< double,std::allocator< double > > *arg2 = 0 ;
12037 PyArrayObject *array2 = NULL ;
12038 int is_new_object2 = 0 ;
12039 std::vector< double > arrayv2 ;
12040 PyObject * obj0 = 0 ;
12041 PyObject * obj1 = 0 ;
12043 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_initial_step",&obj0,&obj1)) SWIG_fail;
12044 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
12045 if (!SWIG_IsOK(res1)) {
12046 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_initial_step" "', argument " "1"" of type '" "nlopt::opt *""'");
12048 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12050 npy_intp size[1] = {
12053 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
12054 if (!array2 || !require_dimensions(array2, 1) ||
12055 !require_size(array2, size, 1)) SWIG_fail;
12056 arrayv2 = std::vector<double>(array_size(array2,0));
12059 double *arr_data = (double *) array_data(array2);
12060 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
12061 int arr_sz = array_size(array2,0);
12062 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
12063 arrayv2[arr_i] = arr_data[arr_i * arr_s];
12067 (arg1)->set_initial_step((std::vector< double,std::allocator< double > > const &)*arg2);
12069 catch(std::invalid_argument &_e) {
12070 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
12073 resultobj = SWIG_Py_Void();
12075 if (is_new_object2 && array2)
12083 if (is_new_object2 && array2)
12092 SWIGINTERN PyObject *_wrap_opt_set_initial_step(PyObject *self, PyObject *args) {
12097 if (!PyTuple_Check(args)) SWIG_fail;
12098 argc = args ? (int)PyObject_Length(args) : 0;
12099 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
12100 argv[ii] = PyTuple_GET_ITEM(args,ii);
12105 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12106 _v = SWIG_CheckState(res);
12109 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
12112 return _wrap_opt_set_initial_step__SWIG_1(self, args);
12119 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12120 _v = SWIG_CheckState(res);
12123 int res = SWIG_AsVal_double(argv[1], NULL);
12124 _v = SWIG_CheckState(res);
12127 return _wrap_opt_set_initial_step__SWIG_0(self, args);
12133 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_set_initial_step'.\n"
12134 " Possible C/C++ prototypes are:\n"
12135 " nlopt::opt::set_initial_step(double)\n"
12136 " nlopt::opt::set_initial_step(std::vector< double,std::allocator< double > > const &)\n");
12141 SWIGINTERN PyObject *_wrap_opt_set_default_initial_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12142 PyObject *resultobj = 0;
12143 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
12144 std::vector< double,std::allocator< double > > *arg2 = 0 ;
12147 PyArrayObject *array2 = NULL ;
12148 int is_new_object2 = 0 ;
12149 std::vector< double > arrayv2 ;
12150 PyObject * obj0 = 0 ;
12151 PyObject * obj1 = 0 ;
12153 if (!PyArg_ParseTuple(args,(char *)"OO:opt_set_default_initial_step",&obj0,&obj1)) SWIG_fail;
12154 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
12155 if (!SWIG_IsOK(res1)) {
12156 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_set_default_initial_step" "', argument " "1"" of type '" "nlopt::opt *""'");
12158 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12160 npy_intp size[1] = {
12163 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
12164 if (!array2 || !require_dimensions(array2, 1) ||
12165 !require_size(array2, size, 1)) SWIG_fail;
12166 arrayv2 = std::vector<double>(array_size(array2,0));
12169 double *arr_data = (double *) array_data(array2);
12170 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
12171 int arr_sz = array_size(array2,0);
12172 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
12173 arrayv2[arr_i] = arr_data[arr_i * arr_s];
12177 (arg1)->set_default_initial_step((std::vector< double,std::allocator< double > > const &)*arg2);
12179 catch(std::bad_alloc &_e) {
12180 PyErr_SetString(PyExc_MemoryError, (_e).what());
12184 catch(std::invalid_argument &_e) {
12185 SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
12188 resultobj = SWIG_Py_Void();
12190 if (is_new_object2 && array2)
12198 if (is_new_object2 && array2)
12207 SWIGINTERN PyObject *_wrap_opt_get_initial_step__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12208 PyObject *resultobj = 0;
12209 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
12210 std::vector< double,std::allocator< double > > *arg2 = 0 ;
12211 std::vector< double,std::allocator< double > > *arg3 = 0 ;
12214 PyArrayObject *array2 = NULL ;
12215 int is_new_object2 = 0 ;
12216 std::vector< double > arrayv2 ;
12219 PyObject * obj0 = 0 ;
12220 PyObject * obj1 = 0 ;
12221 PyObject * obj2 = 0 ;
12223 if (!PyArg_ParseTuple(args,(char *)"OOO:opt_get_initial_step",&obj0,&obj1,&obj2)) SWIG_fail;
12224 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
12225 if (!SWIG_IsOK(res1)) {
12226 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_initial_step" "', argument " "1"" of type '" "nlopt::opt const *""'");
12228 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12230 npy_intp size[1] = {
12233 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
12234 if (!array2 || !require_dimensions(array2, 1) ||
12235 !require_size(array2, size, 1)) SWIG_fail;
12236 arrayv2 = std::vector<double>(array_size(array2,0));
12239 double *arr_data = (double *) array_data(array2);
12240 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
12241 int arr_sz = array_size(array2,0);
12242 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
12243 arrayv2[arr_i] = arr_data[arr_i * arr_s];
12246 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
12247 if (!SWIG_IsOK(res3)) {
12248 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "opt_get_initial_step" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > &""'");
12251 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_get_initial_step" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > &""'");
12253 arg3 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp3);
12254 ((nlopt::opt const *)arg1)->get_initial_step((std::vector< double,std::allocator< double > > const &)*arg2,*arg3);
12255 resultobj = SWIG_Py_Void();
12257 if (is_new_object2 && array2)
12265 if (is_new_object2 && array2)
12274 SWIGINTERN PyObject *_wrap_opt_get_initial_step(PyObject *self, PyObject *args) {
12279 if (!PyTuple_Check(args)) SWIG_fail;
12280 argc = args ? (int)PyObject_Length(args) : 0;
12281 for (ii = 0; (ii < 3) && (ii < argc); ii++) {
12282 argv[ii] = PyTuple_GET_ITEM(args,ii);
12287 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12288 _v = SWIG_CheckState(res);
12290 return _wrap_opt_get_initial_step__SWIG_1(self, args);
12296 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12297 _v = SWIG_CheckState(res);
12300 int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
12301 _v = SWIG_CheckState(res);
12303 return _wrap_opt_get_initial_step__SWIG_0(self, args);
12310 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12311 _v = SWIG_CheckState(res);
12314 _v = is_array(argv[1]) || PySequence_Check(argv[1]);
12318 int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
12319 _v = SWIG_CheckState(res);
12321 return _wrap_opt_get_initial_step__SWIG_2(self, args);
12328 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'opt_get_initial_step'.\n"
12329 " Possible C/C++ prototypes are:\n"
12330 " nlopt::opt::get_initial_step(std::vector< double,std::allocator< double > > &) const\n"
12331 " nlopt::opt::get_initial_step() const\n"
12332 " nlopt::opt::get_initial_step(std::vector< double,std::allocator< double > > const &,std::vector< double,std::allocator< double > > &) const\n");
12337 SWIGINTERN PyObject *_wrap_opt_get_initial_step_(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12338 PyObject *resultobj = 0;
12339 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
12340 std::vector< double,std::allocator< double > > *arg2 = 0 ;
12343 PyArrayObject *array2 = NULL ;
12344 int is_new_object2 = 0 ;
12345 std::vector< double > arrayv2 ;
12346 PyObject * obj0 = 0 ;
12347 PyObject * obj1 = 0 ;
12348 std::vector< double,std::allocator< double > > result;
12350 if (!PyArg_ParseTuple(args,(char *)"OO:opt_get_initial_step_",&obj0,&obj1)) SWIG_fail;
12351 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nlopt__opt, 0 | 0 );
12352 if (!SWIG_IsOK(res1)) {
12353 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "opt_get_initial_step_" "', argument " "1"" of type '" "nlopt::opt const *""'");
12355 arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12357 npy_intp size[1] = {
12360 array2 = obj_to_array_allow_conversion(obj1, NPY_DOUBLE, &is_new_object2);
12361 if (!array2 || !require_dimensions(array2, 1) ||
12362 !require_size(array2, size, 1)) SWIG_fail;
12363 arrayv2 = std::vector<double>(array_size(array2,0));
12366 double *arr_data = (double *) array_data(array2);
12367 int arr_i, arr_s = array_stride(array2,0) / sizeof(double);
12368 int arr_sz = array_size(array2,0);
12369 for (arr_i = 0; arr_i < arr_sz; ++arr_i)
12370 arrayv2[arr_i] = arr_data[arr_i * arr_s];
12373 result = ((nlopt::opt const *)arg1)->get_initial_step_((std::vector< double,std::allocator< double > > const &)*arg2);
12375 npy_intp sz = (&result)->size();
12376 resultobj = PyArray_SimpleNew(1, &sz, NPY_DOUBLE);
12377 std::memcpy(array_data(resultobj), (&result)->empty() ? NULL : &result[0],
12378 sizeof(double) * sz);
12381 if (is_new_object2 && array2)
12389 if (is_new_object2 && array2)
12398 SWIGINTERN PyObject *opt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12400 if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
12401 SWIG_TypeNewClientData(SWIGTYPE_p_nlopt__opt, SWIG_NewClientData(obj));
12402 return SWIG_Py_Void();
12405 SWIGINTERN PyObject *_wrap_srand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12406 PyObject *resultobj = 0;
12407 unsigned long arg1 ;
12408 unsigned long val1 ;
12410 PyObject * obj0 = 0 ;
12412 if (!PyArg_ParseTuple(args,(char *)"O:srand",&obj0)) SWIG_fail;
12413 ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1);
12414 if (!SWIG_IsOK(ecode1)) {
12415 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "srand" "', argument " "1"" of type '" "unsigned long""'");
12417 arg1 = static_cast< unsigned long >(val1);
12418 nlopt::srand(arg1);
12419 resultobj = SWIG_Py_Void();
12426 SWIGINTERN PyObject *_wrap_srand_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12427 PyObject *resultobj = 0;
12429 if (!PyArg_ParseTuple(args,(char *)":srand_time")) SWIG_fail;
12430 nlopt::srand_time();
12431 resultobj = SWIG_Py_Void();
12438 SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12439 PyObject *resultobj = 0;
12449 PyObject * obj0 = 0 ;
12450 PyObject * obj1 = 0 ;
12451 PyObject * obj2 = 0 ;
12453 if (!PyArg_ParseTuple(args,(char *)"OOO:version",&obj0,&obj1,&obj2)) SWIG_fail;
12454 res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_int, 0 );
12455 if (!SWIG_IsOK(res1)) {
12456 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "version" "', argument " "1"" of type '" "int &""'");
12459 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "1"" of type '" "int &""'");
12461 arg1 = reinterpret_cast< int * >(argp1);
12462 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_int, 0 );
12463 if (!SWIG_IsOK(res2)) {
12464 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "version" "', argument " "2"" of type '" "int &""'");
12467 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "2"" of type '" "int &""'");
12469 arg2 = reinterpret_cast< int * >(argp2);
12470 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_int, 0 );
12471 if (!SWIG_IsOK(res3)) {
12472 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "version" "', argument " "3"" of type '" "int &""'");
12475 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "3"" of type '" "int &""'");
12477 arg3 = reinterpret_cast< int * >(argp3);
12478 nlopt::version(*arg1,*arg2,*arg3);
12479 resultobj = SWIG_Py_Void();
12486 SWIGINTERN PyObject *_wrap_version_major(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12487 PyObject *resultobj = 0;
12490 if (!PyArg_ParseTuple(args,(char *)":version_major")) SWIG_fail;
12491 result = (int)nlopt::version_major();
12492 resultobj = SWIG_From_int(static_cast< int >(result));
12499 SWIGINTERN PyObject *_wrap_version_minor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12500 PyObject *resultobj = 0;
12503 if (!PyArg_ParseTuple(args,(char *)":version_minor")) SWIG_fail;
12504 result = (int)nlopt::version_minor();
12505 resultobj = SWIG_From_int(static_cast< int >(result));
12512 SWIGINTERN PyObject *_wrap_version_bugfix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12513 PyObject *resultobj = 0;
12516 if (!PyArg_ParseTuple(args,(char *)":version_bugfix")) SWIG_fail;
12517 result = (int)nlopt::version_bugfix();
12518 resultobj = SWIG_From_int(static_cast< int >(result));
12525 SWIGINTERN PyObject *_wrap_algorithm_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12526 PyObject *resultobj = 0;
12527 nlopt::algorithm arg1 ;
12530 PyObject * obj0 = 0 ;
12533 if (!PyArg_ParseTuple(args,(char *)"O:algorithm_name",&obj0)) SWIG_fail;
12534 ecode1 = SWIG_AsVal_int(obj0, &val1);
12535 if (!SWIG_IsOK(ecode1)) {
12536 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "algorithm_name" "', argument " "1"" of type '" "nlopt::algorithm""'");
12538 arg1 = static_cast< nlopt::algorithm >(val1);
12539 result = (char *)nlopt::algorithm_name(arg1);
12540 resultobj = SWIG_FromCharPtr((const char *)result);
12547 static PyMethodDef SwigMethods[] = {
12548 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
12549 { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL},
12550 { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL},
12551 { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL},
12552 { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL},
12553 { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL},
12554 { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL},
12555 { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL},
12556 { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL},
12557 { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL},
12558 { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL},
12559 { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL},
12560 { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL},
12561 { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL},
12562 { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL},
12563 { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL},
12564 { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL},
12565 { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL},
12566 { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL},
12567 { (char *)"nlopt_doublevector_iterator", _wrap_nlopt_doublevector_iterator, METH_VARARGS, NULL},
12568 { (char *)"nlopt_doublevector___nonzero__", _wrap_nlopt_doublevector___nonzero__, METH_VARARGS, NULL},
12569 { (char *)"nlopt_doublevector___bool__", _wrap_nlopt_doublevector___bool__, METH_VARARGS, NULL},
12570 { (char *)"nlopt_doublevector___len__", _wrap_nlopt_doublevector___len__, METH_VARARGS, NULL},
12571 { (char *)"nlopt_doublevector_pop", _wrap_nlopt_doublevector_pop, METH_VARARGS, NULL},
12572 { (char *)"nlopt_doublevector___getslice__", _wrap_nlopt_doublevector___getslice__, METH_VARARGS, NULL},
12573 { (char *)"nlopt_doublevector___setslice__", _wrap_nlopt_doublevector___setslice__, METH_VARARGS, NULL},
12574 { (char *)"nlopt_doublevector___delslice__", _wrap_nlopt_doublevector___delslice__, METH_VARARGS, NULL},
12575 { (char *)"nlopt_doublevector___delitem__", _wrap_nlopt_doublevector___delitem__, METH_VARARGS, NULL},
12576 { (char *)"nlopt_doublevector___getitem__", _wrap_nlopt_doublevector___getitem__, METH_VARARGS, NULL},
12577 { (char *)"nlopt_doublevector___setitem__", _wrap_nlopt_doublevector___setitem__, METH_VARARGS, NULL},
12578 { (char *)"nlopt_doublevector_append", _wrap_nlopt_doublevector_append, METH_VARARGS, NULL},
12579 { (char *)"nlopt_doublevector_empty", _wrap_nlopt_doublevector_empty, METH_VARARGS, NULL},
12580 { (char *)"nlopt_doublevector_size", _wrap_nlopt_doublevector_size, METH_VARARGS, NULL},
12581 { (char *)"nlopt_doublevector_clear", _wrap_nlopt_doublevector_clear, METH_VARARGS, NULL},
12582 { (char *)"nlopt_doublevector_swap", _wrap_nlopt_doublevector_swap, METH_VARARGS, NULL},
12583 { (char *)"nlopt_doublevector_get_allocator", _wrap_nlopt_doublevector_get_allocator, METH_VARARGS, NULL},
12584 { (char *)"nlopt_doublevector_begin", _wrap_nlopt_doublevector_begin, METH_VARARGS, NULL},
12585 { (char *)"nlopt_doublevector_end", _wrap_nlopt_doublevector_end, METH_VARARGS, NULL},
12586 { (char *)"nlopt_doublevector_rbegin", _wrap_nlopt_doublevector_rbegin, METH_VARARGS, NULL},
12587 { (char *)"nlopt_doublevector_rend", _wrap_nlopt_doublevector_rend, METH_VARARGS, NULL},
12588 { (char *)"nlopt_doublevector_pop_back", _wrap_nlopt_doublevector_pop_back, METH_VARARGS, NULL},
12589 { (char *)"nlopt_doublevector_erase", _wrap_nlopt_doublevector_erase, METH_VARARGS, NULL},
12590 { (char *)"new_nlopt_doublevector", _wrap_new_nlopt_doublevector, METH_VARARGS, NULL},
12591 { (char *)"nlopt_doublevector_push_back", _wrap_nlopt_doublevector_push_back, METH_VARARGS, NULL},
12592 { (char *)"nlopt_doublevector_front", _wrap_nlopt_doublevector_front, METH_VARARGS, NULL},
12593 { (char *)"nlopt_doublevector_back", _wrap_nlopt_doublevector_back, METH_VARARGS, NULL},
12594 { (char *)"nlopt_doublevector_assign", _wrap_nlopt_doublevector_assign, METH_VARARGS, NULL},
12595 { (char *)"nlopt_doublevector_resize", _wrap_nlopt_doublevector_resize, METH_VARARGS, NULL},
12596 { (char *)"nlopt_doublevector_insert", _wrap_nlopt_doublevector_insert, METH_VARARGS, NULL},
12597 { (char *)"nlopt_doublevector_reserve", _wrap_nlopt_doublevector_reserve, METH_VARARGS, NULL},
12598 { (char *)"nlopt_doublevector_capacity", _wrap_nlopt_doublevector_capacity, METH_VARARGS, NULL},
12599 { (char *)"delete_nlopt_doublevector", _wrap_delete_nlopt_doublevector, METH_VARARGS, NULL},
12600 { (char *)"nlopt_doublevector_swigregister", nlopt_doublevector_swigregister, METH_VARARGS, NULL},
12601 { (char *)"nlopt_get_initial_step", _wrap_nlopt_get_initial_step, METH_VARARGS, NULL},
12602 { (char *)"new_roundoff_limited", _wrap_new_roundoff_limited, METH_VARARGS, NULL},
12603 { (char *)"delete_roundoff_limited", _wrap_delete_roundoff_limited, METH_VARARGS, NULL},
12604 { (char *)"roundoff_limited_swigregister", roundoff_limited_swigregister, METH_VARARGS, NULL},
12605 { (char *)"new_forced_stop", _wrap_new_forced_stop, METH_VARARGS, NULL},
12606 { (char *)"delete_forced_stop", _wrap_delete_forced_stop, METH_VARARGS, NULL},
12607 { (char *)"forced_stop_swigregister", forced_stop_swigregister, METH_VARARGS, NULL},
12608 { (char *)"delete_opt", _wrap_delete_opt, METH_VARARGS, NULL},
12609 { (char *)"new_opt", _wrap_new_opt, METH_VARARGS, NULL},
12610 { (char *)"opt_optimize", _wrap_opt_optimize, METH_VARARGS, NULL},
12611 { (char *)"opt_last_optimize_result", _wrap_opt_last_optimize_result, METH_VARARGS, NULL},
12612 { (char *)"opt_last_optimum_value", _wrap_opt_last_optimum_value, METH_VARARGS, NULL},
12613 { (char *)"opt_get_algorithm", _wrap_opt_get_algorithm, METH_VARARGS, NULL},
12614 { (char *)"opt_get_algorithm_name", _wrap_opt_get_algorithm_name, METH_VARARGS, NULL},
12615 { (char *)"opt_get_dimension", _wrap_opt_get_dimension, METH_VARARGS, NULL},
12616 { (char *)"opt_set_min_objective", _wrap_opt_set_min_objective, METH_VARARGS, NULL},
12617 { (char *)"opt_set_max_objective", _wrap_opt_set_max_objective, METH_VARARGS, NULL},
12618 { (char *)"opt_remove_inequality_constraints", _wrap_opt_remove_inequality_constraints, METH_VARARGS, NULL},
12619 { (char *)"opt_remove_equality_constraints", _wrap_opt_remove_equality_constraints, METH_VARARGS, NULL},
12620 { (char *)"opt_add_inequality_constraint", _wrap_opt_add_inequality_constraint, METH_VARARGS, NULL},
12621 { (char *)"opt_add_equality_constraint", _wrap_opt_add_equality_constraint, METH_VARARGS, NULL},
12622 { (char *)"opt_add_inequality_mconstraint", _wrap_opt_add_inequality_mconstraint, METH_VARARGS, NULL},
12623 { (char *)"opt_add_equality_mconstraint", _wrap_opt_add_equality_mconstraint, METH_VARARGS, NULL},
12624 { (char *)"opt_get_lower_bounds", _wrap_opt_get_lower_bounds, METH_VARARGS, NULL},
12625 { (char *)"opt_set_lower_bounds", _wrap_opt_set_lower_bounds, METH_VARARGS, NULL},
12626 { (char *)"opt_get_upper_bounds", _wrap_opt_get_upper_bounds, METH_VARARGS, NULL},
12627 { (char *)"opt_set_upper_bounds", _wrap_opt_set_upper_bounds, METH_VARARGS, NULL},
12628 { (char *)"opt_get_stopval", _wrap_opt_get_stopval, METH_VARARGS, NULL},
12629 { (char *)"opt_set_stopval", _wrap_opt_set_stopval, METH_VARARGS, NULL},
12630 { (char *)"opt_get_ftol_rel", _wrap_opt_get_ftol_rel, METH_VARARGS, NULL},
12631 { (char *)"opt_set_ftol_rel", _wrap_opt_set_ftol_rel, METH_VARARGS, NULL},
12632 { (char *)"opt_get_ftol_abs", _wrap_opt_get_ftol_abs, METH_VARARGS, NULL},
12633 { (char *)"opt_set_ftol_abs", _wrap_opt_set_ftol_abs, METH_VARARGS, NULL},
12634 { (char *)"opt_get_xtol_rel", _wrap_opt_get_xtol_rel, METH_VARARGS, NULL},
12635 { (char *)"opt_set_xtol_rel", _wrap_opt_set_xtol_rel, METH_VARARGS, NULL},
12636 { (char *)"opt_get_xtol_abs", _wrap_opt_get_xtol_abs, METH_VARARGS, NULL},
12637 { (char *)"opt_set_xtol_abs", _wrap_opt_set_xtol_abs, METH_VARARGS, NULL},
12638 { (char *)"opt_get_maxeval", _wrap_opt_get_maxeval, METH_VARARGS, NULL},
12639 { (char *)"opt_set_maxeval", _wrap_opt_set_maxeval, METH_VARARGS, NULL},
12640 { (char *)"opt_get_maxtime", _wrap_opt_get_maxtime, METH_VARARGS, NULL},
12641 { (char *)"opt_set_maxtime", _wrap_opt_set_maxtime, METH_VARARGS, NULL},
12642 { (char *)"opt_get_force_stop", _wrap_opt_get_force_stop, METH_VARARGS, NULL},
12643 { (char *)"opt_set_force_stop", _wrap_opt_set_force_stop, METH_VARARGS, NULL},
12644 { (char *)"opt_force_stop", _wrap_opt_force_stop, METH_VARARGS, NULL},
12645 { (char *)"opt_set_local_optimizer", _wrap_opt_set_local_optimizer, METH_VARARGS, NULL},
12646 { (char *)"opt_get_population", _wrap_opt_get_population, METH_VARARGS, NULL},
12647 { (char *)"opt_set_population", _wrap_opt_set_population, METH_VARARGS, NULL},
12648 { (char *)"opt_get_vector_storage", _wrap_opt_get_vector_storage, METH_VARARGS, NULL},
12649 { (char *)"opt_set_vector_storage", _wrap_opt_set_vector_storage, METH_VARARGS, NULL},
12650 { (char *)"opt_set_initial_step", _wrap_opt_set_initial_step, METH_VARARGS, NULL},
12651 { (char *)"opt_set_default_initial_step", _wrap_opt_set_default_initial_step, METH_VARARGS, NULL},
12652 { (char *)"opt_get_initial_step", _wrap_opt_get_initial_step, METH_VARARGS, NULL},
12653 { (char *)"opt_get_initial_step_", _wrap_opt_get_initial_step_, METH_VARARGS, NULL},
12654 { (char *)"opt_swigregister", opt_swigregister, METH_VARARGS, NULL},
12655 { (char *)"srand", _wrap_srand, METH_VARARGS, NULL},
12656 { (char *)"srand_time", _wrap_srand_time, METH_VARARGS, NULL},
12657 { (char *)"version", _wrap_version, METH_VARARGS, NULL},
12658 { (char *)"version_major", _wrap_version_major, METH_VARARGS, NULL},
12659 { (char *)"version_minor", _wrap_version_minor, METH_VARARGS, NULL},
12660 { (char *)"version_bugfix", _wrap_version_bugfix, METH_VARARGS, NULL},
12661 { (char *)"algorithm_name", _wrap_algorithm_name, METH_VARARGS, NULL},
12662 { NULL, NULL, 0, NULL }
12666 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
12668 static void *_p_nlopt__roundoff_limitedTo_p_std__runtime_error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
12669 return (void *)((std::runtime_error *) ((nlopt::roundoff_limited *) x));
12671 static void *_p_nlopt__forced_stopTo_p_std__runtime_error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
12672 return (void *)((std::runtime_error *) ((nlopt::forced_stop *) x));
12674 static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
12675 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
12676 static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
12677 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
12678 static swig_type_info _swigt__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double = {"_p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double", "nlopt::vfunc|double (*)(std::vector< double,std::allocator< double > > const &,std::vector< double,std::allocator< double > > &,void *)", 0, 0, (void*)0, 0};
12679 static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
12680 static swig_type_info _swigt__p_nlopt__forced_stop = {"_p_nlopt__forced_stop", "nlopt::forced_stop *", 0, 0, (void*)0, 0};
12681 static swig_type_info _swigt__p_nlopt__opt = {"_p_nlopt__opt", "nlopt::opt *", 0, 0, (void*)0, 0};
12682 static swig_type_info _swigt__p_nlopt__roundoff_limited = {"_p_nlopt__roundoff_limited", "nlopt::roundoff_limited *", 0, 0, (void*)0, 0};
12683 static swig_type_info _swigt__p_nlopt_func = {"_p_nlopt_func", "nlopt::func *|nlopt_func *", 0, 0, (void*)0, 0};
12684 static swig_type_info _swigt__p_nlopt_mfunc = {"_p_nlopt_mfunc", "nlopt_mfunc *|nlopt::mfunc *", 0, 0, (void*)0, 0};
12685 static swig_type_info _swigt__p_nlopt_opt = {"_p_nlopt_opt", "nlopt_opt *", 0, 0, (void*)0, 0};
12686 static swig_type_info _swigt__p_nlopt_result = {"_p_nlopt_result", "nlopt_result *", 0, 0, (void*)0, 0};
12687 static swig_type_info _swigt__p_p_PyObject = {"_p_p_PyObject", "PyObject **", 0, 0, (void*)0, 0};
12688 static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
12689 static swig_type_info _swigt__p_std__allocatorT_double_t = {"_p_std__allocatorT_double_t", "std::vector< double >::allocator_type *|std::allocator< double > *", 0, 0, (void*)0, 0};
12690 static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
12691 static swig_type_info _swigt__p_std__runtime_error = {"_p_std__runtime_error", "std::runtime_error *", 0, 0, (void*)0, 0};
12692 static swig_type_info _swigt__p_std__vectorT__Tp__Alloc_t = {"_p_std__vectorT__Tp__Alloc_t", "std::vector< _Tp,_Alloc > *", 0, 0, (void*)0, 0};
12693 static swig_type_info _swigt__p_std__vectorT_double_std__allocatorT_double_t_t = {"_p_std__vectorT_double_std__allocatorT_double_t_t", "std::vector< double,std::allocator< double > > *|std::vector< double > *", 0, 0, (void*)0, 0};
12694 static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0};
12695 static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};
12697 static swig_type_info *swig_type_initial[] = {
12698 &_swigt__p_allocator_type,
12700 &_swigt__p_difference_type,
12702 &_swigt__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double,
12704 &_swigt__p_nlopt__forced_stop,
12705 &_swigt__p_nlopt__opt,
12706 &_swigt__p_nlopt__roundoff_limited,
12707 &_swigt__p_nlopt_func,
12708 &_swigt__p_nlopt_mfunc,
12709 &_swigt__p_nlopt_opt,
12710 &_swigt__p_nlopt_result,
12711 &_swigt__p_p_PyObject,
12712 &_swigt__p_size_type,
12713 &_swigt__p_std__allocatorT_double_t,
12714 &_swigt__p_std__invalid_argument,
12715 &_swigt__p_std__runtime_error,
12716 &_swigt__p_std__vectorT__Tp__Alloc_t,
12717 &_swigt__p_std__vectorT_double_std__allocatorT_double_t_t,
12718 &_swigt__p_swig__SwigPyIterator,
12719 &_swigt__p_value_type,
12722 static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
12723 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
12724 static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
12725 static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
12726 static swig_cast_info _swigc__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double[] = { {&_swigt__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double, 0, 0, 0},{0, 0, 0, 0}};
12727 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
12728 static swig_cast_info _swigc__p_nlopt__forced_stop[] = { {&_swigt__p_nlopt__forced_stop, 0, 0, 0},{0, 0, 0, 0}};
12729 static swig_cast_info _swigc__p_nlopt__opt[] = { {&_swigt__p_nlopt__opt, 0, 0, 0},{0, 0, 0, 0}};
12730 static swig_cast_info _swigc__p_nlopt__roundoff_limited[] = { {&_swigt__p_nlopt__roundoff_limited, 0, 0, 0},{0, 0, 0, 0}};
12731 static swig_cast_info _swigc__p_nlopt_func[] = { {&_swigt__p_nlopt_func, 0, 0, 0},{0, 0, 0, 0}};
12732 static swig_cast_info _swigc__p_nlopt_mfunc[] = { {&_swigt__p_nlopt_mfunc, 0, 0, 0},{0, 0, 0, 0}};
12733 static swig_cast_info _swigc__p_nlopt_opt[] = { {&_swigt__p_nlopt_opt, 0, 0, 0},{0, 0, 0, 0}};
12734 static swig_cast_info _swigc__p_nlopt_result[] = { {&_swigt__p_nlopt_result, 0, 0, 0},{0, 0, 0, 0}};
12735 static swig_cast_info _swigc__p_p_PyObject[] = { {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}};
12736 static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
12737 static swig_cast_info _swigc__p_std__allocatorT_double_t[] = { {&_swigt__p_std__allocatorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
12738 static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
12739 static swig_cast_info _swigc__p_std__runtime_error[] = { {&_swigt__p_std__runtime_error, 0, 0, 0}, {&_swigt__p_nlopt__roundoff_limited, _p_nlopt__roundoff_limitedTo_p_std__runtime_error, 0, 0}, {&_swigt__p_nlopt__forced_stop, _p_nlopt__forced_stopTo_p_std__runtime_error, 0, 0},{0, 0, 0, 0}};
12740 static swig_cast_info _swigc__p_std__vectorT__Tp__Alloc_t[] = { {&_swigt__p_std__vectorT__Tp__Alloc_t, 0, 0, 0},{0, 0, 0, 0}};
12741 static swig_cast_info _swigc__p_std__vectorT_double_std__allocatorT_double_t_t[] = { {&_swigt__p_std__vectorT_double_std__allocatorT_double_t_t, 0, 0, 0},{0, 0, 0, 0}};
12742 static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}};
12743 static swig_cast_info _swigc__p_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};
12745 static swig_cast_info *swig_cast_initial[] = {
12746 _swigc__p_allocator_type,
12748 _swigc__p_difference_type,
12750 _swigc__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double,
12752 _swigc__p_nlopt__forced_stop,
12753 _swigc__p_nlopt__opt,
12754 _swigc__p_nlopt__roundoff_limited,
12755 _swigc__p_nlopt_func,
12756 _swigc__p_nlopt_mfunc,
12757 _swigc__p_nlopt_opt,
12758 _swigc__p_nlopt_result,
12759 _swigc__p_p_PyObject,
12760 _swigc__p_size_type,
12761 _swigc__p_std__allocatorT_double_t,
12762 _swigc__p_std__invalid_argument,
12763 _swigc__p_std__runtime_error,
12764 _swigc__p_std__vectorT__Tp__Alloc_t,
12765 _swigc__p_std__vectorT_double_std__allocatorT_double_t_t,
12766 _swigc__p_swig__SwigPyIterator,
12767 _swigc__p_value_type,
12771 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
12773 static swig_const_info swig_const_table[] = {
12774 {0, 0, 0, 0.0, 0, 0}};
12779 /* -----------------------------------------------------------------------------
12780 * Type initialization:
12781 * This problem is tough by the requirement that no dynamic
12782 * memory is used. Also, since swig_type_info structures store pointers to
12783 * swig_cast_info structures and swig_cast_info structures store pointers back
12784 * to swig_type_info structures, we need some lookup code at initialization.
12785 * The idea is that swig generates all the structures that are needed.
12786 * The runtime then collects these partially filled structures.
12787 * The SWIG_InitializeModule function takes these initial arrays out of
12788 * swig_module, and does all the lookup, filling in the swig_module.types
12789 * array with the correct data and linking the correct swig_cast_info
12790 * structures together.
12792 * The generated swig_type_info structures are assigned staticly to an initial
12793 * array. We just loop through that array, and handle each type individually.
12794 * First we lookup if this type has been already loaded, and if so, use the
12795 * loaded structure instead of the generated one. Then we have to fill in the
12796 * cast linked list. The cast data is initially stored in something like a
12797 * two-dimensional array. Each row corresponds to a type (there are the same
12798 * number of rows as there are in the swig_type_initial array). Each entry in
12799 * a column is one of the swig_cast_info structures for that type.
12800 * The cast_initial array is actually an array of arrays, because each row has
12801 * a variable number of columns. So to actually build the cast linked list,
12802 * we find the array of casts associated with the type, and loop through it
12803 * adding the casts to the list. The one last trick we need to do is making
12804 * sure the type pointer in the swig_cast_info struct is correct.
12806 * First off, we lookup the cast->type name to see if it is already loaded.
12807 * There are three cases to handle:
12808 * 1) If the cast->type has already been loaded AND the type we are adding
12809 * casting info to has not been loaded (it is in this module), THEN we
12810 * replace the cast->type pointer with the type pointer that has already
12812 * 2) If BOTH types (the one we are adding casting info to, and the
12813 * cast->type) are loaded, THEN the cast info has already been loaded by
12814 * the previous module so we just ignore it.
12815 * 3) Finally, if cast->type has not already been loaded, then we add that
12816 * swig_cast_info to the linked list (because the cast->type) pointer will
12818 * ----------------------------------------------------------------------------- */
12828 #define SWIGRUNTIME_DEBUG
12833 SWIG_InitializeModule(void *clientdata) {
12835 swig_module_info *module_head, *iter;
12838 /* check to see if the circular list has been setup, if not, set it up */
12839 if (swig_module.next==0) {
12840 /* Initialize the swig_module */
12841 swig_module.type_initial = swig_type_initial;
12842 swig_module.cast_initial = swig_cast_initial;
12843 swig_module.next = &swig_module;
12849 /* Try and load any already created modules */
12850 module_head = SWIG_GetModule(clientdata);
12851 if (!module_head) {
12852 /* This is the first module loaded for this interpreter */
12853 /* so set the swig module into the interpreter */
12854 SWIG_SetModule(clientdata, &swig_module);
12855 module_head = &swig_module;
12857 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
12861 if (iter==&swig_module) {
12866 } while (iter!= module_head);
12868 /* if the is found in the list, then all is done and we may leave */
12870 /* otherwise we must add out module into the list */
12871 swig_module.next = module_head->next;
12872 module_head->next = &swig_module;
12875 /* When multiple interpreters are used, a module could have already been initialized in
12876 a different interpreter, but not yet have a pointer in this interpreter.
12877 In this case, we do not want to continue adding types... everything should be
12879 if (init == 0) return;
12881 /* Now work on filling in swig_module.types */
12882 #ifdef SWIGRUNTIME_DEBUG
12883 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
12885 for (i = 0; i < swig_module.size; ++i) {
12886 swig_type_info *type = 0;
12887 swig_type_info *ret;
12888 swig_cast_info *cast;
12890 #ifdef SWIGRUNTIME_DEBUG
12891 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
12894 /* if there is another module already loaded */
12895 if (swig_module.next != &swig_module) {
12896 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
12899 /* Overwrite clientdata field */
12900 #ifdef SWIGRUNTIME_DEBUG
12901 printf("SWIG_InitializeModule: found type %s\n", type->name);
12903 if (swig_module.type_initial[i]->clientdata) {
12904 type->clientdata = swig_module.type_initial[i]->clientdata;
12905 #ifdef SWIGRUNTIME_DEBUG
12906 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
12910 type = swig_module.type_initial[i];
12913 /* Insert casting types */
12914 cast = swig_module.cast_initial[i];
12915 while (cast->type) {
12916 /* Don't need to add information already in the list */
12918 #ifdef SWIGRUNTIME_DEBUG
12919 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
12921 if (swig_module.next != &swig_module) {
12922 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
12923 #ifdef SWIGRUNTIME_DEBUG
12924 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
12928 if (type == swig_module.type_initial[i]) {
12929 #ifdef SWIGRUNTIME_DEBUG
12930 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
12935 /* Check for casting already in the list */
12936 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
12937 #ifdef SWIGRUNTIME_DEBUG
12938 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
12940 if (!ocast) ret = 0;
12945 #ifdef SWIGRUNTIME_DEBUG
12946 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
12949 type->cast->prev = cast;
12950 cast->next = type->cast;
12956 /* Set entry in modules->types array equal to the type */
12957 swig_module.types[i] = type;
12959 swig_module.types[i] = 0;
12961 #ifdef SWIGRUNTIME_DEBUG
12962 printf("**** SWIG_InitializeModule: Cast List ******\n");
12963 for (i = 0; i < swig_module.size; ++i) {
12965 swig_cast_info *cast = swig_module.cast_initial[i];
12966 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
12967 while (cast->type) {
12968 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
12972 printf("---- Total casts: %d\n",j);
12974 printf("**** SWIG_InitializeModule: Cast List ******\n");
12978 /* This function will propagate the clientdata field of type to
12979 * any new swig_type_info structures that have been added into the list
12980 * of equivalent types. It is like calling
12981 * SWIG_TypeClientData(type, clientdata) a second time.
12984 SWIG_PropagateClientData(void) {
12986 swig_cast_info *equiv;
12987 static int init_run = 0;
12989 if (init_run) return;
12992 for (i = 0; i < swig_module.size; i++) {
12993 if (swig_module.types[i]->clientdata) {
12994 equiv = swig_module.types[i]->cast;
12996 if (!equiv->converter) {
12997 if (equiv->type && !equiv->type->clientdata)
12998 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
13000 equiv = equiv->next;
13020 /* Python-specific SWIG API */
13021 #define SWIG_newvarlink() SWIG_Python_newvarlink()
13022 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
13023 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
13025 /* -----------------------------------------------------------------------------
13026 * global variable support code.
13027 * ----------------------------------------------------------------------------- */
13029 typedef struct swig_globalvar {
13030 char *name; /* Name of global variable */
13031 PyObject *(*get_attr)(void); /* Return the current value */
13032 int (*set_attr)(PyObject *); /* Set the value */
13033 struct swig_globalvar *next;
13036 typedef struct swig_varlinkobject {
13038 swig_globalvar *vars;
13039 } swig_varlinkobject;
13041 SWIGINTERN PyObject *
13042 swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
13043 #if PY_VERSION_HEX >= 0x03000000
13044 return PyUnicode_InternFromString("<Swig global variables>");
13046 return PyString_FromString("<Swig global variables>");
13050 SWIGINTERN PyObject *
13051 swig_varlink_str(swig_varlinkobject *v) {
13052 #if PY_VERSION_HEX >= 0x03000000
13053 PyObject *str = PyUnicode_InternFromString("(");
13056 swig_globalvar *var;
13057 for (var = v->vars; var; var=var->next) {
13058 tail = PyUnicode_FromString(var->name);
13059 joined = PyUnicode_Concat(str, tail);
13064 tail = PyUnicode_InternFromString(", ");
13065 joined = PyUnicode_Concat(str, tail);
13071 tail = PyUnicode_InternFromString(")");
13072 joined = PyUnicode_Concat(str, tail);
13077 PyObject *str = PyString_FromString("(");
13078 swig_globalvar *var;
13079 for (var = v->vars; var; var=var->next) {
13080 PyString_ConcatAndDel(&str,PyString_FromString(var->name));
13081 if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
13083 PyString_ConcatAndDel(&str,PyString_FromString(")"));
13089 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
13091 PyObject *str = swig_varlink_str(v);
13092 fprintf(fp,"Swig global variables ");
13093 fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
13094 SWIG_Python_str_DelForPy3(tmp);
13100 swig_varlink_dealloc(swig_varlinkobject *v) {
13101 swig_globalvar *var = v->vars;
13103 swig_globalvar *n = var->next;
13110 SWIGINTERN PyObject *
13111 swig_varlink_getattr(swig_varlinkobject *v, char *n) {
13112 PyObject *res = NULL;
13113 swig_globalvar *var = v->vars;
13115 if (strcmp(var->name,n) == 0) {
13116 res = (*var->get_attr)();
13121 if (res == NULL && !PyErr_Occurred()) {
13122 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
13128 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
13130 swig_globalvar *var = v->vars;
13132 if (strcmp(var->name,n) == 0) {
13133 res = (*var->set_attr)(p);
13138 if (res == 1 && !PyErr_Occurred()) {
13139 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
13144 SWIGINTERN PyTypeObject*
13145 swig_varlink_type(void) {
13146 static char varlink__doc__[] = "Swig var link object";
13147 static PyTypeObject varlink_type;
13148 static int type_init = 0;
13150 const PyTypeObject tmp = {
13151 /* PyObject header changed in Python 3 */
13152 #if PY_VERSION_HEX >= 0x03000000
13153 PyVarObject_HEAD_INIT(NULL, 0)
13155 PyObject_HEAD_INIT(NULL)
13158 (char *)"swigvarlink", /* tp_name */
13159 sizeof(swig_varlinkobject), /* tp_basicsize */
13160 0, /* tp_itemsize */
13161 (destructor) swig_varlink_dealloc, /* tp_dealloc */
13162 (printfunc) swig_varlink_print, /* tp_print */
13163 (getattrfunc) swig_varlink_getattr, /* tp_getattr */
13164 (setattrfunc) swig_varlink_setattr, /* tp_setattr */
13165 0, /* tp_compare */
13166 (reprfunc) swig_varlink_repr, /* tp_repr */
13167 0, /* tp_as_number */
13168 0, /* tp_as_sequence */
13169 0, /* tp_as_mapping */
13172 (reprfunc) swig_varlink_str, /* tp_str */
13173 0, /* tp_getattro */
13174 0, /* tp_setattro */
13175 0, /* tp_as_buffer */
13177 varlink__doc__, /* tp_doc */
13178 0, /* tp_traverse */
13180 0, /* tp_richcompare */
13181 0, /* tp_weaklistoffset */
13182 #if PY_VERSION_HEX >= 0x02020000
13183 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
13185 #if PY_VERSION_HEX >= 0x02030000
13188 #if PY_VERSION_HEX >= 0x02060000
13189 0, /* tp_version */
13191 #ifdef COUNT_ALLOCS
13192 0,0,0,0 /* tp_alloc -> tp_next */
13195 varlink_type = tmp;
13197 #if PY_VERSION_HEX < 0x02020000
13198 varlink_type.ob_type = &PyType_Type;
13200 if (PyType_Ready(&varlink_type) < 0)
13204 return &varlink_type;
13207 /* Create a variable linking object for use later */
13208 SWIGINTERN PyObject *
13209 SWIG_Python_newvarlink(void) {
13210 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
13214 return ((PyObject*) result);
13218 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
13219 swig_varlinkobject *v = (swig_varlinkobject *) p;
13220 swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
13222 size_t size = strlen(name)+1;
13223 gv->name = (char *)malloc(size);
13225 strncpy(gv->name,name,size);
13226 gv->get_attr = get_attr;
13227 gv->set_attr = set_attr;
13228 gv->next = v->vars;
13234 SWIGINTERN PyObject *
13235 SWIG_globals(void) {
13236 static PyObject *_SWIG_globals = 0;
13237 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
13238 return _SWIG_globals;
13241 /* -----------------------------------------------------------------------------
13242 * constants/methods manipulation
13243 * ----------------------------------------------------------------------------- */
13245 /* Install Constants */
13247 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
13250 for (i = 0; constants[i].type; ++i) {
13251 switch(constants[i].type) {
13252 case SWIG_PY_POINTER:
13253 obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
13255 case SWIG_PY_BINARY:
13256 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
13263 PyDict_SetItemString(d, constants[i].name, obj);
13269 /* -----------------------------------------------------------------------------*/
13270 /* Fix SwigMethods to carry the callback ptrs when needed */
13271 /* -----------------------------------------------------------------------------*/
13274 SWIG_Python_FixMethods(PyMethodDef *methods,
13275 swig_const_info *const_table,
13276 swig_type_info **types,
13277 swig_type_info **types_initial) {
13279 for (i = 0; methods[i].ml_name; ++i) {
13280 const char *c = methods[i].ml_doc;
13281 if (c && (c = strstr(c, "swig_ptr: "))) {
13283 swig_const_info *ci = 0;
13284 const char *name = c + 10;
13285 for (j = 0; const_table[j].type; ++j) {
13286 if (strncmp(const_table[j].name, name,
13287 strlen(const_table[j].name)) == 0) {
13288 ci = &(const_table[j]);
13293 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
13295 size_t shift = (ci->ptype) - types;
13296 swig_type_info *ty = types_initial[shift];
13297 size_t ldoc = (c - methods[i].ml_doc);
13298 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
13299 char *ndoc = (char*)malloc(ldoc + lptr + 10);
13302 strncpy(buff, methods[i].ml_doc, ldoc);
13304 strncpy(buff, "swig_ptr: ", 10);
13306 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
13307 methods[i].ml_doc = ndoc;
13319 /* -----------------------------------------------------------------------------*
13320 * Partial Init method
13321 * -----------------------------------------------------------------------------*/
13328 #if PY_VERSION_HEX >= 0x03000000
13334 PyObject *m, *d, *md;
13335 #if PY_VERSION_HEX >= 0x03000000
13336 static struct PyModuleDef SWIG_module = {
13337 # if PY_VERSION_HEX >= 0x03020000
13338 PyModuleDef_HEAD_INIT,
13341 PyObject_HEAD_INIT(NULL)
13347 (char *) SWIG_name,
13358 #if defined(SWIGPYTHON_BUILTIN)
13359 static SwigPyClientData SwigPyObject_clientdata = {
13360 0, 0, 0, 0, 0, 0, 0
13362 static PyGetSetDef this_getset_def = {
13363 (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
13365 static SwigPyGetSet thisown_getset_closure = {
13366 (PyCFunction) SwigPyObject_own,
13367 (PyCFunction) SwigPyObject_own
13369 static PyGetSetDef thisown_getset_def = {
13370 (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
13372 PyObject *metatype_args;
13373 PyTypeObject *builtin_pytype;
13374 int builtin_base_count;
13375 swig_type_info *builtin_basetype;
13377 PyGetSetDescrObject *static_getset;
13378 PyTypeObject *metatype;
13379 SwigPyClientData *cd;
13380 PyObject *public_interface, *public_symbol;
13381 PyObject *this_descr;
13382 PyObject *thisown_descr;
13385 (void)builtin_pytype;
13386 (void)builtin_base_count;
13387 (void)builtin_basetype;
13389 (void)static_getset;
13391 /* metatype is used to implement static member variables. */
13392 metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
13393 assert(metatype_args);
13394 metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
13396 Py_DECREF(metatype_args);
13397 metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
13398 assert(PyType_Ready(metatype) >= 0);
13401 /* Fix SwigMethods to carry the callback ptrs when needed */
13402 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
13404 #if PY_VERSION_HEX >= 0x03000000
13405 m = PyModule_Create(&SWIG_module);
13407 m = Py_InitModule((char *) SWIG_name, SwigMethods);
13409 md = d = PyModule_GetDict(m);
13412 SWIG_InitializeModule(0);
13414 #ifdef SWIGPYTHON_BUILTIN
13415 SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
13416 assert(SwigPyObject_stype);
13417 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
13419 SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
13420 SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
13421 } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
13422 PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
13423 # if PY_VERSION_HEX >= 0x03000000
13430 /* All objects have a 'this' attribute */
13431 this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
13434 /* All objects have a 'thisown' attribute */
13435 thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
13436 (void)thisown_descr;
13438 public_interface = PyList_New(0);
13440 (void)public_symbol;
13442 PyDict_SetItemString(md, "__all__", public_interface);
13443 Py_DECREF(public_interface);
13444 for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
13445 SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
13446 for (i = 0; swig_const_table[i].name != 0; ++i)
13447 SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
13450 SWIG_InstallConstants(d,swig_const_table);
13453 init_ForcedStop(m);
13454 init_RoundoffLimited(m);
13459 SWIG_Python_SetConstant(d, "GN_DIRECT",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT)));
13460 SWIG_Python_SetConstant(d, "GN_DIRECT_L",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT_L)));
13461 SWIG_Python_SetConstant(d, "GN_DIRECT_L_RAND",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT_L_RAND)));
13462 SWIG_Python_SetConstant(d, "GN_DIRECT_NOSCAL",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT_NOSCAL)));
13463 SWIG_Python_SetConstant(d, "GN_DIRECT_L_NOSCAL",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT_L_NOSCAL)));
13464 SWIG_Python_SetConstant(d, "GN_DIRECT_L_RAND_NOSCAL",SWIG_From_int(static_cast< int >(nlopt::GN_DIRECT_L_RAND_NOSCAL)));
13465 SWIG_Python_SetConstant(d, "GN_ORIG_DIRECT",SWIG_From_int(static_cast< int >(nlopt::GN_ORIG_DIRECT)));
13466 SWIG_Python_SetConstant(d, "GN_ORIG_DIRECT_L",SWIG_From_int(static_cast< int >(nlopt::GN_ORIG_DIRECT_L)));
13467 SWIG_Python_SetConstant(d, "GD_STOGO",SWIG_From_int(static_cast< int >(nlopt::GD_STOGO)));
13468 SWIG_Python_SetConstant(d, "GD_STOGO_RAND",SWIG_From_int(static_cast< int >(nlopt::GD_STOGO_RAND)));
13469 SWIG_Python_SetConstant(d, "LD_LBFGS_NOCEDAL",SWIG_From_int(static_cast< int >(nlopt::LD_LBFGS_NOCEDAL)));
13470 SWIG_Python_SetConstant(d, "LD_LBFGS",SWIG_From_int(static_cast< int >(nlopt::LD_LBFGS)));
13471 SWIG_Python_SetConstant(d, "LN_PRAXIS",SWIG_From_int(static_cast< int >(nlopt::LN_PRAXIS)));
13472 SWIG_Python_SetConstant(d, "LD_VAR1",SWIG_From_int(static_cast< int >(nlopt::LD_VAR1)));
13473 SWIG_Python_SetConstant(d, "LD_VAR2",SWIG_From_int(static_cast< int >(nlopt::LD_VAR2)));
13474 SWIG_Python_SetConstant(d, "LD_TNEWTON",SWIG_From_int(static_cast< int >(nlopt::LD_TNEWTON)));
13475 SWIG_Python_SetConstant(d, "LD_TNEWTON_RESTART",SWIG_From_int(static_cast< int >(nlopt::LD_TNEWTON_RESTART)));
13476 SWIG_Python_SetConstant(d, "LD_TNEWTON_PRECOND",SWIG_From_int(static_cast< int >(nlopt::LD_TNEWTON_PRECOND)));
13477 SWIG_Python_SetConstant(d, "LD_TNEWTON_PRECOND_RESTART",SWIG_From_int(static_cast< int >(nlopt::LD_TNEWTON_PRECOND_RESTART)));
13478 SWIG_Python_SetConstant(d, "GN_CRS2_LM",SWIG_From_int(static_cast< int >(nlopt::GN_CRS2_LM)));
13479 SWIG_Python_SetConstant(d, "GN_MLSL",SWIG_From_int(static_cast< int >(nlopt::GN_MLSL)));
13480 SWIG_Python_SetConstant(d, "GD_MLSL",SWIG_From_int(static_cast< int >(nlopt::GD_MLSL)));
13481 SWIG_Python_SetConstant(d, "GN_MLSL_LDS",SWIG_From_int(static_cast< int >(nlopt::GN_MLSL_LDS)));
13482 SWIG_Python_SetConstant(d, "GD_MLSL_LDS",SWIG_From_int(static_cast< int >(nlopt::GD_MLSL_LDS)));
13483 SWIG_Python_SetConstant(d, "LD_MMA",SWIG_From_int(static_cast< int >(nlopt::LD_MMA)));
13484 SWIG_Python_SetConstant(d, "LN_COBYLA",SWIG_From_int(static_cast< int >(nlopt::LN_COBYLA)));
13485 SWIG_Python_SetConstant(d, "LN_NEWUOA",SWIG_From_int(static_cast< int >(nlopt::LN_NEWUOA)));
13486 SWIG_Python_SetConstant(d, "LN_NEWUOA_BOUND",SWIG_From_int(static_cast< int >(nlopt::LN_NEWUOA_BOUND)));
13487 SWIG_Python_SetConstant(d, "LN_NELDERMEAD",SWIG_From_int(static_cast< int >(nlopt::LN_NELDERMEAD)));
13488 SWIG_Python_SetConstant(d, "LN_SBPLX",SWIG_From_int(static_cast< int >(nlopt::LN_SBPLX)));
13489 SWIG_Python_SetConstant(d, "LN_AUGLAG",SWIG_From_int(static_cast< int >(nlopt::LN_AUGLAG)));
13490 SWIG_Python_SetConstant(d, "LD_AUGLAG",SWIG_From_int(static_cast< int >(nlopt::LD_AUGLAG)));
13491 SWIG_Python_SetConstant(d, "LN_AUGLAG_EQ",SWIG_From_int(static_cast< int >(nlopt::LN_AUGLAG_EQ)));
13492 SWIG_Python_SetConstant(d, "LD_AUGLAG_EQ",SWIG_From_int(static_cast< int >(nlopt::LD_AUGLAG_EQ)));
13493 SWIG_Python_SetConstant(d, "LN_BOBYQA",SWIG_From_int(static_cast< int >(nlopt::LN_BOBYQA)));
13494 SWIG_Python_SetConstant(d, "GN_ISRES",SWIG_From_int(static_cast< int >(nlopt::GN_ISRES)));
13495 SWIG_Python_SetConstant(d, "AUGLAG",SWIG_From_int(static_cast< int >(nlopt::AUGLAG)));
13496 SWIG_Python_SetConstant(d, "AUGLAG_EQ",SWIG_From_int(static_cast< int >(nlopt::AUGLAG_EQ)));
13497 SWIG_Python_SetConstant(d, "G_MLSL",SWIG_From_int(static_cast< int >(nlopt::G_MLSL)));
13498 SWIG_Python_SetConstant(d, "G_MLSL_LDS",SWIG_From_int(static_cast< int >(nlopt::G_MLSL_LDS)));
13499 SWIG_Python_SetConstant(d, "LD_SLSQP",SWIG_From_int(static_cast< int >(nlopt::LD_SLSQP)));
13500 SWIG_Python_SetConstant(d, "LD_CCSAQ",SWIG_From_int(static_cast< int >(nlopt::LD_CCSAQ)));
13501 SWIG_Python_SetConstant(d, "GN_ESCH",SWIG_From_int(static_cast< int >(nlopt::GN_ESCH)));
13502 SWIG_Python_SetConstant(d, "NUM_ALGORITHMS",SWIG_From_int(static_cast< int >(nlopt::NUM_ALGORITHMS)));
13503 SWIG_Python_SetConstant(d, "FAILURE",SWIG_From_int(static_cast< int >(nlopt::FAILURE)));
13504 SWIG_Python_SetConstant(d, "INVALID_ARGS",SWIG_From_int(static_cast< int >(nlopt::INVALID_ARGS)));
13505 SWIG_Python_SetConstant(d, "OUT_OF_MEMORY",SWIG_From_int(static_cast< int >(nlopt::OUT_OF_MEMORY)));
13506 SWIG_Python_SetConstant(d, "ROUNDOFF_LIMITED",SWIG_From_int(static_cast< int >(nlopt::ROUNDOFF_LIMITED)));
13507 SWIG_Python_SetConstant(d, "FORCED_STOP",SWIG_From_int(static_cast< int >(nlopt::FORCED_STOP)));
13508 SWIG_Python_SetConstant(d, "SUCCESS",SWIG_From_int(static_cast< int >(nlopt::SUCCESS)));
13509 SWIG_Python_SetConstant(d, "STOPVAL_REACHED",SWIG_From_int(static_cast< int >(nlopt::STOPVAL_REACHED)));
13510 SWIG_Python_SetConstant(d, "FTOL_REACHED",SWIG_From_int(static_cast< int >(nlopt::FTOL_REACHED)));
13511 SWIG_Python_SetConstant(d, "XTOL_REACHED",SWIG_From_int(static_cast< int >(nlopt::XTOL_REACHED)));
13512 SWIG_Python_SetConstant(d, "MAXEVAL_REACHED",SWIG_From_int(static_cast< int >(nlopt::MAXEVAL_REACHED)));
13513 SWIG_Python_SetConstant(d, "MAXTIME_REACHED",SWIG_From_int(static_cast< int >(nlopt::MAXTIME_REACHED)));
13514 #if PY_VERSION_HEX >= 0x03000000