chiark / gitweb /
octave4.4
[nlopt.git] / swig / nlopt-python.cpp
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.12
4  *
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  * ----------------------------------------------------------------------------- */
10
11 #define SWIGPYTHON
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
13
14
15 #ifdef __cplusplus
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18   struct SwigMovePointer {
19     T *ptr;
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; }
23   } pointer;
24   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
26 public:
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; }
31 };
32
33 template <typename T> T SwigValueInit() {
34   return T();
35 }
36 #endif
37
38 /* -----------------------------------------------------------------------------
39  *  This section contains generic SWIG labels for method/variable
40  *  declarations/attributes, and other compiler dependent labels.
41  * ----------------------------------------------------------------------------- */
42
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
51 # else
52 #  define SWIGTEMPLATEDISAMBIGUATOR
53 # endif
54 #endif
55
56 /* inline attribute */
57 #ifndef SWIGINLINE
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 #   define SWIGINLINE inline
60 # else
61 #   define SWIGINLINE
62 # endif
63 #endif
64
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
66 #ifndef SWIGUNUSED
67 # if defined(__GNUC__)
68 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 #     define SWIGUNUSED __attribute__ ((__unused__))
70 #   else
71 #     define SWIGUNUSED
72 #   endif
73 # elif defined(__ICC)
74 #   define SWIGUNUSED __attribute__ ((__unused__))
75 # else
76 #   define SWIGUNUSED
77 # endif
78 #endif
79
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
83 # endif
84 #endif
85
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 #   define SWIGUNUSEDPARM(p)
89 # else
90 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
91 # endif
92 #endif
93
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
98
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
103
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 #  ifndef GCC_HASCLASSVISIBILITY
107 #    define GCC_HASCLASSVISIBILITY
108 #  endif
109 #endif
110
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   if defined(STATIC_LINKED)
114 #     define SWIGEXPORT
115 #   else
116 #     define SWIGEXPORT __declspec(dllexport)
117 #   endif
118 # else
119 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 #     define SWIGEXPORT __attribute__ ((visibility("default")))
121 #   else
122 #     define SWIGEXPORT
123 #   endif
124 # endif
125 #endif
126
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 #   define SWIGSTDCALL __stdcall
131 # else
132 #   define SWIGSTDCALL
133 # endif
134 #endif
135
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
139 #endif
140
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
144 #endif
145
146
147
148 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
149 /* Use debug wrappers with the Python release dll */
150 # undef _DEBUG
151 # include <Python.h>
152 # define _DEBUG
153 #else
154 # include <Python.h>
155 #endif
156
157 /* -----------------------------------------------------------------------------
158  * swigrun.swg
159  *
160  * This file contains generic C API SWIG runtime support for pointer
161  * type checking.
162  * ----------------------------------------------------------------------------- */
163
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"
167
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)
173 #else
174 # define SWIG_TYPE_TABLE_NAME
175 #endif
176
177 /*
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'.
181
182   But only do this if strictly necessary, ie, if you have problems
183   with your compiler or suchlike.
184 */
185
186 #ifndef SWIGRUNTIME
187 # define SWIGRUNTIME SWIGINTERN
188 #endif
189
190 #ifndef SWIGRUNTIMEINLINE
191 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
192 #endif
193
194 /*  Generic buffer size */
195 #ifndef SWIG_BUFFER_SIZE
196 # define SWIG_BUFFER_SIZE 1024
197 #endif
198
199 /* Flags for pointer conversions */
200 #define SWIG_POINTER_DISOWN        0x1
201 #define SWIG_CAST_NEW_MEMORY       0x2
202
203 /* Flags for new pointer objects */
204 #define SWIG_POINTER_OWN           0x1
205
206
207 /*
208    Flags/methods for returning states.
209
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).
213
214    Use the following macros/flags to set or process the returning
215    states.
216
217    In old versions of SWIG, code such as the following was usually written:
218
219      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
220        // success code
221      } else {
222        //fail code
223      }
224
225    Now you can be more explicit:
226
227     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
228     if (SWIG_IsOK(res)) {
229       // success code
230     } else {
231       // fail code
232     }
233
234    which is the same really, but now you can also do
235
236     Type *ptr;
237     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
238     if (SWIG_IsOK(res)) {
239       // success code
240       if (SWIG_IsNewObj(res) {
241         ...
242         delete *ptr;
243       } else {
244         ...
245       }
246     } else {
247       // fail code
248     }
249
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
253
254       int SWIG_ConvertPtr(obj, ptr,...) {
255         if (<obj is ok>) {
256           if (<need new object>) {
257             *ptr = <ptr to new allocated object>;
258             return SWIG_NEWOBJ;
259           } else {
260             *ptr = <ptr to old object>;
261             return SWIG_OLDOBJ;
262           }
263         } else {
264           return SWIG_BADOBJ;
265         }
266       }
267
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
270    SWIG errors code.
271
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
274
275        int food(double)
276        int fooi(int);
277
278    and you call
279
280       food(1)   // cast rank '1'  (1 -> 1.0)
281       fooi(1)   // cast rank '0'
282
283    just use the SWIG_AddCast()/SWIG_CheckState()
284 */
285
286 #define SWIG_OK                    (0)
287 #define SWIG_ERROR                 (-1)
288 #define SWIG_IsOK(r)               (r >= 0)
289 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
290
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))
309
310 /* Cast-Rank Mode */
311 #if defined(SWIG_CASTRANK_MODE)
312 #  ifndef SWIG_TypeRank
313 #    define SWIG_TypeRank             unsigned long
314 #  endif
315 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
316 #    define SWIG_MAXCASTRANK          (2)
317 #  endif
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;
322 }
323 SWIGINTERNINLINE int SWIG_CheckState(int r) {
324   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
325 }
326 #else /* no cast-rank mode */
327 #  define SWIG_AddCast(r) (r)
328 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
329 #endif
330
331
332 #include <string.h>
333
334 #ifdef __cplusplus
335 extern "C" {
336 #endif
337
338 typedef void *(*swig_converter_func)(void *, int *);
339 typedef struct swig_type_info *(*swig_dycast_func)(void **);
340
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 */
349 } swig_type_info;
350
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 */
357 } swig_cast_info;
358
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 */
369 } swig_module_info;
370
371 /*
372   Compare two type names skipping the space characters, therefore
373   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
374
375   Return 0 when the two name types are equivalent, as in
376   strncmp, but skipping ' '.
377 */
378 SWIGRUNTIME int
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;
385   }
386   return (int)((l1 - f1) - (l2 - f2));
387 }
388
389 /*
390   Check type equivalence in a name list like <name1>|<name2>|...
391   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
392 */
393 SWIGRUNTIME int
394 SWIG_TypeCmp(const char *nb, const char *tb) {
395   int equiv = 1;
396   const char* te = tb + strlen(tb);
397   const char* ne = nb;
398   while (equiv != 0 && *ne) {
399     for (nb = ne; *ne; ++ne) {
400       if (*ne == '|') break;
401     }
402     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
403     if (*ne) ++ne;
404   }
405   return equiv;
406 }
407
408 /*
409   Check type equivalence in a name list like <name1>|<name2>|...
410   Return 0 if not equal, 1 if equal
411 */
412 SWIGRUNTIME int
413 SWIG_TypeEquiv(const char *nb, const char *tb) {
414   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
415 }
416
417 /*
418   Check the typename
419 */
420 SWIGRUNTIME swig_cast_info *
421 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
422   if (ty) {
423     swig_cast_info *iter = ty->cast;
424     while (iter) {
425       if (strcmp(iter->type->name, c) == 0) {
426         if (iter == ty->cast)
427           return iter;
428         /* Move iter to the top of the linked list */
429         iter->prev->next = iter->next;
430         if (iter->next)
431           iter->next->prev = iter->prev;
432         iter->next = ty->cast;
433         iter->prev = 0;
434         if (ty->cast) ty->cast->prev = iter;
435         ty->cast = iter;
436         return iter;
437       }
438       iter = iter->next;
439     }
440   }
441   return 0;
442 }
443
444 /*
445   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
446 */
447 SWIGRUNTIME swig_cast_info *
448 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
449   if (ty) {
450     swig_cast_info *iter = ty->cast;
451     while (iter) {
452       if (iter->type == from) {
453         if (iter == ty->cast)
454           return iter;
455         /* Move iter to the top of the linked list */
456         iter->prev->next = iter->next;
457         if (iter->next)
458           iter->next->prev = iter->prev;
459         iter->next = ty->cast;
460         iter->prev = 0;
461         if (ty->cast) ty->cast->prev = iter;
462         ty->cast = iter;
463         return iter;
464       }
465       iter = iter->next;
466     }
467   }
468   return 0;
469 }
470
471 /*
472   Cast a pointer up an inheritance hierarchy
473 */
474 SWIGRUNTIMEINLINE void *
475 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
476   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
477 }
478
479 /*
480    Dynamic pointer casting. Down an inheritance hierarchy
481 */
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);
488     if (ty) lastty = ty;
489   }
490   return lastty;
491 }
492
493 /*
494   Return the name associated with this type
495 */
496 SWIGRUNTIMEINLINE const char *
497 SWIG_TypeName(const swig_type_info *ty) {
498   return ty->name;
499 }
500
501 /*
502   Return the pretty name associated with this type,
503   that is an unmangled type name in a form presentable to the user.
504 */
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
510      specific. */
511   if (!type) return NULL;
512   if (type->str != NULL) {
513     const char *last_name = type->str;
514     const char *s;
515     for (s = type->str; *s; s++)
516       if (*s == '|') last_name = s+1;
517     return last_name;
518   }
519   else
520     return type->name;
521 }
522
523 /*
524    Set the clientdata field for a type
525 */
526 SWIGRUNTIME void
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;
531
532   while (cast) {
533     if (!cast->converter) {
534       swig_type_info *tc = cast->type;
535       if (!tc->clientdata) {
536         SWIG_TypeClientData(tc, clientdata);
537       }
538     }
539     cast = cast->next;
540   }
541 }
542 SWIGRUNTIME void
543 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
544   SWIG_TypeClientData(ti, clientdata);
545   ti->owndata = 1;
546 }
547
548 /*
549   Search for a swig_type_info structure only by mangled name
550   Search is a O(log #types)
551
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
554   the circular list.
555 */
556 SWIGRUNTIME swig_type_info *
557 SWIG_MangledTypeQueryModule(swig_module_info *start,
558                             swig_module_info *end,
559                             const char *name) {
560   swig_module_info *iter = start;
561   do {
562     if (iter->size) {
563       register size_t l = 0;
564       register size_t r = iter->size - 1;
565       do {
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;
569         if (iname) {
570           register int compare = strcmp(name, iname);
571           if (compare == 0) {
572             return iter->types[i];
573           } else if (compare < 0) {
574             if (i) {
575               r = i - 1;
576             } else {
577               break;
578             }
579           } else if (compare > 0) {
580             l = i + 1;
581           }
582         } else {
583           break; /* should never happen */
584         }
585       } while (l <= r);
586     }
587     iter = iter->next;
588   } while (iter != end);
589   return 0;
590 }
591
592 /*
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).
596
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
599   the circular list.
600 */
601 SWIGRUNTIME swig_type_info *
602 SWIG_TypeQueryModule(swig_module_info *start,
603                      swig_module_info *end,
604                      const char *name) {
605   /* STEP 1: Search the name field using binary search */
606   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
607   if (ret) {
608     return ret;
609   } else {
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;
613     do {
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];
618       }
619       iter = iter->next;
620     } while (iter != end);
621   }
622
623   /* neither found a match */
624   return 0;
625 }
626
627 /*
628    Pack binary data into a string
629 */
630 SWIGRUNTIME char *
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];
639   }
640   return c;
641 }
642
643 /*
644    Unpack binary data from a string
645 */
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);
657     else
658       return (char *) 0;
659     d = *(c++);
660     if ((d >= '0') && (d <= '9'))
661       uu |= (d - '0');
662     else if ((d >= 'a') && (d <= 'f'))
663       uu |= (d - ('a'-10));
664     else
665       return (char *) 0;
666     *u = uu;
667   }
668   return c;
669 }
670
671 /*
672    Pack 'void *' into a string buffer.
673 */
674 SWIGRUNTIME char *
675 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
676   char *r = buff;
677   if ((2*sizeof(void *) + 2) > bsz) return 0;
678   *(r++) = '_';
679   r = SWIG_PackData(r,&ptr,sizeof(void *));
680   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
681   strcpy(r,name);
682   return buff;
683 }
684
685 SWIGRUNTIME const char *
686 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
687   if (*c != '_') {
688     if (strcmp(c,"NULL") == 0) {
689       *ptr = (void *) 0;
690       return name;
691     } else {
692       return 0;
693     }
694   }
695   return SWIG_UnpackData(++c,ptr,sizeof(void *));
696 }
697
698 SWIGRUNTIME char *
699 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
700   char *r = buff;
701   size_t lname = (name ? strlen(name) : 0);
702   if ((2*sz + 2 + lname) > bsz) return 0;
703   *(r++) = '_';
704   r = SWIG_PackData(r,ptr,sz);
705   if (lname) {
706     strncpy(r,name,lname+1);
707   } else {
708     *r = 0;
709   }
710   return buff;
711 }
712
713 SWIGRUNTIME const char *
714 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
715   if (*c != '_') {
716     if (strcmp(c,"NULL") == 0) {
717       memset(ptr,0,sz);
718       return name;
719     } else {
720       return 0;
721     }
722   }
723   return SWIG_UnpackData(++c,ptr,sz);
724 }
725
726 #ifdef __cplusplus
727 }
728 #endif
729
730 /*  Errors in SWIG */
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
744
745
746
747 /* Compatibility macros for Python 3 */
748 #if PY_VERSION_HEX >= 0x03000000
749
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)
764
765 #endif
766
767 #ifndef Py_TYPE
768 #  define Py_TYPE(op) ((op)->ob_type)
769 #endif
770
771 /* SWIG APIs for compatibility of both Python 2 & 3 */
772
773 #if PY_VERSION_HEX >= 0x03000000
774 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
775 #else
776 #  define SWIG_Python_str_FromFormat PyString_FromFormat
777 #endif
778
779
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.
782  */
783 SWIGINTERN char*
784 SWIG_Python_str_AsChar(PyObject *str)
785 {
786 #if PY_VERSION_HEX >= 0x03000000
787   char *cstr;
788   char *newstr;
789   Py_ssize_t len;
790   str = PyUnicode_AsUTF8String(str);
791   PyBytes_AsStringAndSize(str, &cstr, &len);
792   newstr = (char *) malloc(len+1);
793   memcpy(newstr, cstr, len+1);
794   Py_XDECREF(str);
795   return newstr;
796 #else
797   return PyString_AsString(str);
798 #endif
799 }
800
801 #if PY_VERSION_HEX >= 0x03000000
802 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
803 #else
804 #  define SWIG_Python_str_DelForPy3(x) 
805 #endif
806
807
808 SWIGINTERN PyObject*
809 SWIG_Python_str_FromChar(const char *c)
810 {
811 #if PY_VERSION_HEX >= 0x03000000
812   return PyUnicode_FromString(c); 
813 #else
814   return PyString_FromString(c);
815 #endif
816 }
817
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
822 # else
823 #  define PyOS_snprintf snprintf
824 # endif
825 #endif
826
827 /* A crude PyString_FromFormat implementation for old Pythons */
828 #if PY_VERSION_HEX < 0x02020000
829
830 #ifndef SWIG_PYBUFFER_SIZE
831 # define SWIG_PYBUFFER_SIZE 1024
832 #endif
833
834 static PyObject *
835 PyString_FromFormat(const char *fmt, ...) {
836   va_list ap;
837   char buf[SWIG_PYBUFFER_SIZE * 2];
838   int res;
839   va_start(ap, fmt);
840   res = vsnprintf(buf, sizeof(buf), fmt, ap);
841   va_end(ap);
842   return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
843 }
844 #endif
845
846 /* Add PyObject_Del for old Pythons */
847 #if PY_VERSION_HEX < 0x01060000
848 # define PyObject_Del(op) PyMem_DEL((op))
849 #endif
850 #ifndef PyObject_DEL
851 # define PyObject_DEL PyObject_Del
852 #endif
853
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
858 # endif
859 # ifndef PyObject_GenericGetAttr
860 #  define PyObject_GenericGetAttr 0
861 # endif
862 #endif
863
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
868 # endif
869 #endif
870
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;}
875 # endif
876 #endif
877
878 /* PySequence_Size for old Pythons */
879 #if PY_VERSION_HEX < 0x02000000
880 # ifndef PySequence_Size
881 #  define PySequence_Size PySequence_Length
882 # endif
883 #endif
884
885 /* PyBool_FromLong for old Pythons */
886 #if PY_VERSION_HEX < 0x02030000
887 static
888 PyObject *PyBool_FromLong(long ok)
889 {
890   PyObject *result = ok ? Py_True : Py_False;
891   Py_INCREF(result);
892   return result;
893 }
894 #endif
895
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))
913 {
914   long result = 0;
915   PyObject *i = PyNumber_Int(x);
916   if (i) {
917     result = PyInt_AsLong(i);
918     Py_DECREF(i);
919   }
920   return result;
921 }
922 #endif
923
924 #if PY_VERSION_HEX < 0x02050000
925 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
926 #endif
927
928 #if PY_VERSION_HEX < 0x02040000
929 #define Py_VISIT(op)                            \
930   do {                                          \
931     if (op) {                                   \
932       int vret = visit((op), arg);              \
933       if (vret)                                 \
934         return vret;                            \
935     }                                           \
936   } while (0)
937 #endif
938
939 #if PY_VERSION_HEX < 0x02030000
940 typedef struct {
941   PyTypeObject type;
942   PyNumberMethods as_number;
943   PyMappingMethods as_mapping;
944   PySequenceMethods as_sequence;
945   PyBufferProcs as_buffer;
946   PyObject *name, *slots;
947 } PyHeapTypeObject;
948 #endif
949
950 #if PY_VERSION_HEX < 0x02030000
951 typedef destructor freefunc;
952 #endif
953
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)
959 #endif
960
961 #if PY_VERSION_HEX < 0x03020000
962 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
963 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
964 #endif
965
966 /* -----------------------------------------------------------------------------
967  * error manipulation
968  * ----------------------------------------------------------------------------- */
969
970 SWIGRUNTIME PyObject*
971 SWIG_Python_ErrorType(int code) {
972   PyObject* type = 0;
973   switch(code) {
974   case SWIG_MemoryError:
975     type = PyExc_MemoryError;
976     break;
977   case SWIG_IOError:
978     type = PyExc_IOError;
979     break;
980   case SWIG_RuntimeError:
981     type = PyExc_RuntimeError;
982     break;
983   case SWIG_IndexError:
984     type = PyExc_IndexError;
985     break;
986   case SWIG_TypeError:
987     type = PyExc_TypeError;
988     break;
989   case SWIG_DivisionByZero:
990     type = PyExc_ZeroDivisionError;
991     break;
992   case SWIG_OverflowError:
993     type = PyExc_OverflowError;
994     break;
995   case SWIG_SyntaxError:
996     type = PyExc_SyntaxError;
997     break;
998   case SWIG_ValueError:
999     type = PyExc_ValueError;
1000     break;
1001   case SWIG_SystemError:
1002     type = PyExc_SystemError;
1003     break;
1004   case SWIG_AttributeError:
1005     type = PyExc_AttributeError;
1006     break;
1007   default:
1008     type = PyExc_RuntimeError;
1009   }
1010   return type;
1011 }
1012
1013
1014 SWIGRUNTIME void
1015 SWIG_Python_AddErrorMsg(const char* mesg)
1016 {
1017   PyObject *type = 0;
1018   PyObject *value = 0;
1019   PyObject *traceback = 0;
1020
1021   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1022   if (value) {
1023     char *tmp;
1024     PyObject *old_str = PyObject_Str(value);
1025     PyErr_Clear();
1026     Py_XINCREF(type);
1027
1028     PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1029     SWIG_Python_str_DelForPy3(tmp);
1030     Py_DECREF(old_str);
1031     Py_DECREF(value);
1032   } else {
1033     PyErr_SetString(PyExc_RuntimeError, mesg);
1034   }
1035 }
1036
1037 #if defined(SWIG_PYTHON_NO_THREADS)
1038 #  if defined(SWIG_PYTHON_THREADS)
1039 #    undef SWIG_PYTHON_THREADS
1040 #  endif
1041 #endif
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
1046 #    endif
1047 #  endif
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() 
1051 #    endif
1052 #    ifdef __cplusplus /* C++ code */
1053        class SWIG_Python_Thread_Block {
1054          bool status;
1055          PyGILState_STATE state;
1056        public:
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(); }
1060        };
1061        class SWIG_Python_Thread_Allow {
1062          bool status;
1063          PyThreadState *save;
1064        public:
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(); }
1068        };
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()
1073 #    else /* C code */
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)
1078 #    endif
1079 #  else /* Old thread way, not implemented, user must provide it */
1080 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1081 #      define SWIG_PYTHON_INITIALIZE_THREADS
1082 #    endif
1083 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1084 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1085 #    endif
1086 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1087 #      define SWIG_PYTHON_THREAD_END_BLOCK
1088 #    endif
1089 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1090 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1091 #    endif
1092 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1093 #      define SWIG_PYTHON_THREAD_END_ALLOW
1094 #    endif
1095 #  endif
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
1102 #endif
1103
1104 /* -----------------------------------------------------------------------------
1105  * Python API portion that goes into the runtime
1106  * ----------------------------------------------------------------------------- */
1107
1108 #ifdef __cplusplus
1109 extern "C" {
1110 #endif
1111
1112 /* -----------------------------------------------------------------------------
1113  * Constant declarations
1114  * ----------------------------------------------------------------------------- */
1115
1116 /* Constant Types */
1117 #define SWIG_PY_POINTER 4
1118 #define SWIG_PY_BINARY  5
1119
1120 /* Constant information structure */
1121 typedef struct swig_const_info {
1122   int type;
1123   char *name;
1124   long lvalue;
1125   double dvalue;
1126   void   *pvalue;
1127   swig_type_info **ptype;
1128 } swig_const_info;
1129
1130
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)
1137 {
1138   return PyInstanceMethod_New(func);
1139 }
1140 #else
1141 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1142 {
1143   return NULL;
1144 }
1145 #endif
1146
1147 #ifdef __cplusplus
1148 }
1149 #endif
1150
1151
1152 /* -----------------------------------------------------------------------------
1153  * pyrun.swg
1154  *
1155  * This file contains the runtime support for Python modules
1156  * and includes code for managing global variables and pointer
1157  * type checking.
1158  *
1159  * ----------------------------------------------------------------------------- */
1160
1161 /* Common SWIG API */
1162
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)
1167
1168 #ifdef SWIGPYTHON_BUILTIN
1169 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1170 #else
1171 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1172 #endif
1173
1174 #define SWIG_InternalNewPointerObj(ptr, type, flags)    SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1175
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
1179
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)
1183
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)
1187
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)
1191
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)
1195
1196
1197 /* Runtime API */
1198
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)
1202
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                                          
1208
1209
1210 /* Runtime API implementation */
1211
1212 /* Error manipulation */
1213
1214 SWIGINTERN void 
1215 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1216   SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
1217   PyErr_SetObject(errtype, obj);
1218   Py_DECREF(obj);
1219   SWIG_PYTHON_THREAD_END_BLOCK;
1220 }
1221
1222 SWIGINTERN void 
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;
1227 }
1228
1229 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1230
1231 /* Set a constant value */
1232
1233 #if defined(SWIGPYTHON_BUILTIN)
1234
1235 SWIGINTERN void
1236 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1237   PyObject *s = PyString_InternFromString(key);
1238   PyList_Append(seq, s);
1239   Py_DECREF(s);
1240 }
1241
1242 SWIGINTERN void
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);
1246 #else
1247   PyDict_SetItemString(d, name, obj);
1248 #endif
1249   Py_DECREF(obj);
1250   if (public_interface)
1251     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1252 }
1253
1254 #else
1255
1256 SWIGINTERN void
1257 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
1258 #if PY_VERSION_HEX < 0x02030000
1259   PyDict_SetItemString(d, (char *)name, obj);
1260 #else
1261   PyDict_SetItemString(d, name, obj);
1262 #endif
1263   Py_DECREF(obj);                            
1264 }
1265
1266 #endif
1267
1268 /* Append a value to the result obj */
1269
1270 SWIGINTERN PyObject*
1271 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1272 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1273   if (!result) {
1274     result = obj;
1275   } else if (result == Py_None) {
1276     Py_DECREF(result);
1277     result = obj;
1278   } else {
1279     if (!PyList_Check(result)) {
1280       PyObject *o2 = result;
1281       result = PyList_New(1);
1282       PyList_SetItem(result, 0, o2);
1283     }
1284     PyList_Append(result,obj);
1285     Py_DECREF(obj);
1286   }
1287   return result;
1288 #else
1289   PyObject*   o2;
1290   PyObject*   o3;
1291   if (!result) {
1292     result = obj;
1293   } else if (result == Py_None) {
1294     Py_DECREF(result);
1295     result = obj;
1296   } else {
1297     if (!PyTuple_Check(result)) {
1298       o2 = result;
1299       result = PyTuple_New(1);
1300       PyTuple_SET_ITEM(result, 0, o2);
1301     }
1302     o3 = PyTuple_New(1);
1303     PyTuple_SET_ITEM(o3, 0, obj);
1304     o2 = result;
1305     result = PySequence_Concat(o2, o3);
1306     Py_DECREF(o2);
1307     Py_DECREF(o3);
1308   }
1309   return result;
1310 #endif
1311 }
1312
1313 /* Unpack the argument tuple */
1314
1315 SWIGINTERN int
1316 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1317 {
1318   if (!args) {
1319     if (!min && !max) {
1320       return 1;
1321     } else {
1322       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
1323                    name, (min == max ? "" : "at least "), (int)min);
1324       return 0;
1325     }
1326   }  
1327   if (!PyTuple_Check(args)) {
1328     if (min <= 1 && max >= 1) {
1329       register int i;
1330       objs[0] = args;
1331       for (i = 1; i < max; ++i) {
1332         objs[i] = 0;
1333       }
1334       return 2;
1335     }
1336     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1337     return 0;
1338   } else {
1339     register Py_ssize_t l = PyTuple_GET_SIZE(args);
1340     if (l < min) {
1341       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1342                    name, (min == max ? "" : "at least "), (int)min, (int)l);
1343       return 0;
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);
1347       return 0;
1348     } else {
1349       register int i;
1350       for (i = 0; i < l; ++i) {
1351         objs[i] = PyTuple_GET_ITEM(args, i);
1352       }
1353       for (; l < max; ++l) {
1354         objs[l] = 0;
1355       }
1356       return i + 1;
1357     }    
1358   }
1359 }
1360
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);
1364 #else
1365 #define SWIG_Python_CallFunctor(functor, obj)           PyObject_CallFunction(functor, "O", obj);
1366 #endif
1367
1368 /*
1369   Helper for static pointer initialization for both C and C++ code, for example
1370   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1371 */
1372 #ifdef __cplusplus
1373 #define SWIG_STATIC_POINTER(var)  var
1374 #else
1375 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1376 #endif
1377
1378 /* -----------------------------------------------------------------------------
1379  * Pointer declarations
1380  * ----------------------------------------------------------------------------- */
1381
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)
1385
1386 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1387
1388 #define SWIG_BUILTIN_TP_INIT        (SWIG_POINTER_OWN << 2)
1389 #define SWIG_BUILTIN_INIT           (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1390
1391 #ifdef __cplusplus
1392 extern "C" {
1393 #endif
1394
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
1400 #    endif
1401 #  endif
1402 #endif
1403
1404 #ifdef SWIG_PYTHON_BUILD_NONE
1405 #  ifdef Py_None
1406 #   undef Py_None
1407 #   define Py_None SWIG_Py_None()
1408 #  endif
1409 SWIGRUNTIMEINLINE PyObject * 
1410 _SWIG_Py_None(void)
1411 {
1412   PyObject *none = Py_BuildValue((char*)"");
1413   Py_DECREF(none);
1414   return none;
1415 }
1416 SWIGRUNTIME PyObject * 
1417 SWIG_Py_None(void)
1418 {
1419   static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1420   return none;
1421 }
1422 #endif
1423
1424 /* The python void return value */
1425
1426 SWIGRUNTIMEINLINE PyObject * 
1427 SWIG_Py_Void(void)
1428 {
1429   PyObject *none = Py_None;
1430   Py_INCREF(none);
1431   return none;
1432 }
1433
1434 /* SwigPyClientData */
1435
1436 typedef struct {
1437   PyObject *klass;
1438   PyObject *newraw;
1439   PyObject *newargs;
1440   PyObject *destroy;
1441   int delargs;
1442   int implicitconv;
1443   PyTypeObject *pytype;
1444 } SwigPyClientData;
1445
1446 SWIGRUNTIMEINLINE int 
1447 SWIG_Python_CheckImplicit(swig_type_info *ty)
1448 {
1449   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1450   return data ? data->implicitconv : 0;
1451 }
1452
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);
1458 }
1459
1460
1461 SWIGRUNTIME SwigPyClientData * 
1462 SwigPyClientData_New(PyObject* obj)
1463 {
1464   if (!obj) {
1465     return 0;
1466   } else {
1467     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1468     /* the klass element */
1469     data->klass = obj;
1470     Py_INCREF(data->klass);
1471     /* the newraw method and newargs arguments used to create a new raw instance */
1472     if (PyClass_Check(obj)) {
1473       data->newraw = 0;
1474       data->newargs = obj;
1475       Py_INCREF(obj);
1476     } else {
1477 #if (PY_VERSION_HEX < 0x02020000)
1478       data->newraw = 0;
1479 #else
1480       data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1481 #endif
1482       if (data->newraw) {
1483         Py_INCREF(data->newraw);
1484         data->newargs = PyTuple_New(1);
1485         PyTuple_SetItem(data->newargs, 0, obj);
1486       } else {
1487         data->newargs = obj;
1488       }
1489       Py_INCREF(data->newargs);
1490     }
1491     /* the destroy method, aka as the C++ delete method */
1492     data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1493     if (PyErr_Occurred()) {
1494       PyErr_Clear();
1495       data->destroy = 0;
1496     }
1497     if (data->destroy) {
1498       int flags;
1499       Py_INCREF(data->destroy);
1500       flags = PyCFunction_GET_FLAGS(data->destroy);
1501 #ifdef METH_O
1502       data->delargs = !(flags & (METH_O));
1503 #else
1504       data->delargs = 0;
1505 #endif
1506     } else {
1507       data->delargs = 0;
1508     }
1509     data->implicitconv = 0;
1510     data->pytype = 0;
1511     return data;
1512   }
1513 }
1514
1515 SWIGRUNTIME void 
1516 SwigPyClientData_Del(SwigPyClientData *data) {
1517   Py_XDECREF(data->newraw);
1518   Py_XDECREF(data->newargs);
1519   Py_XDECREF(data->destroy);
1520 }
1521
1522 /* =============== SwigPyObject =====================*/
1523
1524 typedef struct {
1525   PyObject_HEAD
1526   void *ptr;
1527   swig_type_info *ty;
1528   int own;
1529   PyObject *next;
1530 #ifdef SWIGPYTHON_BUILTIN
1531   PyObject *dict;
1532 #endif
1533 } SwigPyObject;
1534
1535 SWIGRUNTIME PyObject *
1536 SwigPyObject_long(SwigPyObject *v)
1537 {
1538   return PyLong_FromVoidPtr(v->ptr);
1539 }
1540
1541 SWIGRUNTIME PyObject *
1542 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1543 {
1544   PyObject *res = NULL;
1545   PyObject *args = PyTuple_New(1);
1546   if (args) {
1547     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1548       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1549       if (ofmt) {
1550 #if PY_VERSION_HEX >= 0x03000000
1551         res = PyUnicode_Format(ofmt,args);
1552 #else
1553         res = PyString_Format(ofmt,args);
1554 #endif
1555         Py_DECREF(ofmt);
1556       }
1557       Py_DECREF(args);
1558     }
1559   }
1560   return res;
1561 }
1562
1563 SWIGRUNTIME PyObject *
1564 SwigPyObject_oct(SwigPyObject *v)
1565 {
1566   return SwigPyObject_format("%o",v);
1567 }
1568
1569 SWIGRUNTIME PyObject *
1570 SwigPyObject_hex(SwigPyObject *v)
1571 {
1572   return SwigPyObject_format("%x",v);
1573 }
1574
1575 SWIGRUNTIME PyObject *
1576 #ifdef METH_NOARGS
1577 SwigPyObject_repr(SwigPyObject *v)
1578 #else
1579 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1580 #endif
1581 {
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);
1584   if (v->next) {
1585 # ifdef METH_NOARGS
1586     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1587 # else
1588     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1589 # endif
1590 # if PY_VERSION_HEX >= 0x03000000
1591     PyObject *joined = PyUnicode_Concat(repr, nrep);
1592     Py_DecRef(repr);
1593     Py_DecRef(nrep);
1594     repr = joined;
1595 # else
1596     PyString_ConcatAndDel(&repr,nrep);
1597 # endif
1598   }
1599   return repr;  
1600 }
1601
1602 SWIGRUNTIME int
1603 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1604 {
1605   void *i = v->ptr;
1606   void *j = w->ptr;
1607   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1608 }
1609
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)
1613 {
1614   PyObject* res;
1615   if( op != Py_EQ && op != Py_NE ) {
1616     Py_INCREF(Py_NotImplemented);
1617     return Py_NotImplemented;
1618   }
1619   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1620   return res;  
1621 }
1622
1623
1624 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1625
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;
1633     assert(cd);
1634     assert(cd->pytype);
1635     return cd->pytype;
1636 }
1637 #else
1638 SWIGRUNTIME PyTypeObject*
1639 SwigPyObject_type(void) {
1640   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1641   return type;
1642 }
1643 #endif
1644
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))
1650     return 1;
1651   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1652 #else
1653   return (Py_TYPE(op) == SwigPyObject_type())
1654     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1655 #endif
1656 }
1657
1658 SWIGRUNTIME PyObject *
1659 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1660
1661 SWIGRUNTIME void
1662 SwigPyObject_dealloc(PyObject *v)
1663 {
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;
1670     if (destroy) {
1671       /* destroy is always a VARARGS method */
1672       PyObject *res;
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);
1677         Py_DECREF(tmp);
1678       } else {
1679         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1680         PyObject *mself = PyCFunction_GET_SELF(destroy);
1681         res = ((*meth)(mself, v));
1682       }
1683       Py_XDECREF(res);
1684     } 
1685 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1686     else {
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"));
1689     }
1690 #endif
1691   } 
1692   Py_XDECREF(next);
1693   PyObject_DEL(v);
1694 }
1695
1696 SWIGRUNTIME PyObject* 
1697 SwigPyObject_append(PyObject* v, PyObject* next)
1698 {
1699   SwigPyObject *sobj = (SwigPyObject *) v;
1700 #ifndef METH_O
1701   PyObject *tmp = 0;
1702   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1703   next = tmp;
1704 #endif
1705   if (!SwigPyObject_Check(next)) {
1706     return NULL;
1707   }
1708   sobj->next = next;
1709   Py_INCREF(next);
1710   return SWIG_Py_Void();
1711 }
1712
1713 SWIGRUNTIME PyObject* 
1714 #ifdef METH_NOARGS
1715 SwigPyObject_next(PyObject* v)
1716 #else
1717 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1718 #endif
1719 {
1720   SwigPyObject *sobj = (SwigPyObject *) v;
1721   if (sobj->next) {    
1722     Py_INCREF(sobj->next);
1723     return sobj->next;
1724   } else {
1725     return SWIG_Py_Void();
1726   }
1727 }
1728
1729 SWIGINTERN PyObject*
1730 #ifdef METH_NOARGS
1731 SwigPyObject_disown(PyObject *v)
1732 #else
1733 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1734 #endif
1735 {
1736   SwigPyObject *sobj = (SwigPyObject *)v;
1737   sobj->own = 0;
1738   return SWIG_Py_Void();
1739 }
1740
1741 SWIGINTERN PyObject*
1742 #ifdef METH_NOARGS
1743 SwigPyObject_acquire(PyObject *v)
1744 #else
1745 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1746 #endif
1747 {
1748   SwigPyObject *sobj = (SwigPyObject *)v;
1749   sobj->own = SWIG_POINTER_OWN;
1750   return SWIG_Py_Void();
1751 }
1752
1753 SWIGINTERN PyObject*
1754 SwigPyObject_own(PyObject *v, PyObject *args)
1755 {
1756   PyObject *val = 0;
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)) 
1761 #else
1762   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) 
1763 #endif
1764     {
1765       return NULL;
1766     } 
1767   else
1768     {
1769       SwigPyObject *sobj = (SwigPyObject *)v;
1770       PyObject *obj = PyBool_FromLong(sobj->own);
1771       if (val) {
1772 #ifdef METH_NOARGS
1773         if (PyObject_IsTrue(val)) {
1774           SwigPyObject_acquire(v);
1775         } else {
1776           SwigPyObject_disown(v);
1777         }
1778 #else
1779         if (PyObject_IsTrue(val)) {
1780           SwigPyObject_acquire(v,args);
1781         } else {
1782           SwigPyObject_disown(v,args);
1783         }
1784 #endif
1785       } 
1786       return obj;
1787     }
1788 }
1789
1790 #ifdef METH_O
1791 static PyMethodDef
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"},
1799   {0, 0, 0, 0}  
1800 };
1801 #else
1802 static PyMethodDef
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"},
1810   {0, 0, 0, 0}  
1811 };
1812 #endif
1813
1814 #if PY_VERSION_HEX < 0x02020000
1815 SWIGINTERN PyObject *
1816 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1817 {
1818   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1819 }
1820 #endif
1821
1822 SWIGRUNTIME PyTypeObject*
1823 SwigPyObject_TypeOnce(void) {
1824   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1825
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*/
1833 #endif
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*/
1841     0,             /*nb_invert*/
1842     0,             /*nb_lshift*/
1843     0,             /*nb_rshift*/
1844     0,             /*nb_and*/
1845     0,             /*nb_xor*/
1846     0,             /*nb_or*/
1847 #if PY_VERSION_HEX < 0x03000000
1848     0,   /*nb_coerce*/
1849 #endif
1850     (unaryfunc)SwigPyObject_long, /*nb_int*/
1851 #if PY_VERSION_HEX < 0x03000000
1852     (unaryfunc)SwigPyObject_long, /*nb_long*/
1853 #else
1854     0, /*nb_reserved*/
1855 #endif
1856     (unaryfunc)0,                 /*nb_float*/
1857 #if PY_VERSION_HEX < 0x03000000
1858     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1859     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1860 #endif
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 */
1869 #endif
1870   };
1871
1872   static PyTypeObject swigpyobject_type;
1873   static int type_init = 0;
1874   if (!type_init) {
1875     const PyTypeObject tmp = {
1876       /* PyObject header changed in Python 3 */
1877 #if PY_VERSION_HEX >= 0x03000000
1878       PyVarObject_HEAD_INIT(NULL, 0)
1879 #else
1880       PyObject_HEAD_INIT(NULL)
1881       0,                                    /* ob_size */
1882 #endif
1883       (char *)"SwigPyObject",               /* tp_name */
1884       sizeof(SwigPyObject),                 /* tp_basicsize */
1885       0,                                    /* tp_itemsize */
1886       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1887       0,                                    /* tp_print */
1888 #if PY_VERSION_HEX < 0x02020000
1889       (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
1890 #else
1891       (getattrfunc)0,                       /* tp_getattr */
1892 #endif
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 */
1896 #else
1897       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1898 #endif
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 */
1905       0,                                    /* tp_str */
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 */
1912       0,                                    /* tp_clear */
1913       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1914       0,                                    /* tp_weaklistoffset */
1915 #if PY_VERSION_HEX >= 0x02020000
1916       0,                                    /* tp_iter */
1917       0,                                    /* tp_iternext */
1918       swigobject_methods,                   /* tp_methods */
1919       0,                                    /* tp_members */
1920       0,                                    /* tp_getset */
1921       0,                                    /* tp_base */
1922       0,                                    /* tp_dict */
1923       0,                                    /* tp_descr_get */
1924       0,                                    /* tp_descr_set */
1925       0,                                    /* tp_dictoffset */
1926       0,                                    /* tp_init */
1927       0,                                    /* tp_alloc */
1928       0,                                    /* tp_new */
1929       0,                                    /* tp_free */
1930       0,                                    /* tp_is_gc */
1931       0,                                    /* tp_bases */
1932       0,                                    /* tp_mro */
1933       0,                                    /* tp_cache */
1934       0,                                    /* tp_subclasses */
1935       0,                                    /* tp_weaklist */
1936 #endif
1937 #if PY_VERSION_HEX >= 0x02030000
1938       0,                                    /* tp_del */
1939 #endif
1940 #if PY_VERSION_HEX >= 0x02060000
1941       0,                                    /* tp_version */
1942 #endif
1943 #ifdef COUNT_ALLOCS
1944       0,0,0,0                               /* tp_alloc -> tp_next */
1945 #endif
1946     };
1947     swigpyobject_type = tmp;
1948     type_init = 1;
1949 #if PY_VERSION_HEX < 0x02020000
1950     swigpyobject_type.ob_type = &PyType_Type;
1951 #else
1952     if (PyType_Ready(&swigpyobject_type) < 0)
1953       return NULL;
1954 #endif
1955   }
1956   return &swigpyobject_type;
1957 }
1958
1959 SWIGRUNTIME PyObject *
1960 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1961 {
1962   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1963   if (sobj) {
1964     sobj->ptr  = ptr;
1965     sobj->ty   = ty;
1966     sobj->own  = own;
1967     sobj->next = 0;
1968   }
1969   return (PyObject *)sobj;
1970 }
1971
1972 /* -----------------------------------------------------------------------------
1973  * Implements a simple Swig Packed type, and use it instead of string
1974  * ----------------------------------------------------------------------------- */
1975
1976 typedef struct {
1977   PyObject_HEAD
1978   void *pack;
1979   swig_type_info *ty;
1980   size_t size;
1981 } SwigPyPacked;
1982
1983 SWIGRUNTIME int
1984 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1985 {
1986   char result[SWIG_BUFFER_SIZE];
1987   fputs("<Swig Packed ", fp); 
1988   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1989     fputs("at ", fp); 
1990     fputs(result, fp); 
1991   }
1992   fputs(v->ty->name,fp); 
1993   fputs(">", fp);
1994   return 0; 
1995 }
1996   
1997 SWIGRUNTIME PyObject *
1998 SwigPyPacked_repr(SwigPyPacked *v)
1999 {
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);
2003   } else {
2004     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2005   }  
2006 }
2007
2008 SWIGRUNTIME PyObject *
2009 SwigPyPacked_str(SwigPyPacked *v)
2010 {
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);
2014   } else {
2015     return SWIG_Python_str_FromChar(v->ty->name);
2016   }  
2017 }
2018
2019 SWIGRUNTIME int
2020 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2021 {
2022   size_t i = v->size;
2023   size_t j = w->size;
2024   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2025   return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2026 }
2027
2028 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2029
2030 SWIGRUNTIME PyTypeObject*
2031 SwigPyPacked_type(void) {
2032   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2033   return type;
2034 }
2035
2036 SWIGRUNTIMEINLINE int
2037 SwigPyPacked_Check(PyObject *op) {
2038   return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
2039     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2040 }
2041
2042 SWIGRUNTIME void
2043 SwigPyPacked_dealloc(PyObject *v)
2044 {
2045   if (SwigPyPacked_Check(v)) {
2046     SwigPyPacked *sobj = (SwigPyPacked *) v;
2047     free(sobj->pack);
2048   }
2049   PyObject_DEL(v);
2050 }
2051
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;
2057   if (!type_init) {
2058     const PyTypeObject tmp = {
2059       /* PyObject header changed in Python 3 */
2060 #if PY_VERSION_HEX>=0x03000000
2061       PyVarObject_HEAD_INIT(NULL, 0)
2062 #else
2063       PyObject_HEAD_INIT(NULL)
2064       0,                                    /* ob_size */
2065 #endif
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 */
2075 #else
2076       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
2077 #endif
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 */
2091       0,                                    /* tp_clear */
2092       0,                                    /* tp_richcompare */
2093       0,                                    /* tp_weaklistoffset */
2094 #if PY_VERSION_HEX >= 0x02020000
2095       0,                                    /* tp_iter */
2096       0,                                    /* tp_iternext */
2097       0,                                    /* tp_methods */
2098       0,                                    /* tp_members */
2099       0,                                    /* tp_getset */
2100       0,                                    /* tp_base */
2101       0,                                    /* tp_dict */
2102       0,                                    /* tp_descr_get */
2103       0,                                    /* tp_descr_set */
2104       0,                                    /* tp_dictoffset */
2105       0,                                    /* tp_init */
2106       0,                                    /* tp_alloc */
2107       0,                                    /* tp_new */
2108       0,                                    /* tp_free */
2109       0,                                    /* tp_is_gc */
2110       0,                                    /* tp_bases */
2111       0,                                    /* tp_mro */
2112       0,                                    /* tp_cache */
2113       0,                                    /* tp_subclasses */
2114       0,                                    /* tp_weaklist */
2115 #endif
2116 #if PY_VERSION_HEX >= 0x02030000
2117       0,                                    /* tp_del */
2118 #endif
2119 #if PY_VERSION_HEX >= 0x02060000
2120       0,                                    /* tp_version */
2121 #endif
2122 #ifdef COUNT_ALLOCS
2123       0,0,0,0                               /* tp_alloc -> tp_next */
2124 #endif
2125     };
2126     swigpypacked_type = tmp;
2127     type_init = 1;
2128 #if PY_VERSION_HEX < 0x02020000
2129     swigpypacked_type.ob_type = &PyType_Type;
2130 #else
2131     if (PyType_Ready(&swigpypacked_type) < 0)
2132       return NULL;
2133 #endif
2134   }
2135   return &swigpypacked_type;
2136 }
2137
2138 SWIGRUNTIME PyObject *
2139 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2140 {
2141   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2142   if (sobj) {
2143     void *pack = malloc(size);
2144     if (pack) {
2145       memcpy(pack, ptr, size);
2146       sobj->pack = pack;
2147       sobj->ty   = ty;
2148       sobj->size = size;
2149     } else {
2150       PyObject_DEL((PyObject *) sobj);
2151       sobj = 0;
2152     }
2153   }
2154   return (PyObject *) sobj;
2155 }
2156
2157 SWIGRUNTIME swig_type_info *
2158 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2159 {
2160   if (SwigPyPacked_Check(obj)) {
2161     SwigPyPacked *sobj = (SwigPyPacked *)obj;
2162     if (sobj->size != size) return 0;
2163     memcpy(ptr, sobj->pack, size);
2164     return sobj->ty;
2165   } else {
2166     return 0;
2167   }
2168 }
2169
2170 /* -----------------------------------------------------------------------------
2171  * pointers/data manipulation
2172  * ----------------------------------------------------------------------------- */
2173
2174 SWIGRUNTIMEINLINE PyObject *
2175 _SWIG_This(void)
2176 {
2177     return SWIG_Python_str_FromChar("this");
2178 }
2179
2180 static PyObject *swig_this = NULL;
2181
2182 SWIGRUNTIME PyObject *
2183 SWIG_This(void)
2184 {
2185   if (swig_this == NULL)
2186     swig_this = _SWIG_This();
2187   return swig_this;
2188 }
2189
2190 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2191
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 
2195 #endif
2196
2197 SWIGRUNTIME SwigPyObject *
2198 SWIG_Python_GetSwigThis(PyObject *pyobj) 
2199 {
2200   PyObject *obj;
2201
2202   if (SwigPyObject_Check(pyobj))
2203     return (SwigPyObject *) pyobj;
2204
2205 #ifdef SWIGPYTHON_BUILTIN
2206   (void)obj;
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;
2212   }
2213 # endif
2214   return NULL;
2215 #else
2216
2217   obj = 0;
2218
2219 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2220   if (PyInstance_Check(pyobj)) {
2221     obj = _PyInstance_Lookup(pyobj, SWIG_This());      
2222   } else {
2223     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2224     if (dictptr != NULL) {
2225       PyObject *dict = *dictptr;
2226       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2227     } else {
2228 #ifdef PyWeakref_CheckProxy
2229       if (PyWeakref_CheckProxy(pyobj)) {
2230         PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2231         return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2232       }
2233 #endif
2234       obj = PyObject_GetAttr(pyobj,SWIG_This());
2235       if (obj) {
2236         Py_DECREF(obj);
2237       } else {
2238         if (PyErr_Occurred()) PyErr_Clear();
2239         return 0;
2240       }
2241     }
2242   }
2243 #else
2244   obj = PyObject_GetAttr(pyobj,SWIG_This());
2245   if (obj) {
2246     Py_DECREF(obj);
2247   } else {
2248     if (PyErr_Occurred()) PyErr_Clear();
2249     return 0;
2250   }
2251 #endif
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);
2256   }
2257   return (SwigPyObject *)obj;
2258 #endif
2259 }
2260
2261 /* Acquire a pointer value */
2262
2263 SWIGRUNTIME int
2264 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2265   if (own == SWIG_POINTER_OWN) {
2266     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2267     if (sobj) {
2268       int oldown = sobj->own;
2269       sobj->own = own;
2270       return oldown;
2271     }
2272   }
2273   return 0;
2274 }
2275
2276 /* Convert a pointer value */
2277
2278 SWIGRUNTIME int
2279 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2280   int res;
2281   SwigPyObject *sobj;
2282   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2283
2284   if (!obj)
2285     return SWIG_ERROR;
2286   if (obj == Py_None && !implicit_conv) {
2287     if (ptr)
2288       *ptr = 0;
2289     return SWIG_OK;
2290   }
2291
2292   res = SWIG_ERROR;
2293
2294   sobj = SWIG_Python_GetSwigThis(obj);
2295   if (own)
2296     *own = 0;
2297   while (sobj) {
2298     void *vptr = sobj->ptr;
2299     if (ty) {
2300       swig_type_info *to = sobj->ty;
2301       if (to == ty) {
2302         /* no type cast needed */
2303         if (ptr) *ptr = vptr;
2304         break;
2305       } else {
2306         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2307         if (!tc) {
2308           sobj = (SwigPyObject *)sobj->next;
2309         } else {
2310           if (ptr) {
2311             int newmemory = 0;
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 */
2315               if (own)
2316                 *own = *own | SWIG_CAST_NEW_MEMORY;
2317             }
2318           }
2319           break;
2320         }
2321       }
2322     } else {
2323       if (ptr) *ptr = vptr;
2324       break;
2325     }
2326   }
2327   if (sobj) {
2328     if (own)
2329       *own = *own | sobj->own;
2330     if (flags & SWIG_POINTER_DISOWN) {
2331       sobj->own = 0;
2332     }
2333     res = SWIG_OK;
2334   } else {
2335     if (implicit_conv) {
2336       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2337       if (data && !data->implicitconv) {
2338         PyObject *klass = data->klass;
2339         if (klass) {
2340           PyObject *impconv;
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()) {
2345             PyErr_Clear();
2346             impconv = 0;
2347           }
2348           if (impconv) {
2349             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2350             if (iobj) {
2351               void *vptr;
2352               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2353               if (SWIG_IsOK(res)) {
2354                 if (ptr) {
2355                   *ptr = vptr;
2356                   /* transfer the ownership to 'ptr' */
2357                   iobj->own = 0;
2358                   res = SWIG_AddCast(res);
2359                   res = SWIG_AddNewMask(res);
2360                 } else {
2361                   res = SWIG_AddCast(res);                  
2362                 }
2363               }
2364             }
2365             Py_DECREF(impconv);
2366           }
2367         }
2368       }
2369     }
2370     if (!SWIG_IsOK(res) && obj == Py_None) {
2371       if (ptr)
2372         *ptr = 0;
2373       if (PyErr_Occurred())
2374         PyErr_Clear();
2375       res = SWIG_OK;
2376     }
2377   }
2378   return res;
2379 }
2380
2381 /* Convert a function ptr value */
2382
2383 SWIGRUNTIME int
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);
2387   } else {
2388     void *vptr = 0;
2389     
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;
2393     if (desc)
2394       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2395     if (!desc) 
2396       return SWIG_ERROR;
2397     if (ty) {
2398       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2399       if (tc) {
2400         int newmemory = 0;
2401         *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2402         assert(!newmemory); /* newmemory handling not yet implemented */
2403       } else {
2404         return SWIG_ERROR;
2405       }
2406     } else {
2407       *ptr = vptr;
2408     }
2409     return SWIG_OK;
2410   }
2411 }
2412
2413 /* Convert a packed value value */
2414
2415 SWIGRUNTIME int
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;
2419   if (ty) {
2420     if (to != ty) {
2421       /* check type cast? */
2422       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2423       if (!tc) return SWIG_ERROR;
2424     }
2425   }
2426   return SWIG_OK;
2427 }  
2428
2429 /* -----------------------------------------------------------------------------
2430  * Create a new pointer object
2431  * ----------------------------------------------------------------------------- */
2432
2433 /*
2434   Create a new instance object, without calling __init__, and set the
2435   'this' attribute.
2436 */
2437
2438 SWIGRUNTIME PyObject* 
2439 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2440 {
2441 #if (PY_VERSION_HEX >= 0x02020000)
2442   PyObject *inst = 0;
2443   PyObject *newraw = data->newraw;
2444   if (newraw) {
2445     inst = PyObject_Call(newraw, data->newargs, NULL);
2446     if (inst) {
2447 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2448       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2449       if (dictptr != NULL) {
2450         PyObject *dict = *dictptr;
2451         if (dict == NULL) {
2452           dict = PyDict_New();
2453           *dictptr = dict;
2454           PyDict_SetItem(dict, SWIG_This(), swig_this);
2455         }
2456       }
2457 #else
2458       PyObject *key = SWIG_This();
2459       PyObject_SetAttr(inst, key, swig_this);
2460 #endif
2461     }
2462   } else {
2463 #if PY_VERSION_HEX >= 0x03000000
2464     inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2465     if (inst) {
2466       PyObject_SetAttr(inst, SWIG_This(), swig_this);
2467       Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2468     }
2469 #else
2470     PyObject *dict = PyDict_New();
2471     if (dict) {
2472       PyDict_SetItem(dict, SWIG_This(), swig_this);
2473       inst = PyInstance_NewRaw(data->newargs, dict);
2474       Py_DECREF(dict);
2475     }
2476 #endif
2477   }
2478   return inst;
2479 #else
2480 #if (PY_VERSION_HEX >= 0x02010000)
2481   PyObject *inst = 0;
2482   PyObject *dict = PyDict_New();
2483   if (dict) {
2484     PyDict_SetItem(dict, SWIG_This(), swig_this);
2485     inst = PyInstance_NewRaw(data->newargs, dict);
2486     Py_DECREF(dict);
2487   }
2488   return (PyObject *) inst;
2489 #else
2490   PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2491   if (inst == NULL) {
2492     return NULL;
2493   }
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) {
2498     Py_DECREF(inst);
2499     return NULL;
2500   }
2501 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2502   inst->in_weakreflist = NULL;
2503 #endif
2504 #ifdef Py_TPFLAGS_GC
2505   PyObject_GC_Init(inst);
2506 #endif
2507   PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2508   return (PyObject *) inst;
2509 #endif
2510 #endif
2511 }
2512
2513 SWIGRUNTIME void
2514 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2515 {
2516  PyObject *dict;
2517 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2518  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2519  if (dictptr != NULL) {
2520    dict = *dictptr;
2521    if (dict == NULL) {
2522      dict = PyDict_New();
2523      *dictptr = dict;
2524    }
2525    PyDict_SetItem(dict, SWIG_This(), swig_this);
2526    return;
2527  }
2528 #endif
2529  dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2530  PyDict_SetItem(dict, SWIG_This(), swig_this);
2531  Py_DECREF(dict);
2532
2533
2534
2535 SWIGINTERN PyObject *
2536 SWIG_Python_InitShadowInstance(PyObject *args) {
2537   PyObject *obj[2];
2538   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2539     return NULL;
2540   } else {
2541     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2542     if (sthis) {
2543       SwigPyObject_append((PyObject*) sthis, obj[1]);
2544     } else {
2545       SWIG_Python_SetSwigThis(obj[0], obj[1]);
2546     }
2547     return SWIG_Py_Void();
2548   }
2549 }
2550
2551 /* Create a new pointer object */
2552
2553 SWIGRUNTIME PyObject *
2554 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2555   SwigPyClientData *clientdata;
2556   PyObject * robj;
2557   int own;
2558
2559   if (!ptr)
2560     return SWIG_Py_Void();
2561
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;
2568       if (newobj->ptr) {
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;
2574       }
2575     } else {
2576       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2577     }
2578     if (newobj) {
2579       newobj->ptr = ptr;
2580       newobj->ty = type;
2581       newobj->own = own;
2582       newobj->next = 0;
2583 #ifdef SWIGPYTHON_BUILTIN
2584       newobj->dict = 0;
2585 #endif
2586       return (PyObject*) newobj;
2587     }
2588     return SWIG_Py_Void();
2589   }
2590
2591   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2592
2593   robj = SwigPyObject_New(ptr, type, own);
2594   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2595     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2596     Py_DECREF(robj);
2597     robj = inst;
2598   }
2599   return robj;
2600 }
2601
2602 /* Create a new packed object */
2603
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();
2607 }
2608
2609 /* -----------------------------------------------------------------------------*
2610  *  Get type list 
2611  * -----------------------------------------------------------------------------*/
2612
2613 #ifdef SWIG_LINK_RUNTIME
2614 void *SWIG_ReturnGlobalTypeList(void *);
2615 #endif
2616
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);
2624 #else
2625 # ifdef SWIGPY_USE_CAPSULE
2626     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2627 # else
2628     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2629                                     (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2630 # endif
2631     if (PyErr_Occurred()) {
2632       PyErr_Clear();
2633       type_pointer = (void *)0;
2634     }
2635 #endif
2636   }
2637   return (swig_module_info *) type_pointer;
2638 }
2639
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 */
2643 SWIGINTERN int
2644 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2645 {
2646   PyObject *dict;
2647   if (!PyModule_Check(m)) {
2648     PyErr_SetString(PyExc_TypeError,
2649                     "PyModule_AddObject() needs module as first arg");
2650     return SWIG_ERROR;
2651   }
2652   if (!o) {
2653     PyErr_SetString(PyExc_TypeError,
2654                     "PyModule_AddObject() needs non-NULL value");
2655     return SWIG_ERROR;
2656   }
2657   
2658   dict = PyModule_GetDict(m);
2659   if (dict == NULL) {
2660     /* Internal error -- modules must have a dict! */
2661     PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2662                  PyModule_GetName(m));
2663     return SWIG_ERROR;
2664   }
2665   if (PyDict_SetItemString(dict, name, o))
2666     return SWIG_ERROR;
2667   Py_DECREF(o);
2668   return SWIG_OK;
2669 }
2670 #endif
2671
2672 SWIGRUNTIME void
2673 #ifdef SWIGPY_USE_CAPSULE
2674 SWIG_Python_DestroyModule(PyObject *obj)
2675 #else
2676 SWIG_Python_DestroyModule(void *vptr)
2677 #endif
2678 {
2679 #ifdef SWIGPY_USE_CAPSULE
2680   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2681 #else
2682   swig_module_info *swig_module = (swig_module_info *) vptr;
2683 #endif
2684   swig_type_info **types = swig_module->types;
2685   size_t i;
2686   for (i =0; i < swig_module->size; ++i) {
2687     swig_type_info *ty = types[i];
2688     if (ty->owndata) {
2689       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2690       if (data) SwigPyClientData_Del(data);
2691     }
2692   }
2693   Py_DECREF(SWIG_This());
2694   swig_this = NULL;
2695 }
2696
2697 SWIGRUNTIME void
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);
2702 #else
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);
2705 #endif
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);
2710   } else {
2711     Py_XDECREF(pointer);
2712   }
2713 #else
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);
2717   } else {
2718     Py_XDECREF(pointer);
2719   }
2720 #endif
2721 }
2722
2723 /* The python cached type query */
2724 SWIGRUNTIME PyObject *
2725 SWIG_Python_TypeCache(void) {
2726   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2727   return cache;
2728 }
2729
2730 SWIGRUNTIME swig_type_info *
2731 SWIG_Python_TypeQuery(const char *type)
2732 {
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;
2737   if (obj) {
2738 #ifdef SWIGPY_USE_CAPSULE
2739     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2740 #else
2741     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2742 #endif
2743   } else {
2744     swig_module_info *swig_module = SWIG_GetModule(0);
2745     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2746     if (descriptor) {
2747 #ifdef SWIGPY_USE_CAPSULE
2748       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2749 #else
2750       obj = PyCObject_FromVoidPtr(descriptor, NULL);
2751 #endif
2752       PyDict_SetItem(cache, key, obj);
2753       Py_DECREF(obj);
2754     }
2755   }
2756   Py_DECREF(key);
2757   return descriptor;
2758 }
2759
2760 /* 
2761    For backward compatibility only
2762 */
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)
2766
2767 SWIGRUNTIME int
2768 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2769 {  
2770   if (PyErr_Occurred()) {
2771     PyObject *type = 0;
2772     PyObject *value = 0;
2773     PyObject *traceback = 0;
2774     PyErr_Fetch(&type, &value, &traceback);
2775     if (value) {
2776       char *tmp;
2777       PyObject *old_str = PyObject_Str(value);
2778       Py_XINCREF(type);
2779       PyErr_Clear();
2780       if (infront) {
2781         PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2782       } else {
2783         PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2784       }
2785       SWIG_Python_str_DelForPy3(tmp);
2786       Py_DECREF(old_str);
2787     }
2788     return 1;
2789   } else {
2790     return 0;
2791   }
2792 }
2793   
2794 SWIGRUNTIME int
2795 SWIG_Python_ArgFail(int argnum)
2796 {
2797   if (PyErr_Occurred()) {
2798     /* add information about failing argument */
2799     char mesg[256];
2800     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2801     return SWIG_Python_AddErrMesg(mesg, 1);
2802   } else {
2803     return 0;
2804   }
2805 }
2806
2807 SWIGRUNTIMEINLINE const char *
2808 SwigPyObject_GetDesc(PyObject *self)
2809 {
2810   SwigPyObject *v = (SwigPyObject *)self;
2811   swig_type_info *ty = v ? v->ty : 0;
2812   return ty ? ty->str : "";
2813 }
2814
2815 SWIGRUNTIME void
2816 SWIG_Python_TypeError(const char *type, PyObject *obj)
2817 {
2818   if (type) {
2819 #if defined(SWIG_COBJECT_TYPES)
2820     if (obj && SwigPyObject_Check(obj)) {
2821       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2822       if (otype) {
2823         PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2824                      type, otype);
2825         return;
2826       }
2827     } else 
2828 #endif      
2829     {
2830       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
2831       if (otype) {
2832         PyObject *str = PyObject_Str(obj);
2833         const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2834         if (cstr) {
2835           PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2836                        type, otype, cstr);
2837           SWIG_Python_str_DelForPy3(cstr);
2838         } else {
2839           PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2840                        type, otype);
2841         }
2842         Py_XDECREF(str);
2843         return;
2844       }
2845     }   
2846     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2847   } else {
2848     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2849   }
2850 }
2851
2852
2853 /* Convert a pointer value, signal an exception on a type mismatch */
2854 SWIGRUNTIME void *
2855 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2856   void *result;
2857   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2858     PyErr_Clear();
2859 #if SWIG_POINTER_EXCEPTION
2860     if (flags) {
2861       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2862       SWIG_Python_ArgFail(argnum);
2863     }
2864 #endif
2865   }
2866   return result;
2867 }
2868
2869 #ifdef SWIGPYTHON_BUILTIN
2870 SWIGRUNTIME int
2871 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2872   PyTypeObject *tp = obj->ob_type;
2873   PyObject *descr;
2874   PyObject *encoded_name;
2875   descrsetfunc f;
2876   int res = -1;
2877
2878 # ifdef Py_USING_UNICODE
2879   if (PyString_Check(name)) {
2880     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2881     if (!name)
2882       return -1;
2883   } else if (!PyUnicode_Check(name))
2884 # else
2885   if (!PyString_Check(name))
2886 # endif
2887   {
2888     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2889     return -1;
2890   } else {
2891     Py_INCREF(name);
2892   }
2893
2894   if (!tp->tp_dict) {
2895     if (PyType_Ready(tp) < 0)
2896       goto done;
2897   }
2898
2899   descr = _PyType_Lookup(tp, name);
2900   f = NULL;
2901   if (descr != NULL)
2902     f = descr->ob_type->tp_descr_set;
2903   if (!f) {
2904     if (PyString_Check(name)) {
2905       encoded_name = name;
2906       Py_INCREF(name);
2907     } else {
2908       encoded_name = PyUnicode_AsUTF8String(name);
2909     }
2910     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2911     Py_DECREF(encoded_name);
2912   } else {
2913     res = f(descr, obj, value);
2914   }
2915   
2916   done:
2917   Py_DECREF(name);
2918   return res;
2919 }
2920 #endif
2921
2922
2923 #ifdef __cplusplus
2924 }
2925 #endif
2926
2927
2928
2929 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
2930
2931 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
2932
2933
2934
2935   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
2936
2937
2938 /* -------- TYPES TABLE (BEGIN) -------- */
2939
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)
2966
2967 /* -------- TYPES TABLE (END) -------- */
2968
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"
2972 # endif
2973 #endif
2974
2975 /*-----------------------------------------------
2976               @(target):= _nlopt.so
2977   ------------------------------------------------*/
2978 #if PY_VERSION_HEX >= 0x03000000
2979 #  define SWIG_init    PyInit__nlopt
2980
2981 #else
2982 #  define SWIG_init    init_nlopt
2983
2984 #endif
2985 #define SWIG_name    "_nlopt"
2986
2987 #define SWIGVERSION 0x020012 
2988 #define SWIG_VERSION SWIGVERSION
2989
2990
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)) 
2993
2994
2995 #include <stdexcept>
2996
2997
2998 namespace swig {
2999   class SwigPtr_PyObject {
3000   protected:
3001     PyObject *_obj;
3002
3003   public:
3004     SwigPtr_PyObject() :_obj(0)
3005     {
3006     }
3007
3008     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3009     {
3010       Py_XINCREF(_obj);      
3011     }
3012     
3013     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3014     {
3015       if (initial_ref) {
3016         Py_XINCREF(_obj);
3017       }
3018     }
3019     
3020     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
3021     {
3022       Py_XINCREF(item._obj);
3023       Py_XDECREF(_obj);
3024       _obj = item._obj;
3025       return *this;      
3026     }
3027     
3028     ~SwigPtr_PyObject() 
3029     {
3030       Py_XDECREF(_obj);
3031     }
3032     
3033     operator PyObject *() const
3034     {
3035       return _obj;
3036     }
3037
3038     PyObject *operator->() const
3039     {
3040       return _obj;
3041     }
3042   };
3043 }
3044
3045
3046 namespace swig {
3047   struct SwigVar_PyObject : SwigPtr_PyObject {
3048     SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3049     
3050     SwigVar_PyObject & operator = (PyObject* obj)
3051     {
3052       Py_XDECREF(_obj);
3053       _obj = obj;
3054       return *this;      
3055     }
3056   };
3057 }
3058
3059
3060 #include "nlopt.hpp"
3061
3062
3063 #include <iostream>
3064
3065 #if PY_VERSION_HEX >= 0x03020000
3066 # define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
3067 #else
3068 # define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
3069 #endif
3070
3071
3072 #include <stdexcept>
3073
3074
3075 #if defined(__GNUC__)
3076 #  if __GNUC__ == 2 && __GNUC_MINOR <= 96
3077 #     define SWIG_STD_NOMODERN_STL
3078 #  endif
3079 #endif
3080
3081
3082 #include <string>
3083 #include <stdexcept>
3084 #include <stddef.h>
3085
3086
3087   #include <stddef.h>
3088
3089
3090 namespace swig {
3091   struct stop_iteration {
3092   };
3093
3094   struct SwigPyIterator {
3095   private:
3096     SwigPtr_PyObject _seq;
3097
3098   protected:
3099     SwigPyIterator(PyObject *seq) : _seq(seq)
3100     {
3101     }
3102       
3103   public:
3104     virtual ~SwigPyIterator() {}
3105
3106     // Access iterator method, required by Python
3107     virtual PyObject *value() const = 0;
3108
3109     // Forward iterator method, required by Python
3110     virtual SwigPyIterator *incr(size_t n = 1) = 0;
3111     
3112     // Backward iterator method, very common in C++, but not required in Python
3113     virtual SwigPyIterator *decr(size_t /*n*/ = 1)
3114     {
3115       throw stop_iteration();
3116     }
3117
3118     // Random access iterator methods, but not required in Python
3119     virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
3120     {
3121       throw std::invalid_argument("operation not supported");
3122     }
3123
3124     virtual bool equal (const SwigPyIterator &/*x*/) const
3125     {
3126       throw std::invalid_argument("operation not supported");
3127     }
3128     
3129     // C++ common/needed methods
3130     virtual SwigPyIterator *copy() const = 0;
3131
3132     PyObject *next()     
3133     {
3134       SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
3135       PyObject *obj = value();
3136       incr();       
3137       SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3138       return obj;     
3139     }
3140
3141     /* Make an alias for Python 3.x */
3142     PyObject *__next__()
3143     {
3144       return next();
3145     }
3146
3147     PyObject *previous()
3148     {
3149       SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
3150       decr();
3151       PyObject *obj = value();
3152       SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads       
3153       return obj;
3154     }
3155
3156     SwigPyIterator *advance(ptrdiff_t n)
3157     {
3158       return  (n > 0) ?  incr(n) : decr(-n);
3159     }
3160       
3161     bool operator == (const SwigPyIterator& x)  const
3162     {
3163       return equal(x);
3164     }
3165       
3166     bool operator != (const SwigPyIterator& x) const
3167     {
3168       return ! operator==(x);
3169     }
3170       
3171     SwigPyIterator& operator += (ptrdiff_t n)
3172     {
3173       return *advance(n);
3174     }
3175
3176     SwigPyIterator& operator -= (ptrdiff_t n)
3177     {
3178       return *advance(-n);
3179     }
3180       
3181     SwigPyIterator* operator + (ptrdiff_t n) const
3182     {
3183       return copy()->advance(n);
3184     }
3185
3186     SwigPyIterator* operator - (ptrdiff_t n) const
3187     {
3188       return copy()->advance(-n);
3189     }
3190       
3191     ptrdiff_t operator - (const SwigPyIterator& x) const
3192     {
3193       return x.distance(*this);
3194     }
3195       
3196     static swig_type_info* descriptor() {
3197       static int init = 0;
3198       static swig_type_info* desc = 0;
3199       if (!init) {
3200         desc = SWIG_TypeQuery("swig::SwigPyIterator *");
3201         init = 1;
3202       } 
3203       return desc;
3204     }    
3205   };
3206
3207 #if defined(SWIGPYTHON_BUILTIN)
3208   inline PyObject* make_output_iterator_builtin (PyObject *pyself)
3209   {
3210     Py_INCREF(pyself);
3211     return pyself;
3212   }
3213 #endif
3214 }
3215
3216
3217 SWIGINTERN int
3218 SWIG_AsVal_double (PyObject *obj, double *val)
3219 {
3220   int res = SWIG_TypeError;
3221   if (PyFloat_Check(obj)) {
3222     if (val) *val = PyFloat_AsDouble(obj);
3223     return SWIG_OK;
3224   } else if (PyInt_Check(obj)) {
3225     if (val) *val = PyInt_AsLong(obj);
3226     return SWIG_OK;
3227   } else if (PyLong_Check(obj)) {
3228     double v = PyLong_AsDouble(obj);
3229     if (!PyErr_Occurred()) {
3230       if (val) *val = v;
3231       return SWIG_OK;
3232     } else {
3233       PyErr_Clear();
3234     }
3235   }
3236 #ifdef SWIG_PYTHON_CAST_MODE
3237   {
3238     int dispatch = 0;
3239     double d = PyFloat_AsDouble(obj);
3240     if (!PyErr_Occurred()) {
3241       if (val) *val = d;
3242       return SWIG_AddCast(SWIG_OK);
3243     } else {
3244       PyErr_Clear();
3245     }
3246     if (!dispatch) {
3247       long v = PyLong_AsLong(obj);
3248       if (!PyErr_Occurred()) {
3249         if (val) *val = v;
3250         return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3251       } else {
3252         PyErr_Clear();
3253       }
3254     }
3255   }
3256 #endif
3257   return res;
3258 }
3259
3260
3261 #include <float.h>
3262
3263
3264 #include <math.h>
3265
3266
3267 SWIGINTERNINLINE int
3268 SWIG_CanCastAsInteger(double *d, double min, double max) {
3269   double x = *d;
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)) {
3275      errno = 0;
3276    } else {
3277      double summ, reps, diff;
3278      if (rd < x) {
3279        diff = x - rd;
3280      } else if (rd > x) {
3281        diff = rd - x;
3282      } else {
3283        return 1;
3284      }
3285      summ = rd + x;
3286      reps = diff/summ;
3287      if (reps < 8*DBL_EPSILON) {
3288        *d = rd;
3289        return 1;
3290      }
3291    }
3292   }
3293   return 0;
3294 }
3295
3296
3297 SWIGINTERN int
3298 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
3299 {
3300 #if PY_VERSION_HEX < 0x03000000
3301   if (PyInt_Check(obj)) {
3302     long v = PyInt_AsLong(obj);
3303     if (v >= 0) {
3304       if (val) *val = v;
3305       return SWIG_OK;
3306     } else {
3307       return SWIG_OverflowError;
3308     }
3309   } else
3310 #endif
3311   if (PyLong_Check(obj)) {
3312     unsigned long v = PyLong_AsUnsignedLong(obj);
3313     if (!PyErr_Occurred()) {
3314       if (val) *val = v;
3315       return SWIG_OK;
3316     } else {
3317       PyErr_Clear();
3318 #if PY_VERSION_HEX >= 0x03000000
3319       {
3320         long v = PyLong_AsLong(obj);
3321         if (!PyErr_Occurred()) {
3322           if (v < 0) {
3323             return SWIG_OverflowError;
3324           }
3325         } else {
3326           PyErr_Clear();
3327         }
3328       }
3329 #endif
3330     }
3331   }
3332 #ifdef SWIG_PYTHON_CAST_MODE
3333   {
3334     int dispatch = 0;
3335     unsigned long v = PyLong_AsUnsignedLong(obj);
3336     if (!PyErr_Occurred()) {
3337       if (val) *val = v;
3338       return SWIG_AddCast(SWIG_OK);
3339     } else {
3340       PyErr_Clear();
3341     }
3342     if (!dispatch) {
3343       double d;
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);
3347         return res;
3348       }
3349     }
3350   }
3351 #endif
3352   return SWIG_TypeError;
3353 }
3354
3355
3356 SWIGINTERNINLINE int
3357 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3358 {
3359   unsigned long v;
3360   int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3361   if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3362   return res;
3363 }
3364
3365
3366   #define SWIG_From_long   PyLong_FromLong 
3367
3368
3369 SWIGINTERNINLINE PyObject *
3370 SWIG_From_ptrdiff_t  (ptrdiff_t value)
3371 {    
3372   return SWIG_From_long  (static_cast< long >(value));
3373 }
3374
3375
3376 SWIGINTERNINLINE PyObject*
3377   SWIG_From_bool  (bool value)
3378 {
3379   return PyBool_FromLong(value ? 1 : 0);
3380 }
3381
3382
3383 SWIGINTERN int
3384 SWIG_AsVal_long (PyObject *obj, long* val)
3385 {
3386   if (PyInt_Check(obj)) {
3387     if (val) *val = PyInt_AsLong(obj);
3388     return SWIG_OK;
3389   } else if (PyLong_Check(obj)) {
3390     long v = PyLong_AsLong(obj);
3391     if (!PyErr_Occurred()) {
3392       if (val) *val = v;
3393       return SWIG_OK;
3394     } else {
3395       PyErr_Clear();
3396     }
3397   }
3398 #ifdef SWIG_PYTHON_CAST_MODE
3399   {
3400     int dispatch = 0;
3401     long v = PyInt_AsLong(obj);
3402     if (!PyErr_Occurred()) {
3403       if (val) *val = v;
3404       return SWIG_AddCast(SWIG_OK);
3405     } else {
3406       PyErr_Clear();
3407     }
3408     if (!dispatch) {
3409       double d;
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);
3413         return res;
3414       }
3415     }
3416   }
3417 #endif
3418   return SWIG_TypeError;
3419 }
3420
3421
3422 SWIGINTERNINLINE int
3423 SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
3424 {
3425   long v;
3426   int res = SWIG_AsVal_long (obj, val ? &v : 0);
3427   if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
3428   return res;
3429 }
3430
3431
3432 #include <stdexcept>
3433
3434
3435 #include <algorithm>
3436
3437
3438 #include <vector>
3439
3440
3441 namespace swig {  
3442   template <class Type>
3443   struct noconst_traits {
3444     typedef Type noconst_type;
3445   };
3446
3447   template <class Type>
3448   struct noconst_traits<const Type> {
3449     typedef Type noconst_type;
3450   };
3451
3452   /*
3453     type categories
3454   */
3455   struct pointer_category { };  
3456   struct value_category { };
3457
3458   /*
3459     General traits that provides type_name and type_info
3460   */
3461   template <class Type> struct traits { };
3462
3463   template <class Type>
3464   inline const char* type_name() {
3465     return traits<typename noconst_traits<Type >::noconst_type >::type_name();
3466   }
3467
3468   template <class Type> 
3469   struct traits_info {
3470     static swig_type_info *type_query(std::string name) {
3471       name += " *";
3472       return SWIG_TypeQuery(name.c_str());
3473     }    
3474     static swig_type_info *type_info() {
3475       static swig_type_info *info = type_query(type_name<Type>());
3476       return info;
3477     }
3478   };
3479
3480   template <class Type>
3481   inline swig_type_info *type_info() {
3482     return traits_info<Type>::type_info();
3483   }
3484
3485   /*
3486     Partial specialization for pointers
3487   */
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;
3492       ptrname += " *";
3493       return ptrname;
3494     }    
3495     static const char* type_name() {
3496       static std::string name = make_ptr_name(swig::type_name<Type>());
3497       return name.c_str();
3498     }
3499   };
3500
3501   template <class Type, class Category> 
3502   struct traits_as { };
3503  
3504   template <class Type, class Category> 
3505   struct traits_check { };
3506
3507 }
3508
3509
3510 namespace swig {  
3511   /*
3512     Traits that provides the from method
3513   */
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);
3517     }
3518   };
3519
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);
3523     }
3524   };
3525
3526   template <class Type> struct traits_from<Type *> {
3527     static PyObject *from(Type* val) {
3528       return traits_from_ptr<Type>::from(val, 0);
3529     }
3530   };
3531
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);
3535     }
3536   };
3537
3538
3539   template <class Type>
3540   inline PyObject *from(const Type& val) {
3541     return traits_from<Type>::from(val);
3542   }
3543
3544   template <class Type>
3545   inline PyObject *from_ptr(Type* val, int owner) {
3546     return traits_from_ptr<Type>::from(val, owner);
3547   }
3548
3549   /*
3550     Traits that provides the asval/as/check method
3551   */
3552   template <class Type>
3553   struct traits_asptr {   
3554     static int asptr(PyObject *obj, Type **val) {
3555       Type *p;
3556       int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
3557       if (SWIG_IsOK(res)) {
3558         if (val) *val = p;
3559       }
3560       return res;
3561     }
3562   }; 
3563
3564   template <class Type>
3565   inline int asptr(PyObject *obj, Type **vptr) {
3566     return traits_asptr<Type>::asptr(obj, vptr);
3567   }
3568
3569   template <class Type> 
3570   struct traits_asval {
3571     static int asval(PyObject *obj, Type *val) {
3572       if (val) {
3573         Type *p = 0;
3574         int res = traits_asptr<Type>::asptr(obj, &p);
3575         if (!SWIG_IsOK(res)) return res;        
3576         if (p) {
3577           typedef typename noconst_traits<Type>::noconst_type noconst_type;
3578           *(const_cast<noconst_type*>(val)) = *p;
3579           if (SWIG_IsNewObj(res)){
3580             delete p;
3581             res = SWIG_DelNewMask(res);
3582           }
3583           return res;
3584         } else {
3585           return SWIG_ERROR;
3586         }
3587       } else {
3588         return traits_asptr<Type>::asptr(obj, (Type **)(0));
3589       }
3590     }
3591   };
3592
3593   template <class Type> struct traits_asval<Type*> {
3594     static int asval(PyObject *obj, Type **val) {
3595       if (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;
3601         }
3602         return res;
3603       } else {
3604         return traits_asptr<Type>::asptr(obj, (Type **)(0));
3605       }
3606     }
3607   };
3608   
3609   template <class Type>
3610   inline int asval(PyObject *obj, Type *val) {
3611     return traits_asval<Type>::asval(obj, val);
3612   }
3613
3614   template <class Type> 
3615   struct traits_as<Type, value_category> {
3616     static Type as(PyObject *obj, bool throw_error) {
3617       Type v;
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>());
3622         }
3623         if (throw_error) throw std::invalid_argument("bad type");
3624       }
3625       return v;
3626     }
3627   };
3628
3629   template <class Type> 
3630   struct traits_as<Type, pointer_category> {
3631     static Type as(PyObject *obj, bool throw_error) {
3632       Type *v = 0;      
3633       int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3634       if (SWIG_IsOK(res) && v) {
3635         if (SWIG_IsNewObj(res)) {
3636           Type r(*v);
3637           delete v;
3638           return r;
3639         } else {
3640           return *v;
3641         }
3642       } else {
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>());
3647         }
3648         if (throw_error) throw std::invalid_argument("bad type");
3649         memset(v_def,0,sizeof(Type));
3650         return *v_def;
3651       }
3652     }
3653   };
3654
3655   template <class Type> 
3656   struct traits_as<Type*, pointer_category> {
3657     static Type* as(PyObject *obj, bool throw_error) {
3658       Type *v = 0;      
3659       int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3660       if (SWIG_IsOK(res)) {
3661         return v;
3662       } else {
3663         if (!PyErr_Occurred()) {
3664           SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
3665         }
3666         if (throw_error) throw std::invalid_argument("bad type");
3667         return 0;
3668       }
3669     }
3670   };
3671     
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);
3675   }
3676
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;
3682     }
3683   };
3684
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;
3690     }
3691   };
3692
3693   template <class Type>
3694   inline bool check(PyObject *obj) {
3695     return traits_check<Type, typename traits<Type>::category>::check(obj);
3696   }
3697 }
3698
3699
3700 #include <functional>
3701
3702 namespace std {
3703   template <>
3704   struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool>
3705   {
3706     bool
3707     operator()(PyObject * v, PyObject *w) const
3708     { 
3709       bool res;
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
3714                but ObjA < ObjB
3715       */
3716       if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
3717       {
3718         /* Objects can't be compared, this mostly occurred in Python 3.0 */
3719         /* Compare their ptr directly for a workaround */
3720         res = (v < w);
3721         PyErr_Clear();
3722       }
3723       SWIG_PYTHON_THREAD_END_BLOCK;
3724       return res;
3725     }
3726   };
3727
3728   template <>
3729   struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool>
3730   {
3731     bool
3732     operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const
3733     {
3734       return std::less<PyObject *>()(v, w);
3735     }
3736   };
3737
3738   template <>
3739   struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool>
3740   {
3741     bool
3742     operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const
3743     {
3744       return std::less<PyObject *>()(v, w);
3745     }
3746   };
3747
3748 }
3749
3750 namespace swig {
3751   template <> struct traits<PyObject *> {
3752     typedef value_category category;
3753     static const char* type_name() { return "PyObject *"; }
3754   };  
3755
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;
3760       return SWIG_OK;
3761     }
3762   };
3763
3764   template <> 
3765   struct traits_check<PyObject *, value_category> {
3766     static bool check(PyObject *) {
3767       return true;
3768     }
3769   };
3770
3771   template <>  struct traits_from<PyObject *> {
3772     typedef PyObject * value_type;
3773     static PyObject *from(const value_type& val) {
3774       Py_XINCREF(val);
3775       return val;
3776     }
3777   };
3778   
3779 }
3780
3781 namespace swig {
3782   template <class Difference>
3783   inline size_t
3784   check_index(Difference i, size_t size, bool insert = false) {
3785     if ( i < 0 ) {
3786       if ((size_t) (-i) <= size)
3787         return (size_t) (i + size);
3788     } else if ( (size_t) i < size ) {
3789       return (size_t) i;
3790     } else if (insert && ((size_t) i == size)) {
3791       return size;
3792     }
3793     throw std::out_of_range("index out of range");
3794   }
3795
3796   template <class Difference>
3797   void
3798   slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) {
3799     if (step == 0) {
3800       throw std::invalid_argument("slice step cannot be zero");
3801     } else if (step > 0) {
3802       // Required range: 0 <= i < size, 0 <= j < size
3803       if (i < 0) {
3804         ii = 0;
3805       } else if (i < (Difference)size) {
3806         ii = i;
3807       } else if (insert && (i >= (Difference)size)) {
3808         ii = (Difference)size;
3809       }
3810       if ( j < 0 ) {
3811         jj = 0;
3812       } else {
3813         jj = (j < (Difference)size) ? j : (Difference)size;
3814       }
3815     } else {
3816       // Required range: -1 <= i < size-1, -1 <= j < size-1
3817       if (i < -1) {
3818         ii = -1;
3819       } else if (i < (Difference) size) {
3820         ii = i;
3821       } else if (i >= (Difference)(size-1)) {
3822         ii = (Difference)(size-1);
3823       }
3824       if (j < -1) {
3825         jj = -1;
3826       } else {
3827         jj = (j < (Difference)size ) ? j : (Difference)(size-1);
3828       }
3829     }
3830   }
3831
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()));
3837     return pos;
3838   }
3839
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()));
3845     return pos;
3846   }
3847
3848   template <class Sequence, class Difference>
3849   inline Sequence*
3850   getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) {
3851     typename Sequence::size_type size = self->size();
3852     Difference ii = 0;
3853     Difference jj = 0;
3854     swig::slice_adjust(i, j, step, size, ii, jj);
3855
3856     if (step > 0) {
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);
3861       if (step == 1) {
3862         return new Sequence(sb, se);
3863       } else {
3864         Sequence *sequence = new Sequence();
3865         typename Sequence::const_iterator it = sb;
3866         while (it!=se) {
3867           sequence->push_back(*it);
3868           for (Py_ssize_t c=0; c<step && it!=se; ++c)
3869             it++;
3870         }
3871         return sequence;
3872       } 
3873     } else {
3874       Sequence *sequence = new Sequence();
3875       if (ii > jj) {
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;
3881         while (it!=se) {
3882           sequence->push_back(*it);
3883           for (Py_ssize_t c=0; c<-step && it!=se; ++c)
3884             it++;
3885         }
3886       }
3887       return sequence;
3888     }
3889   }
3890
3891   template <class Sequence, class Difference, class InputSeq>
3892   inline void
3893   setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) {
3894     typename Sequence::size_type size = self->size();
3895     Difference ii = 0;
3896     Difference jj = 0;
3897     swig::slice_adjust(i, j, step, size, ii, jj, true);
3898     if (step > 0) {
3899       if (jj < ii)
3900         jj = ii;
3901       if (step == 1) {
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());
3910         } else {
3911           // shrinking
3912           typename Sequence::iterator sb = self->begin();
3913           typename Sequence::iterator se = self->begin();
3914           std::advance(sb,ii);
3915           std::advance(se,jj);
3916           self->erase(sb,se);
3917           sb = self->begin();
3918           std::advance(sb,ii);
3919           self->insert(sb, is.begin(), is.end());
3920         }
3921       } else {
3922         size_t replacecount = (jj - ii + step - 1) / step;
3923         if (is.size() != replacecount) {
3924           char msg[1024];
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);
3927         }
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) {
3932           *it++ = *isit++;
3933           for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
3934             it++;
3935         }
3936       }
3937     } else {
3938       if (jj > ii)
3939         jj = ii;
3940       size_t replacecount = (ii - jj - step - 1) / -step;
3941       if (is.size() != replacecount) {
3942         char msg[1024];
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);
3945       }
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) {
3950         *it++ = *isit++;
3951         for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
3952           it++;
3953       }
3954     }
3955   }
3956
3957   template <class Sequence, class Difference>
3958   inline void
3959   delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) {
3960     typename Sequence::size_type size = self->size();
3961     Difference ii = 0;
3962     Difference jj = 0;
3963     swig::slice_adjust(i, j, step, size, ii, jj, true);
3964     if (step > 0) {
3965       if (jj > ii) {
3966         typename Sequence::iterator sb = self->begin();
3967         std::advance(sb,ii);
3968         if (step == 1) {
3969           typename Sequence::iterator se = self->begin();
3970           std::advance(se,jj);
3971           self->erase(sb,se);
3972         } else {
3973           typename Sequence::iterator it = sb;
3974           size_t delcount = (jj - ii + step - 1) / step;
3975           while (delcount) {
3976             it = self->erase(it);
3977             for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
3978               it++;
3979             delcount--;
3980           }
3981         }
3982       }
3983     } else {
3984       if (ii > jj) {
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;
3989         while (delcount) {
3990           it = typename Sequence::reverse_iterator(self->erase((++it).base()));
3991           for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
3992             it++;
3993           delcount--;
3994         }
3995       }
3996     }
3997   }
3998 }
3999
4000
4001 #if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
4002 #  if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
4003 #    define SWIG_STD_NOITERATOR_TRAITS_STL
4004 #  endif
4005 #endif
4006
4007 #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
4008 #include <iterator>
4009 #else
4010 namespace std {
4011   template <class Iterator>
4012   struct iterator_traits {
4013     typedef ptrdiff_t difference_type;
4014     typedef typename Iterator::value_type value_type;
4015   };
4016
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;
4021   };
4022
4023   template <class T>
4024   struct iterator_traits<T*> {
4025     typedef T value_type;
4026     typedef ptrdiff_t difference_type;
4027   };
4028
4029   template<typename _InputIterator>
4030   inline typename iterator_traits<_InputIterator>::difference_type
4031   distance(_InputIterator __first, _InputIterator __last)
4032   {
4033     typename iterator_traits<_InputIterator>::difference_type __n = 0;
4034     while (__first != __last) {
4035       ++__first; ++__n;
4036     }
4037     return __n;
4038   }
4039 }
4040 #endif
4041
4042
4043 namespace swig {
4044   template<typename OutIterator>
4045   class SwigPyIterator_T :  public SwigPyIterator
4046   {
4047   public:
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;
4051
4052     SwigPyIterator_T(out_iterator curr, PyObject *seq)
4053       : SwigPyIterator(seq), current(curr)
4054     {
4055     }
4056
4057     const out_iterator& get_current() const
4058     {
4059       return current;
4060     }
4061
4062     
4063     bool equal (const SwigPyIterator &iter) const
4064     {
4065       const self_type *iters = dynamic_cast<const self_type *>(&iter);
4066       if (iters) {
4067         return (current == iters->get_current());
4068       } else {
4069         throw std::invalid_argument("bad iterator type");
4070       }
4071     }
4072     
4073     ptrdiff_t distance(const SwigPyIterator &iter) const
4074     {
4075       const self_type *iters = dynamic_cast<const self_type *>(&iter);
4076       if (iters) {
4077         return std::distance(current, iters->get_current());
4078       } else {
4079         throw std::invalid_argument("bad iterator type");
4080       }
4081     }    
4082     
4083   protected:
4084     out_iterator current;
4085   };
4086   
4087   template <class ValueType>
4088   struct from_oper 
4089   {
4090     typedef const ValueType& argument_type;
4091     typedef PyObject *result_type;
4092     result_type operator()(argument_type v) const
4093     {
4094       return swig::from(v);
4095     }
4096   };
4097
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>
4102   {
4103   public:
4104     FromOper from;
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;
4109     
4110     SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq)
4111       : SwigPyIterator_T<OutIterator>(curr, seq)
4112     {
4113     }
4114     
4115     PyObject *value() const {
4116       return from(static_cast<const value_type&>(*(base::current)));
4117     }
4118     
4119     SwigPyIterator *copy() const
4120     {
4121       return new self_type(*this);
4122     }
4123
4124     SwigPyIterator *incr(size_t n = 1)
4125     {
4126       while (n--) {
4127         ++base::current;
4128       }
4129       return this;
4130     }
4131
4132     SwigPyIterator *decr(size_t n = 1)
4133     {
4134       while (n--) {
4135         --base::current;
4136       }
4137       return this;
4138     }
4139   };
4140
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>
4145   {
4146   public:
4147     FromOper from;
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;
4152     
4153     SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq)
4154       : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last)
4155     {
4156     }
4157     
4158     PyObject *value() const {
4159       if (base::current == end) {
4160         throw stop_iteration();
4161       } else {
4162         return from(static_cast<const value_type&>(*(base::current)));
4163       }
4164     }
4165     
4166     SwigPyIterator *copy() const
4167     {
4168       return new self_type(*this);
4169     }
4170
4171     SwigPyIterator *incr(size_t n = 1)
4172     {
4173       while (n--) {
4174         if (base::current == end) {
4175           throw stop_iteration();
4176         } else {
4177           ++base::current;
4178         }
4179       }
4180       return this;
4181     }
4182
4183     SwigPyIterator *decr(size_t n = 1)
4184     {
4185       while (n--) {
4186         if (base::current == begin) {
4187           throw stop_iteration();
4188         } else {
4189           --base::current;
4190         }
4191       }
4192       return this;
4193     }
4194
4195   private:
4196     out_iterator begin;
4197     out_iterator end;
4198   };
4199
4200   template<typename OutIter>
4201   inline SwigPyIterator*
4202   make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0)
4203   {
4204     return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
4205   }
4206
4207   template<typename OutIter>
4208   inline SwigPyIterator*
4209   make_output_iterator(const OutIter& current, PyObject *seq = 0)
4210   {
4211     return new SwigPyIteratorOpen_T<OutIter>(current, seq);
4212   }
4213
4214 }
4215
4216
4217 namespace swig
4218 {
4219   template <class T>
4220   struct SwigPySequence_Ref
4221   {
4222     SwigPySequence_Ref(PyObject* seq, int index)
4223       : _seq(seq), _index(index)
4224     {
4225     }
4226     
4227     operator T () const
4228     {
4229       swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
4230       try {
4231         return swig::as<T>(item, true);
4232       } catch (std::exception& e) {
4233         char msg[1024];
4234         sprintf(msg, "in sequence element %d ", _index);
4235         if (!PyErr_Occurred()) {
4236           ::SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
4237         }
4238         SWIG_Python_AddErrorMsg(msg);
4239         SWIG_Python_AddErrorMsg(e.what());
4240         throw;
4241       }
4242     }
4243
4244     SwigPySequence_Ref& operator=(const T& v)
4245     {
4246       PySequence_SetItem(_seq, _index, swig::from<T>(v));
4247       return *this;
4248     }
4249
4250   private:
4251     PyObject* _seq;
4252     int _index;
4253   };
4254
4255   template <class T>
4256   struct SwigPySequence_ArrowProxy
4257   {
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; }
4261     T m_value;
4262   };
4263
4264   template <class T, class Reference >
4265   struct SwigPySequence_InputIterator
4266   {
4267     typedef SwigPySequence_InputIterator<T, Reference > self;
4268
4269     typedef std::random_access_iterator_tag iterator_category;
4270     typedef Reference reference;
4271     typedef T value_type;
4272     typedef T* pointer;
4273     typedef int difference_type;
4274
4275     SwigPySequence_InputIterator()
4276     {
4277     }
4278
4279     SwigPySequence_InputIterator(PyObject* seq, int index)
4280       : _seq(seq), _index(index)
4281     {
4282     }
4283
4284     reference operator*() const
4285     {
4286       return reference(_seq, _index);
4287     }
4288
4289     SwigPySequence_ArrowProxy<T>
4290     operator->() const {
4291       return SwigPySequence_ArrowProxy<T>(operator*());
4292     }
4293
4294     bool operator==(const self& ri) const
4295     {
4296       return (_index == ri._index) && (_seq == ri._seq);
4297     }
4298
4299     bool operator!=(const self& ri) const
4300     {
4301       return !(operator==(ri));
4302     }
4303
4304     self& operator ++ ()
4305     {
4306       ++_index;
4307       return *this;
4308     }
4309
4310     self& operator -- ()
4311     {
4312       --_index;
4313       return *this;
4314     }
4315
4316     self& operator += (difference_type n)
4317     {
4318       _index += n;
4319       return *this;
4320     }
4321
4322     self operator +(difference_type n) const
4323     {
4324       return self(_seq, _index + n);
4325     }
4326
4327     self& operator -= (difference_type n)
4328     {
4329       _index -= n;
4330       return *this;
4331     }
4332
4333     self operator -(difference_type n) const
4334     {
4335       return self(_seq, _index - n);
4336     }
4337
4338     difference_type operator - (const self& ri) const
4339     {
4340       return _index - ri._index;
4341     }
4342
4343     bool operator < (const self& ri) const
4344     {
4345       return _index < ri._index;
4346     }
4347
4348     reference
4349     operator[](difference_type n) const
4350     {
4351       return reference(_seq, _index + n);
4352     }
4353
4354   private:
4355     PyObject* _seq;
4356     difference_type _index;
4357   };
4358
4359   template <class T>
4360   struct SwigPySequence_Cont
4361   {
4362     typedef SwigPySequence_Ref<T> reference;
4363     typedef const SwigPySequence_Ref<T> const_reference;
4364     typedef T value_type;
4365     typedef T* pointer;
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;
4371
4372     SwigPySequence_Cont(PyObject* seq) : _seq(0)
4373     {
4374       if (!PySequence_Check(seq)) {
4375         throw std::invalid_argument("a sequence is expected");
4376       }
4377       _seq = seq;
4378       Py_INCREF(_seq);
4379     }
4380
4381     ~SwigPySequence_Cont()
4382     {
4383       Py_XDECREF(_seq);
4384     }
4385
4386     size_type size() const
4387     {
4388       return static_cast<size_type>(PySequence_Size(_seq));
4389     }
4390
4391     bool empty() const
4392     {
4393       return size() == 0;
4394     }
4395
4396     iterator begin()
4397     {
4398       return iterator(_seq, 0);
4399     }
4400
4401     const_iterator begin() const
4402     {
4403       return const_iterator(_seq, 0);
4404     }
4405
4406     iterator end()
4407     {
4408       return iterator(_seq, size());
4409     }
4410
4411     const_iterator end() const
4412     {
4413       return const_iterator(_seq, size());
4414     }
4415
4416     reference operator[](difference_type n)
4417     {
4418       return reference(_seq, n);
4419     }
4420
4421     const_reference operator[](difference_type n)  const
4422     {
4423       return const_reference(_seq, n);
4424     }
4425
4426     bool check(bool set_err = true) const
4427     {
4428       int s = size();
4429       for (int i = 0; i < s; ++i) {
4430         swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
4431         if (!swig::check<value_type>(item)) {
4432           if (set_err) {
4433             char msg[1024];
4434             sprintf(msg, "in sequence element %d", i);
4435             SWIG_Error(SWIG_RuntimeError, msg);
4436           }
4437           return false;
4438         }
4439       }
4440       return true;
4441     }
4442
4443   private:
4444     PyObject* _seq;
4445   };
4446
4447 }
4448
4449
4450   #define SWIG_From_double   PyFloat_FromDouble 
4451
4452
4453 namespace swig {
4454   template <> struct traits<double > {
4455     typedef value_category category;
4456     static const char* type_name() { return"double"; }
4457   };  
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);
4462     }
4463   };
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);
4468     }
4469   };
4470 }
4471
4472
4473 namespace swig {
4474   template <class SwigPySeq, class Seq>
4475   inline void
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));
4482     }
4483   }
4484
4485   template <class Seq, class T = typename Seq::value_type >
4486   struct traits_asptr_stdseq {
4487     typedef Seq sequence;
4488     typedef T value_type;
4489
4490     static int asptr(PyObject *obj, sequence **seq) {
4491       if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) {
4492         sequence *p;
4493         if (::SWIG_ConvertPtr(obj,(void**)&p,
4494                               swig::type_info<sequence>(),0) == SWIG_OK) {
4495           if (seq) *seq = p;
4496           return SWIG_OLDOBJ;
4497         }
4498       } else if (PySequence_Check(obj)) {
4499         try {
4500           SwigPySequence_Cont<value_type> swigpyseq(obj);
4501           if (seq) {
4502             sequence *pseq = new sequence();
4503             assign(swigpyseq, pseq);
4504             *seq = pseq;
4505             return SWIG_NEWOBJ;
4506           } else {
4507             return swigpyseq.check() ? SWIG_OK : SWIG_ERROR;
4508           }
4509         } catch (std::exception& e) {
4510           if (seq) {
4511             if (!PyErr_Occurred()) {
4512               PyErr_SetString(PyExc_TypeError, e.what());
4513             }
4514           }
4515           return SWIG_ERROR;
4516         }
4517       }
4518       return SWIG_ERROR;
4519     }
4520   };
4521
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;
4528
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);
4534       }
4535 #endif
4536       size_type size = seq.size();
4537       if (size <= (size_type)INT_MAX) {
4538         PyObject *obj = PyTuple_New((int)size);
4539         int i = 0;
4540         for (const_iterator it = seq.begin();
4541              it != seq.end(); ++it, ++i) {
4542           PyTuple_SetItem(obj,i,swig::from<value_type>(*it));
4543         }
4544         return obj;
4545       } else {
4546         PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python");
4547         return NULL;
4548       }
4549     }
4550   };
4551 }
4552
4553
4554   namespace swig {
4555     template <class T>
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);
4559       }
4560     };
4561     
4562     template <class T>
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);
4566       }
4567     };
4568   }
4569
4570
4571       namespace swig {
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 >" " >";
4576           }
4577         };
4578       }
4579     
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);
4582     }
4583 SWIGINTERN bool std_vector_Sl_double_Sg____nonzero__(std::vector< double > const *self){
4584       return !(self->empty());
4585     }
4586 SWIGINTERN bool std_vector_Sl_double_Sg____bool__(std::vector< double > const *self){
4587       return !(self->empty());
4588     }
4589 SWIGINTERN std::vector< double >::size_type std_vector_Sl_double_Sg____len__(std::vector< double > const *self){
4590       return self->size();
4591     }
4592
4593 SWIGINTERNINLINE PyObject* 
4594 SWIG_From_unsigned_SS_long  (unsigned long value)
4595 {
4596   return (value > LONG_MAX) ?
4597     PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value)); 
4598 }
4599
4600
4601 SWIGINTERNINLINE PyObject *
4602 SWIG_From_size_t  (size_t value)
4603 {    
4604   return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
4605 }
4606
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();
4611       self->pop_back();
4612       return x;
4613     }
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);
4616     }
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);
4619     }
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);
4622     }
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));
4625     }
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.");
4630         return NULL;
4631       }
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);
4636     }
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.");
4641         return;
4642       }
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);
4647     }
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.");
4652         return;
4653       }
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);
4658     }
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.");
4663         return;
4664       }
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);
4669     }
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));
4672     }
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;
4675     }
4676 SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector< double > *self,std::vector< double >::value_type const &x){
4677       self->push_back(x);
4678     }
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); }
4683
4684
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,                                               \
4692       PyDoc_STR(EXCDOC)                                                 \
4693   };                                                                    \
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);  \
4699   }
4700
4701
4702 ExceptionSubclass(ForcedStop,
4703                   "Python version of nlopt::forced_stop exception.")
4704
4705 ExceptionSubclass(RoundoffLimited,
4706                   "Python version of nlopt::roundoff_limited exception.")
4707
4708
4709
4710 #define SWIG_FILE_WITH_INIT
4711
4712
4713 #ifndef SWIG_FILE_WITH_INIT
4714 #define NO_IMPORT_ARRAY
4715 #endif
4716 #include "stdio.h"
4717 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
4718 #include <numpy/arrayobject.h>
4719
4720
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; }
4723
4724 #if NPY_API_VERSION < 0x00000007
4725 #  define NPY_ARRAY_C_CONTIGUOUS NPY_C_CONTIGUOUS
4726 #  define NPY_ARRAY_ALIGNED NPY_ALIGNED
4727 #endif
4728
4729 static double func_python(unsigned n, const double *x, double *grad, void *f)
4730 {
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);
4738   
4739   PyObject *arglist = Py_BuildValue("OO", xpy, gradpy);
4740   PyObject *result = PyEval_CallObject((PyObject *) f, arglist);
4741   Py_DECREF(arglist);
4742
4743   Py_DECREF(gradpy);
4744   Py_DECREF(xpy);
4745
4746   double val = HUGE_VAL;
4747   if (PyErr_Occurred()) {
4748     Py_XDECREF(result);
4749     throw nlopt::forced_stop(); // just stop, don't call PyErr_Clear()
4750   }
4751   else if (result && PyFloat_Check(result)) {
4752     val = PyFloat_AsDouble(result);
4753     Py_DECREF(result);
4754   }
4755   else {
4756     Py_XDECREF(result);
4757     throw std::invalid_argument("invalid result passed to nlopt");
4758   }
4759   return val;
4760 }
4761
4762 static void mfunc_python(unsigned m, double *result,
4763                          unsigned n, const double *x, double *grad, void *f)
4764 {
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);
4775   
4776   PyObject *arglist = Py_BuildValue("OOO", rpy, xpy, gradpy);
4777   PyObject *res = PyEval_CallObject((PyObject *) f, arglist);
4778   Py_XDECREF(res);
4779   Py_DECREF(arglist);
4780
4781   Py_DECREF(gradpy);
4782   Py_DECREF(rpy);
4783   Py_DECREF(xpy);
4784
4785   if (PyErr_Occurred()) {
4786     throw nlopt::forced_stop(); // just stop, don't call PyErr_Clear()
4787   }
4788 }
4789
4790
4791 SWIGINTERNINLINE PyObject*
4792   SWIG_From_int  (int value)
4793 {
4794   return PyInt_FromLong((long) value);
4795 }
4796
4797
4798 #include <limits.h>
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)
4804 # endif
4805 #endif
4806
4807
4808 SWIGINTERN int
4809 SWIG_AsVal_int (PyObject * obj, int *val)
4810 {
4811   long v;
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;
4816     } else {
4817       if (val) *val = static_cast< int >(v);
4818     }
4819   }  
4820   return res;
4821 }
4822
4823
4824 SWIGINTERN int
4825 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
4826 {
4827   unsigned long v;
4828   int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
4829   if (SWIG_IsOK(res)) {
4830     if ((v > UINT_MAX)) {
4831       return SWIG_OverflowError;
4832     } else {
4833       if (val) *val = static_cast< unsigned int >(v);
4834     }
4835   }  
4836   return res;
4837 }
4838
4839
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
4844 #endif
4845
4846
4847 /* Macros to extract array attributes.
4848  */
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
4861 #else
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)
4873 #endif
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))
4877
4878
4879   /* Given a PyObject, return a string describing its type.
4880    */
4881   const char* pytype_string(PyObject* py_obj)
4882   {
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"    ;
4896 #endif
4897
4898     return "unknown type";
4899   }
4900
4901   /* Given a NumPy typecode, return a string describing the type.
4902    */
4903   const char* typecode_string(int typecode)
4904   {
4905     static const char* type_names[25] = {"bool",
4906                                          "byte",
4907                                          "unsigned byte",
4908                                          "short",
4909                                          "unsigned short",
4910                                          "int",
4911                                          "unsigned int",
4912                                          "long",
4913                                          "unsigned long",
4914                                          "long long",
4915                                          "unsigned long long",
4916                                          "float",
4917                                          "double",
4918                                          "long double",
4919                                          "complex float",
4920                                          "complex double",
4921                                          "complex long double",
4922                                          "object",
4923                                          "string",
4924                                          "unicode",
4925                                          "void",
4926                                          "ntypes",
4927                                          "notype",
4928                                          "char",
4929                                          "unknown"};
4930     return typecode < 24 ? type_names[typecode] : type_names[24];
4931   }
4932
4933   /* Make sure input has correct numpy type.  This now just calls
4934      PyArray_EquivTypenums().
4935    */
4936   int type_match(int actual_type,
4937                  int desired_type)
4938   {
4939     return PyArray_EquivTypenums(actual_type, desired_type);
4940   }
4941
4942 #ifdef SWIGPY_USE_CAPSULE
4943   void free_cap(PyObject * cap)
4944   {
4945     void* array = (void*) PyCapsule_GetPointer(cap,SWIGPY_CAPSULE_NAME);
4946     if (array != NULL) free(array);
4947   }
4948 #endif
4949
4950
4951
4952
4953   /* Given a PyObject pointer, cast it to a PyArrayObject pointer if
4954    * legal.  If not, set the python error string appropriately and
4955    * return NULL.
4956    */
4957   PyArrayObject* obj_to_array_no_conversion(PyObject* input,
4958                                             int        typecode)
4959   {
4960     PyArrayObject* ary = NULL;
4961     if (is_array(input) && (typecode == NPY_NOTYPE ||
4962                             PyArray_EquivTypenums(array_type(input), typecode)))
4963     {
4964       ary = (PyArrayObject*) input;
4965     }
4966     else if is_array(input)
4967     {
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);
4973       ary = NULL;
4974     }
4975     else
4976     {
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",
4981                    desired_type,
4982                    actual_type);
4983       ary = NULL;
4984     }
4985     return ary;
4986   }
4987
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.
4992    */
4993   PyArrayObject* obj_to_array_allow_conversion(PyObject* input,
4994                                                int       typecode,
4995                                                int*      is_new_object)
4996   {
4997     PyArrayObject* ary = NULL;
4998     PyObject*      py_obj;
4999     if (is_array(input) && (typecode == NPY_NOTYPE ||
5000                             PyArray_EquivTypenums(array_type(input),typecode)))
5001     {
5002       ary = (PyArrayObject*) input;
5003       *is_new_object = 0;
5004     }
5005     else
5006     {
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;
5010       *is_new_object = 1;
5011     }
5012     return ary;
5013   }
5014
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.
5019    */
5020   PyArrayObject* make_contiguous(PyArrayObject* ary,
5021                                  int*           is_new_object,
5022                                  int            min_dims,
5023                                  int            max_dims)
5024   {
5025     PyArrayObject* result;
5026     if (array_is_contiguous(ary))
5027     {
5028       result = ary;
5029       *is_new_object = 0;
5030     }
5031     else
5032     {
5033       result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary,
5034                                                               array_type(ary),
5035                                                               min_dims,
5036                                                               max_dims);
5037       *is_new_object = 1;
5038     }
5039     return result;
5040   }
5041
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.
5047    */
5048   PyArrayObject* make_fortran(PyArrayObject* ary,
5049                               int*           is_new_object)
5050   {
5051     PyArrayObject* result;
5052     if (array_is_fortran(ary))
5053     {
5054       result = ary;
5055       *is_new_object = 0;
5056     }
5057     else
5058     {
5059       Py_INCREF(array_descr(ary));
5060       result = (PyArrayObject*) PyArray_FromArray(ary,
5061                                                   array_descr(ary),
5062                                                   NPY_FORTRANORDER);
5063       *is_new_object = 1;
5064     }
5065     return result;
5066   }
5067
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
5071    * will be set.
5072    */
5073   PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
5074                                                           int       typecode,
5075                                                           int*      is_new_object)
5076   {
5077     int is_new1 = 0;
5078     int is_new2 = 0;
5079     PyArrayObject* ary2;
5080     PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
5081                                                         typecode,
5082                                                         &is_new1);
5083     if (ary1)
5084     {
5085       ary2 = make_contiguous(ary1, &is_new2, 0, 0);
5086       if ( is_new1 && is_new2)
5087       {
5088         Py_DECREF(ary1);
5089       }
5090       ary1 = ary2;
5091     }
5092     *is_new_object = is_new1 || is_new2;
5093     return ary1;
5094   }
5095
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
5099    * will be set.
5100    */
5101   PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input,
5102                                                        int       typecode,
5103                                                        int*      is_new_object)
5104   {
5105     int is_new1 = 0;
5106     int is_new2 = 0;
5107     PyArrayObject* ary2;
5108     PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
5109                                                         typecode,
5110                                                         &is_new1);
5111     if (ary1)
5112     {
5113       ary2 = make_fortran(ary1, &is_new2);
5114       if (is_new1 && is_new2)
5115       {
5116         Py_DECREF(ary1);
5117       }
5118       ary1 = ary2;
5119     }
5120     *is_new_object = is_new1 || is_new2;
5121     return ary1;
5122   }
5123
5124
5125   /* Test whether a python object is contiguous.  If array is
5126    * contiguous, return 1.  Otherwise, set the python error string and
5127    * return 0.
5128    */
5129   int require_contiguous(PyArrayObject* ary)
5130   {
5131     int contiguous = 1;
5132     if (!array_is_contiguous(ary))
5133     {
5134       PyErr_SetString(PyExc_TypeError,
5135                       "Array must be contiguous.  A non-contiguous array was given");
5136       contiguous = 0;
5137     }
5138     return contiguous;
5139   }
5140
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
5143    * and return 0.
5144    */
5145   int require_native(PyArrayObject* ary)
5146   {
5147     int native = 1;
5148     if (!array_is_native(ary))
5149     {
5150       PyErr_SetString(PyExc_TypeError,
5151                       "Array must have native byteorder.  "
5152                       "A byte-swapped array was given");
5153       native = 0;
5154     }
5155     return native;
5156   }
5157
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.
5161    */
5162   int require_dimensions(PyArrayObject* ary,
5163                          int            exact_dimensions)
5164   {
5165     int success = 1;
5166     if (array_numdims(ary) != exact_dimensions)
5167     {
5168       PyErr_Format(PyExc_TypeError,
5169                    "Array must have %d dimensions.  Given array has %d dimensions",
5170                    exact_dimensions,
5171                    array_numdims(ary));
5172       success = 0;
5173     }
5174     return success;
5175   }
5176
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
5180    * and return 0.
5181    */
5182   int require_dimensions_n(PyArrayObject* ary,
5183                            int*           exact_dimensions,
5184                            int            n)
5185   {
5186     int success = 0;
5187     int i;
5188     char dims_str[255] = "";
5189     char s[255];
5190     for (i = 0; i < n && !success; i++)
5191     {
5192       if (array_numdims(ary) == exact_dimensions[i])
5193       {
5194         success = 1;
5195       }
5196     }
5197     if (!success)
5198     {
5199       for (i = 0; i < n-1; i++)
5200       {
5201         sprintf(s, "%d, ", exact_dimensions[i]);
5202         strcat(dims_str,s);
5203       }
5204       sprintf(s, " or %d", exact_dimensions[n-1]);
5205       strcat(dims_str,s);
5206       PyErr_Format(PyExc_TypeError,
5207                    "Array must have %s dimensions.  Given array has %d dimensions",
5208                    dims_str,
5209                    array_numdims(ary));
5210     }
5211     return success;
5212   }
5213
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.
5217    */
5218   int require_size(PyArrayObject* ary,
5219                    npy_intp*      size,
5220                    int            n)
5221   {
5222     int i;
5223     int success = 1;
5224     int len;
5225     char desired_dims[255] = "[";
5226     char s[255];
5227     char actual_dims[255] = "[";
5228     for(i=0; i < n;i++)
5229     {
5230       if (size[i] != -1 &&  size[i] != array_size(ary,i))
5231       {
5232         success = 0;
5233       }
5234     }
5235     if (!success)
5236     {
5237       for (i = 0; i < n; i++)
5238       {
5239         if (size[i] == -1)
5240         {
5241           sprintf(s, "*,");
5242         }
5243         else
5244         {
5245           sprintf(s, "%ld,", (long int)size[i]);
5246         }
5247         strcat(desired_dims,s);
5248       }
5249       len = strlen(desired_dims);
5250       desired_dims[len-1] = ']';
5251       for (i = 0; i < n; i++)
5252       {
5253         sprintf(s, "%ld,", (long int)array_size(ary,i));
5254         strcat(actual_dims,s);
5255       }
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",
5260                    desired_dims,
5261                    actual_dims);
5262     }
5263     return success;
5264   }
5265
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.
5269    */
5270   int require_fortran(PyArrayObject* ary)
5271   {
5272     int success = 1;
5273     int nd = array_numdims(ary);
5274     int i;
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);
5283     return success;
5284   }
5285
5286
5287
5288
5289 SWIGINTERN swig_type_info*
5290 SWIG_pchar_descriptor(void)
5291 {
5292   static int init = 0;
5293   static swig_type_info* info = 0;
5294   if (!init) {
5295     info = SWIG_TypeQuery("_p_char");
5296     init = 1;
5297   }
5298   return info;
5299 }
5300
5301
5302 SWIGINTERNINLINE PyObject *
5303 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
5304 {
5305   if (carray) {
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();
5310     } else {
5311 #if PY_VERSION_HEX >= 0x03000000
5312       return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
5313 #else
5314       return PyString_FromStringAndSize(carray, static_cast< int >(size));
5315 #endif
5316     }
5317   } else {
5318     return SWIG_Py_Void();
5319   }
5320 }
5321
5322
5323 SWIGINTERNINLINE PyObject * 
5324 SWIG_FromCharPtr(const char *cptr)
5325
5326   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
5327 }
5328
5329
5330 SWIGINTERNINLINE PyObject*
5331   SWIG_From_unsigned_SS_int  (unsigned int value)
5332 {
5333   return PyInt_FromSize_t((size_t) value);
5334 }
5335
5336 #ifdef __cplusplus
5337 extern "C" {
5338 #endif
5339 SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5340   PyObject *resultobj = 0;
5341   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5342   void *argp1 = 0 ;
5343   int res1 = 0 ;
5344   PyObject * obj0 = 0 ;
5345   
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 *""'"); 
5350   }
5351   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5352   delete arg1;
5353   resultobj = SWIG_Py_Void();
5354   return resultobj;
5355 fail:
5356   return NULL;
5357 }
5358
5359
5360 SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5361   PyObject *resultobj = 0;
5362   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5363   void *argp1 = 0 ;
5364   int res1 = 0 ;
5365   PyObject * obj0 = 0 ;
5366   PyObject *result = 0 ;
5367   
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 *""'"); 
5372   }
5373   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5374   try {
5375     result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
5376   }
5377   catch(swig::stop_iteration &_e) {
5378     {
5379       (void)_e;
5380       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5381       SWIG_fail;
5382     }
5383   }
5384   
5385   resultobj = result;
5386   return resultobj;
5387 fail:
5388   return NULL;
5389 }
5390
5391
5392 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5393   PyObject *resultobj = 0;
5394   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5395   size_t arg2 ;
5396   void *argp1 = 0 ;
5397   int res1 = 0 ;
5398   size_t val2 ;
5399   int ecode2 = 0 ;
5400   PyObject * obj0 = 0 ;
5401   PyObject * obj1 = 0 ;
5402   swig::SwigPyIterator *result = 0 ;
5403   
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 *""'"); 
5408   }
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""'");
5413   } 
5414   arg2 = static_cast< size_t >(val2);
5415   try {
5416     result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
5417   }
5418   catch(swig::stop_iteration &_e) {
5419     {
5420       (void)_e;
5421       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5422       SWIG_fail;
5423     }
5424   }
5425   
5426   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
5427   return resultobj;
5428 fail:
5429   return NULL;
5430 }
5431
5432
5433 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5434   PyObject *resultobj = 0;
5435   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5436   void *argp1 = 0 ;
5437   int res1 = 0 ;
5438   PyObject * obj0 = 0 ;
5439   swig::SwigPyIterator *result = 0 ;
5440   
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 *""'"); 
5445   }
5446   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5447   try {
5448     result = (swig::SwigPyIterator *)(arg1)->incr();
5449   }
5450   catch(swig::stop_iteration &_e) {
5451     {
5452       (void)_e;
5453       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5454       SWIG_fail;
5455     }
5456   }
5457   
5458   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
5459   return resultobj;
5460 fail:
5461   return NULL;
5462 }
5463
5464
5465 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
5466   int argc;
5467   PyObject *argv[3];
5468   int ii;
5469   
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);
5474   }
5475   if (argc == 1) {
5476     int _v;
5477     void *vptr = 0;
5478     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5479     _v = SWIG_CheckState(res);
5480     if (_v) {
5481       return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
5482     }
5483   }
5484   if (argc == 2) {
5485     int _v;
5486     void *vptr = 0;
5487     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5488     _v = SWIG_CheckState(res);
5489     if (_v) {
5490       {
5491         int res = SWIG_AsVal_size_t(argv[1], NULL);
5492         _v = SWIG_CheckState(res);
5493       }
5494       if (_v) {
5495         return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
5496       }
5497     }
5498   }
5499   
5500 fail:
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");
5505   return 0;
5506 }
5507
5508
5509 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5510   PyObject *resultobj = 0;
5511   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5512   size_t arg2 ;
5513   void *argp1 = 0 ;
5514   int res1 = 0 ;
5515   size_t val2 ;
5516   int ecode2 = 0 ;
5517   PyObject * obj0 = 0 ;
5518   PyObject * obj1 = 0 ;
5519   swig::SwigPyIterator *result = 0 ;
5520   
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 *""'"); 
5525   }
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""'");
5530   } 
5531   arg2 = static_cast< size_t >(val2);
5532   try {
5533     result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
5534   }
5535   catch(swig::stop_iteration &_e) {
5536     {
5537       (void)_e;
5538       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5539       SWIG_fail;
5540     }
5541   }
5542   
5543   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
5544   return resultobj;
5545 fail:
5546   return NULL;
5547 }
5548
5549
5550 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5551   PyObject *resultobj = 0;
5552   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5553   void *argp1 = 0 ;
5554   int res1 = 0 ;
5555   PyObject * obj0 = 0 ;
5556   swig::SwigPyIterator *result = 0 ;
5557   
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 *""'"); 
5562   }
5563   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5564   try {
5565     result = (swig::SwigPyIterator *)(arg1)->decr();
5566   }
5567   catch(swig::stop_iteration &_e) {
5568     {
5569       (void)_e;
5570       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5571       SWIG_fail;
5572     }
5573   }
5574   
5575   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
5576   return resultobj;
5577 fail:
5578   return NULL;
5579 }
5580
5581
5582 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
5583   int argc;
5584   PyObject *argv[3];
5585   int ii;
5586   
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);
5591   }
5592   if (argc == 1) {
5593     int _v;
5594     void *vptr = 0;
5595     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5596     _v = SWIG_CheckState(res);
5597     if (_v) {
5598       return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
5599     }
5600   }
5601   if (argc == 2) {
5602     int _v;
5603     void *vptr = 0;
5604     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5605     _v = SWIG_CheckState(res);
5606     if (_v) {
5607       {
5608         int res = SWIG_AsVal_size_t(argv[1], NULL);
5609         _v = SWIG_CheckState(res);
5610       }
5611       if (_v) {
5612         return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
5613       }
5614     }
5615   }
5616   
5617 fail:
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");
5622   return 0;
5623 }
5624
5625
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 ;
5630   void *argp1 = 0 ;
5631   int res1 = 0 ;
5632   void *argp2 = 0 ;
5633   int res2 = 0 ;
5634   PyObject * obj0 = 0 ;
5635   PyObject * obj1 = 0 ;
5636   ptrdiff_t result;
5637   
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 *""'"); 
5642   }
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 &""'"); 
5647   }
5648   if (!argp2) {
5649     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
5650   }
5651   arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5652   try {
5653     result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
5654   }
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;
5657   }
5658   
5659   resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
5660   return resultobj;
5661 fail:
5662   return NULL;
5663 }
5664
5665
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 ;
5670   void *argp1 = 0 ;
5671   int res1 = 0 ;
5672   void *argp2 = 0 ;
5673   int res2 = 0 ;
5674   PyObject * obj0 = 0 ;
5675   PyObject * obj1 = 0 ;
5676   bool result;
5677   
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 *""'"); 
5682   }
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 &""'"); 
5687   }
5688   if (!argp2) {
5689     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
5690   }
5691   arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5692   try {
5693     result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
5694   }
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;
5697   }
5698   
5699   resultobj = SWIG_From_bool(static_cast< bool >(result));
5700   return resultobj;
5701 fail:
5702   return NULL;
5703 }
5704
5705
5706 SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5707   PyObject *resultobj = 0;
5708   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5709   void *argp1 = 0 ;
5710   int res1 = 0 ;
5711   PyObject * obj0 = 0 ;
5712   swig::SwigPyIterator *result = 0 ;
5713   
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 *""'"); 
5718   }
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 );
5722   return resultobj;
5723 fail:
5724   return NULL;
5725 }
5726
5727
5728 SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5729   PyObject *resultobj = 0;
5730   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5731   void *argp1 = 0 ;
5732   int res1 = 0 ;
5733   PyObject * obj0 = 0 ;
5734   PyObject *result = 0 ;
5735   
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 *""'"); 
5740   }
5741   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5742   try {
5743     result = (PyObject *)(arg1)->next();
5744   }
5745   catch(swig::stop_iteration &_e) {
5746     {
5747       (void)_e;
5748       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5749       SWIG_fail;
5750     }
5751   }
5752   
5753   resultobj = result;
5754   return resultobj;
5755 fail:
5756   return NULL;
5757 }
5758
5759
5760 SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5761   PyObject *resultobj = 0;
5762   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5763   void *argp1 = 0 ;
5764   int res1 = 0 ;
5765   PyObject * obj0 = 0 ;
5766   PyObject *result = 0 ;
5767   
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 *""'"); 
5772   }
5773   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5774   try {
5775     result = (PyObject *)(arg1)->__next__();
5776   }
5777   catch(swig::stop_iteration &_e) {
5778     {
5779       (void)_e;
5780       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5781       SWIG_fail;
5782     }
5783   }
5784   
5785   resultobj = result;
5786   return resultobj;
5787 fail:
5788   return NULL;
5789 }
5790
5791
5792 SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5793   PyObject *resultobj = 0;
5794   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5795   void *argp1 = 0 ;
5796   int res1 = 0 ;
5797   PyObject * obj0 = 0 ;
5798   PyObject *result = 0 ;
5799   
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 *""'"); 
5804   }
5805   arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5806   try {
5807     result = (PyObject *)(arg1)->previous();
5808   }
5809   catch(swig::stop_iteration &_e) {
5810     {
5811       (void)_e;
5812       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5813       SWIG_fail;
5814     }
5815   }
5816   
5817   resultobj = result;
5818   return resultobj;
5819 fail:
5820   return NULL;
5821 }
5822
5823
5824 SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5825   PyObject *resultobj = 0;
5826   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5827   ptrdiff_t arg2 ;
5828   void *argp1 = 0 ;
5829   int res1 = 0 ;
5830   ptrdiff_t val2 ;
5831   int ecode2 = 0 ;
5832   PyObject * obj0 = 0 ;
5833   PyObject * obj1 = 0 ;
5834   swig::SwigPyIterator *result = 0 ;
5835   
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 *""'"); 
5840   }
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""'");
5845   } 
5846   arg2 = static_cast< ptrdiff_t >(val2);
5847   try {
5848     result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
5849   }
5850   catch(swig::stop_iteration &_e) {
5851     {
5852       (void)_e;
5853       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5854       SWIG_fail;
5855     }
5856   }
5857   
5858   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
5859   return resultobj;
5860 fail:
5861   return NULL;
5862 }
5863
5864
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 ;
5869   void *argp1 = 0 ;
5870   int res1 = 0 ;
5871   void *argp2 = 0 ;
5872   int res2 = 0 ;
5873   PyObject * obj0 = 0 ;
5874   PyObject * obj1 = 0 ;
5875   bool result;
5876   
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 *""'"); 
5881   }
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 &""'"); 
5886   }
5887   if (!argp2) {
5888     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
5889   }
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));
5893   return resultobj;
5894 fail:
5895   return NULL;
5896 }
5897
5898
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 ;
5903   void *argp1 = 0 ;
5904   int res1 = 0 ;
5905   void *argp2 = 0 ;
5906   int res2 = 0 ;
5907   PyObject * obj0 = 0 ;
5908   PyObject * obj1 = 0 ;
5909   bool result;
5910   
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 *""'"); 
5915   }
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 &""'"); 
5920   }
5921   if (!argp2) {
5922     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
5923   }
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));
5927   return resultobj;
5928 fail:
5929   return NULL;
5930 }
5931
5932
5933 SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5934   PyObject *resultobj = 0;
5935   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5936   ptrdiff_t arg2 ;
5937   void *argp1 = 0 ;
5938   int res1 = 0 ;
5939   ptrdiff_t val2 ;
5940   int ecode2 = 0 ;
5941   PyObject * obj0 = 0 ;
5942   PyObject * obj1 = 0 ;
5943   swig::SwigPyIterator *result = 0 ;
5944   
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 *""'"); 
5949   }
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""'");
5954   } 
5955   arg2 = static_cast< ptrdiff_t >(val2);
5956   try {
5957     result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
5958   }
5959   catch(swig::stop_iteration &_e) {
5960     {
5961       (void)_e;
5962       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5963       SWIG_fail;
5964     }
5965   }
5966   
5967   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
5968   return resultobj;
5969 fail:
5970   return NULL;
5971 }
5972
5973
5974 SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5975   PyObject *resultobj = 0;
5976   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5977   ptrdiff_t arg2 ;
5978   void *argp1 = 0 ;
5979   int res1 = 0 ;
5980   ptrdiff_t val2 ;
5981   int ecode2 = 0 ;
5982   PyObject * obj0 = 0 ;
5983   PyObject * obj1 = 0 ;
5984   swig::SwigPyIterator *result = 0 ;
5985   
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 *""'"); 
5990   }
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""'");
5995   } 
5996   arg2 = static_cast< ptrdiff_t >(val2);
5997   try {
5998     result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
5999   }
6000   catch(swig::stop_iteration &_e) {
6001     {
6002       (void)_e;
6003       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6004       SWIG_fail;
6005     }
6006   }
6007   
6008   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
6009   return resultobj;
6010 fail:
6011   return NULL;
6012 }
6013
6014
6015 SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6016   PyObject *resultobj = 0;
6017   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
6018   ptrdiff_t arg2 ;
6019   void *argp1 = 0 ;
6020   int res1 = 0 ;
6021   ptrdiff_t val2 ;
6022   int ecode2 = 0 ;
6023   PyObject * obj0 = 0 ;
6024   PyObject * obj1 = 0 ;
6025   swig::SwigPyIterator *result = 0 ;
6026   
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 *""'"); 
6031   }
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""'");
6036   } 
6037   arg2 = static_cast< ptrdiff_t >(val2);
6038   try {
6039     result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
6040   }
6041   catch(swig::stop_iteration &_e) {
6042     {
6043       (void)_e;
6044       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6045       SWIG_fail;
6046     }
6047   }
6048   
6049   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
6050   return resultobj;
6051 fail:
6052   return NULL;
6053 }
6054
6055
6056 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6057   PyObject *resultobj = 0;
6058   swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
6059   ptrdiff_t arg2 ;
6060   void *argp1 = 0 ;
6061   int res1 = 0 ;
6062   ptrdiff_t val2 ;
6063   int ecode2 = 0 ;
6064   PyObject * obj0 = 0 ;
6065   PyObject * obj1 = 0 ;
6066   swig::SwigPyIterator *result = 0 ;
6067   
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 *""'"); 
6072   }
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""'");
6077   } 
6078   arg2 = static_cast< ptrdiff_t >(val2);
6079   try {
6080     result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
6081   }
6082   catch(swig::stop_iteration &_e) {
6083     {
6084       (void)_e;
6085       SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
6086       SWIG_fail;
6087     }
6088   }
6089   
6090   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
6091   return resultobj;
6092 fail:
6093   return NULL;
6094 }
6095
6096
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 ;
6101   void *argp1 = 0 ;
6102   int res1 = 0 ;
6103   void *argp2 = 0 ;
6104   int res2 = 0 ;
6105   PyObject * obj0 = 0 ;
6106   PyObject * obj1 = 0 ;
6107   ptrdiff_t result;
6108   
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 *""'"); 
6113   }
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 &""'"); 
6118   }
6119   if (!argp2) {
6120     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
6121   }
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));
6125   return resultobj;
6126 fail:
6127   return NULL;
6128 }
6129
6130
6131 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
6132   int argc;
6133   PyObject *argv[3];
6134   int ii;
6135   
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);
6140   }
6141   if (argc == 2) {
6142     int _v;
6143     void *vptr = 0;
6144     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
6145     _v = SWIG_CheckState(res);
6146     if (_v) {
6147       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
6148       _v = SWIG_CheckState(res);
6149       if (_v) {
6150         return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
6151       }
6152     }
6153   }
6154   if (argc == 2) {
6155     int _v;
6156     void *vptr = 0;
6157     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
6158     _v = SWIG_CheckState(res);
6159     if (_v) {
6160       {
6161         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6162         _v = SWIG_CheckState(res);
6163       }
6164       if (_v) {
6165         return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
6166       }
6167     }
6168   }
6169   
6170 fail:
6171   Py_INCREF(Py_NotImplemented);
6172   return Py_NotImplemented;
6173 }
6174
6175
6176 SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6177   PyObject *obj;
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();
6181 }
6182
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 ;
6187   void *argp1 = 0 ;
6188   int res1 = 0 ;
6189   PyObject * obj0 = 0 ;
6190   swig::SwigPyIterator *result = 0 ;
6191   
6192   arg2 = &obj0;
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 > *""'"); 
6197   }
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 );
6201   return resultobj;
6202 fail:
6203   return NULL;
6204 }
6205
6206
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 ;
6210   void *argp1 = 0 ;
6211   int res1 = 0 ;
6212   PyObject * obj0 = 0 ;
6213   bool result;
6214   
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 *""'"); 
6219   }
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));
6223   return resultobj;
6224 fail:
6225   return NULL;
6226 }
6227
6228
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 ;
6232   void *argp1 = 0 ;
6233   int res1 = 0 ;
6234   PyObject * obj0 = 0 ;
6235   bool result;
6236   
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 *""'"); 
6241   }
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));
6245   return resultobj;
6246 fail:
6247   return NULL;
6248 }
6249
6250
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 ;
6254   void *argp1 = 0 ;
6255   int res1 = 0 ;
6256   PyObject * obj0 = 0 ;
6257   std::vector< double >::size_type result;
6258   
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 *""'"); 
6263   }
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));
6267   return resultobj;
6268 fail:
6269   return NULL;
6270 }
6271
6272
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 ;
6276   void *argp1 = 0 ;
6277   int res1 = 0 ;
6278   PyObject * obj0 = 0 ;
6279   std::vector< double >::value_type result;
6280   
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 > *""'"); 
6285   }
6286   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6287   try {
6288     result = (std::vector< double >::value_type)std_vector_Sl_double_Sg__pop(arg1);
6289   }
6290   catch(std::out_of_range &_e) {
6291     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6292   }
6293   
6294   resultobj = SWIG_From_double(static_cast< double >(result));
6295   return resultobj;
6296 fail:
6297   return NULL;
6298 }
6299
6300
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 ;
6306   void *argp1 = 0 ;
6307   int res1 = 0 ;
6308   ptrdiff_t val2 ;
6309   int ecode2 = 0 ;
6310   ptrdiff_t val3 ;
6311   int ecode3 = 0 ;
6312   PyObject * obj0 = 0 ;
6313   PyObject * obj1 = 0 ;
6314   PyObject * obj2 = 0 ;
6315   std::vector< double,std::allocator< double > > *result = 0 ;
6316   
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 > *""'"); 
6321   }
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""'");
6326   } 
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""'");
6331   } 
6332   arg3 = static_cast< std::vector< double >::difference_type >(val3);
6333   try {
6334     result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getslice__(arg1,arg2,arg3);
6335   }
6336   catch(std::out_of_range &_e) {
6337     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6338   }
6339   catch(std::invalid_argument &_e) {
6340     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6341   }
6342   
6343   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
6344   return resultobj;
6345 fail:
6346   return NULL;
6347 }
6348
6349
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 ;
6356   void *argp1 = 0 ;
6357   int res1 = 0 ;
6358   ptrdiff_t val2 ;
6359   int ecode2 = 0 ;
6360   ptrdiff_t val3 ;
6361   int ecode3 = 0 ;
6362   int res4 = SWIG_OLDOBJ ;
6363   PyObject * obj0 = 0 ;
6364   PyObject * obj1 = 0 ;
6365   PyObject * obj2 = 0 ;
6366   PyObject * obj3 = 0 ;
6367   
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 > *""'"); 
6372   }
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""'");
6377   } 
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""'");
6382   } 
6383   arg3 = static_cast< std::vector< double >::difference_type >(val3);
6384   {
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 &""'"); 
6389     }
6390     if (!ptr) {
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 &""'"); 
6392     }
6393     arg4 = ptr;
6394   }
6395   try {
6396     std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
6397   }
6398   catch(std::out_of_range &_e) {
6399     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6400   }
6401   catch(std::invalid_argument &_e) {
6402     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6403   }
6404   
6405   resultobj = SWIG_Py_Void();
6406   if (SWIG_IsNewObj(res4)) delete arg4;
6407   return resultobj;
6408 fail:
6409   if (SWIG_IsNewObj(res4)) delete arg4;
6410   return NULL;
6411 }
6412
6413
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 ;
6419   void *argp1 = 0 ;
6420   int res1 = 0 ;
6421   ptrdiff_t val2 ;
6422   int ecode2 = 0 ;
6423   ptrdiff_t val3 ;
6424   int ecode3 = 0 ;
6425   PyObject * obj0 = 0 ;
6426   PyObject * obj1 = 0 ;
6427   PyObject * obj2 = 0 ;
6428   
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 > *""'"); 
6433   }
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""'");
6438   } 
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""'");
6443   } 
6444   arg3 = static_cast< std::vector< double >::difference_type >(val3);
6445   try {
6446     std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3);
6447   }
6448   catch(std::out_of_range &_e) {
6449     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6450   }
6451   catch(std::invalid_argument &_e) {
6452     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6453   }
6454   
6455   resultobj = SWIG_Py_Void();
6456   return resultobj;
6457 fail:
6458   return NULL;
6459 }
6460
6461
6462 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setslice__(PyObject *self, PyObject *args) {
6463   int argc;
6464   PyObject *argv[5];
6465   int ii;
6466   
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);
6471   }
6472   if (argc == 3) {
6473     int _v;
6474     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6475     _v = SWIG_CheckState(res);
6476     if (_v) {
6477       {
6478         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6479         _v = SWIG_CheckState(res);
6480       }
6481       if (_v) {
6482         {
6483           int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
6484           _v = SWIG_CheckState(res);
6485         }
6486         if (_v) {
6487           return _wrap_nlopt_doublevector___setslice____SWIG_1(self, args);
6488         }
6489       }
6490     }
6491   }
6492   if (argc == 4) {
6493     int _v;
6494     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6495     _v = SWIG_CheckState(res);
6496     if (_v) {
6497       {
6498         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6499         _v = SWIG_CheckState(res);
6500       }
6501       if (_v) {
6502         {
6503           int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
6504           _v = SWIG_CheckState(res);
6505         }
6506         if (_v) {
6507           int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
6508           _v = SWIG_CheckState(res);
6509           if (_v) {
6510             return _wrap_nlopt_doublevector___setslice____SWIG_0(self, args);
6511           }
6512         }
6513       }
6514     }
6515   }
6516   
6517 fail:
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");
6522   return 0;
6523 }
6524
6525
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 ;
6531   void *argp1 = 0 ;
6532   int res1 = 0 ;
6533   ptrdiff_t val2 ;
6534   int ecode2 = 0 ;
6535   ptrdiff_t val3 ;
6536   int ecode3 = 0 ;
6537   PyObject * obj0 = 0 ;
6538   PyObject * obj1 = 0 ;
6539   PyObject * obj2 = 0 ;
6540   
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 > *""'"); 
6545   }
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""'");
6550   } 
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""'");
6555   } 
6556   arg3 = static_cast< std::vector< double >::difference_type >(val3);
6557   try {
6558     std_vector_Sl_double_Sg____delslice__(arg1,arg2,arg3);
6559   }
6560   catch(std::out_of_range &_e) {
6561     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6562   }
6563   catch(std::invalid_argument &_e) {
6564     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6565   }
6566   
6567   resultobj = SWIG_Py_Void();
6568   return resultobj;
6569 fail:
6570   return NULL;
6571 }
6572
6573
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 ;
6578   void *argp1 = 0 ;
6579   int res1 = 0 ;
6580   ptrdiff_t val2 ;
6581   int ecode2 = 0 ;
6582   PyObject * obj0 = 0 ;
6583   PyObject * obj1 = 0 ;
6584   
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 > *""'"); 
6589   }
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""'");
6594   } 
6595   arg2 = static_cast< std::vector< double >::difference_type >(val2);
6596   try {
6597     std_vector_Sl_double_Sg____delitem____SWIG_0(arg1,arg2);
6598   }
6599   catch(std::out_of_range &_e) {
6600     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6601   }
6602   
6603   resultobj = SWIG_Py_Void();
6604   return resultobj;
6605 fail:
6606   return NULL;
6607 }
6608
6609
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 ;
6614   void *argp1 = 0 ;
6615   int res1 = 0 ;
6616   PyObject * obj0 = 0 ;
6617   PyObject * obj1 = 0 ;
6618   std::vector< double,std::allocator< double > > *result = 0 ;
6619   
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 > *""'"); 
6624   }
6625   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6626   {
6627     if (!PySlice_Check(obj1)) {
6628       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6629     }
6630     arg2 = (PySliceObject *) obj1;
6631   }
6632   try {
6633     result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getitem____SWIG_0(arg1,arg2);
6634   }
6635   catch(std::out_of_range &_e) {
6636     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6637   }
6638   catch(std::invalid_argument &_e) {
6639     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6640   }
6641   
6642   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
6643   return resultobj;
6644 fail:
6645   return NULL;
6646 }
6647
6648
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 ;
6654   void *argp1 = 0 ;
6655   int res1 = 0 ;
6656   int res3 = SWIG_OLDOBJ ;
6657   PyObject * obj0 = 0 ;
6658   PyObject * obj1 = 0 ;
6659   PyObject * obj2 = 0 ;
6660   
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 > *""'"); 
6665   }
6666   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6667   {
6668     if (!PySlice_Check(obj1)) {
6669       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6670     }
6671     arg2 = (PySliceObject *) obj1;
6672   }
6673   {
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 &""'"); 
6678     }
6679     if (!ptr) {
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 &""'"); 
6681     }
6682     arg3 = ptr;
6683   }
6684   try {
6685     std_vector_Sl_double_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
6686   }
6687   catch(std::out_of_range &_e) {
6688     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6689   }
6690   catch(std::invalid_argument &_e) {
6691     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6692   }
6693   
6694   resultobj = SWIG_Py_Void();
6695   if (SWIG_IsNewObj(res3)) delete arg3;
6696   return resultobj;
6697 fail:
6698   if (SWIG_IsNewObj(res3)) delete arg3;
6699   return NULL;
6700 }
6701
6702
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 ;
6707   void *argp1 = 0 ;
6708   int res1 = 0 ;
6709   PyObject * obj0 = 0 ;
6710   PyObject * obj1 = 0 ;
6711   
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 > *""'"); 
6716   }
6717   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6718   {
6719     if (!PySlice_Check(obj1)) {
6720       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6721     }
6722     arg2 = (PySliceObject *) obj1;
6723   }
6724   try {
6725     std_vector_Sl_double_Sg____setitem____SWIG_1(arg1,arg2);
6726   }
6727   catch(std::out_of_range &_e) {
6728     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6729   }
6730   catch(std::invalid_argument &_e) {
6731     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6732   }
6733   
6734   resultobj = SWIG_Py_Void();
6735   return resultobj;
6736 fail:
6737   return NULL;
6738 }
6739
6740
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 ;
6745   void *argp1 = 0 ;
6746   int res1 = 0 ;
6747   PyObject * obj0 = 0 ;
6748   PyObject * obj1 = 0 ;
6749   
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 > *""'"); 
6754   }
6755   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
6756   {
6757     if (!PySlice_Check(obj1)) {
6758       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
6759     }
6760     arg2 = (PySliceObject *) obj1;
6761   }
6762   try {
6763     std_vector_Sl_double_Sg____delitem____SWIG_1(arg1,arg2);
6764   }
6765   catch(std::out_of_range &_e) {
6766     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6767   }
6768   catch(std::invalid_argument &_e) {
6769     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
6770   }
6771   
6772   resultobj = SWIG_Py_Void();
6773   return resultobj;
6774 fail:
6775   return NULL;
6776 }
6777
6778
6779 SWIGINTERN PyObject *_wrap_nlopt_doublevector___delitem__(PyObject *self, PyObject *args) {
6780   int argc;
6781   PyObject *argv[3];
6782   int ii;
6783   
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);
6788   }
6789   if (argc == 2) {
6790     int _v;
6791     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6792     _v = SWIG_CheckState(res);
6793     if (_v) {
6794       {
6795         _v = PySlice_Check(argv[1]);
6796       }
6797       if (_v) {
6798         return _wrap_nlopt_doublevector___delitem____SWIG_1(self, args);
6799       }
6800     }
6801   }
6802   if (argc == 2) {
6803     int _v;
6804     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6805     _v = SWIG_CheckState(res);
6806     if (_v) {
6807       {
6808         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6809         _v = SWIG_CheckState(res);
6810       }
6811       if (_v) {
6812         return _wrap_nlopt_doublevector___delitem____SWIG_0(self, args);
6813       }
6814     }
6815   }
6816   
6817 fail:
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");
6822   return 0;
6823 }
6824
6825
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 ;
6830   void *argp1 = 0 ;
6831   int res1 = 0 ;
6832   ptrdiff_t val2 ;
6833   int ecode2 = 0 ;
6834   PyObject * obj0 = 0 ;
6835   PyObject * obj1 = 0 ;
6836   std::vector< double >::value_type *result = 0 ;
6837   
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 *""'"); 
6842   }
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""'");
6847   } 
6848   arg2 = static_cast< std::vector< double >::difference_type >(val2);
6849   try {
6850     result = (std::vector< double >::value_type *) &std_vector_Sl_double_Sg____getitem____SWIG_1((std::vector< double > const *)arg1,arg2);
6851   }
6852   catch(std::out_of_range &_e) {
6853     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6854   }
6855   
6856   resultobj = SWIG_From_double(static_cast< double >(*result));
6857   return resultobj;
6858 fail:
6859   return NULL;
6860 }
6861
6862
6863 SWIGINTERN PyObject *_wrap_nlopt_doublevector___getitem__(PyObject *self, PyObject *args) {
6864   int argc;
6865   PyObject *argv[3];
6866   int ii;
6867   
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);
6872   }
6873   if (argc == 2) {
6874     int _v;
6875     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6876     _v = SWIG_CheckState(res);
6877     if (_v) {
6878       {
6879         _v = PySlice_Check(argv[1]);
6880       }
6881       if (_v) {
6882         return _wrap_nlopt_doublevector___getitem____SWIG_0(self, args);
6883       }
6884     }
6885   }
6886   if (argc == 2) {
6887     int _v;
6888     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6889     _v = SWIG_CheckState(res);
6890     if (_v) {
6891       {
6892         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
6893         _v = SWIG_CheckState(res);
6894       }
6895       if (_v) {
6896         return _wrap_nlopt_doublevector___getitem____SWIG_1(self, args);
6897       }
6898     }
6899   }
6900   
6901 fail:
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");
6906   return 0;
6907 }
6908
6909
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 ;
6915   void *argp1 = 0 ;
6916   int res1 = 0 ;
6917   ptrdiff_t val2 ;
6918   int ecode2 = 0 ;
6919   std::vector< double >::value_type temp3 ;
6920   double val3 ;
6921   int ecode3 = 0 ;
6922   PyObject * obj0 = 0 ;
6923   PyObject * obj1 = 0 ;
6924   PyObject * obj2 = 0 ;
6925   
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 > *""'"); 
6930   }
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""'");
6935   } 
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""'");
6940   } 
6941   temp3 = static_cast< std::vector< double >::value_type >(val3);
6942   arg3 = &temp3;
6943   try {
6944     std_vector_Sl_double_Sg____setitem____SWIG_2(arg1,arg2,(double const &)*arg3);
6945   }
6946   catch(std::out_of_range &_e) {
6947     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
6948   }
6949   
6950   resultobj = SWIG_Py_Void();
6951   return resultobj;
6952 fail:
6953   return NULL;
6954 }
6955
6956
6957 SWIGINTERN PyObject *_wrap_nlopt_doublevector___setitem__(PyObject *self, PyObject *args) {
6958   int argc;
6959   PyObject *argv[4];
6960   int ii;
6961   
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);
6966   }
6967   if (argc == 2) {
6968     int _v;
6969     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6970     _v = SWIG_CheckState(res);
6971     if (_v) {
6972       {
6973         _v = PySlice_Check(argv[1]);
6974       }
6975       if (_v) {
6976         return _wrap_nlopt_doublevector___setitem____SWIG_1(self, args);
6977       }
6978     }
6979   }
6980   if (argc == 3) {
6981     int _v;
6982     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
6983     _v = SWIG_CheckState(res);
6984     if (_v) {
6985       {
6986         _v = PySlice_Check(argv[1]);
6987       }
6988       if (_v) {
6989         int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
6990         _v = SWIG_CheckState(res);
6991         if (_v) {
6992           return _wrap_nlopt_doublevector___setitem____SWIG_0(self, args);
6993         }
6994       }
6995     }
6996   }
6997   if (argc == 3) {
6998     int _v;
6999     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7000     _v = SWIG_CheckState(res);
7001     if (_v) {
7002       {
7003         int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
7004         _v = SWIG_CheckState(res);
7005       }
7006       if (_v) {
7007         {
7008           int res = SWIG_AsVal_double(argv[2], NULL);
7009           _v = SWIG_CheckState(res);
7010         }
7011         if (_v) {
7012           return _wrap_nlopt_doublevector___setitem____SWIG_2(self, args);
7013         }
7014       }
7015     }
7016   }
7017   
7018 fail:
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");
7024   return 0;
7025 }
7026
7027
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 ;
7032   void *argp1 = 0 ;
7033   int res1 = 0 ;
7034   std::vector< double >::value_type temp2 ;
7035   double val2 ;
7036   int ecode2 = 0 ;
7037   PyObject * obj0 = 0 ;
7038   PyObject * obj1 = 0 ;
7039   
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 > *""'"); 
7044   }
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""'");
7049   } 
7050   temp2 = static_cast< std::vector< double >::value_type >(val2);
7051   arg2 = &temp2;
7052   std_vector_Sl_double_Sg__append(arg1,(double const &)*arg2);
7053   resultobj = SWIG_Py_Void();
7054   return resultobj;
7055 fail:
7056   return NULL;
7057 }
7058
7059
7060 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7061   PyObject *resultobj = 0;
7062   std::vector< double > *result = 0 ;
7063   
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 );
7067   return resultobj;
7068 fail:
7069   return NULL;
7070 }
7071
7072
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 ;
7079   
7080   if (!PyArg_ParseTuple(args,(char *)"O:new_nlopt_doublevector",&obj0)) SWIG_fail;
7081   {
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 &""'"); 
7086     }
7087     if (!ptr) {
7088       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_nlopt_doublevector" "', argument " "1"" of type '" "std::vector< double > const &""'"); 
7089     }
7090     arg1 = ptr;
7091   }
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;
7095   return resultobj;
7096 fail:
7097   if (SWIG_IsNewObj(res1)) delete arg1;
7098   return NULL;
7099 }
7100
7101
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 ;
7105   void *argp1 = 0 ;
7106   int res1 = 0 ;
7107   PyObject * obj0 = 0 ;
7108   bool result;
7109   
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 *""'"); 
7114   }
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));
7118   return resultobj;
7119 fail:
7120   return NULL;
7121 }
7122
7123
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 ;
7127   void *argp1 = 0 ;
7128   int res1 = 0 ;
7129   PyObject * obj0 = 0 ;
7130   std::vector< double >::size_type result;
7131   
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 *""'"); 
7136   }
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));
7140   return resultobj;
7141 fail:
7142   return NULL;
7143 }
7144
7145
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 ;
7149   void *argp1 = 0 ;
7150   int res1 = 0 ;
7151   PyObject * obj0 = 0 ;
7152   
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 > *""'"); 
7157   }
7158   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7159   (arg1)->clear();
7160   resultobj = SWIG_Py_Void();
7161   return resultobj;
7162 fail:
7163   return NULL;
7164 }
7165
7166
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 ;
7171   void *argp1 = 0 ;
7172   int res1 = 0 ;
7173   void *argp2 = 0 ;
7174   int res2 = 0 ;
7175   PyObject * obj0 = 0 ;
7176   PyObject * obj1 = 0 ;
7177   
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 > *""'"); 
7182   }
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 > &""'"); 
7187   }
7188   if (!argp2) {
7189     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_doublevector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); 
7190   }
7191   arg2 = reinterpret_cast< std::vector< double > * >(argp2);
7192   (arg1)->swap(*arg2);
7193   resultobj = SWIG_Py_Void();
7194   return resultobj;
7195 fail:
7196   return NULL;
7197 }
7198
7199
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 ;
7203   void *argp1 = 0 ;
7204   int res1 = 0 ;
7205   PyObject * obj0 = 0 ;
7206   SwigValueWrapper< std::allocator< double > > result;
7207   
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 *""'"); 
7212   }
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 );
7216   return resultobj;
7217 fail:
7218   return NULL;
7219 }
7220
7221
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 ;
7225   void *argp1 = 0 ;
7226   int res1 = 0 ;
7227   PyObject * obj0 = 0 ;
7228   std::vector< double >::iterator result;
7229   
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 > *""'"); 
7234   }
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);
7239   return resultobj;
7240 fail:
7241   return NULL;
7242 }
7243
7244
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 ;
7248   void *argp1 = 0 ;
7249   int res1 = 0 ;
7250   PyObject * obj0 = 0 ;
7251   std::vector< double >::iterator result;
7252   
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 > *""'"); 
7257   }
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);
7262   return resultobj;
7263 fail:
7264   return NULL;
7265 }
7266
7267
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 ;
7271   void *argp1 = 0 ;
7272   int res1 = 0 ;
7273   PyObject * obj0 = 0 ;
7274   std::vector< double >::reverse_iterator result;
7275   
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 > *""'"); 
7280   }
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);
7285   return resultobj;
7286 fail:
7287   return NULL;
7288 }
7289
7290
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 ;
7294   void *argp1 = 0 ;
7295   int res1 = 0 ;
7296   PyObject * obj0 = 0 ;
7297   std::vector< double >::reverse_iterator result;
7298   
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 > *""'"); 
7303   }
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);
7308   return resultobj;
7309 fail:
7310   return NULL;
7311 }
7312
7313
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 ;
7317   size_t val1 ;
7318   int ecode1 = 0 ;
7319   PyObject * obj0 = 0 ;
7320   std::vector< double > *result = 0 ;
7321   
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""'");
7326   } 
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 );
7330   return resultobj;
7331 fail:
7332   return NULL;
7333 }
7334
7335
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 ;
7339   void *argp1 = 0 ;
7340   int res1 = 0 ;
7341   PyObject * obj0 = 0 ;
7342   
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 > *""'"); 
7347   }
7348   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
7349   (arg1)->pop_back();
7350   resultobj = SWIG_Py_Void();
7351   return resultobj;
7352 fail:
7353   return NULL;
7354 }
7355
7356
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 ;
7361   void *argp1 = 0 ;
7362   int res1 = 0 ;
7363   size_t val2 ;
7364   int ecode2 = 0 ;
7365   PyObject * obj0 = 0 ;
7366   PyObject * obj1 = 0 ;
7367   
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 > *""'"); 
7372   }
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""'");
7377   } 
7378   arg2 = static_cast< std::vector< double >::size_type >(val2);
7379   (arg1)->resize(arg2);
7380   resultobj = SWIG_Py_Void();
7381   return resultobj;
7382 fail:
7383   return NULL;
7384 }
7385
7386
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 ;
7391   void *argp1 = 0 ;
7392   int res1 = 0 ;
7393   swig::SwigPyIterator *iter2 = 0 ;
7394   int res2 ;
7395   PyObject * obj0 = 0 ;
7396   PyObject * obj1 = 0 ;
7397   std::vector< double >::iterator result;
7398   
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 > *""'"); 
7403   }
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""'");
7408   } else {
7409     swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7410     if (iter_t) {
7411       arg2 = iter_t->get_current();
7412     } else {
7413       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7414     }
7415   }
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);
7419   return resultobj;
7420 fail:
7421   return NULL;
7422 }
7423
7424
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 ;
7430   void *argp1 = 0 ;
7431   int res1 = 0 ;
7432   swig::SwigPyIterator *iter2 = 0 ;
7433   int res2 ;
7434   swig::SwigPyIterator *iter3 = 0 ;
7435   int res3 ;
7436   PyObject * obj0 = 0 ;
7437   PyObject * obj1 = 0 ;
7438   PyObject * obj2 = 0 ;
7439   std::vector< double >::iterator result;
7440   
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 > *""'"); 
7445   }
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""'");
7450   } else {
7451     swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7452     if (iter_t) {
7453       arg2 = iter_t->get_current();
7454     } else {
7455       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7456     }
7457   }
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""'");
7461   } else {
7462     swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter3);
7463     if (iter_t) {
7464       arg3 = iter_t->get_current();
7465     } else {
7466       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'");
7467     }
7468   }
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);
7472   return resultobj;
7473 fail:
7474   return NULL;
7475 }
7476
7477
7478 SWIGINTERN PyObject *_wrap_nlopt_doublevector_erase(PyObject *self, PyObject *args) {
7479   int argc;
7480   PyObject *argv[4];
7481   int ii;
7482   
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);
7487   }
7488   if (argc == 2) {
7489     int _v;
7490     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7491     _v = SWIG_CheckState(res);
7492     if (_v) {
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));
7496       if (_v) {
7497         return _wrap_nlopt_doublevector_erase__SWIG_0(self, args);
7498       }
7499     }
7500   }
7501   if (argc == 3) {
7502     int _v;
7503     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7504     _v = SWIG_CheckState(res);
7505     if (_v) {
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));
7509       if (_v) {
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));
7513         if (_v) {
7514           return _wrap_nlopt_doublevector_erase__SWIG_1(self, args);
7515         }
7516       }
7517     }
7518   }
7519   
7520 fail:
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");
7525   return 0;
7526 }
7527
7528
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 ;
7533   size_t val1 ;
7534   int ecode1 = 0 ;
7535   std::vector< double >::value_type temp2 ;
7536   double val2 ;
7537   int ecode2 = 0 ;
7538   PyObject * obj0 = 0 ;
7539   PyObject * obj1 = 0 ;
7540   std::vector< double > *result = 0 ;
7541   
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""'");
7546   } 
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""'");
7551   } 
7552   temp2 = static_cast< std::vector< double >::value_type >(val2);
7553   arg2 = &temp2;
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 );
7556   return resultobj;
7557 fail:
7558   return NULL;
7559 }
7560
7561
7562 SWIGINTERN PyObject *_wrap_new_nlopt_doublevector(PyObject *self, PyObject *args) {
7563   int argc;
7564   PyObject *argv[3];
7565   int ii;
7566   
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);
7571   }
7572   if (argc == 0) {
7573     return _wrap_new_nlopt_doublevector__SWIG_0(self, args);
7574   }
7575   if (argc == 1) {
7576     int _v;
7577     {
7578       int res = SWIG_AsVal_size_t(argv[0], NULL);
7579       _v = SWIG_CheckState(res);
7580     }
7581     if (_v) {
7582       return _wrap_new_nlopt_doublevector__SWIG_2(self, args);
7583     }
7584   }
7585   if (argc == 1) {
7586     int _v;
7587     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7588     _v = SWIG_CheckState(res);
7589     if (_v) {
7590       return _wrap_new_nlopt_doublevector__SWIG_1(self, args);
7591     }
7592   }
7593   if (argc == 2) {
7594     int _v;
7595     {
7596       int res = SWIG_AsVal_size_t(argv[0], NULL);
7597       _v = SWIG_CheckState(res);
7598     }
7599     if (_v) {
7600       {
7601         int res = SWIG_AsVal_double(argv[1], NULL);
7602         _v = SWIG_CheckState(res);
7603       }
7604       if (_v) {
7605         return _wrap_new_nlopt_doublevector__SWIG_3(self, args);
7606       }
7607     }
7608   }
7609   
7610 fail:
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");
7617   return 0;
7618 }
7619
7620
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 ;
7625   void *argp1 = 0 ;
7626   int res1 = 0 ;
7627   std::vector< double >::value_type temp2 ;
7628   double val2 ;
7629   int ecode2 = 0 ;
7630   PyObject * obj0 = 0 ;
7631   PyObject * obj1 = 0 ;
7632   
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 > *""'"); 
7637   }
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""'");
7642   } 
7643   temp2 = static_cast< std::vector< double >::value_type >(val2);
7644   arg2 = &temp2;
7645   (arg1)->push_back((std::vector< double >::value_type const &)*arg2);
7646   resultobj = SWIG_Py_Void();
7647   return resultobj;
7648 fail:
7649   return NULL;
7650 }
7651
7652
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 ;
7656   void *argp1 = 0 ;
7657   int res1 = 0 ;
7658   PyObject * obj0 = 0 ;
7659   std::vector< double >::value_type *result = 0 ;
7660   
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 *""'"); 
7665   }
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));
7669   return resultobj;
7670 fail:
7671   return NULL;
7672 }
7673
7674
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 ;
7678   void *argp1 = 0 ;
7679   int res1 = 0 ;
7680   PyObject * obj0 = 0 ;
7681   std::vector< double >::value_type *result = 0 ;
7682   
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 *""'"); 
7687   }
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));
7691   return resultobj;
7692 fail:
7693   return NULL;
7694 }
7695
7696
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 ;
7702   void *argp1 = 0 ;
7703   int res1 = 0 ;
7704   size_t val2 ;
7705   int ecode2 = 0 ;
7706   std::vector< double >::value_type temp3 ;
7707   double val3 ;
7708   int ecode3 = 0 ;
7709   PyObject * obj0 = 0 ;
7710   PyObject * obj1 = 0 ;
7711   PyObject * obj2 = 0 ;
7712   
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 > *""'"); 
7717   }
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""'");
7722   } 
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""'");
7727   } 
7728   temp3 = static_cast< std::vector< double >::value_type >(val3);
7729   arg3 = &temp3;
7730   (arg1)->assign(arg2,(std::vector< double >::value_type const &)*arg3);
7731   resultobj = SWIG_Py_Void();
7732   return resultobj;
7733 fail:
7734   return NULL;
7735 }
7736
7737
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 ;
7743   void *argp1 = 0 ;
7744   int res1 = 0 ;
7745   size_t val2 ;
7746   int ecode2 = 0 ;
7747   std::vector< double >::value_type temp3 ;
7748   double val3 ;
7749   int ecode3 = 0 ;
7750   PyObject * obj0 = 0 ;
7751   PyObject * obj1 = 0 ;
7752   PyObject * obj2 = 0 ;
7753   
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 > *""'"); 
7758   }
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""'");
7763   } 
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""'");
7768   } 
7769   temp3 = static_cast< std::vector< double >::value_type >(val3);
7770   arg3 = &temp3;
7771   (arg1)->resize(arg2,(std::vector< double >::value_type const &)*arg3);
7772   resultobj = SWIG_Py_Void();
7773   return resultobj;
7774 fail:
7775   return NULL;
7776 }
7777
7778
7779 SWIGINTERN PyObject *_wrap_nlopt_doublevector_resize(PyObject *self, PyObject *args) {
7780   int argc;
7781   PyObject *argv[4];
7782   int ii;
7783   
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);
7788   }
7789   if (argc == 2) {
7790     int _v;
7791     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7792     _v = SWIG_CheckState(res);
7793     if (_v) {
7794       {
7795         int res = SWIG_AsVal_size_t(argv[1], NULL);
7796         _v = SWIG_CheckState(res);
7797       }
7798       if (_v) {
7799         return _wrap_nlopt_doublevector_resize__SWIG_0(self, args);
7800       }
7801     }
7802   }
7803   if (argc == 3) {
7804     int _v;
7805     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7806     _v = SWIG_CheckState(res);
7807     if (_v) {
7808       {
7809         int res = SWIG_AsVal_size_t(argv[1], NULL);
7810         _v = SWIG_CheckState(res);
7811       }
7812       if (_v) {
7813         {
7814           int res = SWIG_AsVal_double(argv[2], NULL);
7815           _v = SWIG_CheckState(res);
7816         }
7817         if (_v) {
7818           return _wrap_nlopt_doublevector_resize__SWIG_1(self, args);
7819         }
7820       }
7821     }
7822   }
7823   
7824 fail:
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");
7829   return 0;
7830 }
7831
7832
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 ;
7838   void *argp1 = 0 ;
7839   int res1 = 0 ;
7840   swig::SwigPyIterator *iter2 = 0 ;
7841   int res2 ;
7842   std::vector< double >::value_type temp3 ;
7843   double val3 ;
7844   int ecode3 = 0 ;
7845   PyObject * obj0 = 0 ;
7846   PyObject * obj1 = 0 ;
7847   PyObject * obj2 = 0 ;
7848   std::vector< double >::iterator result;
7849   
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 > *""'"); 
7854   }
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""'");
7859   } else {
7860     swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7861     if (iter_t) {
7862       arg2 = iter_t->get_current();
7863     } else {
7864       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7865     }
7866   }
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""'");
7870   } 
7871   temp3 = static_cast< std::vector< double >::value_type >(val3);
7872   arg3 = &temp3;
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);
7876   return resultobj;
7877 fail:
7878   return NULL;
7879 }
7880
7881
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 ;
7888   void *argp1 = 0 ;
7889   int res1 = 0 ;
7890   swig::SwigPyIterator *iter2 = 0 ;
7891   int res2 ;
7892   size_t val3 ;
7893   int ecode3 = 0 ;
7894   std::vector< double >::value_type temp4 ;
7895   double val4 ;
7896   int ecode4 = 0 ;
7897   PyObject * obj0 = 0 ;
7898   PyObject * obj1 = 0 ;
7899   PyObject * obj2 = 0 ;
7900   PyObject * obj3 = 0 ;
7901   
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 > *""'"); 
7906   }
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""'");
7911   } else {
7912     swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
7913     if (iter_t) {
7914       arg2 = iter_t->get_current();
7915     } else {
7916       SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "nlopt_doublevector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
7917     }
7918   }
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""'");
7922   } 
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""'");
7927   } 
7928   temp4 = static_cast< std::vector< double >::value_type >(val4);
7929   arg4 = &temp4;
7930   std_vector_Sl_double_Sg__insert__SWIG_1(arg1,arg2,arg3,(double const &)*arg4);
7931   resultobj = SWIG_Py_Void();
7932   return resultobj;
7933 fail:
7934   return NULL;
7935 }
7936
7937
7938 SWIGINTERN PyObject *_wrap_nlopt_doublevector_insert(PyObject *self, PyObject *args) {
7939   int argc;
7940   PyObject *argv[5];
7941   int ii;
7942   
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);
7947   }
7948   if (argc == 3) {
7949     int _v;
7950     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7951     _v = SWIG_CheckState(res);
7952     if (_v) {
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));
7956       if (_v) {
7957         {
7958           int res = SWIG_AsVal_double(argv[2], NULL);
7959           _v = SWIG_CheckState(res);
7960         }
7961         if (_v) {
7962           return _wrap_nlopt_doublevector_insert__SWIG_0(self, args);
7963         }
7964       }
7965     }
7966   }
7967   if (argc == 4) {
7968     int _v;
7969     int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
7970     _v = SWIG_CheckState(res);
7971     if (_v) {
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));
7975       if (_v) {
7976         {
7977           int res = SWIG_AsVal_size_t(argv[2], NULL);
7978           _v = SWIG_CheckState(res);
7979         }
7980         if (_v) {
7981           {
7982             int res = SWIG_AsVal_double(argv[3], NULL);
7983             _v = SWIG_CheckState(res);
7984           }
7985           if (_v) {
7986             return _wrap_nlopt_doublevector_insert__SWIG_1(self, args);
7987           }
7988         }
7989       }
7990     }
7991   }
7992   
7993 fail:
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");
7998   return 0;
7999 }
8000
8001
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 ;
8006   void *argp1 = 0 ;
8007   int res1 = 0 ;
8008   size_t val2 ;
8009   int ecode2 = 0 ;
8010   PyObject * obj0 = 0 ;
8011   PyObject * obj1 = 0 ;
8012   
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 > *""'"); 
8017   }
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""'");
8022   } 
8023   arg2 = static_cast< std::vector< double >::size_type >(val2);
8024   (arg1)->reserve(arg2);
8025   resultobj = SWIG_Py_Void();
8026   return resultobj;
8027 fail:
8028   return NULL;
8029 }
8030
8031
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 ;
8035   void *argp1 = 0 ;
8036   int res1 = 0 ;
8037   PyObject * obj0 = 0 ;
8038   std::vector< double >::size_type result;
8039   
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 *""'"); 
8044   }
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));
8048   return resultobj;
8049 fail:
8050   return NULL;
8051 }
8052
8053
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 ;
8057   void *argp1 = 0 ;
8058   int res1 = 0 ;
8059   PyObject * obj0 = 0 ;
8060   
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 > *""'"); 
8065   }
8066   arg1 = reinterpret_cast< std::vector< double > * >(argp1);
8067   delete arg1;
8068   resultobj = SWIG_Py_Void();
8069   return resultobj;
8070 fail:
8071   return NULL;
8072 }
8073
8074
8075 SWIGINTERN PyObject *nlopt_doublevector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8076   PyObject *obj;
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();
8080 }
8081
8082 SWIGINTERN PyObject *_wrap_nlopt_get_initial_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8083   PyObject *resultobj = 0;
8084   nlopt_opt arg1 ;
8085   double *arg2 = (double *) 0 ;
8086   void *argp1 ;
8087   int res1 = 0 ;
8088   void *argp2 = 0 ;
8089   int res2 = 0 ;
8090   PyObject * obj0 = 0 ;
8091   PyObject * obj1 = 0 ;
8092   nlopt_result result;
8093   
8094   if (!PyArg_ParseTuple(args,(char *)"OO:nlopt_get_initial_step",&obj0,&obj1)) SWIG_fail;
8095   {
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""'"); 
8099     }  
8100     if (!argp1) {
8101       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlopt_get_initial_step" "', argument " "1"" of type '" "nlopt_opt const""'");
8102     } else {
8103       nlopt_opt * temp = reinterpret_cast< nlopt_opt * >(argp1);
8104       arg1 = *temp;
8105       if (SWIG_IsNewObj(res1)) delete temp;
8106     }
8107   }
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 *""'"); 
8111   }
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 );
8115   return resultobj;
8116 fail:
8117   return NULL;
8118 }
8119
8120
8121 SWIGINTERN PyObject *_wrap_new_roundoff_limited(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8122   PyObject *resultobj = 0;
8123   nlopt::roundoff_limited *result = 0 ;
8124   
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 );
8128   return resultobj;
8129 fail:
8130   return NULL;
8131 }
8132
8133
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 ;
8137   void *argp1 = 0 ;
8138   int res1 = 0 ;
8139   PyObject * obj0 = 0 ;
8140   
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 *""'"); 
8145   }
8146   arg1 = reinterpret_cast< nlopt::roundoff_limited * >(argp1);
8147   delete arg1;
8148   resultobj = SWIG_Py_Void();
8149   return resultobj;
8150 fail:
8151   return NULL;
8152 }
8153
8154
8155 SWIGINTERN PyObject *roundoff_limited_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8156   PyObject *obj;
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();
8160 }
8161
8162 SWIGINTERN PyObject *_wrap_new_forced_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8163   PyObject *resultobj = 0;
8164   nlopt::forced_stop *result = 0 ;
8165   
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 );
8169   return resultobj;
8170 fail:
8171   return NULL;
8172 }
8173
8174
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 ;
8178   void *argp1 = 0 ;
8179   int res1 = 0 ;
8180   PyObject * obj0 = 0 ;
8181   
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 *""'"); 
8186   }
8187   arg1 = reinterpret_cast< nlopt::forced_stop * >(argp1);
8188   delete arg1;
8189   resultobj = SWIG_Py_Void();
8190   return resultobj;
8191 fail:
8192   return NULL;
8193 }
8194
8195
8196 SWIGINTERN PyObject *forced_stop_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8197   PyObject *obj;
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();
8201 }
8202
8203 SWIGINTERN PyObject *_wrap_new_opt__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8204   PyObject *resultobj = 0;
8205   nlopt::opt *result = 0 ;
8206   
8207   if (!PyArg_ParseTuple(args,(char *)":new_opt")) SWIG_fail;
8208   try {
8209     result = (nlopt::opt *)new nlopt::opt();
8210   }
8211   catch(std::bad_alloc &_e) {
8212     PyErr_SetString(PyExc_MemoryError, (_e).what());
8213     SWIG_fail;
8214     
8215   }
8216   
8217   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW |  0 );
8218   return resultobj;
8219 fail:
8220   return NULL;
8221 }
8222
8223
8224 SWIGINTERN PyObject *_wrap_delete_opt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8225   PyObject *resultobj = 0;
8226   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8227   void *argp1 = 0 ;
8228   int res1 = 0 ;
8229   PyObject * obj0 = 0 ;
8230   
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 *""'"); 
8235   }
8236   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8237   delete arg1;
8238   resultobj = SWIG_Py_Void();
8239   return resultobj;
8240 fail:
8241   return NULL;
8242 }
8243
8244
8245 SWIGINTERN PyObject *_wrap_new_opt__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8246   PyObject *resultobj = 0;
8247   nlopt::algorithm arg1 ;
8248   unsigned int arg2 ;
8249   int val1 ;
8250   int ecode1 = 0 ;
8251   unsigned int val2 ;
8252   int ecode2 = 0 ;
8253   PyObject * obj0 = 0 ;
8254   PyObject * obj1 = 0 ;
8255   nlopt::opt *result = 0 ;
8256   
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""'");
8261   } 
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""'");
8266   } 
8267   arg2 = static_cast< unsigned int >(val2);
8268   try {
8269     result = (nlopt::opt *)new nlopt::opt(arg1,arg2);
8270   }
8271   catch(std::bad_alloc &_e) {
8272     PyErr_SetString(PyExc_MemoryError, (_e).what());
8273     SWIG_fail;
8274     
8275   }
8276   
8277   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW |  0 );
8278   return resultobj;
8279 fail:
8280   return NULL;
8281 }
8282
8283
8284 SWIGINTERN PyObject *_wrap_new_opt__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8285   PyObject *resultobj = 0;
8286   nlopt::opt *arg1 = 0 ;
8287   void *argp1 = 0 ;
8288   int res1 = 0 ;
8289   PyObject * obj0 = 0 ;
8290   nlopt::opt *result = 0 ;
8291   
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 &""'"); 
8296   }
8297   if (!argp1) {
8298     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_opt" "', argument " "1"" of type '" "nlopt::opt const &""'"); 
8299   }
8300   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8301   try {
8302     result = (nlopt::opt *)new nlopt::opt((nlopt::opt const &)*arg1);
8303   }
8304   catch(std::bad_alloc &_e) {
8305     PyErr_SetString(PyExc_MemoryError, (_e).what());
8306     SWIG_fail;
8307     
8308   }
8309   
8310   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nlopt__opt, SWIG_POINTER_NEW |  0 );
8311   return resultobj;
8312 fail:
8313   return NULL;
8314 }
8315
8316
8317 SWIGINTERN PyObject *_wrap_new_opt(PyObject *self, PyObject *args) {
8318   int argc;
8319   PyObject *argv[3];
8320   int ii;
8321   
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);
8326   }
8327   if (argc == 0) {
8328     return _wrap_new_opt__SWIG_0(self, args);
8329   }
8330   if (argc == 1) {
8331     int _v;
8332     int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_nlopt__opt, 0);
8333     _v = SWIG_CheckState(res);
8334     if (_v) {
8335       return _wrap_new_opt__SWIG_2(self, args);
8336     }
8337   }
8338   if (argc == 2) {
8339     int _v;
8340     {
8341       int res = SWIG_AsVal_int(argv[0], NULL);
8342       _v = SWIG_CheckState(res);
8343     }
8344     if (_v) {
8345       {
8346         int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
8347         _v = SWIG_CheckState(res);
8348       }
8349       if (_v) {
8350         return _wrap_new_opt__SWIG_1(self, args);
8351       }
8352     }
8353   }
8354   
8355 fail:
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");
8361   return 0;
8362 }
8363
8364
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 ;
8369   double *arg3 = 0 ;
8370   void *argp1 = 0 ;
8371   int res1 = 0 ;
8372   void *argp2 = 0 ;
8373   int res2 = 0 ;
8374   void *argp3 = 0 ;
8375   int res3 = 0 ;
8376   PyObject * obj0 = 0 ;
8377   PyObject * obj1 = 0 ;
8378   PyObject * obj2 = 0 ;
8379   nlopt::result result;
8380   
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 *""'"); 
8385   }
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 > > &""'"); 
8390   }
8391   if (!argp2) {
8392     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_optimize" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > &""'"); 
8393   }
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 &""'"); 
8398   }
8399   if (!argp3) {
8400     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_optimize" "', argument " "3"" of type '" "double &""'"); 
8401   }
8402   arg3 = reinterpret_cast< double * >(argp3);
8403   try {
8404     result = (nlopt::result)(arg1)->optimize(*arg2,*arg3);
8405   }
8406   catch(nlopt::roundoff_limited &_e) {
8407     PyErr_SetString((PyObject*)&MyExc_RoundoffLimited, "NLopt roundoff-limited");
8408     SWIG_fail;
8409     
8410   }
8411   catch(nlopt::forced_stop &_e) {
8412     if (!PyErr_Occurred())
8413     PyErr_SetString((PyObject*)&MyExc_ForcedStop, "NLopt forced stop");
8414     SWIG_fail;
8415     
8416   }
8417   catch(std::runtime_error &_e) {
8418     SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
8419   }
8420   catch(std::bad_alloc &_e) {
8421     PyErr_SetString(PyExc_MemoryError, (_e).what());
8422     SWIG_fail;
8423     
8424   }
8425   catch(std::invalid_argument &_e) {
8426     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8427   }
8428   
8429   resultobj = SWIG_From_int(static_cast< int >(result));
8430   return resultobj;
8431 fail:
8432   return NULL;
8433 }
8434
8435
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 ;
8440   void *argp1 = 0 ;
8441   int res1 = 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;
8448   
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 *""'"); 
8453   }
8454   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8455   {
8456     npy_intp size[1] = {
8457       -1 
8458     };
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));
8463     arg2 = &arrayv2;
8464     {
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];
8470     }
8471   }
8472   try {
8473     result = (arg1)->optimize((std::vector< double,std::allocator< double > > const &)*arg2);
8474   }
8475   catch(nlopt::roundoff_limited &_e) {
8476     PyErr_SetString((PyObject*)&MyExc_RoundoffLimited, "NLopt roundoff-limited");
8477     SWIG_fail;
8478     
8479   }
8480   catch(nlopt::forced_stop &_e) {
8481     if (!PyErr_Occurred())
8482     PyErr_SetString((PyObject*)&MyExc_ForcedStop, "NLopt forced stop");
8483     SWIG_fail;
8484     
8485   }
8486   catch(std::runtime_error &_e) {
8487     SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
8488   }
8489   catch(std::bad_alloc &_e) {
8490     PyErr_SetString(PyExc_MemoryError, (_e).what());
8491     SWIG_fail;
8492     
8493   }
8494   catch(std::invalid_argument &_e) {
8495     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8496   }
8497   
8498   {
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);
8503   }
8504   {
8505     if (is_new_object2 && array2)
8506     {
8507       Py_DECREF(array2); 
8508     }
8509   }
8510   return resultobj;
8511 fail:
8512   {
8513     if (is_new_object2 && array2)
8514     {
8515       Py_DECREF(array2); 
8516     }
8517   }
8518   return NULL;
8519 }
8520
8521
8522 SWIGINTERN PyObject *_wrap_opt_optimize(PyObject *self, PyObject *args) {
8523   int argc;
8524   PyObject *argv[4];
8525   int ii;
8526   
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);
8531   }
8532   if (argc == 2) {
8533     int _v;
8534     void *vptr = 0;
8535     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8536     _v = SWIG_CheckState(res);
8537     if (_v) {
8538       {
8539         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
8540       }
8541       if (_v) {
8542         return _wrap_opt_optimize__SWIG_1(self, args);
8543       }
8544     }
8545   }
8546   if (argc == 3) {
8547     int _v;
8548     void *vptr = 0;
8549     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8550     _v = SWIG_CheckState(res);
8551     if (_v) {
8552       void *vptr = 0;
8553       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
8554       _v = SWIG_CheckState(res);
8555       if (_v) {
8556         void *vptr = 0;
8557         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_double, 0);
8558         _v = SWIG_CheckState(res);
8559         if (_v) {
8560           return _wrap_opt_optimize__SWIG_0(self, args);
8561         }
8562       }
8563     }
8564   }
8565   
8566 fail:
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");
8571   return 0;
8572 }
8573
8574
8575 SWIGINTERN PyObject *_wrap_opt_last_optimize_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8576   PyObject *resultobj = 0;
8577   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8578   void *argp1 = 0 ;
8579   int res1 = 0 ;
8580   PyObject * obj0 = 0 ;
8581   nlopt::result result;
8582   
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 *""'"); 
8587   }
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));
8591   return resultobj;
8592 fail:
8593   return NULL;
8594 }
8595
8596
8597 SWIGINTERN PyObject *_wrap_opt_last_optimum_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8598   PyObject *resultobj = 0;
8599   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8600   void *argp1 = 0 ;
8601   int res1 = 0 ;
8602   PyObject * obj0 = 0 ;
8603   double result;
8604   
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 *""'"); 
8609   }
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));
8613   return resultobj;
8614 fail:
8615   return NULL;
8616 }
8617
8618
8619 SWIGINTERN PyObject *_wrap_opt_get_algorithm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8620   PyObject *resultobj = 0;
8621   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8622   void *argp1 = 0 ;
8623   int res1 = 0 ;
8624   PyObject * obj0 = 0 ;
8625   nlopt::algorithm result;
8626   
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 *""'"); 
8631   }
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));
8635   return resultobj;
8636 fail:
8637   return NULL;
8638 }
8639
8640
8641 SWIGINTERN PyObject *_wrap_opt_get_algorithm_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8642   PyObject *resultobj = 0;
8643   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8644   void *argp1 = 0 ;
8645   int res1 = 0 ;
8646   PyObject * obj0 = 0 ;
8647   char *result = 0 ;
8648   
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 *""'"); 
8653   }
8654   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8655   result = (char *)((nlopt::opt const *)arg1)->get_algorithm_name();
8656   resultobj = SWIG_FromCharPtr((const char *)result);
8657   return resultobj;
8658 fail:
8659   return NULL;
8660 }
8661
8662
8663 SWIGINTERN PyObject *_wrap_opt_get_dimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8664   PyObject *resultobj = 0;
8665   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
8666   void *argp1 = 0 ;
8667   int res1 = 0 ;
8668   PyObject * obj0 = 0 ;
8669   unsigned int result;
8670   
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 *""'"); 
8675   }
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));
8679   return resultobj;
8680 fail:
8681   return NULL;
8682 }
8683
8684
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 ;
8688   nlopt::func arg2 ;
8689   void *arg3 = (void *) 0 ;
8690   void *argp1 = 0 ;
8691   int res1 = 0 ;
8692   void *argp2 ;
8693   int res2 = 0 ;
8694   int res3 ;
8695   PyObject * obj0 = 0 ;
8696   PyObject * obj1 = 0 ;
8697   PyObject * obj2 = 0 ;
8698   
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 *""'"); 
8703   }
8704   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8705   {
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""'"); 
8709     }  
8710     if (!argp2) {
8711       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_min_objective" "', argument " "2"" of type '" "nlopt::func""'");
8712     } else {
8713       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
8714       arg2 = *temp;
8715       if (SWIG_IsNewObj(res2)) delete temp;
8716     }
8717   }
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 *""'"); 
8721   }
8722   try {
8723     (arg1)->set_min_objective(arg2,arg3);
8724   }
8725   catch(std::bad_alloc &_e) {
8726     PyErr_SetString(PyExc_MemoryError, (_e).what());
8727     SWIG_fail;
8728     
8729   }
8730   catch(std::invalid_argument &_e) {
8731     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8732   }
8733   
8734   resultobj = SWIG_Py_Void();
8735   return resultobj;
8736 fail:
8737   return NULL;
8738 }
8739
8740
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 ;
8746   void *argp1 = 0 ;
8747   int res1 = 0 ;
8748   int res3 ;
8749   PyObject * obj0 = 0 ;
8750   PyObject * obj1 = 0 ;
8751   PyObject * obj2 = 0 ;
8752   
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 *""'"); 
8757   }
8758   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8759   {
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""'"); 
8763     }
8764   }
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 *""'"); 
8768   }
8769   try {
8770     (arg1)->set_min_objective(arg2,arg3);
8771   }
8772   catch(std::bad_alloc &_e) {
8773     PyErr_SetString(PyExc_MemoryError, (_e).what());
8774     SWIG_fail;
8775     
8776   }
8777   catch(std::invalid_argument &_e) {
8778     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8779   }
8780   
8781   resultobj = SWIG_Py_Void();
8782   return resultobj;
8783 fail:
8784   return NULL;
8785 }
8786
8787
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 ;
8791   nlopt::func arg2 ;
8792   void *arg3 = (void *) 0 ;
8793   void *argp1 = 0 ;
8794   int res1 = 0 ;
8795   void *argp2 ;
8796   int res2 = 0 ;
8797   int res3 ;
8798   PyObject * obj0 = 0 ;
8799   PyObject * obj1 = 0 ;
8800   PyObject * obj2 = 0 ;
8801   
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 *""'"); 
8806   }
8807   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8808   {
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""'"); 
8812     }  
8813     if (!argp2) {
8814       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_max_objective" "', argument " "2"" of type '" "nlopt::func""'");
8815     } else {
8816       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
8817       arg2 = *temp;
8818       if (SWIG_IsNewObj(res2)) delete temp;
8819     }
8820   }
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 *""'"); 
8824   }
8825   try {
8826     (arg1)->set_max_objective(arg2,arg3);
8827   }
8828   catch(std::bad_alloc &_e) {
8829     PyErr_SetString(PyExc_MemoryError, (_e).what());
8830     SWIG_fail;
8831     
8832   }
8833   catch(std::invalid_argument &_e) {
8834     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8835   }
8836   
8837   resultobj = SWIG_Py_Void();
8838   return resultobj;
8839 fail:
8840   return NULL;
8841 }
8842
8843
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 ;
8849   void *argp1 = 0 ;
8850   int res1 = 0 ;
8851   int res3 ;
8852   PyObject * obj0 = 0 ;
8853   PyObject * obj1 = 0 ;
8854   PyObject * obj2 = 0 ;
8855   
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 *""'"); 
8860   }
8861   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8862   {
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""'"); 
8866     }
8867   }
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 *""'"); 
8871   }
8872   try {
8873     (arg1)->set_max_objective(arg2,arg3);
8874   }
8875   catch(std::bad_alloc &_e) {
8876     PyErr_SetString(PyExc_MemoryError, (_e).what());
8877     SWIG_fail;
8878     
8879   }
8880   catch(std::invalid_argument &_e) {
8881     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8882   }
8883   
8884   resultobj = SWIG_Py_Void();
8885   return resultobj;
8886 fail:
8887   return NULL;
8888 }
8889
8890
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 ;
8894   nlopt::func arg2 ;
8895   void *arg3 = (void *) 0 ;
8896   nlopt_munge arg4 ;
8897   nlopt_munge arg5 ;
8898   void *argp1 = 0 ;
8899   int res1 = 0 ;
8900   PyObject * obj0 = 0 ;
8901   PyObject * obj1 = 0 ;
8902   
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 *""'"); 
8907   }
8908   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
8909   {
8910     arg2 = func_python;
8911     arg3 = dup_pyfunc((void*) obj1);
8912     arg4 = free_pyfunc;
8913     arg5 = dup_pyfunc;
8914   }
8915   try {
8916     (arg1)->set_min_objective(arg2,arg3,arg4,arg5);
8917   }
8918   catch(std::bad_alloc &_e) {
8919     PyErr_SetString(PyExc_MemoryError, (_e).what());
8920     SWIG_fail;
8921     
8922   }
8923   catch(std::invalid_argument &_e) {
8924     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
8925   }
8926   
8927   resultobj = SWIG_Py_Void();
8928   return resultobj;
8929 fail:
8930   return NULL;
8931 }
8932
8933
8934 SWIGINTERN PyObject *_wrap_opt_set_min_objective(PyObject *self, PyObject *args) {
8935   int argc;
8936   PyObject *argv[4];
8937   int ii;
8938   
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);
8943   }
8944   if (argc == 2) {
8945     int _v;
8946     void *vptr = 0;
8947     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8948     _v = SWIG_CheckState(res);
8949     if (_v) {
8950       {
8951         _v = PyCallable_Check(argv[1]);
8952       }
8953       if (_v) {
8954         if (argc <= 2) {
8955           return _wrap_opt_set_min_objective__SWIG_2(self, args);
8956         }
8957         if (argc <= 3) {
8958           return _wrap_opt_set_min_objective__SWIG_2(self, args);
8959         }
8960         if (argc <= 4) {
8961           return _wrap_opt_set_min_objective__SWIG_2(self, args);
8962         }
8963         return _wrap_opt_set_min_objective__SWIG_2(self, args);
8964       }
8965     }
8966   }
8967   if (argc == 3) {
8968     int _v;
8969     void *vptr = 0;
8970     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8971     _v = SWIG_CheckState(res);
8972     if (_v) {
8973       void *ptr = 0;
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);
8976       if (_v) {
8977         void *ptr = 0;
8978         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
8979         _v = SWIG_CheckState(res);
8980         if (_v) {
8981           return _wrap_opt_set_min_objective__SWIG_1(self, args);
8982         }
8983       }
8984     }
8985   }
8986   if (argc == 3) {
8987     int _v;
8988     void *vptr = 0;
8989     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
8990     _v = SWIG_CheckState(res);
8991     if (_v) {
8992       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
8993       _v = SWIG_CheckState(res);
8994       if (_v) {
8995         void *ptr = 0;
8996         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
8997         _v = SWIG_CheckState(res);
8998         if (_v) {
8999           return _wrap_opt_set_min_objective__SWIG_0(self, args);
9000         }
9001       }
9002     }
9003   }
9004   
9005 fail:
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");
9011   return 0;
9012 }
9013
9014
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 ;
9018   nlopt::func arg2 ;
9019   void *arg3 = (void *) 0 ;
9020   nlopt_munge arg4 ;
9021   nlopt_munge arg5 ;
9022   void *argp1 = 0 ;
9023   int res1 = 0 ;
9024   PyObject * obj0 = 0 ;
9025   PyObject * obj1 = 0 ;
9026   
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 *""'"); 
9031   }
9032   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9033   {
9034     arg2 = func_python;
9035     arg3 = dup_pyfunc((void*) obj1);
9036     arg4 = free_pyfunc;
9037     arg5 = dup_pyfunc;
9038   }
9039   try {
9040     (arg1)->set_max_objective(arg2,arg3,arg4,arg5);
9041   }
9042   catch(std::bad_alloc &_e) {
9043     PyErr_SetString(PyExc_MemoryError, (_e).what());
9044     SWIG_fail;
9045     
9046   }
9047   catch(std::invalid_argument &_e) {
9048     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9049   }
9050   
9051   resultobj = SWIG_Py_Void();
9052   return resultobj;
9053 fail:
9054   return NULL;
9055 }
9056
9057
9058 SWIGINTERN PyObject *_wrap_opt_set_max_objective(PyObject *self, PyObject *args) {
9059   int argc;
9060   PyObject *argv[4];
9061   int ii;
9062   
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);
9067   }
9068   if (argc == 2) {
9069     int _v;
9070     void *vptr = 0;
9071     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9072     _v = SWIG_CheckState(res);
9073     if (_v) {
9074       {
9075         _v = PyCallable_Check(argv[1]);
9076       }
9077       if (_v) {
9078         if (argc <= 2) {
9079           return _wrap_opt_set_max_objective__SWIG_2(self, args);
9080         }
9081         if (argc <= 3) {
9082           return _wrap_opt_set_max_objective__SWIG_2(self, args);
9083         }
9084         if (argc <= 4) {
9085           return _wrap_opt_set_max_objective__SWIG_2(self, args);
9086         }
9087         return _wrap_opt_set_max_objective__SWIG_2(self, args);
9088       }
9089     }
9090   }
9091   if (argc == 3) {
9092     int _v;
9093     void *vptr = 0;
9094     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9095     _v = SWIG_CheckState(res);
9096     if (_v) {
9097       void *ptr = 0;
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);
9100       if (_v) {
9101         void *ptr = 0;
9102         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9103         _v = SWIG_CheckState(res);
9104         if (_v) {
9105           return _wrap_opt_set_max_objective__SWIG_1(self, args);
9106         }
9107       }
9108     }
9109   }
9110   if (argc == 3) {
9111     int _v;
9112     void *vptr = 0;
9113     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9114     _v = SWIG_CheckState(res);
9115     if (_v) {
9116       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
9117       _v = SWIG_CheckState(res);
9118       if (_v) {
9119         void *ptr = 0;
9120         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9121         _v = SWIG_CheckState(res);
9122         if (_v) {
9123           return _wrap_opt_set_max_objective__SWIG_0(self, args);
9124         }
9125       }
9126     }
9127   }
9128   
9129 fail:
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");
9135   return 0;
9136 }
9137
9138
9139 SWIGINTERN PyObject *_wrap_opt_remove_inequality_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9140   PyObject *resultobj = 0;
9141   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9142   void *argp1 = 0 ;
9143   int res1 = 0 ;
9144   PyObject * obj0 = 0 ;
9145   
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 *""'"); 
9150   }
9151   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9152   try {
9153     (arg1)->remove_inequality_constraints();
9154   }
9155   catch(std::invalid_argument &_e) {
9156     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9157   }
9158   
9159   resultobj = SWIG_Py_Void();
9160   return resultobj;
9161 fail:
9162   return NULL;
9163 }
9164
9165
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 ;
9169   nlopt::func arg2 ;
9170   void *arg3 = (void *) 0 ;
9171   double arg4 ;
9172   void *argp1 = 0 ;
9173   int res1 = 0 ;
9174   void *argp2 ;
9175   int res2 = 0 ;
9176   int res3 ;
9177   double val4 ;
9178   int ecode4 = 0 ;
9179   PyObject * obj0 = 0 ;
9180   PyObject * obj1 = 0 ;
9181   PyObject * obj2 = 0 ;
9182   PyObject * obj3 = 0 ;
9183   
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 *""'"); 
9188   }
9189   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9190   {
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""'"); 
9194     }  
9195     if (!argp2) {
9196       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9197     } else {
9198       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9199       arg2 = *temp;
9200       if (SWIG_IsNewObj(res2)) delete temp;
9201     }
9202   }
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 *""'"); 
9206   }
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""'");
9210   } 
9211   arg4 = static_cast< double >(val4);
9212   try {
9213     (arg1)->add_inequality_constraint(arg2,arg3,arg4);
9214   }
9215   catch(std::bad_alloc &_e) {
9216     PyErr_SetString(PyExc_MemoryError, (_e).what());
9217     SWIG_fail;
9218     
9219   }
9220   catch(std::invalid_argument &_e) {
9221     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9222   }
9223   
9224   resultobj = SWIG_Py_Void();
9225   return resultobj;
9226 fail:
9227   return NULL;
9228 }
9229
9230
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 ;
9234   nlopt::func arg2 ;
9235   void *arg3 = (void *) 0 ;
9236   void *argp1 = 0 ;
9237   int res1 = 0 ;
9238   void *argp2 ;
9239   int res2 = 0 ;
9240   int res3 ;
9241   PyObject * obj0 = 0 ;
9242   PyObject * obj1 = 0 ;
9243   PyObject * obj2 = 0 ;
9244   
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 *""'"); 
9249   }
9250   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9251   {
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""'"); 
9255     }  
9256     if (!argp2) {
9257       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9258     } else {
9259       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9260       arg2 = *temp;
9261       if (SWIG_IsNewObj(res2)) delete temp;
9262     }
9263   }
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 *""'"); 
9267   }
9268   try {
9269     (arg1)->add_inequality_constraint(arg2,arg3);
9270   }
9271   catch(std::bad_alloc &_e) {
9272     PyErr_SetString(PyExc_MemoryError, (_e).what());
9273     SWIG_fail;
9274     
9275   }
9276   catch(std::invalid_argument &_e) {
9277     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9278   }
9279   
9280   resultobj = SWIG_Py_Void();
9281   return resultobj;
9282 fail:
9283   return NULL;
9284 }
9285
9286
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 ;
9292   double arg4 ;
9293   void *argp1 = 0 ;
9294   int res1 = 0 ;
9295   int res3 ;
9296   double val4 ;
9297   int ecode4 = 0 ;
9298   PyObject * obj0 = 0 ;
9299   PyObject * obj1 = 0 ;
9300   PyObject * obj2 = 0 ;
9301   PyObject * obj3 = 0 ;
9302   
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 *""'"); 
9307   }
9308   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9309   {
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""'"); 
9313     }
9314   }
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 *""'"); 
9318   }
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""'");
9322   } 
9323   arg4 = static_cast< double >(val4);
9324   try {
9325     (arg1)->add_inequality_constraint(arg2,arg3,arg4);
9326   }
9327   catch(std::bad_alloc &_e) {
9328     PyErr_SetString(PyExc_MemoryError, (_e).what());
9329     SWIG_fail;
9330     
9331   }
9332   catch(std::invalid_argument &_e) {
9333     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9334   }
9335   
9336   resultobj = SWIG_Py_Void();
9337   return resultobj;
9338 fail:
9339   return NULL;
9340 }
9341
9342
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 ;
9348   void *argp1 = 0 ;
9349   int res1 = 0 ;
9350   int res3 ;
9351   PyObject * obj0 = 0 ;
9352   PyObject * obj1 = 0 ;
9353   PyObject * obj2 = 0 ;
9354   
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 *""'"); 
9359   }
9360   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9361   {
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""'"); 
9365     }
9366   }
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 *""'"); 
9370   }
9371   try {
9372     (arg1)->add_inequality_constraint(arg2,arg3);
9373   }
9374   catch(std::bad_alloc &_e) {
9375     PyErr_SetString(PyExc_MemoryError, (_e).what());
9376     SWIG_fail;
9377     
9378   }
9379   catch(std::invalid_argument &_e) {
9380     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9381   }
9382   
9383   resultobj = SWIG_Py_Void();
9384   return resultobj;
9385 fail:
9386   return NULL;
9387 }
9388
9389
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 ;
9393   nlopt::mfunc arg2 ;
9394   void *arg3 = (void *) 0 ;
9395   std::vector< double,std::allocator< double > > *arg4 = 0 ;
9396   void *argp1 = 0 ;
9397   int res1 = 0 ;
9398   void *argp2 ;
9399   int res2 = 0 ;
9400   int res3 ;
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 ;
9408   
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 *""'"); 
9413   }
9414   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9415   {
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""'"); 
9419     }  
9420     if (!argp2) {
9421       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_inequality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9422     } else {
9423       nlopt::mfunc * temp = reinterpret_cast< nlopt::mfunc * >(argp2);
9424       arg2 = *temp;
9425       if (SWIG_IsNewObj(res2)) delete temp;
9426     }
9427   }
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 *""'"); 
9431   }
9432   {
9433     npy_intp size[1] = {
9434       -1 
9435     };
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));
9440     arg4 = &arrayv4;
9441     {
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];
9447     }
9448   }
9449   try {
9450     (arg1)->add_inequality_mconstraint(arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
9451   }
9452   catch(std::bad_alloc &_e) {
9453     PyErr_SetString(PyExc_MemoryError, (_e).what());
9454     SWIG_fail;
9455     
9456   }
9457   catch(std::invalid_argument &_e) {
9458     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9459   }
9460   
9461   resultobj = SWIG_Py_Void();
9462   {
9463     if (is_new_object4 && array4)
9464     {
9465       Py_DECREF(array4); 
9466     }
9467   }
9468   return resultobj;
9469 fail:
9470   {
9471     if (is_new_object4 && array4)
9472     {
9473       Py_DECREF(array4); 
9474     }
9475   }
9476   return NULL;
9477 }
9478
9479
9480 SWIGINTERN PyObject *_wrap_opt_remove_equality_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9481   PyObject *resultobj = 0;
9482   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
9483   void *argp1 = 0 ;
9484   int res1 = 0 ;
9485   PyObject * obj0 = 0 ;
9486   
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 *""'"); 
9491   }
9492   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9493   try {
9494     (arg1)->remove_equality_constraints();
9495   }
9496   catch(std::invalid_argument &_e) {
9497     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9498   }
9499   
9500   resultobj = SWIG_Py_Void();
9501   return resultobj;
9502 fail:
9503   return NULL;
9504 }
9505
9506
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 ;
9510   nlopt::func arg2 ;
9511   void *arg3 = (void *) 0 ;
9512   double arg4 ;
9513   void *argp1 = 0 ;
9514   int res1 = 0 ;
9515   void *argp2 ;
9516   int res2 = 0 ;
9517   int res3 ;
9518   double val4 ;
9519   int ecode4 = 0 ;
9520   PyObject * obj0 = 0 ;
9521   PyObject * obj1 = 0 ;
9522   PyObject * obj2 = 0 ;
9523   PyObject * obj3 = 0 ;
9524   
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 *""'"); 
9529   }
9530   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9531   {
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""'"); 
9535     }  
9536     if (!argp2) {
9537       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9538     } else {
9539       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9540       arg2 = *temp;
9541       if (SWIG_IsNewObj(res2)) delete temp;
9542     }
9543   }
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 *""'"); 
9547   }
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""'");
9551   } 
9552   arg4 = static_cast< double >(val4);
9553   try {
9554     (arg1)->add_equality_constraint(arg2,arg3,arg4);
9555   }
9556   catch(std::bad_alloc &_e) {
9557     PyErr_SetString(PyExc_MemoryError, (_e).what());
9558     SWIG_fail;
9559     
9560   }
9561   catch(std::invalid_argument &_e) {
9562     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9563   }
9564   
9565   resultobj = SWIG_Py_Void();
9566   return resultobj;
9567 fail:
9568   return NULL;
9569 }
9570
9571
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 ;
9575   nlopt::func arg2 ;
9576   void *arg3 = (void *) 0 ;
9577   void *argp1 = 0 ;
9578   int res1 = 0 ;
9579   void *argp2 ;
9580   int res2 = 0 ;
9581   int res3 ;
9582   PyObject * obj0 = 0 ;
9583   PyObject * obj1 = 0 ;
9584   PyObject * obj2 = 0 ;
9585   
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 *""'"); 
9590   }
9591   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9592   {
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""'"); 
9596     }  
9597     if (!argp2) {
9598       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_constraint" "', argument " "2"" of type '" "nlopt::func""'");
9599     } else {
9600       nlopt::func * temp = reinterpret_cast< nlopt::func * >(argp2);
9601       arg2 = *temp;
9602       if (SWIG_IsNewObj(res2)) delete temp;
9603     }
9604   }
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 *""'"); 
9608   }
9609   try {
9610     (arg1)->add_equality_constraint(arg2,arg3);
9611   }
9612   catch(std::bad_alloc &_e) {
9613     PyErr_SetString(PyExc_MemoryError, (_e).what());
9614     SWIG_fail;
9615     
9616   }
9617   catch(std::invalid_argument &_e) {
9618     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9619   }
9620   
9621   resultobj = SWIG_Py_Void();
9622   return resultobj;
9623 fail:
9624   return NULL;
9625 }
9626
9627
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 ;
9633   double arg4 ;
9634   void *argp1 = 0 ;
9635   int res1 = 0 ;
9636   int res3 ;
9637   double val4 ;
9638   int ecode4 = 0 ;
9639   PyObject * obj0 = 0 ;
9640   PyObject * obj1 = 0 ;
9641   PyObject * obj2 = 0 ;
9642   PyObject * obj3 = 0 ;
9643   
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 *""'"); 
9648   }
9649   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9650   {
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""'"); 
9654     }
9655   }
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 *""'"); 
9659   }
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""'");
9663   } 
9664   arg4 = static_cast< double >(val4);
9665   try {
9666     (arg1)->add_equality_constraint(arg2,arg3,arg4);
9667   }
9668   catch(std::bad_alloc &_e) {
9669     PyErr_SetString(PyExc_MemoryError, (_e).what());
9670     SWIG_fail;
9671     
9672   }
9673   catch(std::invalid_argument &_e) {
9674     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9675   }
9676   
9677   resultobj = SWIG_Py_Void();
9678   return resultobj;
9679 fail:
9680   return NULL;
9681 }
9682
9683
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 ;
9689   void *argp1 = 0 ;
9690   int res1 = 0 ;
9691   int res3 ;
9692   PyObject * obj0 = 0 ;
9693   PyObject * obj1 = 0 ;
9694   PyObject * obj2 = 0 ;
9695   
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 *""'"); 
9700   }
9701   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9702   {
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""'"); 
9706     }
9707   }
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 *""'"); 
9711   }
9712   try {
9713     (arg1)->add_equality_constraint(arg2,arg3);
9714   }
9715   catch(std::bad_alloc &_e) {
9716     PyErr_SetString(PyExc_MemoryError, (_e).what());
9717     SWIG_fail;
9718     
9719   }
9720   catch(std::invalid_argument &_e) {
9721     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9722   }
9723   
9724   resultobj = SWIG_Py_Void();
9725   return resultobj;
9726 fail:
9727   return NULL;
9728 }
9729
9730
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 ;
9734   nlopt::mfunc arg2 ;
9735   void *arg3 = (void *) 0 ;
9736   std::vector< double,std::allocator< double > > *arg4 = 0 ;
9737   void *argp1 = 0 ;
9738   int res1 = 0 ;
9739   void *argp2 ;
9740   int res2 = 0 ;
9741   int res3 ;
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 ;
9749   
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 *""'"); 
9754   }
9755   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9756   {
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""'"); 
9760     }  
9761     if (!argp2) {
9762       SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_add_equality_mconstraint" "', argument " "2"" of type '" "nlopt::mfunc""'");
9763     } else {
9764       nlopt::mfunc * temp = reinterpret_cast< nlopt::mfunc * >(argp2);
9765       arg2 = *temp;
9766       if (SWIG_IsNewObj(res2)) delete temp;
9767     }
9768   }
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 *""'"); 
9772   }
9773   {
9774     npy_intp size[1] = {
9775       -1 
9776     };
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));
9781     arg4 = &arrayv4;
9782     {
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];
9788     }
9789   }
9790   try {
9791     (arg1)->add_equality_mconstraint(arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
9792   }
9793   catch(std::bad_alloc &_e) {
9794     PyErr_SetString(PyExc_MemoryError, (_e).what());
9795     SWIG_fail;
9796     
9797   }
9798   catch(std::invalid_argument &_e) {
9799     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9800   }
9801   
9802   resultobj = SWIG_Py_Void();
9803   {
9804     if (is_new_object4 && array4)
9805     {
9806       Py_DECREF(array4); 
9807     }
9808   }
9809   return resultobj;
9810 fail:
9811   {
9812     if (is_new_object4 && array4)
9813     {
9814       Py_DECREF(array4); 
9815     }
9816   }
9817   return NULL;
9818 }
9819
9820
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 ;
9824   nlopt::func arg2 ;
9825   void *arg3 = (void *) 0 ;
9826   nlopt_munge arg4 ;
9827   nlopt_munge arg5 ;
9828   double arg6 ;
9829   void *argp1 = 0 ;
9830   int res1 = 0 ;
9831   double val6 ;
9832   int ecode6 = 0 ;
9833   PyObject * obj0 = 0 ;
9834   PyObject * obj1 = 0 ;
9835   PyObject * obj2 = 0 ;
9836   
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 *""'"); 
9841   }
9842   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9843   {
9844     arg2 = func_python;
9845     arg3 = dup_pyfunc((void*) obj1);
9846     arg4 = free_pyfunc;
9847     arg5 = dup_pyfunc;
9848   }
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""'");
9852   } 
9853   arg6 = static_cast< double >(val6);
9854   try {
9855     (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5,arg6);
9856   }
9857   catch(std::bad_alloc &_e) {
9858     PyErr_SetString(PyExc_MemoryError, (_e).what());
9859     SWIG_fail;
9860     
9861   }
9862   catch(std::invalid_argument &_e) {
9863     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9864   }
9865   
9866   resultobj = SWIG_Py_Void();
9867   return resultobj;
9868 fail:
9869   return NULL;
9870 }
9871
9872
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 ;
9876   nlopt::func arg2 ;
9877   void *arg3 = (void *) 0 ;
9878   nlopt_munge arg4 ;
9879   nlopt_munge arg5 ;
9880   void *argp1 = 0 ;
9881   int res1 = 0 ;
9882   PyObject * obj0 = 0 ;
9883   PyObject * obj1 = 0 ;
9884   
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 *""'"); 
9889   }
9890   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
9891   {
9892     arg2 = func_python;
9893     arg3 = dup_pyfunc((void*) obj1);
9894     arg4 = free_pyfunc;
9895     arg5 = dup_pyfunc;
9896   }
9897   try {
9898     (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5);
9899   }
9900   catch(std::bad_alloc &_e) {
9901     PyErr_SetString(PyExc_MemoryError, (_e).what());
9902     SWIG_fail;
9903     
9904   }
9905   catch(std::invalid_argument &_e) {
9906     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
9907   }
9908   
9909   resultobj = SWIG_Py_Void();
9910   return resultobj;
9911 fail:
9912   return NULL;
9913 }
9914
9915
9916 SWIGINTERN PyObject *_wrap_opt_add_inequality_constraint(PyObject *self, PyObject *args) {
9917   int argc;
9918   PyObject *argv[5];
9919   int ii;
9920   
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);
9925   }
9926   if (argc == 2) {
9927     int _v;
9928     void *vptr = 0;
9929     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9930     _v = SWIG_CheckState(res);
9931     if (_v) {
9932       {
9933         _v = PyCallable_Check(argv[1]);
9934       }
9935       if (_v) {
9936         if (argc <= 2) {
9937           return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9938         }
9939         if (argc <= 3) {
9940           return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9941         }
9942         if (argc <= 4) {
9943           return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9944         }
9945         return _wrap_opt_add_inequality_constraint__SWIG_5(self, args);
9946       }
9947     }
9948   }
9949   if (argc == 3) {
9950     int _v;
9951     void *vptr = 0;
9952     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9953     _v = SWIG_CheckState(res);
9954     if (_v) {
9955       void *ptr = 0;
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);
9958       if (_v) {
9959         void *ptr = 0;
9960         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9961         _v = SWIG_CheckState(res);
9962         if (_v) {
9963           return _wrap_opt_add_inequality_constraint__SWIG_3(self, args);
9964         }
9965       }
9966     }
9967   }
9968   if (argc == 3) {
9969     int _v;
9970     void *vptr = 0;
9971     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9972     _v = SWIG_CheckState(res);
9973     if (_v) {
9974       {
9975         _v = PyCallable_Check(argv[1]);
9976       }
9977       if (_v) {
9978         {
9979           int res = SWIG_AsVal_double(argv[2], NULL);
9980           _v = SWIG_CheckState(res);
9981         }
9982         if (_v) {
9983           return _wrap_opt_add_inequality_constraint__SWIG_4(self, args);
9984         }
9985       }
9986     }
9987   }
9988   if (argc == 3) {
9989     int _v;
9990     void *vptr = 0;
9991     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
9992     _v = SWIG_CheckState(res);
9993     if (_v) {
9994       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
9995       _v = SWIG_CheckState(res);
9996       if (_v) {
9997         void *ptr = 0;
9998         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
9999         _v = SWIG_CheckState(res);
10000         if (_v) {
10001           return _wrap_opt_add_inequality_constraint__SWIG_1(self, args);
10002         }
10003       }
10004     }
10005   }
10006   if (argc == 4) {
10007     int _v;
10008     void *vptr = 0;
10009     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10010     _v = SWIG_CheckState(res);
10011     if (_v) {
10012       void *ptr = 0;
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);
10015       if (_v) {
10016         void *ptr = 0;
10017         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10018         _v = SWIG_CheckState(res);
10019         if (_v) {
10020           {
10021             int res = SWIG_AsVal_double(argv[3], NULL);
10022             _v = SWIG_CheckState(res);
10023           }
10024           if (_v) {
10025             return _wrap_opt_add_inequality_constraint__SWIG_2(self, args);
10026           }
10027         }
10028       }
10029     }
10030   }
10031   if (argc == 4) {
10032     int _v;
10033     void *vptr = 0;
10034     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10035     _v = SWIG_CheckState(res);
10036     if (_v) {
10037       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10038       _v = SWIG_CheckState(res);
10039       if (_v) {
10040         void *ptr = 0;
10041         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10042         _v = SWIG_CheckState(res);
10043         if (_v) {
10044           {
10045             int res = SWIG_AsVal_double(argv[3], NULL);
10046             _v = SWIG_CheckState(res);
10047           }
10048           if (_v) {
10049             return _wrap_opt_add_inequality_constraint__SWIG_0(self, args);
10050           }
10051         }
10052       }
10053     }
10054   }
10055   
10056 fail:
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");
10065   return 0;
10066 }
10067
10068
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 ;
10072   nlopt::func arg2 ;
10073   void *arg3 = (void *) 0 ;
10074   nlopt_munge arg4 ;
10075   nlopt_munge arg5 ;
10076   double arg6 ;
10077   void *argp1 = 0 ;
10078   int res1 = 0 ;
10079   double val6 ;
10080   int ecode6 = 0 ;
10081   PyObject * obj0 = 0 ;
10082   PyObject * obj1 = 0 ;
10083   PyObject * obj2 = 0 ;
10084   
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 *""'"); 
10089   }
10090   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10091   {
10092     arg2 = func_python;
10093     arg3 = dup_pyfunc((void*) obj1);
10094     arg4 = free_pyfunc;
10095     arg5 = dup_pyfunc;
10096   }
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""'");
10100   } 
10101   arg6 = static_cast< double >(val6);
10102   try {
10103     (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5,arg6);
10104   }
10105   catch(std::bad_alloc &_e) {
10106     PyErr_SetString(PyExc_MemoryError, (_e).what());
10107     SWIG_fail;
10108     
10109   }
10110   catch(std::invalid_argument &_e) {
10111     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10112   }
10113   
10114   resultobj = SWIG_Py_Void();
10115   return resultobj;
10116 fail:
10117   return NULL;
10118 }
10119
10120
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 ;
10124   nlopt::func arg2 ;
10125   void *arg3 = (void *) 0 ;
10126   nlopt_munge arg4 ;
10127   nlopt_munge arg5 ;
10128   void *argp1 = 0 ;
10129   int res1 = 0 ;
10130   PyObject * obj0 = 0 ;
10131   PyObject * obj1 = 0 ;
10132   
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 *""'"); 
10137   }
10138   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10139   {
10140     arg2 = func_python;
10141     arg3 = dup_pyfunc((void*) obj1);
10142     arg4 = free_pyfunc;
10143     arg5 = dup_pyfunc;
10144   }
10145   try {
10146     (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5);
10147   }
10148   catch(std::bad_alloc &_e) {
10149     PyErr_SetString(PyExc_MemoryError, (_e).what());
10150     SWIG_fail;
10151     
10152   }
10153   catch(std::invalid_argument &_e) {
10154     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10155   }
10156   
10157   resultobj = SWIG_Py_Void();
10158   return resultobj;
10159 fail:
10160   return NULL;
10161 }
10162
10163
10164 SWIGINTERN PyObject *_wrap_opt_add_equality_constraint(PyObject *self, PyObject *args) {
10165   int argc;
10166   PyObject *argv[5];
10167   int ii;
10168   
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);
10173   }
10174   if (argc == 2) {
10175     int _v;
10176     void *vptr = 0;
10177     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10178     _v = SWIG_CheckState(res);
10179     if (_v) {
10180       {
10181         _v = PyCallable_Check(argv[1]);
10182       }
10183       if (_v) {
10184         if (argc <= 2) {
10185           return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10186         }
10187         if (argc <= 3) {
10188           return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10189         }
10190         if (argc <= 4) {
10191           return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10192         }
10193         return _wrap_opt_add_equality_constraint__SWIG_5(self, args);
10194       }
10195     }
10196   }
10197   if (argc == 3) {
10198     int _v;
10199     void *vptr = 0;
10200     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10201     _v = SWIG_CheckState(res);
10202     if (_v) {
10203       void *ptr = 0;
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);
10206       if (_v) {
10207         void *ptr = 0;
10208         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10209         _v = SWIG_CheckState(res);
10210         if (_v) {
10211           return _wrap_opt_add_equality_constraint__SWIG_3(self, args);
10212         }
10213       }
10214     }
10215   }
10216   if (argc == 3) {
10217     int _v;
10218     void *vptr = 0;
10219     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10220     _v = SWIG_CheckState(res);
10221     if (_v) {
10222       {
10223         _v = PyCallable_Check(argv[1]);
10224       }
10225       if (_v) {
10226         {
10227           int res = SWIG_AsVal_double(argv[2], NULL);
10228           _v = SWIG_CheckState(res);
10229         }
10230         if (_v) {
10231           return _wrap_opt_add_equality_constraint__SWIG_4(self, args);
10232         }
10233       }
10234     }
10235   }
10236   if (argc == 3) {
10237     int _v;
10238     void *vptr = 0;
10239     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10240     _v = SWIG_CheckState(res);
10241     if (_v) {
10242       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10243       _v = SWIG_CheckState(res);
10244       if (_v) {
10245         void *ptr = 0;
10246         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10247         _v = SWIG_CheckState(res);
10248         if (_v) {
10249           return _wrap_opt_add_equality_constraint__SWIG_1(self, args);
10250         }
10251       }
10252     }
10253   }
10254   if (argc == 4) {
10255     int _v;
10256     void *vptr = 0;
10257     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10258     _v = SWIG_CheckState(res);
10259     if (_v) {
10260       void *ptr = 0;
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);
10263       if (_v) {
10264         void *ptr = 0;
10265         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10266         _v = SWIG_CheckState(res);
10267         if (_v) {
10268           {
10269             int res = SWIG_AsVal_double(argv[3], NULL);
10270             _v = SWIG_CheckState(res);
10271           }
10272           if (_v) {
10273             return _wrap_opt_add_equality_constraint__SWIG_2(self, args);
10274           }
10275         }
10276       }
10277     }
10278   }
10279   if (argc == 4) {
10280     int _v;
10281     void *vptr = 0;
10282     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10283     _v = SWIG_CheckState(res);
10284     if (_v) {
10285       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_func, 0);
10286       _v = SWIG_CheckState(res);
10287       if (_v) {
10288         void *ptr = 0;
10289         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10290         _v = SWIG_CheckState(res);
10291         if (_v) {
10292           {
10293             int res = SWIG_AsVal_double(argv[3], NULL);
10294             _v = SWIG_CheckState(res);
10295           }
10296           if (_v) {
10297             return _wrap_opt_add_equality_constraint__SWIG_0(self, args);
10298           }
10299         }
10300       }
10301     }
10302   }
10303   
10304 fail:
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");
10313   return 0;
10314 }
10315
10316
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 ;
10322   nlopt_munge arg4 ;
10323   nlopt_munge arg5 ;
10324   std::vector< double,std::allocator< double > > *arg6 = 0 ;
10325   void *argp1 = 0 ;
10326   int res1 = 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 ;
10333   
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 *""'"); 
10338   }
10339   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10340   {
10341     arg2 = mfunc_python;
10342     arg3 = dup_pyfunc((void*) obj1);
10343     arg4 = free_pyfunc;
10344     arg5 = dup_pyfunc;
10345   }
10346   {
10347     npy_intp size[1] = {
10348       -1 
10349     };
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));
10354     arg6 = &arrayv6;
10355     {
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];
10361     }
10362   }
10363   try {
10364     (arg1)->add_inequality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double,std::allocator< double > > const &)*arg6);
10365   }
10366   catch(std::bad_alloc &_e) {
10367     PyErr_SetString(PyExc_MemoryError, (_e).what());
10368     SWIG_fail;
10369     
10370   }
10371   catch(std::invalid_argument &_e) {
10372     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10373   }
10374   
10375   resultobj = SWIG_Py_Void();
10376   {
10377     if (is_new_object6 && array6)
10378     {
10379       Py_DECREF(array6); 
10380     }
10381   }
10382   return resultobj;
10383 fail:
10384   {
10385     if (is_new_object6 && array6)
10386     {
10387       Py_DECREF(array6); 
10388     }
10389   }
10390   return NULL;
10391 }
10392
10393
10394 SWIGINTERN PyObject *_wrap_opt_add_inequality_mconstraint(PyObject *self, PyObject *args) {
10395   int argc;
10396   PyObject *argv[5];
10397   int ii;
10398   
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);
10403   }
10404   if (argc == 3) {
10405     int _v;
10406     void *vptr = 0;
10407     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10408     _v = SWIG_CheckState(res);
10409     if (_v) {
10410       {
10411         _v = PyCallable_Check(argv[1]);
10412       }
10413       if (_v) {
10414         {
10415           _v = is_array(argv[2]) || PySequence_Check(argv[2]);
10416         }
10417         if (_v) {
10418           return _wrap_opt_add_inequality_mconstraint__SWIG_1(self, args);
10419         }
10420       }
10421     }
10422   }
10423   if (argc == 4) {
10424     int _v;
10425     void *vptr = 0;
10426     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10427     _v = SWIG_CheckState(res);
10428     if (_v) {
10429       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_mfunc, 0);
10430       _v = SWIG_CheckState(res);
10431       if (_v) {
10432         void *ptr = 0;
10433         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10434         _v = SWIG_CheckState(res);
10435         if (_v) {
10436           {
10437             _v = is_array(argv[3]) || PySequence_Check(argv[3]);
10438           }
10439           if (_v) {
10440             return _wrap_opt_add_inequality_mconstraint__SWIG_0(self, args);
10441           }
10442         }
10443       }
10444     }
10445   }
10446   
10447 fail:
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");
10452   return 0;
10453 }
10454
10455
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 ;
10461   nlopt_munge arg4 ;
10462   nlopt_munge arg5 ;
10463   std::vector< double,std::allocator< double > > *arg6 = 0 ;
10464   void *argp1 = 0 ;
10465   int res1 = 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 ;
10472   
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 *""'"); 
10477   }
10478   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10479   {
10480     arg2 = mfunc_python;
10481     arg3 = dup_pyfunc((void*) obj1);
10482     arg4 = free_pyfunc;
10483     arg5 = dup_pyfunc;
10484   }
10485   {
10486     npy_intp size[1] = {
10487       -1 
10488     };
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));
10493     arg6 = &arrayv6;
10494     {
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];
10500     }
10501   }
10502   try {
10503     (arg1)->add_equality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double,std::allocator< double > > const &)*arg6);
10504   }
10505   catch(std::bad_alloc &_e) {
10506     PyErr_SetString(PyExc_MemoryError, (_e).what());
10507     SWIG_fail;
10508     
10509   }
10510   catch(std::invalid_argument &_e) {
10511     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10512   }
10513   
10514   resultobj = SWIG_Py_Void();
10515   {
10516     if (is_new_object6 && array6)
10517     {
10518       Py_DECREF(array6); 
10519     }
10520   }
10521   return resultobj;
10522 fail:
10523   {
10524     if (is_new_object6 && array6)
10525     {
10526       Py_DECREF(array6); 
10527     }
10528   }
10529   return NULL;
10530 }
10531
10532
10533 SWIGINTERN PyObject *_wrap_opt_add_equality_mconstraint(PyObject *self, PyObject *args) {
10534   int argc;
10535   PyObject *argv[5];
10536   int ii;
10537   
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);
10542   }
10543   if (argc == 3) {
10544     int _v;
10545     void *vptr = 0;
10546     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10547     _v = SWIG_CheckState(res);
10548     if (_v) {
10549       {
10550         _v = PyCallable_Check(argv[1]);
10551       }
10552       if (_v) {
10553         {
10554           _v = is_array(argv[2]) || PySequence_Check(argv[2]);
10555         }
10556         if (_v) {
10557           return _wrap_opt_add_equality_mconstraint__SWIG_1(self, args);
10558         }
10559       }
10560     }
10561   }
10562   if (argc == 4) {
10563     int _v;
10564     void *vptr = 0;
10565     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10566     _v = SWIG_CheckState(res);
10567     if (_v) {
10568       int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_nlopt_mfunc, 0);
10569       _v = SWIG_CheckState(res);
10570       if (_v) {
10571         void *ptr = 0;
10572         int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
10573         _v = SWIG_CheckState(res);
10574         if (_v) {
10575           {
10576             _v = is_array(argv[3]) || PySequence_Check(argv[3]);
10577           }
10578           if (_v) {
10579             return _wrap_opt_add_equality_mconstraint__SWIG_0(self, args);
10580           }
10581         }
10582       }
10583     }
10584   }
10585   
10586 fail:
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");
10591   return 0;
10592 }
10593
10594
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 ;
10598   double arg2 ;
10599   void *argp1 = 0 ;
10600   int res1 = 0 ;
10601   double val2 ;
10602   int ecode2 = 0 ;
10603   PyObject * obj0 = 0 ;
10604   PyObject * obj1 = 0 ;
10605   
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 *""'"); 
10610   }
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""'");
10615   } 
10616   arg2 = static_cast< double >(val2);
10617   try {
10618     (arg1)->set_lower_bounds(arg2);
10619   }
10620   catch(std::invalid_argument &_e) {
10621     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10622   }
10623   
10624   resultobj = SWIG_Py_Void();
10625   return resultobj;
10626 fail:
10627   return NULL;
10628 }
10629
10630
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 ;
10635   void *argp1 = 0 ;
10636   int res1 = 0 ;
10637   void *argp2 = 0 ;
10638   int res2 = 0 ;
10639   PyObject * obj0 = 0 ;
10640   PyObject * obj1 = 0 ;
10641   
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 *""'"); 
10646   }
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 > > &""'"); 
10651   }
10652   if (!argp2) {
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 > > &""'"); 
10654   }
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();
10658   return resultobj;
10659 fail:
10660   return NULL;
10661 }
10662
10663
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 ;
10667   void *argp1 = 0 ;
10668   int res1 = 0 ;
10669   PyObject * obj0 = 0 ;
10670   std::vector< double,std::allocator< double > > result;
10671   
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 *""'"); 
10676   }
10677   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10678   result = ((nlopt::opt const *)arg1)->get_lower_bounds();
10679   {
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);
10684   }
10685   return resultobj;
10686 fail:
10687   return NULL;
10688 }
10689
10690
10691 SWIGINTERN PyObject *_wrap_opt_get_lower_bounds(PyObject *self, PyObject *args) {
10692   int argc;
10693   PyObject *argv[3];
10694   int ii;
10695   
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);
10700   }
10701   if (argc == 1) {
10702     int _v;
10703     void *vptr = 0;
10704     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10705     _v = SWIG_CheckState(res);
10706     if (_v) {
10707       return _wrap_opt_get_lower_bounds__SWIG_1(self, args);
10708     }
10709   }
10710   if (argc == 2) {
10711     int _v;
10712     void *vptr = 0;
10713     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10714     _v = SWIG_CheckState(res);
10715     if (_v) {
10716       void *vptr = 0;
10717       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
10718       _v = SWIG_CheckState(res);
10719       if (_v) {
10720         return _wrap_opt_get_lower_bounds__SWIG_0(self, args);
10721       }
10722     }
10723   }
10724   
10725 fail:
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");
10730   return 0;
10731 }
10732
10733
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 ;
10738   void *argp1 = 0 ;
10739   int res1 = 0 ;
10740   PyArrayObject *array2 = NULL ;
10741   int is_new_object2 = 0 ;
10742   std::vector< double > arrayv2 ;
10743   PyObject * obj0 = 0 ;
10744   PyObject * obj1 = 0 ;
10745   
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 *""'"); 
10750   }
10751   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10752   {
10753     npy_intp size[1] = {
10754       -1 
10755     };
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));
10760     arg2 = &arrayv2;
10761     {
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];
10767     }
10768   }
10769   try {
10770     (arg1)->set_lower_bounds((std::vector< double,std::allocator< double > > const &)*arg2);
10771   }
10772   catch(std::invalid_argument &_e) {
10773     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10774   }
10775   
10776   resultobj = SWIG_Py_Void();
10777   {
10778     if (is_new_object2 && array2)
10779     {
10780       Py_DECREF(array2); 
10781     }
10782   }
10783   return resultobj;
10784 fail:
10785   {
10786     if (is_new_object2 && array2)
10787     {
10788       Py_DECREF(array2); 
10789     }
10790   }
10791   return NULL;
10792 }
10793
10794
10795 SWIGINTERN PyObject *_wrap_opt_set_lower_bounds(PyObject *self, PyObject *args) {
10796   int argc;
10797   PyObject *argv[3];
10798   int ii;
10799   
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);
10804   }
10805   if (argc == 2) {
10806     int _v;
10807     void *vptr = 0;
10808     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10809     _v = SWIG_CheckState(res);
10810     if (_v) {
10811       {
10812         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
10813       }
10814       if (_v) {
10815         return _wrap_opt_set_lower_bounds__SWIG_1(self, args);
10816       }
10817     }
10818   }
10819   if (argc == 2) {
10820     int _v;
10821     void *vptr = 0;
10822     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10823     _v = SWIG_CheckState(res);
10824     if (_v) {
10825       {
10826         int res = SWIG_AsVal_double(argv[1], NULL);
10827         _v = SWIG_CheckState(res);
10828       }
10829       if (_v) {
10830         return _wrap_opt_set_lower_bounds__SWIG_0(self, args);
10831       }
10832     }
10833   }
10834   
10835 fail:
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");
10840   return 0;
10841 }
10842
10843
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 ;
10847   double arg2 ;
10848   void *argp1 = 0 ;
10849   int res1 = 0 ;
10850   double val2 ;
10851   int ecode2 = 0 ;
10852   PyObject * obj0 = 0 ;
10853   PyObject * obj1 = 0 ;
10854   
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 *""'"); 
10859   }
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""'");
10864   } 
10865   arg2 = static_cast< double >(val2);
10866   try {
10867     (arg1)->set_upper_bounds(arg2);
10868   }
10869   catch(std::invalid_argument &_e) {
10870     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
10871   }
10872   
10873   resultobj = SWIG_Py_Void();
10874   return resultobj;
10875 fail:
10876   return NULL;
10877 }
10878
10879
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 ;
10884   void *argp1 = 0 ;
10885   int res1 = 0 ;
10886   void *argp2 = 0 ;
10887   int res2 = 0 ;
10888   PyObject * obj0 = 0 ;
10889   PyObject * obj1 = 0 ;
10890   
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 *""'"); 
10895   }
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 > > &""'"); 
10900   }
10901   if (!argp2) {
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 > > &""'"); 
10903   }
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();
10907   return resultobj;
10908 fail:
10909   return NULL;
10910 }
10911
10912
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 ;
10916   void *argp1 = 0 ;
10917   int res1 = 0 ;
10918   PyObject * obj0 = 0 ;
10919   std::vector< double,std::allocator< double > > result;
10920   
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 *""'"); 
10925   }
10926   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
10927   result = ((nlopt::opt const *)arg1)->get_upper_bounds();
10928   {
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);
10933   }
10934   return resultobj;
10935 fail:
10936   return NULL;
10937 }
10938
10939
10940 SWIGINTERN PyObject *_wrap_opt_get_upper_bounds(PyObject *self, PyObject *args) {
10941   int argc;
10942   PyObject *argv[3];
10943   int ii;
10944   
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);
10949   }
10950   if (argc == 1) {
10951     int _v;
10952     void *vptr = 0;
10953     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10954     _v = SWIG_CheckState(res);
10955     if (_v) {
10956       return _wrap_opt_get_upper_bounds__SWIG_1(self, args);
10957     }
10958   }
10959   if (argc == 2) {
10960     int _v;
10961     void *vptr = 0;
10962     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
10963     _v = SWIG_CheckState(res);
10964     if (_v) {
10965       void *vptr = 0;
10966       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
10967       _v = SWIG_CheckState(res);
10968       if (_v) {
10969         return _wrap_opt_get_upper_bounds__SWIG_0(self, args);
10970       }
10971     }
10972   }
10973   
10974 fail:
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");
10979   return 0;
10980 }
10981
10982
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 ;
10987   void *argp1 = 0 ;
10988   int res1 = 0 ;
10989   PyArrayObject *array2 = NULL ;
10990   int is_new_object2 = 0 ;
10991   std::vector< double > arrayv2 ;
10992   PyObject * obj0 = 0 ;
10993   PyObject * obj1 = 0 ;
10994   
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 *""'"); 
10999   }
11000   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11001   {
11002     npy_intp size[1] = {
11003       -1 
11004     };
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));
11009     arg2 = &arrayv2;
11010     {
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];
11016     }
11017   }
11018   try {
11019     (arg1)->set_upper_bounds((std::vector< double,std::allocator< double > > const &)*arg2);
11020   }
11021   catch(std::invalid_argument &_e) {
11022     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11023   }
11024   
11025   resultobj = SWIG_Py_Void();
11026   {
11027     if (is_new_object2 && array2)
11028     {
11029       Py_DECREF(array2); 
11030     }
11031   }
11032   return resultobj;
11033 fail:
11034   {
11035     if (is_new_object2 && array2)
11036     {
11037       Py_DECREF(array2); 
11038     }
11039   }
11040   return NULL;
11041 }
11042
11043
11044 SWIGINTERN PyObject *_wrap_opt_set_upper_bounds(PyObject *self, PyObject *args) {
11045   int argc;
11046   PyObject *argv[3];
11047   int ii;
11048   
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);
11053   }
11054   if (argc == 2) {
11055     int _v;
11056     void *vptr = 0;
11057     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11058     _v = SWIG_CheckState(res);
11059     if (_v) {
11060       {
11061         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
11062       }
11063       if (_v) {
11064         return _wrap_opt_set_upper_bounds__SWIG_1(self, args);
11065       }
11066     }
11067   }
11068   if (argc == 2) {
11069     int _v;
11070     void *vptr = 0;
11071     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11072     _v = SWIG_CheckState(res);
11073     if (_v) {
11074       {
11075         int res = SWIG_AsVal_double(argv[1], NULL);
11076         _v = SWIG_CheckState(res);
11077       }
11078       if (_v) {
11079         return _wrap_opt_set_upper_bounds__SWIG_0(self, args);
11080       }
11081     }
11082   }
11083   
11084 fail:
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");
11089   return 0;
11090 }
11091
11092
11093 SWIGINTERN PyObject *_wrap_opt_get_stopval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11094   PyObject *resultobj = 0;
11095   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11096   void *argp1 = 0 ;
11097   int res1 = 0 ;
11098   PyObject * obj0 = 0 ;
11099   double result;
11100   
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 *""'"); 
11105   }
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));
11109   return resultobj;
11110 fail:
11111   return NULL;
11112 }
11113
11114
11115 SWIGINTERN PyObject *_wrap_opt_set_stopval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11116   PyObject *resultobj = 0;
11117   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11118   double arg2 ;
11119   void *argp1 = 0 ;
11120   int res1 = 0 ;
11121   double val2 ;
11122   int ecode2 = 0 ;
11123   PyObject * obj0 = 0 ;
11124   PyObject * obj1 = 0 ;
11125   
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 *""'"); 
11130   }
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""'");
11135   } 
11136   arg2 = static_cast< double >(val2);
11137   try {
11138     (arg1)->set_stopval(arg2);
11139   }
11140   catch(std::invalid_argument &_e) {
11141     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11142   }
11143   
11144   resultobj = SWIG_Py_Void();
11145   return resultobj;
11146 fail:
11147   return NULL;
11148 }
11149
11150
11151 SWIGINTERN PyObject *_wrap_opt_get_ftol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11152   PyObject *resultobj = 0;
11153   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11154   void *argp1 = 0 ;
11155   int res1 = 0 ;
11156   PyObject * obj0 = 0 ;
11157   double result;
11158   
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 *""'"); 
11163   }
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));
11167   return resultobj;
11168 fail:
11169   return NULL;
11170 }
11171
11172
11173 SWIGINTERN PyObject *_wrap_opt_set_ftol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11174   PyObject *resultobj = 0;
11175   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11176   double arg2 ;
11177   void *argp1 = 0 ;
11178   int res1 = 0 ;
11179   double val2 ;
11180   int ecode2 = 0 ;
11181   PyObject * obj0 = 0 ;
11182   PyObject * obj1 = 0 ;
11183   
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 *""'"); 
11188   }
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""'");
11193   } 
11194   arg2 = static_cast< double >(val2);
11195   try {
11196     (arg1)->set_ftol_rel(arg2);
11197   }
11198   catch(std::invalid_argument &_e) {
11199     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11200   }
11201   
11202   resultobj = SWIG_Py_Void();
11203   return resultobj;
11204 fail:
11205   return NULL;
11206 }
11207
11208
11209 SWIGINTERN PyObject *_wrap_opt_get_ftol_abs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11210   PyObject *resultobj = 0;
11211   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11212   void *argp1 = 0 ;
11213   int res1 = 0 ;
11214   PyObject * obj0 = 0 ;
11215   double result;
11216   
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 *""'"); 
11221   }
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));
11225   return resultobj;
11226 fail:
11227   return NULL;
11228 }
11229
11230
11231 SWIGINTERN PyObject *_wrap_opt_set_ftol_abs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11232   PyObject *resultobj = 0;
11233   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11234   double arg2 ;
11235   void *argp1 = 0 ;
11236   int res1 = 0 ;
11237   double val2 ;
11238   int ecode2 = 0 ;
11239   PyObject * obj0 = 0 ;
11240   PyObject * obj1 = 0 ;
11241   
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 *""'"); 
11246   }
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""'");
11251   } 
11252   arg2 = static_cast< double >(val2);
11253   try {
11254     (arg1)->set_ftol_abs(arg2);
11255   }
11256   catch(std::invalid_argument &_e) {
11257     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11258   }
11259   
11260   resultobj = SWIG_Py_Void();
11261   return resultobj;
11262 fail:
11263   return NULL;
11264 }
11265
11266
11267 SWIGINTERN PyObject *_wrap_opt_get_xtol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11268   PyObject *resultobj = 0;
11269   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11270   void *argp1 = 0 ;
11271   int res1 = 0 ;
11272   PyObject * obj0 = 0 ;
11273   double result;
11274   
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 *""'"); 
11279   }
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));
11283   return resultobj;
11284 fail:
11285   return NULL;
11286 }
11287
11288
11289 SWIGINTERN PyObject *_wrap_opt_set_xtol_rel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11290   PyObject *resultobj = 0;
11291   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11292   double arg2 ;
11293   void *argp1 = 0 ;
11294   int res1 = 0 ;
11295   double val2 ;
11296   int ecode2 = 0 ;
11297   PyObject * obj0 = 0 ;
11298   PyObject * obj1 = 0 ;
11299   
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 *""'"); 
11304   }
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""'");
11309   } 
11310   arg2 = static_cast< double >(val2);
11311   try {
11312     (arg1)->set_xtol_rel(arg2);
11313   }
11314   catch(std::invalid_argument &_e) {
11315     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11316   }
11317   
11318   resultobj = SWIG_Py_Void();
11319   return resultobj;
11320 fail:
11321   return NULL;
11322 }
11323
11324
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 ;
11328   double arg2 ;
11329   void *argp1 = 0 ;
11330   int res1 = 0 ;
11331   double val2 ;
11332   int ecode2 = 0 ;
11333   PyObject * obj0 = 0 ;
11334   PyObject * obj1 = 0 ;
11335   
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 *""'"); 
11340   }
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""'");
11345   } 
11346   arg2 = static_cast< double >(val2);
11347   try {
11348     (arg1)->set_xtol_abs(arg2);
11349   }
11350   catch(std::invalid_argument &_e) {
11351     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11352   }
11353   
11354   resultobj = SWIG_Py_Void();
11355   return resultobj;
11356 fail:
11357   return NULL;
11358 }
11359
11360
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 ;
11365   void *argp1 = 0 ;
11366   int res1 = 0 ;
11367   void *argp2 = 0 ;
11368   int res2 = 0 ;
11369   PyObject * obj0 = 0 ;
11370   PyObject * obj1 = 0 ;
11371   
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 *""'"); 
11376   }
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 > > &""'"); 
11381   }
11382   if (!argp2) {
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 > > &""'"); 
11384   }
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();
11388   return resultobj;
11389 fail:
11390   return NULL;
11391 }
11392
11393
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 ;
11397   void *argp1 = 0 ;
11398   int res1 = 0 ;
11399   PyObject * obj0 = 0 ;
11400   std::vector< double,std::allocator< double > > result;
11401   
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 *""'"); 
11406   }
11407   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11408   result = ((nlopt::opt const *)arg1)->get_xtol_abs();
11409   {
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);
11414   }
11415   return resultobj;
11416 fail:
11417   return NULL;
11418 }
11419
11420
11421 SWIGINTERN PyObject *_wrap_opt_get_xtol_abs(PyObject *self, PyObject *args) {
11422   int argc;
11423   PyObject *argv[3];
11424   int ii;
11425   
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);
11430   }
11431   if (argc == 1) {
11432     int _v;
11433     void *vptr = 0;
11434     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11435     _v = SWIG_CheckState(res);
11436     if (_v) {
11437       return _wrap_opt_get_xtol_abs__SWIG_1(self, args);
11438     }
11439   }
11440   if (argc == 2) {
11441     int _v;
11442     void *vptr = 0;
11443     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11444     _v = SWIG_CheckState(res);
11445     if (_v) {
11446       void *vptr = 0;
11447       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
11448       _v = SWIG_CheckState(res);
11449       if (_v) {
11450         return _wrap_opt_get_xtol_abs__SWIG_0(self, args);
11451       }
11452     }
11453   }
11454   
11455 fail:
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");
11460   return 0;
11461 }
11462
11463
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 ;
11468   void *argp1 = 0 ;
11469   int res1 = 0 ;
11470   PyArrayObject *array2 = NULL ;
11471   int is_new_object2 = 0 ;
11472   std::vector< double > arrayv2 ;
11473   PyObject * obj0 = 0 ;
11474   PyObject * obj1 = 0 ;
11475   
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 *""'"); 
11480   }
11481   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11482   {
11483     npy_intp size[1] = {
11484       -1 
11485     };
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));
11490     arg2 = &arrayv2;
11491     {
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];
11497     }
11498   }
11499   try {
11500     (arg1)->set_xtol_abs((std::vector< double,std::allocator< double > > const &)*arg2);
11501   }
11502   catch(std::invalid_argument &_e) {
11503     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11504   }
11505   
11506   resultobj = SWIG_Py_Void();
11507   {
11508     if (is_new_object2 && array2)
11509     {
11510       Py_DECREF(array2); 
11511     }
11512   }
11513   return resultobj;
11514 fail:
11515   {
11516     if (is_new_object2 && array2)
11517     {
11518       Py_DECREF(array2); 
11519     }
11520   }
11521   return NULL;
11522 }
11523
11524
11525 SWIGINTERN PyObject *_wrap_opt_set_xtol_abs(PyObject *self, PyObject *args) {
11526   int argc;
11527   PyObject *argv[3];
11528   int ii;
11529   
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);
11534   }
11535   if (argc == 2) {
11536     int _v;
11537     void *vptr = 0;
11538     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11539     _v = SWIG_CheckState(res);
11540     if (_v) {
11541       {
11542         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
11543       }
11544       if (_v) {
11545         return _wrap_opt_set_xtol_abs__SWIG_1(self, args);
11546       }
11547     }
11548   }
11549   if (argc == 2) {
11550     int _v;
11551     void *vptr = 0;
11552     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
11553     _v = SWIG_CheckState(res);
11554     if (_v) {
11555       {
11556         int res = SWIG_AsVal_double(argv[1], NULL);
11557         _v = SWIG_CheckState(res);
11558       }
11559       if (_v) {
11560         return _wrap_opt_set_xtol_abs__SWIG_0(self, args);
11561       }
11562     }
11563   }
11564   
11565 fail:
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");
11570   return 0;
11571 }
11572
11573
11574 SWIGINTERN PyObject *_wrap_opt_get_maxeval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11575   PyObject *resultobj = 0;
11576   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11577   void *argp1 = 0 ;
11578   int res1 = 0 ;
11579   PyObject * obj0 = 0 ;
11580   int result;
11581   
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 *""'"); 
11586   }
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));
11590   return resultobj;
11591 fail:
11592   return NULL;
11593 }
11594
11595
11596 SWIGINTERN PyObject *_wrap_opt_set_maxeval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11597   PyObject *resultobj = 0;
11598   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11599   int arg2 ;
11600   void *argp1 = 0 ;
11601   int res1 = 0 ;
11602   int val2 ;
11603   int ecode2 = 0 ;
11604   PyObject * obj0 = 0 ;
11605   PyObject * obj1 = 0 ;
11606   
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 *""'"); 
11611   }
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""'");
11616   } 
11617   arg2 = static_cast< int >(val2);
11618   try {
11619     (arg1)->set_maxeval(arg2);
11620   }
11621   catch(std::invalid_argument &_e) {
11622     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11623   }
11624   
11625   resultobj = SWIG_Py_Void();
11626   return resultobj;
11627 fail:
11628   return NULL;
11629 }
11630
11631
11632 SWIGINTERN PyObject *_wrap_opt_get_maxtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11633   PyObject *resultobj = 0;
11634   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11635   void *argp1 = 0 ;
11636   int res1 = 0 ;
11637   PyObject * obj0 = 0 ;
11638   double result;
11639   
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 *""'"); 
11644   }
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));
11648   return resultobj;
11649 fail:
11650   return NULL;
11651 }
11652
11653
11654 SWIGINTERN PyObject *_wrap_opt_set_maxtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11655   PyObject *resultobj = 0;
11656   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11657   double arg2 ;
11658   void *argp1 = 0 ;
11659   int res1 = 0 ;
11660   double val2 ;
11661   int ecode2 = 0 ;
11662   PyObject * obj0 = 0 ;
11663   PyObject * obj1 = 0 ;
11664   
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 *""'"); 
11669   }
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""'");
11674   } 
11675   arg2 = static_cast< double >(val2);
11676   try {
11677     (arg1)->set_maxtime(arg2);
11678   }
11679   catch(std::invalid_argument &_e) {
11680     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11681   }
11682   
11683   resultobj = SWIG_Py_Void();
11684   return resultobj;
11685 fail:
11686   return NULL;
11687 }
11688
11689
11690 SWIGINTERN PyObject *_wrap_opt_get_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11691   PyObject *resultobj = 0;
11692   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11693   void *argp1 = 0 ;
11694   int res1 = 0 ;
11695   PyObject * obj0 = 0 ;
11696   int result;
11697   
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 *""'"); 
11702   }
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));
11706   return resultobj;
11707 fail:
11708   return NULL;
11709 }
11710
11711
11712 SWIGINTERN PyObject *_wrap_opt_set_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11713   PyObject *resultobj = 0;
11714   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11715   int arg2 ;
11716   void *argp1 = 0 ;
11717   int res1 = 0 ;
11718   int val2 ;
11719   int ecode2 = 0 ;
11720   PyObject * obj0 = 0 ;
11721   PyObject * obj1 = 0 ;
11722   
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 *""'"); 
11727   }
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""'");
11732   } 
11733   arg2 = static_cast< int >(val2);
11734   try {
11735     (arg1)->set_force_stop(arg2);
11736   }
11737   catch(std::invalid_argument &_e) {
11738     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11739   }
11740   
11741   resultobj = SWIG_Py_Void();
11742   return resultobj;
11743 fail:
11744   return NULL;
11745 }
11746
11747
11748 SWIGINTERN PyObject *_wrap_opt_force_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11749   PyObject *resultobj = 0;
11750   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11751   void *argp1 = 0 ;
11752   int res1 = 0 ;
11753   PyObject * obj0 = 0 ;
11754   
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 *""'"); 
11759   }
11760   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
11761   try {
11762     (arg1)->force_stop();
11763   }
11764   catch(std::invalid_argument &_e) {
11765     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11766   }
11767   
11768   resultobj = SWIG_Py_Void();
11769   return resultobj;
11770 fail:
11771   return NULL;
11772 }
11773
11774
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 ;
11779   void *argp1 = 0 ;
11780   int res1 = 0 ;
11781   void *argp2 = 0 ;
11782   int res2 = 0 ;
11783   PyObject * obj0 = 0 ;
11784   PyObject * obj1 = 0 ;
11785   
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 *""'"); 
11790   }
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 &""'"); 
11795   }
11796   if (!argp2) {
11797     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "opt_set_local_optimizer" "', argument " "2"" of type '" "nlopt::opt const &""'"); 
11798   }
11799   arg2 = reinterpret_cast< nlopt::opt * >(argp2);
11800   try {
11801     (arg1)->set_local_optimizer((nlopt::opt const &)*arg2);
11802   }
11803   catch(std::bad_alloc &_e) {
11804     PyErr_SetString(PyExc_MemoryError, (_e).what());
11805     SWIG_fail;
11806     
11807   }
11808   catch(std::invalid_argument &_e) {
11809     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11810   }
11811   
11812   resultobj = SWIG_Py_Void();
11813   return resultobj;
11814 fail:
11815   return NULL;
11816 }
11817
11818
11819 SWIGINTERN PyObject *_wrap_opt_get_population(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11820   PyObject *resultobj = 0;
11821   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11822   void *argp1 = 0 ;
11823   int res1 = 0 ;
11824   PyObject * obj0 = 0 ;
11825   unsigned int result;
11826   
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 *""'"); 
11831   }
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));
11835   return resultobj;
11836 fail:
11837   return NULL;
11838 }
11839
11840
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 ;
11845   void *argp1 = 0 ;
11846   int res1 = 0 ;
11847   unsigned int val2 ;
11848   int ecode2 = 0 ;
11849   PyObject * obj0 = 0 ;
11850   PyObject * obj1 = 0 ;
11851   
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 *""'"); 
11856   }
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""'");
11861   } 
11862   arg2 = static_cast< unsigned int >(val2);
11863   try {
11864     (arg1)->set_population(arg2);
11865   }
11866   catch(std::invalid_argument &_e) {
11867     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11868   }
11869   
11870   resultobj = SWIG_Py_Void();
11871   return resultobj;
11872 fail:
11873   return NULL;
11874 }
11875
11876
11877 SWIGINTERN PyObject *_wrap_opt_get_vector_storage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11878   PyObject *resultobj = 0;
11879   nlopt::opt *arg1 = (nlopt::opt *) 0 ;
11880   void *argp1 = 0 ;
11881   int res1 = 0 ;
11882   PyObject * obj0 = 0 ;
11883   unsigned int result;
11884   
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 *""'"); 
11889   }
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));
11893   return resultobj;
11894 fail:
11895   return NULL;
11896 }
11897
11898
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 ;
11903   void *argp1 = 0 ;
11904   int res1 = 0 ;
11905   unsigned int val2 ;
11906   int ecode2 = 0 ;
11907   PyObject * obj0 = 0 ;
11908   PyObject * obj1 = 0 ;
11909   
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 *""'"); 
11914   }
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""'");
11919   } 
11920   arg2 = static_cast< unsigned int >(val2);
11921   try {
11922     (arg1)->set_vector_storage(arg2);
11923   }
11924   catch(std::invalid_argument &_e) {
11925     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11926   }
11927   
11928   resultobj = SWIG_Py_Void();
11929   return resultobj;
11930 fail:
11931   return NULL;
11932 }
11933
11934
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 ;
11938   double arg2 ;
11939   void *argp1 = 0 ;
11940   int res1 = 0 ;
11941   double val2 ;
11942   int ecode2 = 0 ;
11943   PyObject * obj0 = 0 ;
11944   PyObject * obj1 = 0 ;
11945   
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 *""'"); 
11950   }
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""'");
11955   } 
11956   arg2 = static_cast< double >(val2);
11957   try {
11958     (arg1)->set_initial_step(arg2);
11959   }
11960   catch(std::invalid_argument &_e) {
11961     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
11962   }
11963   
11964   resultobj = SWIG_Py_Void();
11965   return resultobj;
11966 fail:
11967   return NULL;
11968 }
11969
11970
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 ;
11975   void *argp1 = 0 ;
11976   int res1 = 0 ;
11977   void *argp2 = 0 ;
11978   int res2 = 0 ;
11979   PyObject * obj0 = 0 ;
11980   PyObject * obj1 = 0 ;
11981   
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 *""'"); 
11986   }
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 > > &""'"); 
11991   }
11992   if (!argp2) {
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 > > &""'"); 
11994   }
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();
11998   return resultobj;
11999 fail:
12000   return NULL;
12001 }
12002
12003
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 ;
12007   void *argp1 = 0 ;
12008   int res1 = 0 ;
12009   PyObject * obj0 = 0 ;
12010   std::vector< double,std::allocator< double > > result;
12011   
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 *""'"); 
12016   }
12017   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12018   result = ((nlopt::opt const *)arg1)->get_initial_step();
12019   {
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);
12024   }
12025   return resultobj;
12026 fail:
12027   return NULL;
12028 }
12029
12030
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 ;
12035   void *argp1 = 0 ;
12036   int res1 = 0 ;
12037   PyArrayObject *array2 = NULL ;
12038   int is_new_object2 = 0 ;
12039   std::vector< double > arrayv2 ;
12040   PyObject * obj0 = 0 ;
12041   PyObject * obj1 = 0 ;
12042   
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 *""'"); 
12047   }
12048   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12049   {
12050     npy_intp size[1] = {
12051       -1 
12052     };
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));
12057     arg2 = &arrayv2;
12058     {
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];
12064     }
12065   }
12066   try {
12067     (arg1)->set_initial_step((std::vector< double,std::allocator< double > > const &)*arg2);
12068   }
12069   catch(std::invalid_argument &_e) {
12070     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
12071   }
12072   
12073   resultobj = SWIG_Py_Void();
12074   {
12075     if (is_new_object2 && array2)
12076     {
12077       Py_DECREF(array2); 
12078     }
12079   }
12080   return resultobj;
12081 fail:
12082   {
12083     if (is_new_object2 && array2)
12084     {
12085       Py_DECREF(array2); 
12086     }
12087   }
12088   return NULL;
12089 }
12090
12091
12092 SWIGINTERN PyObject *_wrap_opt_set_initial_step(PyObject *self, PyObject *args) {
12093   int argc;
12094   PyObject *argv[3];
12095   int ii;
12096   
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);
12101   }
12102   if (argc == 2) {
12103     int _v;
12104     void *vptr = 0;
12105     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12106     _v = SWIG_CheckState(res);
12107     if (_v) {
12108       {
12109         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
12110       }
12111       if (_v) {
12112         return _wrap_opt_set_initial_step__SWIG_1(self, args);
12113       }
12114     }
12115   }
12116   if (argc == 2) {
12117     int _v;
12118     void *vptr = 0;
12119     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12120     _v = SWIG_CheckState(res);
12121     if (_v) {
12122       {
12123         int res = SWIG_AsVal_double(argv[1], NULL);
12124         _v = SWIG_CheckState(res);
12125       }
12126       if (_v) {
12127         return _wrap_opt_set_initial_step__SWIG_0(self, args);
12128       }
12129     }
12130   }
12131   
12132 fail:
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");
12137   return 0;
12138 }
12139
12140
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 ;
12145   void *argp1 = 0 ;
12146   int res1 = 0 ;
12147   PyArrayObject *array2 = NULL ;
12148   int is_new_object2 = 0 ;
12149   std::vector< double > arrayv2 ;
12150   PyObject * obj0 = 0 ;
12151   PyObject * obj1 = 0 ;
12152   
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 *""'"); 
12157   }
12158   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12159   {
12160     npy_intp size[1] = {
12161       -1 
12162     };
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));
12167     arg2 = &arrayv2;
12168     {
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];
12174     }
12175   }
12176   try {
12177     (arg1)->set_default_initial_step((std::vector< double,std::allocator< double > > const &)*arg2);
12178   }
12179   catch(std::bad_alloc &_e) {
12180     PyErr_SetString(PyExc_MemoryError, (_e).what());
12181     SWIG_fail;
12182     
12183   }
12184   catch(std::invalid_argument &_e) {
12185     SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
12186   }
12187   
12188   resultobj = SWIG_Py_Void();
12189   {
12190     if (is_new_object2 && array2)
12191     {
12192       Py_DECREF(array2); 
12193     }
12194   }
12195   return resultobj;
12196 fail:
12197   {
12198     if (is_new_object2 && array2)
12199     {
12200       Py_DECREF(array2); 
12201     }
12202   }
12203   return NULL;
12204 }
12205
12206
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 ;
12212   void *argp1 = 0 ;
12213   int res1 = 0 ;
12214   PyArrayObject *array2 = NULL ;
12215   int is_new_object2 = 0 ;
12216   std::vector< double > arrayv2 ;
12217   void *argp3 = 0 ;
12218   int res3 = 0 ;
12219   PyObject * obj0 = 0 ;
12220   PyObject * obj1 = 0 ;
12221   PyObject * obj2 = 0 ;
12222   
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 *""'"); 
12227   }
12228   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12229   {
12230     npy_intp size[1] = {
12231       -1 
12232     };
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));
12237     arg2 = &arrayv2;
12238     {
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];
12244     }
12245   }
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 > > &""'"); 
12249   }
12250   if (!argp3) {
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 > > &""'"); 
12252   }
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();
12256   {
12257     if (is_new_object2 && array2)
12258     {
12259       Py_DECREF(array2); 
12260     }
12261   }
12262   return resultobj;
12263 fail:
12264   {
12265     if (is_new_object2 && array2)
12266     {
12267       Py_DECREF(array2); 
12268     }
12269   }
12270   return NULL;
12271 }
12272
12273
12274 SWIGINTERN PyObject *_wrap_opt_get_initial_step(PyObject *self, PyObject *args) {
12275   int argc;
12276   PyObject *argv[4];
12277   int ii;
12278   
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);
12283   }
12284   if (argc == 1) {
12285     int _v;
12286     void *vptr = 0;
12287     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12288     _v = SWIG_CheckState(res);
12289     if (_v) {
12290       return _wrap_opt_get_initial_step__SWIG_1(self, args);
12291     }
12292   }
12293   if (argc == 2) {
12294     int _v;
12295     void *vptr = 0;
12296     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12297     _v = SWIG_CheckState(res);
12298     if (_v) {
12299       void *vptr = 0;
12300       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
12301       _v = SWIG_CheckState(res);
12302       if (_v) {
12303         return _wrap_opt_get_initial_step__SWIG_0(self, args);
12304       }
12305     }
12306   }
12307   if (argc == 3) {
12308     int _v;
12309     void *vptr = 0;
12310     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_nlopt__opt, 0);
12311     _v = SWIG_CheckState(res);
12312     if (_v) {
12313       {
12314         _v = is_array(argv[1]) || PySequence_Check(argv[1]);
12315       }
12316       if (_v) {
12317         void *vptr = 0;
12318         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
12319         _v = SWIG_CheckState(res);
12320         if (_v) {
12321           return _wrap_opt_get_initial_step__SWIG_2(self, args);
12322         }
12323       }
12324     }
12325   }
12326   
12327 fail:
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");
12333   return 0;
12334 }
12335
12336
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 ;
12341   void *argp1 = 0 ;
12342   int res1 = 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;
12349   
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 *""'"); 
12354   }
12355   arg1 = reinterpret_cast< nlopt::opt * >(argp1);
12356   {
12357     npy_intp size[1] = {
12358       -1 
12359     };
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));
12364     arg2 = &arrayv2;
12365     {
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];
12371     }
12372   }
12373   result = ((nlopt::opt const *)arg1)->get_initial_step_((std::vector< double,std::allocator< double > > const &)*arg2);
12374   {
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);
12379   }
12380   {
12381     if (is_new_object2 && array2)
12382     {
12383       Py_DECREF(array2); 
12384     }
12385   }
12386   return resultobj;
12387 fail:
12388   {
12389     if (is_new_object2 && array2)
12390     {
12391       Py_DECREF(array2); 
12392     }
12393   }
12394   return NULL;
12395 }
12396
12397
12398 SWIGINTERN PyObject *opt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12399   PyObject *obj;
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();
12403 }
12404
12405 SWIGINTERN PyObject *_wrap_srand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12406   PyObject *resultobj = 0;
12407   unsigned long arg1 ;
12408   unsigned long val1 ;
12409   int ecode1 = 0 ;
12410   PyObject * obj0 = 0 ;
12411   
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""'");
12416   } 
12417   arg1 = static_cast< unsigned long >(val1);
12418   nlopt::srand(arg1);
12419   resultobj = SWIG_Py_Void();
12420   return resultobj;
12421 fail:
12422   return NULL;
12423 }
12424
12425
12426 SWIGINTERN PyObject *_wrap_srand_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12427   PyObject *resultobj = 0;
12428   
12429   if (!PyArg_ParseTuple(args,(char *)":srand_time")) SWIG_fail;
12430   nlopt::srand_time();
12431   resultobj = SWIG_Py_Void();
12432   return resultobj;
12433 fail:
12434   return NULL;
12435 }
12436
12437
12438 SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12439   PyObject *resultobj = 0;
12440   int *arg1 = 0 ;
12441   int *arg2 = 0 ;
12442   int *arg3 = 0 ;
12443   void *argp1 = 0 ;
12444   int res1 = 0 ;
12445   void *argp2 = 0 ;
12446   int res2 = 0 ;
12447   void *argp3 = 0 ;
12448   int res3 = 0 ;
12449   PyObject * obj0 = 0 ;
12450   PyObject * obj1 = 0 ;
12451   PyObject * obj2 = 0 ;
12452   
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 &""'"); 
12457   }
12458   if (!argp1) {
12459     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "1"" of type '" "int &""'"); 
12460   }
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 &""'"); 
12465   }
12466   if (!argp2) {
12467     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "2"" of type '" "int &""'"); 
12468   }
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 &""'"); 
12473   }
12474   if (!argp3) {
12475     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "version" "', argument " "3"" of type '" "int &""'"); 
12476   }
12477   arg3 = reinterpret_cast< int * >(argp3);
12478   nlopt::version(*arg1,*arg2,*arg3);
12479   resultobj = SWIG_Py_Void();
12480   return resultobj;
12481 fail:
12482   return NULL;
12483 }
12484
12485
12486 SWIGINTERN PyObject *_wrap_version_major(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12487   PyObject *resultobj = 0;
12488   int result;
12489   
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));
12493   return resultobj;
12494 fail:
12495   return NULL;
12496 }
12497
12498
12499 SWIGINTERN PyObject *_wrap_version_minor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12500   PyObject *resultobj = 0;
12501   int result;
12502   
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));
12506   return resultobj;
12507 fail:
12508   return NULL;
12509 }
12510
12511
12512 SWIGINTERN PyObject *_wrap_version_bugfix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12513   PyObject *resultobj = 0;
12514   int result;
12515   
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));
12519   return resultobj;
12520 fail:
12521   return NULL;
12522 }
12523
12524
12525 SWIGINTERN PyObject *_wrap_algorithm_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12526   PyObject *resultobj = 0;
12527   nlopt::algorithm arg1 ;
12528   int val1 ;
12529   int ecode1 = 0 ;
12530   PyObject * obj0 = 0 ;
12531   char *result = 0 ;
12532   
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""'");
12537   } 
12538   arg1 = static_cast< nlopt::algorithm >(val1);
12539   result = (char *)nlopt::algorithm_name(arg1);
12540   resultobj = SWIG_FromCharPtr((const char *)result);
12541   return resultobj;
12542 fail:
12543   return NULL;
12544 }
12545
12546
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 }
12663 };
12664
12665
12666 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
12667
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));
12670 }
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));
12673 }
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};
12696
12697 static swig_type_info *swig_type_initial[] = {
12698   &_swigt__p_allocator_type,
12699   &_swigt__p_char,
12700   &_swigt__p_difference_type,
12701   &_swigt__p_double,
12702   &_swigt__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double,
12703   &_swigt__p_int,
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,
12720 };
12721
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}};
12744
12745 static swig_cast_info *swig_cast_initial[] = {
12746   _swigc__p_allocator_type,
12747   _swigc__p_char,
12748   _swigc__p_difference_type,
12749   _swigc__p_double,
12750   _swigc__p_f_r_q_const__std__vector__double_std__allocator__double_____r_std__vector__double_std__allocator__double_____p_void__double,
12751   _swigc__p_int,
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,
12768 };
12769
12770
12771 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
12772
12773 static swig_const_info swig_const_table[] = {
12774 {0, 0, 0, 0.0, 0, 0}};
12775
12776 #ifdef __cplusplus
12777 }
12778 #endif
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.
12791  *
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.
12805  *
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
12811  *     been loaded.
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
12817  *     be correct.
12818  * ----------------------------------------------------------------------------- */
12819
12820 #ifdef __cplusplus
12821 extern "C" {
12822 #if 0
12823 } /* c-mode */
12824 #endif
12825 #endif
12826
12827 #if 0
12828 #define SWIGRUNTIME_DEBUG
12829 #endif
12830
12831
12832 SWIGRUNTIME void
12833 SWIG_InitializeModule(void *clientdata) {
12834   size_t i;
12835   swig_module_info *module_head, *iter;
12836   int found, init;
12837   
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;
12844     init = 1;
12845   } else {
12846     init = 0;
12847   }
12848   
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;
12856   } else {
12857     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
12858     found=0;
12859     iter=module_head;
12860     do {
12861       if (iter==&swig_module) {
12862         found=1;
12863         break;
12864       }
12865       iter=iter->next;
12866     } while (iter!= module_head);
12867     
12868     /* if the is found in the list, then all is done and we may leave */
12869     if (found) return;
12870     /* otherwise we must add out module into the list */
12871     swig_module.next = module_head->next;
12872     module_head->next = &swig_module;
12873   }
12874   
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
12878        set up already */
12879   if (init == 0) return;
12880   
12881   /* Now work on filling in swig_module.types */
12882 #ifdef SWIGRUNTIME_DEBUG
12883   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
12884 #endif
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;
12889     
12890 #ifdef SWIGRUNTIME_DEBUG
12891     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
12892 #endif
12893     
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);
12897     }
12898     if (type) {
12899       /* Overwrite clientdata field */
12900 #ifdef SWIGRUNTIME_DEBUG
12901       printf("SWIG_InitializeModule: found type %s\n", type->name);
12902 #endif
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);
12907 #endif
12908       }
12909     } else {
12910       type = swig_module.type_initial[i];
12911     }
12912     
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 */
12917       ret = 0;
12918 #ifdef SWIGRUNTIME_DEBUG
12919       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
12920 #endif
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);
12925 #endif
12926       }
12927       if (ret) {
12928         if (type == swig_module.type_initial[i]) {
12929 #ifdef SWIGRUNTIME_DEBUG
12930           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
12931 #endif
12932           cast->type = ret;
12933           ret = 0;
12934         } else {
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);
12939 #endif
12940           if (!ocast) ret = 0;
12941         }
12942       }
12943       
12944       if (!ret) {
12945 #ifdef SWIGRUNTIME_DEBUG
12946         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
12947 #endif
12948         if (type->cast) {
12949           type->cast->prev = cast;
12950           cast->next = type->cast;
12951         }
12952         type->cast = cast;
12953       }
12954       cast++;
12955     }
12956     /* Set entry in modules->types array equal to the type */
12957     swig_module.types[i] = type;
12958   }
12959   swig_module.types[i] = 0;
12960   
12961 #ifdef SWIGRUNTIME_DEBUG
12962   printf("**** SWIG_InitializeModule: Cast List ******\n");
12963   for (i = 0; i < swig_module.size; ++i) {
12964     int j = 0;
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);
12969       cast++;
12970       ++j;
12971     }
12972     printf("---- Total casts: %d\n",j);
12973   }
12974   printf("**** SWIG_InitializeModule: Cast List ******\n");
12975 #endif
12976 }
12977
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.
12982 */
12983 SWIGRUNTIME void
12984 SWIG_PropagateClientData(void) {
12985   size_t i;
12986   swig_cast_info *equiv;
12987   static int init_run = 0;
12988   
12989   if (init_run) return;
12990   init_run = 1;
12991   
12992   for (i = 0; i < swig_module.size; i++) {
12993     if (swig_module.types[i]->clientdata) {
12994       equiv = swig_module.types[i]->cast;
12995       while (equiv) {
12996         if (!equiv->converter) {
12997           if (equiv->type && !equiv->type->clientdata)
12998           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
12999         }
13000         equiv = equiv->next;
13001       }
13002     }
13003   }
13004 }
13005
13006 #ifdef __cplusplus
13007 #if 0
13008 {
13009   /* c-mode */
13010 #endif
13011 }
13012 #endif
13013
13014
13015
13016 #ifdef __cplusplus
13017 extern "C" {
13018 #endif
13019   
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)
13024   
13025   /* -----------------------------------------------------------------------------
13026    * global variable support code.
13027    * ----------------------------------------------------------------------------- */
13028   
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;
13034   } swig_globalvar;
13035   
13036   typedef struct swig_varlinkobject {
13037     PyObject_HEAD
13038     swig_globalvar *vars;
13039   } swig_varlinkobject;
13040   
13041   SWIGINTERN PyObject *
13042   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
13043 #if PY_VERSION_HEX >= 0x03000000
13044     return PyUnicode_InternFromString("<Swig global variables>");
13045 #else
13046     return PyString_FromString("<Swig global variables>");
13047 #endif
13048   }
13049   
13050   SWIGINTERN PyObject *
13051   swig_varlink_str(swig_varlinkobject *v) {
13052 #if PY_VERSION_HEX >= 0x03000000
13053     PyObject *str = PyUnicode_InternFromString("(");
13054     PyObject *tail;
13055     PyObject *joined;
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);
13060       Py_DecRef(str);
13061       Py_DecRef(tail);
13062       str = joined;
13063       if (var->next) {
13064         tail = PyUnicode_InternFromString(", ");
13065         joined = PyUnicode_Concat(str, tail);
13066         Py_DecRef(str);
13067         Py_DecRef(tail);
13068         str = joined;
13069       }
13070     }
13071     tail = PyUnicode_InternFromString(")");
13072     joined = PyUnicode_Concat(str, tail);
13073     Py_DecRef(str);
13074     Py_DecRef(tail);
13075     str = joined;
13076 #else
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(", "));
13082     }
13083     PyString_ConcatAndDel(&str,PyString_FromString(")"));
13084 #endif
13085     return str;
13086   }
13087   
13088   SWIGINTERN int
13089   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
13090     char *tmp;
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);
13095     Py_DECREF(str);
13096     return 0;
13097   }
13098   
13099   SWIGINTERN void
13100   swig_varlink_dealloc(swig_varlinkobject *v) {
13101     swig_globalvar *var = v->vars;
13102     while (var) {
13103       swig_globalvar *n = var->next;
13104       free(var->name);
13105       free(var);
13106       var = n;
13107     }
13108   }
13109   
13110   SWIGINTERN PyObject *
13111   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
13112     PyObject *res = NULL;
13113     swig_globalvar *var = v->vars;
13114     while (var) {
13115       if (strcmp(var->name,n) == 0) {
13116         res = (*var->get_attr)();
13117         break;
13118       }
13119       var = var->next;
13120     }
13121     if (res == NULL && !PyErr_Occurred()) {
13122       PyErr_SetString(PyExc_NameError,"Unknown C global variable");
13123     }
13124     return res;
13125   }
13126   
13127   SWIGINTERN int
13128   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
13129     int res = 1;
13130     swig_globalvar *var = v->vars;
13131     while (var) {
13132       if (strcmp(var->name,n) == 0) {
13133         res = (*var->set_attr)(p);
13134         break;
13135       }
13136       var = var->next;
13137     }
13138     if (res == 1 && !PyErr_Occurred()) {
13139       PyErr_SetString(PyExc_NameError,"Unknown C global variable");
13140     }
13141     return res;
13142   }
13143   
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;
13149     if (!type_init) {
13150       const PyTypeObject tmp = {
13151         /* PyObject header changed in Python 3 */
13152 #if PY_VERSION_HEX >= 0x03000000
13153         PyVarObject_HEAD_INIT(NULL, 0)
13154 #else
13155         PyObject_HEAD_INIT(NULL)
13156         0,                                  /* ob_size */
13157 #endif
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 */
13170         0,                                  /* tp_hash */
13171         0,                                  /* tp_call */
13172         (reprfunc) swig_varlink_str,        /* tp_str */
13173         0,                                  /* tp_getattro */
13174         0,                                  /* tp_setattro */
13175         0,                                  /* tp_as_buffer */
13176         0,                                  /* tp_flags */
13177         varlink__doc__,                     /* tp_doc */
13178         0,                                  /* tp_traverse */
13179         0,                                  /* tp_clear */
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 */
13184 #endif
13185 #if PY_VERSION_HEX >= 0x02030000
13186         0,                                  /* tp_del */
13187 #endif
13188 #if PY_VERSION_HEX >= 0x02060000
13189         0,                                  /* tp_version */
13190 #endif
13191 #ifdef COUNT_ALLOCS
13192         0,0,0,0                             /* tp_alloc -> tp_next */
13193 #endif
13194       };
13195       varlink_type = tmp;
13196       type_init = 1;
13197 #if PY_VERSION_HEX < 0x02020000
13198       varlink_type.ob_type = &PyType_Type;
13199 #else
13200       if (PyType_Ready(&varlink_type) < 0)
13201       return NULL;
13202 #endif
13203     }
13204     return &varlink_type;
13205   }
13206   
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());
13211     if (result) {
13212       result->vars = 0;
13213     }
13214     return ((PyObject*) result);
13215   }
13216   
13217   SWIGINTERN void 
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));
13221     if (gv) {
13222       size_t size = strlen(name)+1;
13223       gv->name = (char *)malloc(size);
13224       if (gv->name) {
13225         strncpy(gv->name,name,size);
13226         gv->get_attr = get_attr;
13227         gv->set_attr = set_attr;
13228         gv->next = v->vars;
13229       }
13230     }
13231     v->vars = gv;
13232   }
13233   
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;
13239   }
13240   
13241   /* -----------------------------------------------------------------------------
13242    * constants/methods manipulation
13243    * ----------------------------------------------------------------------------- */
13244   
13245   /* Install Constants */
13246   SWIGINTERN void
13247   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
13248     PyObject *obj = 0;
13249     size_t i;
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);
13254         break;
13255       case SWIG_PY_BINARY:
13256         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
13257         break;
13258       default:
13259         obj = 0;
13260         break;
13261       }
13262       if (obj) {
13263         PyDict_SetItemString(d, constants[i].name, obj);
13264         Py_DECREF(obj);
13265       }
13266     }
13267   }
13268   
13269   /* -----------------------------------------------------------------------------*/
13270   /* Fix SwigMethods to carry the callback ptrs when needed */
13271   /* -----------------------------------------------------------------------------*/
13272   
13273   SWIGINTERN void
13274   SWIG_Python_FixMethods(PyMethodDef *methods,
13275     swig_const_info *const_table,
13276     swig_type_info **types,
13277     swig_type_info **types_initial) {
13278     size_t i;
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: "))) {
13282         int j;
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]);
13289             break;
13290           }
13291         }
13292         if (ci) {
13293           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
13294           if (ptr) {
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);
13300             if (ndoc) {
13301               char *buff = ndoc;
13302               strncpy(buff, methods[i].ml_doc, ldoc);
13303               buff += ldoc;
13304               strncpy(buff, "swig_ptr: ", 10);
13305               buff += 10;
13306               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
13307               methods[i].ml_doc = ndoc;
13308             }
13309           }
13310         }
13311       }
13312     }
13313   } 
13314   
13315 #ifdef __cplusplus
13316 }
13317 #endif
13318
13319 /* -----------------------------------------------------------------------------*
13320  *  Partial Init method
13321  * -----------------------------------------------------------------------------*/
13322
13323 #ifdef __cplusplus
13324 extern "C"
13325 #endif
13326
13327 SWIGEXPORT 
13328 #if PY_VERSION_HEX >= 0x03000000
13329 PyObject*
13330 #else
13331 void
13332 #endif
13333 SWIG_init(void) {
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,
13339 # else
13340     {
13341       PyObject_HEAD_INIT(NULL)
13342       NULL, /* m_init */
13343       0,    /* m_index */
13344       NULL, /* m_copy */
13345     },
13346 # endif
13347     (char *) SWIG_name,
13348     NULL,
13349     -1,
13350     SwigMethods,
13351     NULL,
13352     NULL,
13353     NULL,
13354     NULL
13355   };
13356 #endif
13357   
13358 #if defined(SWIGPYTHON_BUILTIN)
13359   static SwigPyClientData SwigPyObject_clientdata = {
13360     0, 0, 0, 0, 0, 0, 0
13361   };
13362   static PyGetSetDef this_getset_def = {
13363     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
13364   };
13365   static SwigPyGetSet thisown_getset_closure = {
13366     (PyCFunction) SwigPyObject_own,
13367     (PyCFunction) SwigPyObject_own
13368   };
13369   static PyGetSetDef thisown_getset_def = {
13370     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
13371   };
13372   PyObject *metatype_args;
13373   PyTypeObject *builtin_pytype;
13374   int builtin_base_count;
13375   swig_type_info *builtin_basetype;
13376   PyObject *tuple;
13377   PyGetSetDescrObject *static_getset;
13378   PyTypeObject *metatype;
13379   SwigPyClientData *cd;
13380   PyObject *public_interface, *public_symbol;
13381   PyObject *this_descr;
13382   PyObject *thisown_descr;
13383   int i;
13384   
13385   (void)builtin_pytype;
13386   (void)builtin_base_count;
13387   (void)builtin_basetype;
13388   (void)tuple;
13389   (void)static_getset;
13390   
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);
13395   assert(metatype);
13396   Py_DECREF(metatype_args);
13397   metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
13398   assert(PyType_Ready(metatype) >= 0);
13399 #endif
13400   
13401   /* Fix SwigMethods to carry the callback ptrs when needed */
13402   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
13403   
13404 #if PY_VERSION_HEX >= 0x03000000
13405   m = PyModule_Create(&SWIG_module);
13406 #else
13407   m = Py_InitModule((char *) SWIG_name, SwigMethods);
13408 #endif
13409   md = d = PyModule_GetDict(m);
13410   (void)md;
13411   
13412   SWIG_InitializeModule(0);
13413   
13414 #ifdef SWIGPYTHON_BUILTIN
13415   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
13416   assert(SwigPyObject_stype);
13417   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
13418   if (!cd) {
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
13424     return NULL;
13425 # else
13426     return;
13427 # endif
13428   }
13429   
13430   /* All objects have a 'this' attribute */
13431   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
13432   (void)this_descr;
13433   
13434   /* All objects have a 'thisown' attribute */
13435   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
13436   (void)thisown_descr;
13437   
13438   public_interface = PyList_New(0);
13439   public_symbol = 0;
13440   (void)public_symbol;
13441   
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);
13448 #endif
13449   
13450   SWIG_InstallConstants(d,swig_const_table);
13451   
13452   
13453   init_ForcedStop(m);
13454   init_RoundoffLimited(m);
13455   
13456   
13457   import_array();
13458   
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
13515   return m;
13516 #else
13517   return;
13518 #endif
13519 }
13520