OR-Tools  9.1
sat_python_wrap.cc
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.1
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 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #endif
15 
16 #define SWIG_DIRECTORS
17 #define SWIG_PYTHON_THREADS
18 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
19 
20 
21 #ifdef __cplusplus
22 /* SwigValueWrapper is described in swig.swg */
23 template<typename T> class SwigValueWrapper {
24  struct SwigMovePointer {
25  T *ptr;
26  SwigMovePointer(T *p) : ptr(p) { }
27  ~SwigMovePointer() { delete ptr; }
28  SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
29  } pointer;
30  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
31  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
32 public:
33  SwigValueWrapper() : pointer(0) { }
34  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
35  operator T&() const { return *pointer.ptr; }
36  T *operator&() { return pointer.ptr; }
37 };
38 
39 template <typename T> T SwigValueInit() {
40  return T();
41 }
42 #endif
43 
44 /* -----------------------------------------------------------------------------
45  * This section contains generic SWIG labels for method/variable
46  * declarations/attributes, and other compiler dependent labels.
47  * ----------------------------------------------------------------------------- */
48 
49 /* template workaround for compilers that cannot correctly implement the C++ standard */
50 #ifndef SWIGTEMPLATEDISAMBIGUATOR
51 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
52 # define SWIGTEMPLATEDISAMBIGUATOR template
53 # elif defined(__HP_aCC)
54 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
55 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
56 # define SWIGTEMPLATEDISAMBIGUATOR template
57 # else
58 # define SWIGTEMPLATEDISAMBIGUATOR
59 # endif
60 #endif
61 
62 /* inline attribute */
63 #ifndef SWIGINLINE
64 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
65 # define SWIGINLINE inline
66 # else
67 # define SWIGINLINE
68 # endif
69 #endif
70 
71 /* attribute recognised by some compilers to avoid 'unused' warnings */
72 #ifndef SWIGUNUSED
73 # if defined(__GNUC__)
74 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
75 # define SWIGUNUSED __attribute__ ((__unused__))
76 # else
77 # define SWIGUNUSED
78 # endif
79 # elif defined(__ICC)
80 # define SWIGUNUSED __attribute__ ((__unused__))
81 # else
82 # define SWIGUNUSED
83 # endif
84 #endif
85 
86 #ifndef SWIG_MSC_UNSUPPRESS_4505
87 # if defined(_MSC_VER)
88 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
89 # endif
90 #endif
91 
92 #ifndef SWIGUNUSEDPARM
93 # ifdef __cplusplus
94 # define SWIGUNUSEDPARM(p)
95 # else
96 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
97 # endif
98 #endif
99 
100 /* internal SWIG method */
101 #ifndef SWIGINTERN
102 # define SWIGINTERN static SWIGUNUSED
103 #endif
104 
105 /* internal inline SWIG method */
106 #ifndef SWIGINTERNINLINE
107 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
108 #endif
109 
110 /* exporting methods */
111 #if defined(__GNUC__)
112 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
113 # ifndef GCC_HASCLASSVISIBILITY
114 # define GCC_HASCLASSVISIBILITY
115 # endif
116 # endif
117 #endif
118 
119 #ifndef SWIGEXPORT
120 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
121 # if defined(STATIC_LINKED)
122 # define SWIGEXPORT
123 # else
124 # define SWIGEXPORT __declspec(dllexport)
125 # endif
126 # else
127 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
128 # define SWIGEXPORT __attribute__ ((visibility("default")))
129 # else
130 # define SWIGEXPORT
131 # endif
132 # endif
133 #endif
134 
135 /* calling conventions for Windows */
136 #ifndef SWIGSTDCALL
137 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
138 # define SWIGSTDCALL __stdcall
139 # else
140 # define SWIGSTDCALL
141 # endif
142 #endif
143 
144 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
145 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
146 # define _CRT_SECURE_NO_DEPRECATE
147 #endif
148 
149 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
150 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
151 # define _SCL_SECURE_NO_DEPRECATE
152 #endif
153 
154 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
155 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
156 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
157 #endif
158 
159 /* Intel's compiler complains if a variable which was never initialised is
160  * cast to void, which is a common idiom which we use to indicate that we
161  * are aware a variable isn't used. So we just silence that warning.
162  * See: https://github.com/swig/swig/issues/192 for more discussion.
163  */
164 #ifdef __INTEL_COMPILER
165 # pragma warning disable 592
166 #endif
167 
168 
169 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
170 /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
171 # include <math.h>
172 #endif
173 
174 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
175 /* Use debug wrappers with the Python release dll */
176 # undef _DEBUG
177 # include <Python.h>
178 # define _DEBUG 1
179 #else
180 # include <Python.h>
181 #endif
182 
183 /* -----------------------------------------------------------------------------
184  * swigrun.swg
185  *
186  * This file contains generic C API SWIG runtime support for pointer
187  * type checking.
188  * ----------------------------------------------------------------------------- */
189 
190 /* This should only be incremented when either the layout of swig_type_info changes,
191  or for whatever reason, the runtime changes incompatibly */
192 #define SWIG_RUNTIME_VERSION "4"
193 
194 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
195 #ifdef SWIG_TYPE_TABLE
196 # define SWIG_QUOTE_STRING(x) #x
197 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
198 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
199 #else
200 # define SWIG_TYPE_TABLE_NAME
201 #endif
202 
203 /*
204  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
205  creating a static or dynamic library from the SWIG runtime code.
206  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
207 
208  But only do this if strictly necessary, ie, if you have problems
209  with your compiler or suchlike.
210 */
211 
212 #ifndef SWIGRUNTIME
213 # define SWIGRUNTIME SWIGINTERN
214 #endif
215 
216 #ifndef SWIGRUNTIMEINLINE
217 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
218 #endif
219 
220 /* Generic buffer size */
221 #ifndef SWIG_BUFFER_SIZE
222 # define SWIG_BUFFER_SIZE 1024
223 #endif
224 
225 /* Flags for pointer conversions */
226 #define SWIG_POINTER_DISOWN 0x1
227 #define SWIG_CAST_NEW_MEMORY 0x2
228 #define SWIG_POINTER_NO_NULL 0x4
229 
230 /* Flags for new pointer objects */
231 #define SWIG_POINTER_OWN 0x1
232 
233 
234 /*
235  Flags/methods for returning states.
236 
237  The SWIG conversion methods, as ConvertPtr, return an integer
238  that tells if the conversion was successful or not. And if not,
239  an error code can be returned (see swigerrors.swg for the codes).
240 
241  Use the following macros/flags to set or process the returning
242  states.
243 
244  In old versions of SWIG, code such as the following was usually written:
245 
246  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
247  // success code
248  } else {
249  //fail code
250  }
251 
252  Now you can be more explicit:
253 
254  int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
255  if (SWIG_IsOK(res)) {
256  // success code
257  } else {
258  // fail code
259  }
260 
261  which is the same really, but now you can also do
262 
263  Type *ptr;
264  int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
265  if (SWIG_IsOK(res)) {
266  // success code
267  if (SWIG_IsNewObj(res) {
268  ...
269  delete *ptr;
270  } else {
271  ...
272  }
273  } else {
274  // fail code
275  }
276 
277  I.e., now SWIG_ConvertPtr can return new objects and you can
278  identify the case and take care of the deallocation. Of course that
279  also requires SWIG_ConvertPtr to return new result values, such as
280 
281  int SWIG_ConvertPtr(obj, ptr,...) {
282  if (<obj is ok>) {
283  if (<need new object>) {
284  *ptr = <ptr to new allocated object>;
285  return SWIG_NEWOBJ;
286  } else {
287  *ptr = <ptr to old object>;
288  return SWIG_OLDOBJ;
289  }
290  } else {
291  return SWIG_BADOBJ;
292  }
293  }
294 
295  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
296  more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
297  SWIG errors code.
298 
299  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
300  allows to return the 'cast rank', for example, if you have this
301 
302  int food(double)
303  int fooi(int);
304 
305  and you call
306 
307  food(1) // cast rank '1' (1 -> 1.0)
308  fooi(1) // cast rank '0'
309 
310  just use the SWIG_AddCast()/SWIG_CheckState()
311 */
312 
313 #define SWIG_OK (0)
314 #define SWIG_ERROR (-1)
315 #define SWIG_IsOK(r) (r >= 0)
316 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
317 
318 /* The CastRankLimit says how many bits are used for the cast rank */
319 #define SWIG_CASTRANKLIMIT (1 << 8)
320 /* The NewMask denotes the object was created (using new/malloc) */
321 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
322 /* The TmpMask is for in/out typemaps that use temporal objects */
323 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
324 /* Simple returning values */
325 #define SWIG_BADOBJ (SWIG_ERROR)
326 #define SWIG_OLDOBJ (SWIG_OK)
327 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
328 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
329 /* Check, add and del mask methods */
330 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
331 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
332 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
333 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
334 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
335 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
336 
337 /* Cast-Rank Mode */
338 #if defined(SWIG_CASTRANK_MODE)
339 # ifndef SWIG_TypeRank
340 # define SWIG_TypeRank unsigned long
341 # endif
342 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
343 # define SWIG_MAXCASTRANK (2)
344 # endif
345 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
346 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
347 SWIGINTERNINLINE int SWIG_AddCast(int r) {
348  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
349 }
351  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
352 }
353 #else /* no cast-rank mode */
354 # define SWIG_AddCast(r) (r)
355 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
356 #endif
357 
358 
359 #include <string.h>
360 
361 #ifdef __cplusplus
362 extern "C" {
363 #endif
364 
365 typedef void *(*swig_converter_func)(void *, int *);
366 typedef struct swig_type_info *(*swig_dycast_func)(void **);
367 
368 /* Structure to store information on one type */
369 typedef struct swig_type_info {
370  const char *name; /* mangled name of this type */
371  const char *str; /* human readable name of this type */
372  swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
373  struct swig_cast_info *cast; /* linked list of types that can cast into this type */
374  void *clientdata; /* language specific type data */
375  int owndata; /* flag if the structure owns the clientdata */
377 
378 /* Structure to store a type and conversion function used for casting */
379 typedef struct swig_cast_info {
380  swig_type_info *type; /* pointer to type that is equivalent to this type */
381  swig_converter_func converter; /* function to cast the void pointers */
382  struct swig_cast_info *next; /* pointer to next cast in linked list */
383  struct swig_cast_info *prev; /* pointer to the previous cast */
385 
386 /* Structure used to store module information
387  * Each module generates one structure like this, and the runtime collects
388  * all of these structures and stores them in a circularly linked list.*/
389 typedef struct swig_module_info {
390  swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
391  size_t size; /* Number of types in this module */
392  struct swig_module_info *next; /* Pointer to next element in circularly linked list */
393  swig_type_info **type_initial; /* Array of initially generated type structures */
394  swig_cast_info **cast_initial; /* Array of initially generated casting structures */
395  void *clientdata; /* Language specific module data */
397 
398 /*
399  Compare two type names skipping the space characters, therefore
400  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
401 
402  Return 0 when the two name types are equivalent, as in
403  strncmp, but skipping ' '.
404 */
405 SWIGRUNTIME int
406 SWIG_TypeNameComp(const char *f1, const char *l1,
407  const char *f2, const char *l2) {
408  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
409  while ((*f1 == ' ') && (f1 != l1)) ++f1;
410  while ((*f2 == ' ') && (f2 != l2)) ++f2;
411  if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
412  }
413  return (int)((l1 - f1) - (l2 - f2));
414 }
415 
416 /*
417  Check type equivalence in a name list like <name1>|<name2>|...
418  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
419 */
420 SWIGRUNTIME int
421 SWIG_TypeCmp(const char *nb, const char *tb) {
422  int equiv = 1;
423  const char* te = tb + strlen(tb);
424  const char* ne = nb;
425  while (equiv != 0 && *ne) {
426  for (nb = ne; *ne; ++ne) {
427  if (*ne == '|') break;
428  }
429  equiv = SWIG_TypeNameComp(nb, ne, tb, te);
430  if (*ne) ++ne;
431  }
432  return equiv;
433 }
434 
435 /*
436  Check type equivalence in a name list like <name1>|<name2>|...
437  Return 0 if not equal, 1 if equal
438 */
439 SWIGRUNTIME int
440 SWIG_TypeEquiv(const char *nb, const char *tb) {
441  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
442 }
443 
444 /*
445  Check the typename
446 */
448 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
449  if (ty) {
450  swig_cast_info *iter = ty->cast;
451  while (iter) {
452  if (strcmp(iter->type->name, c) == 0) {
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  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
473 */
476  if (ty) {
477  swig_cast_info *iter = ty->cast;
478  while (iter) {
479  if (iter->type == from) {
480  if (iter == ty->cast)
481  return iter;
482  /* Move iter to the top of the linked list */
483  iter->prev->next = iter->next;
484  if (iter->next)
485  iter->next->prev = iter->prev;
486  iter->next = ty->cast;
487  iter->prev = 0;
488  if (ty->cast) ty->cast->prev = iter;
489  ty->cast = iter;
490  return iter;
491  }
492  iter = iter->next;
493  }
494  }
495  return 0;
496 }
497 
498 /*
499  Cast a pointer up an inheritance hierarchy
500 */
501 SWIGRUNTIMEINLINE void *
502 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
503  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
504 }
505 
506 /*
507  Dynamic pointer casting. Down an inheritance hierarchy
508 */
511  swig_type_info *lastty = ty;
512  if (!ty || !ty->dcast) return ty;
513  while (ty && (ty->dcast)) {
514  ty = (*ty->dcast)(ptr);
515  if (ty) lastty = ty;
516  }
517  return lastty;
518 }
519 
520 /*
521  Return the name associated with this type
522 */
523 SWIGRUNTIMEINLINE const char *
525  return ty->name;
526 }
527 
528 /*
529  Return the pretty name associated with this type,
530  that is an unmangled type name in a form presentable to the user.
531 */
532 SWIGRUNTIME const char *
534  /* The "str" field contains the equivalent pretty names of the
535  type, separated by vertical-bar characters. We choose
536  to print the last name, as it is often (?) the most
537  specific. */
538  if (!type) return NULL;
539  if (type->str != NULL) {
540  const char *last_name = type->str;
541  const char *s;
542  for (s = type->str; *s; s++)
543  if (*s == '|') last_name = s+1;
544  return last_name;
545  }
546  else
547  return type->name;
548 }
549 
550 /*
551  Set the clientdata field for a type
552 */
553 SWIGRUNTIME void
555  swig_cast_info *cast = ti->cast;
556  /* if (ti->clientdata == clientdata) return; */
557  ti->clientdata = clientdata;
558 
559  while (cast) {
560  if (!cast->converter) {
561  swig_type_info *tc = cast->type;
562  if (!tc->clientdata) {
564  }
565  }
566  cast = cast->next;
567  }
568 }
569 SWIGRUNTIME void
572  ti->owndata = 1;
573 }
574 
575 /*
576  Search for a swig_type_info structure only by mangled name
577  Search is a O(log #types)
578 
579  We start searching at module start, and finish searching when start == end.
580  Note: if start == end at the beginning of the function, we go all the way around
581  the circular list.
582 */
585  swig_module_info *end,
586  const char *name) {
587  swig_module_info *iter = start;
588  do {
589  if (iter->size) {
590  size_t l = 0;
591  size_t r = iter->size - 1;
592  do {
593  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
594  size_t i = (l + r) >> 1;
595  const char *iname = iter->types[i]->name;
596  if (iname) {
597  int compare = strcmp(name, iname);
598  if (compare == 0) {
599  return iter->types[i];
600  } else if (compare < 0) {
601  if (i) {
602  r = i - 1;
603  } else {
604  break;
605  }
606  } else if (compare > 0) {
607  l = i + 1;
608  }
609  } else {
610  break; /* should never happen */
611  }
612  } while (l <= r);
613  }
614  iter = iter->next;
615  } while (iter != end);
616  return 0;
617 }
618 
619 /*
620  Search for a swig_type_info structure for either a mangled name or a human readable name.
621  It first searches the mangled names of the types, which is a O(log #types)
622  If a type is not found it then searches the human readable names, which is O(#types).
623 
624  We start searching at module start, and finish searching when start == end.
625  Note: if start == end at the beginning of the function, we go all the way around
626  the circular list.
627 */
630  swig_module_info *end,
631  const char *name) {
632  /* STEP 1: Search the name field using binary search */
633  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
634  if (ret) {
635  return ret;
636  } else {
637  /* STEP 2: If the type hasn't been found, do a complete search
638  of the str field (the human readable name) */
639  swig_module_info *iter = start;
640  do {
641  size_t i = 0;
642  for (; i < iter->size; ++i) {
643  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
644  return iter->types[i];
645  }
646  iter = iter->next;
647  } while (iter != end);
648  }
649 
650  /* neither found a match */
651  return 0;
652 }
653 
654 /*
655  Pack binary data into a string
656 */
657 SWIGRUNTIME char *
658 SWIG_PackData(char *c, void *ptr, size_t sz) {
659  static const char hex[17] = "0123456789abcdef";
660  const unsigned char *u = (unsigned char *) ptr;
661  const unsigned char *eu = u + sz;
662  for (; u != eu; ++u) {
663  unsigned char uu = *u;
664  *(c++) = hex[(uu & 0xf0) >> 4];
665  *(c++) = hex[uu & 0xf];
666  }
667  return c;
668 }
669 
670 /*
671  Unpack binary data from a string
672 */
673 SWIGRUNTIME const char *
674 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
675  unsigned char *u = (unsigned char *) ptr;
676  const unsigned char *eu = u + sz;
677  for (; u != eu; ++u) {
678  char d = *(c++);
679  unsigned char uu;
680  if ((d >= '0') && (d <= '9'))
681  uu = (unsigned char)((d - '0') << 4);
682  else if ((d >= 'a') && (d <= 'f'))
683  uu = (unsigned char)((d - ('a'-10)) << 4);
684  else
685  return (char *) 0;
686  d = *(c++);
687  if ((d >= '0') && (d <= '9'))
688  uu |= (unsigned char)(d - '0');
689  else if ((d >= 'a') && (d <= 'f'))
690  uu |= (unsigned char)(d - ('a'-10));
691  else
692  return (char *) 0;
693  *u = uu;
694  }
695  return c;
696 }
697 
698 /*
699  Pack 'void *' into a string buffer.
700 */
701 SWIGRUNTIME char *
702 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
703  char *r = buff;
704  if ((2*sizeof(void *) + 2) > bsz) return 0;
705  *(r++) = '_';
706  r = SWIG_PackData(r,&ptr,sizeof(void *));
707  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
708  strcpy(r,name);
709  return buff;
710 }
711 
712 SWIGRUNTIME const char *
713 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
714  if (*c != '_') {
715  if (strcmp(c,"NULL") == 0) {
716  *ptr = (void *) 0;
717  return name;
718  } else {
719  return 0;
720  }
721  }
722  return SWIG_UnpackData(++c,ptr,sizeof(void *));
723 }
724 
725 SWIGRUNTIME char *
726 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
727  char *r = buff;
728  size_t lname = (name ? strlen(name) : 0);
729  if ((2*sz + 2 + lname) > bsz) return 0;
730  *(r++) = '_';
731  r = SWIG_PackData(r,ptr,sz);
732  if (lname) {
733  strncpy(r,name,lname+1);
734  } else {
735  *r = 0;
736  }
737  return buff;
738 }
739 
740 SWIGRUNTIME const char *
741 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
742  if (*c != '_') {
743  if (strcmp(c,"NULL") == 0) {
744  memset(ptr,0,sz);
745  return name;
746  } else {
747  return 0;
748  }
749  }
750  return SWIG_UnpackData(++c,ptr,sz);
751 }
752 
753 #ifdef __cplusplus
754 }
755 #endif
756 
757 /* Errors in SWIG */
758 #define SWIG_UnknownError -1
759 #define SWIG_IOError -2
760 #define SWIG_RuntimeError -3
761 #define SWIG_IndexError -4
762 #define SWIG_TypeError -5
763 #define SWIG_DivisionByZero -6
764 #define SWIG_OverflowError -7
765 #define SWIG_SyntaxError -8
766 #define SWIG_ValueError -9
767 #define SWIG_SystemError -10
768 #define SWIG_AttributeError -11
769 #define SWIG_MemoryError -12
770 #define SWIG_NullReferenceError -13
771 
772 
773 
774 /* Compatibility macros for Python 3 */
775 #if PY_VERSION_HEX >= 0x03000000
776 
777 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
778 #define PyInt_Check(x) PyLong_Check(x)
779 #define PyInt_AsLong(x) PyLong_AsLong(x)
780 #define PyInt_FromLong(x) PyLong_FromLong(x)
781 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
782 #define PyString_Check(name) PyBytes_Check(name)
783 #define PyString_FromString(x) PyUnicode_FromString(x)
784 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
785 #define PyString_AsString(str) PyBytes_AsString(str)
786 #define PyString_Size(str) PyBytes_Size(str)
787 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
788 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
789 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
790 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
791 
792 #endif
793 
794 #ifndef Py_TYPE
795 # define Py_TYPE(op) ((op)->ob_type)
796 #endif
797 
798 /* SWIG APIs for compatibility of both Python 2 & 3 */
799 
800 #if PY_VERSION_HEX >= 0x03000000
801 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
802 #else
803 # define SWIG_Python_str_FromFormat PyString_FromFormat
804 #endif
805 
806 
807 /* Warning: This function will allocate a new string in Python 3,
808  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
809  */
810 SWIGINTERN char*
812 {
813 #if PY_VERSION_HEX >= 0x03000000
814  char *newstr = 0;
815  str = PyUnicode_AsUTF8String(str);
816  if (str) {
817  char *cstr;
818  Py_ssize_t len;
819  PyBytes_AsStringAndSize(str, &cstr, &len);
820  newstr = (char *) malloc(len+1);
821  memcpy(newstr, cstr, len+1);
822  Py_XDECREF(str);
823  }
824  return newstr;
825 #else
826  return PyString_AsString(str);
827 #endif
828 }
829 
830 #if PY_VERSION_HEX >= 0x03000000
831 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
832 #else
833 # define SWIG_Python_str_DelForPy3(x)
834 #endif
835 
836 
837 SWIGINTERN PyObject*
839 {
840 #if PY_VERSION_HEX >= 0x03000000
841  return PyUnicode_FromString(c);
842 #else
843  return PyString_FromString(c);
844 #endif
845 }
846 
847 #ifndef PyObject_DEL
848 # define PyObject_DEL PyObject_Del
849 #endif
850 
851 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
852 // interface files check for it.
853 # define SWIGPY_USE_CAPSULE
854 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
855 
856 #if PY_VERSION_HEX < 0x03020000
857 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
858 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
859 #define Py_hash_t long
860 #endif
861 
862 /* -----------------------------------------------------------------------------
863  * error manipulation
864  * ----------------------------------------------------------------------------- */
865 
866 SWIGRUNTIME PyObject*
868  PyObject* type = 0;
869  switch(code) {
870  case SWIG_MemoryError:
871  type = PyExc_MemoryError;
872  break;
873  case SWIG_IOError:
874  type = PyExc_IOError;
875  break;
876  case SWIG_RuntimeError:
877  type = PyExc_RuntimeError;
878  break;
879  case SWIG_IndexError:
880  type = PyExc_IndexError;
881  break;
882  case SWIG_TypeError:
883  type = PyExc_TypeError;
884  break;
885  case SWIG_DivisionByZero:
886  type = PyExc_ZeroDivisionError;
887  break;
888  case SWIG_OverflowError:
889  type = PyExc_OverflowError;
890  break;
891  case SWIG_SyntaxError:
892  type = PyExc_SyntaxError;
893  break;
894  case SWIG_ValueError:
895  type = PyExc_ValueError;
896  break;
897  case SWIG_SystemError:
898  type = PyExc_SystemError;
899  break;
900  case SWIG_AttributeError:
901  type = PyExc_AttributeError;
902  break;
903  default:
904  type = PyExc_RuntimeError;
905  }
906  return type;
907 }
908 
909 
910 SWIGRUNTIME void
911 SWIG_Python_AddErrorMsg(const char* mesg)
912 {
913  PyObject *type = 0;
914  PyObject *value = 0;
915  PyObject *traceback = 0;
916 
917  if (PyErr_Occurred())
918  PyErr_Fetch(&type, &value, &traceback);
919  if (value) {
920  PyObject *old_str = PyObject_Str(value);
921  const char *tmp = SWIG_Python_str_AsChar(old_str);
922  PyErr_Clear();
923  Py_XINCREF(type);
924  if (tmp)
925  PyErr_Format(type, "%s %s", tmp, mesg);
926  else
927  PyErr_Format(type, "%s", mesg);
929  Py_DECREF(old_str);
930  Py_DECREF(value);
931  } else {
932  PyErr_SetString(PyExc_RuntimeError, mesg);
933  }
934 }
935 
936 SWIGRUNTIME int
938 {
939  PyObject *error;
940  if (obj)
941  return 0;
942  error = PyErr_Occurred();
943  return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
944 }
945 
946 SWIGRUNTIME void
948 {
949  if (SWIG_Python_TypeErrorOccurred(NULL)) {
950  /* Use existing TypeError to preserve stacktrace and enhance with given message */
951  PyObject *newvalue;
952  PyObject *type = NULL, *value = NULL, *traceback = NULL;
953  PyErr_Fetch(&type, &value, &traceback);
954 #if PY_VERSION_HEX >= 0x03000000
955  newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
956 #else
957  newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
958 #endif
959  Py_XDECREF(value);
960  PyErr_Restore(type, newvalue, traceback);
961  } else {
962  /* Raise TypeError using given message */
963  PyErr_SetString(PyExc_TypeError, message);
964  }
965 }
966 
967 #if defined(SWIG_PYTHON_NO_THREADS)
968 # if defined(SWIG_PYTHON_THREADS)
969 # undef SWIG_PYTHON_THREADS
970 # endif
971 #endif
972 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
973 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
974 # define SWIG_PYTHON_USE_GIL
975 # endif
976 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
977 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
978 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
979 # endif
980 # ifdef __cplusplus /* C++ code */
981  class SWIG_Python_Thread_Block {
982  bool status;
983  PyGILState_STATE state;
984  public:
985  void end() { if (status) { PyGILState_Release(state); status = false;} }
986  SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
987  ~SWIG_Python_Thread_Block() { end(); }
988  };
989  class SWIG_Python_Thread_Allow {
990  bool status;
991  PyThreadState *save;
992  public:
993  void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
994  SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
995  ~SWIG_Python_Thread_Allow() { end(); }
996  };
997 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
998 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
999 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1000 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1001 # else /* C code */
1002 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1003 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1004 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1005 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1006 # endif
1007 # else /* Old thread way, not implemented, user must provide it */
1008 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1009 # define SWIG_PYTHON_INITIALIZE_THREADS
1010 # endif
1011 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1012 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1013 # endif
1014 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1015 # define SWIG_PYTHON_THREAD_END_BLOCK
1016 # endif
1017 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1018 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1019 # endif
1020 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1021 # define SWIG_PYTHON_THREAD_END_ALLOW
1022 # endif
1023 # endif
1024 #else /* No thread support */
1025 # define SWIG_PYTHON_INITIALIZE_THREADS
1026 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1027 # define SWIG_PYTHON_THREAD_END_BLOCK
1028 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1029 # define SWIG_PYTHON_THREAD_END_ALLOW
1030 #endif
1031 
1032 /* -----------------------------------------------------------------------------
1033  * Python API portion that goes into the runtime
1034  * ----------------------------------------------------------------------------- */
1035 
1036 #ifdef __cplusplus
1037 extern "C" {
1038 #endif
1039 
1040 /* -----------------------------------------------------------------------------
1041  * Constant declarations
1042  * ----------------------------------------------------------------------------- */
1043 
1044 /* Constant Types */
1045 #define SWIG_PY_POINTER 4
1046 #define SWIG_PY_BINARY 5
1047 
1048 /* Constant information structure */
1049 typedef struct swig_const_info {
1050  int type;
1051  const char *name;
1052  long lvalue;
1053  double dvalue;
1054  void *pvalue;
1056 } swig_const_info;
1057 
1058 #ifdef __cplusplus
1059 }
1060 #endif
1061 
1062 
1063 /* -----------------------------------------------------------------------------
1064  * pyrun.swg
1065  *
1066  * This file contains the runtime support for Python modules
1067  * and includes code for managing global variables and pointer
1068  * type checking.
1069  *
1070  * ----------------------------------------------------------------------------- */
1071 
1072 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1073 # error "This version of SWIG only supports Python >= 2.7"
1074 #endif
1075 
1076 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1077 # error "This version of SWIG only supports Python 3 >= 3.2"
1078 #endif
1079 
1080 /* Common SWIG API */
1081 
1082 /* for raw pointers */
1083 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1084 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1085 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1086 
1087 #ifdef SWIGPYTHON_BUILTIN
1088 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1089 #else
1090 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1091 #endif
1092 
1093 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1094 
1095 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1096 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1097 #define swig_owntype int
1098 
1099 /* for raw packed data */
1100 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1101 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1102 
1103 /* for class or struct pointers */
1104 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1105 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1106 
1107 /* for C or C++ function pointers */
1108 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1109 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1110 
1111 /* for C++ member pointers, ie, member methods */
1112 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1113 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1114 
1115 
1116 /* Runtime API */
1117 
1118 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1119 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1120 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1121 
1122 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1123 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1124 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1125 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1126 #define SWIG_fail goto fail
1127 
1128 
1129 /* Runtime API implementation */
1130 
1131 /* Error manipulation */
1132 
1133 SWIGINTERN void
1134 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1136  PyErr_SetObject(errtype, obj);
1137  Py_DECREF(obj);
1139 }
1140 
1141 SWIGINTERN void
1142 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1144  PyErr_SetString(errtype, msg);
1146 }
1147 
1148 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1149 
1150 /* Set a constant value */
1151 
1152 #if defined(SWIGPYTHON_BUILTIN)
1153 
1154 SWIGINTERN void
1155 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1156  PyObject *s = PyString_InternFromString(key);
1157  PyList_Append(seq, s);
1158  Py_DECREF(s);
1159 }
1160 
1161 SWIGINTERN void
1162 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1163  PyDict_SetItemString(d, name, obj);
1164  Py_DECREF(obj);
1165  if (public_interface)
1166  SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1167 }
1168 
1169 #else
1170 
1171 SWIGINTERN void
1172 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1173  PyDict_SetItemString(d, name, obj);
1174  Py_DECREF(obj);
1175 }
1176 
1177 #endif
1178 
1179 /* Append a value to the result obj */
1180 
1181 SWIGINTERN PyObject*
1182 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1183  if (!result) {
1184  result = obj;
1185  } else if (result == Py_None) {
1186  Py_DECREF(result);
1187  result = obj;
1188  } else {
1189  if (!PyList_Check(result)) {
1190  PyObject *o2 = result;
1191  result = PyList_New(1);
1192  PyList_SetItem(result, 0, o2);
1193  }
1194  PyList_Append(result,obj);
1195  Py_DECREF(obj);
1196  }
1197  return result;
1198 }
1199 
1200 /* Unpack the argument tuple */
1201 
1202 SWIGINTERN Py_ssize_t
1203 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1204 {
1205  if (!args) {
1206  if (!min && !max) {
1207  return 1;
1208  } else {
1209  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1210  name, (min == max ? "" : "at least "), (int)min);
1211  return 0;
1212  }
1213  }
1214  if (!PyTuple_Check(args)) {
1215  if (min <= 1 && max >= 1) {
1216  Py_ssize_t i;
1217  objs[0] = args;
1218  for (i = 1; i < max; ++i) {
1219  objs[i] = 0;
1220  }
1221  return 2;
1222  }
1223  PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1224  return 0;
1225  } else {
1226  Py_ssize_t l = PyTuple_GET_SIZE(args);
1227  if (l < min) {
1228  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1229  name, (min == max ? "" : "at least "), (int)min, (int)l);
1230  return 0;
1231  } else if (l > max) {
1232  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1233  name, (min == max ? "" : "at most "), (int)max, (int)l);
1234  return 0;
1235  } else {
1236  Py_ssize_t i;
1237  for (i = 0; i < l; ++i) {
1238  objs[i] = PyTuple_GET_ITEM(args, i);
1239  }
1240  for (; l < max; ++l) {
1241  objs[l] = 0;
1242  }
1243  return i + 1;
1244  }
1245  }
1246 }
1247 
1248 /* A functor is a function object with one single object argument */
1249 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1250 
1251 /*
1252  Helper for static pointer initialization for both C and C++ code, for example
1253  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1254 */
1255 #ifdef __cplusplus
1256 #define SWIG_STATIC_POINTER(var) var
1257 #else
1258 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1259 #endif
1260 
1261 /* -----------------------------------------------------------------------------
1262  * Pointer declarations
1263  * ----------------------------------------------------------------------------- */
1264 
1265 /* Flags for new pointer objects */
1266 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1267 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1268 
1269 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1270 
1271 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1272 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1273 
1274 #ifdef __cplusplus
1275 extern "C" {
1276 #endif
1277 
1278 /* The python void return value */
1279 
1280 SWIGRUNTIMEINLINE PyObject *
1282 {
1283  PyObject *none = Py_None;
1284  Py_INCREF(none);
1285  return none;
1286 }
1287 
1288 /* SwigPyClientData */
1289 
1290 typedef struct {
1291  PyObject *klass;
1292  PyObject *newraw;
1293  PyObject *newargs;
1294  PyObject *destroy;
1295  int delargs;
1296  int implicitconv;
1297  PyTypeObject *pytype;
1299 
1300 SWIGRUNTIMEINLINE int
1302 {
1304  int fail = data ? data->implicitconv : 0;
1305  if (fail)
1306  PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1307  return fail;
1308 }
1309 
1310 SWIGRUNTIMEINLINE PyObject *
1312  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1313  PyObject *klass = data ? data->klass : 0;
1314  return (klass ? klass : PyExc_RuntimeError);
1315 }
1316 
1317 
1319 SwigPyClientData_New(PyObject* obj)
1320 {
1321  if (!obj) {
1322  return 0;
1323  } else {
1325  /* the klass element */
1326  data->klass = obj;
1327  Py_INCREF(data->klass);
1328  /* the newraw method and newargs arguments used to create a new raw instance */
1329  if (PyClass_Check(obj)) {
1330  data->newraw = 0;
1331  data->newargs = obj;
1332  Py_INCREF(obj);
1333  } else {
1334  data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1335  if (data->newraw) {
1336  Py_INCREF(data->newraw);
1337  data->newargs = PyTuple_New(1);
1338  PyTuple_SetItem(data->newargs, 0, obj);
1339  } else {
1340  data->newargs = obj;
1341  }
1342  Py_INCREF(data->newargs);
1343  }
1344  /* the destroy method, aka as the C++ delete method */
1345  data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1346  if (PyErr_Occurred()) {
1347  PyErr_Clear();
1348  data->destroy = 0;
1349  }
1350  if (data->destroy) {
1351  int flags;
1352  Py_INCREF(data->destroy);
1353  flags = PyCFunction_GET_FLAGS(data->destroy);
1354  data->delargs = !(flags & (METH_O));
1355  } else {
1356  data->delargs = 0;
1357  }
1358  data->implicitconv = 0;
1359  data->pytype = 0;
1360  return data;
1361  }
1362 }
1363 
1364 SWIGRUNTIME void
1366  Py_XDECREF(data->newraw);
1367  Py_XDECREF(data->newargs);
1368  Py_XDECREF(data->destroy);
1369 }
1370 
1371 /* =============== SwigPyObject =====================*/
1372 
1373 typedef struct {
1374  PyObject_HEAD
1375  void *ptr;
1376  swig_type_info *ty;
1377  int own;
1378  PyObject *next;
1379 #ifdef SWIGPYTHON_BUILTIN
1380  PyObject *dict;
1381 #endif
1382 } SwigPyObject;
1383 
1384 
1385 #ifdef SWIGPYTHON_BUILTIN
1386 
1387 SWIGRUNTIME PyObject *
1388 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1389 {
1390  SwigPyObject *sobj = (SwigPyObject *)v;
1391 
1392  if (!sobj->dict)
1393  sobj->dict = PyDict_New();
1394 
1395  Py_INCREF(sobj->dict);
1396  return sobj->dict;
1397 }
1398 
1399 #endif
1400 
1401 SWIGRUNTIME PyObject *
1403 {
1404  return PyLong_FromVoidPtr(v->ptr);
1405 }
1406 
1407 SWIGRUNTIME PyObject *
1408 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1409 {
1410  PyObject *res = NULL;
1411  PyObject *args = PyTuple_New(1);
1412  if (args) {
1413  if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1414  PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1415  if (ofmt) {
1416 #if PY_VERSION_HEX >= 0x03000000
1417  res = PyUnicode_Format(ofmt,args);
1418 #else
1419  res = PyString_Format(ofmt,args);
1420 #endif
1421  Py_DECREF(ofmt);
1422  }
1423  Py_DECREF(args);
1424  }
1425  }
1426  return res;
1427 }
1428 
1429 SWIGRUNTIME PyObject *
1431 {
1432  return SwigPyObject_format("%o",v);
1433 }
1434 
1435 SWIGRUNTIME PyObject *
1437 {
1438  return SwigPyObject_format("%x",v);
1439 }
1440 
1441 SWIGRUNTIME PyObject *
1443 {
1444  const char *name = SWIG_TypePrettyName(v->ty);
1445  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1446  if (v->next) {
1447  PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1448 # if PY_VERSION_HEX >= 0x03000000
1449  PyObject *joined = PyUnicode_Concat(repr, nrep);
1450  Py_DecRef(repr);
1451  Py_DecRef(nrep);
1452  repr = joined;
1453 # else
1454  PyString_ConcatAndDel(&repr,nrep);
1455 # endif
1456  }
1457  return repr;
1458 }
1459 
1460 /* We need a version taking two PyObject* parameters so it's a valid
1461  * PyCFunction to use in swigobject_methods[]. */
1462 SWIGRUNTIME PyObject *
1463 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1464 {
1465  return SwigPyObject_repr((SwigPyObject*)v);
1466 }
1467 
1468 SWIGRUNTIME int
1470 {
1471  void *i = v->ptr;
1472  void *j = w->ptr;
1473  return (i < j) ? -1 : ((i > j) ? 1 : 0);
1474 }
1475 
1476 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1477 SWIGRUNTIME PyObject*
1479 {
1480  PyObject* res;
1481  if( op != Py_EQ && op != Py_NE ) {
1482  Py_INCREF(Py_NotImplemented);
1483  return Py_NotImplemented;
1484  }
1485  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1486  return res;
1487 }
1488 
1489 
1490 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1491 
1492 #ifdef SWIGPYTHON_BUILTIN
1493 static swig_type_info *SwigPyObject_stype = 0;
1494 SWIGRUNTIME PyTypeObject*
1495 SwigPyObject_type(void) {
1496  SwigPyClientData *cd;
1497  assert(SwigPyObject_stype);
1498  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1499  assert(cd);
1500  assert(cd->pytype);
1501  return cd->pytype;
1502 }
1503 #else
1504 SWIGRUNTIME PyTypeObject*
1506  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1507  return type;
1508 }
1509 #endif
1510 
1512 SwigPyObject_Check(PyObject *op) {
1513 #ifdef SWIGPYTHON_BUILTIN
1514  PyTypeObject *target_tp = SwigPyObject_type();
1515  if (PyType_IsSubtype(op->ob_type, target_tp))
1516  return 1;
1517  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1518 #else
1519  return (Py_TYPE(op) == SwigPyObject_type())
1520  || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1521 #endif
1522 }
1523 
1524 SWIGRUNTIME PyObject *
1525 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1526 
1527 SWIGRUNTIME void
1529 {
1530  SwigPyObject *sobj = (SwigPyObject *) v;
1531  PyObject *next = sobj->next;
1532  if (sobj->own == SWIG_POINTER_OWN) {
1533  swig_type_info *ty = sobj->ty;
1534  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1535  PyObject *destroy = data ? data->destroy : 0;
1536  if (destroy) {
1537  /* destroy is always a VARARGS method */
1538  PyObject *res;
1539 
1540  /* PyObject_CallFunction() has the potential to silently drop
1541  the active exception. In cases of unnamed temporary
1542  variable or where we just finished iterating over a generator
1543  StopIteration will be active right now, and this needs to
1544  remain true upon return from SwigPyObject_dealloc. So save
1545  and restore. */
1546 
1547  PyObject *type = NULL, *value = NULL, *traceback = NULL;
1548  PyErr_Fetch(&type, &value, &traceback);
1549 
1550  if (data->delargs) {
1551  /* we need to create a temporary object to carry the destroy operation */
1552  PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1553  res = SWIG_Python_CallFunctor(destroy, tmp);
1554  Py_DECREF(tmp);
1555  } else {
1556  PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1557  PyObject *mself = PyCFunction_GET_SELF(destroy);
1558  res = ((*meth)(mself, v));
1559  }
1560  if (!res)
1561  PyErr_WriteUnraisable(destroy);
1562 
1563  PyErr_Restore(type, value, traceback);
1564 
1565  Py_XDECREF(res);
1566  }
1567 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1568  else {
1569  const char *name = SWIG_TypePrettyName(ty);
1570  printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1571  }
1572 #endif
1573  }
1574  Py_XDECREF(next);
1575  PyObject_DEL(v);
1576 }
1577 
1578 SWIGRUNTIME PyObject*
1579 SwigPyObject_append(PyObject* v, PyObject* next)
1580 {
1581  SwigPyObject *sobj = (SwigPyObject *) v;
1582  if (!SwigPyObject_Check(next)) {
1583  PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1584  return NULL;
1585  }
1586  sobj->next = next;
1587  Py_INCREF(next);
1588  return SWIG_Py_Void();
1589 }
1590 
1591 SWIGRUNTIME PyObject*
1592 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1593 {
1594  SwigPyObject *sobj = (SwigPyObject *) v;
1595  if (sobj->next) {
1596  Py_INCREF(sobj->next);
1597  return sobj->next;
1598  } else {
1599  return SWIG_Py_Void();
1600  }
1601 }
1602 
1603 SWIGINTERN PyObject*
1604 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1605 {
1606  SwigPyObject *sobj = (SwigPyObject *)v;
1607  sobj->own = 0;
1608  return SWIG_Py_Void();
1609 }
1610 
1611 SWIGINTERN PyObject*
1612 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1613 {
1614  SwigPyObject *sobj = (SwigPyObject *)v;
1615  sobj->own = SWIG_POINTER_OWN;
1616  return SWIG_Py_Void();
1617 }
1618 
1619 SWIGINTERN PyObject*
1620 SwigPyObject_own(PyObject *v, PyObject *args)
1621 {
1622  PyObject *val = 0;
1623  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1624  return NULL;
1625  } else {
1626  SwigPyObject *sobj = (SwigPyObject *)v;
1627  PyObject *obj = PyBool_FromLong(sobj->own);
1628  if (val) {
1629  if (PyObject_IsTrue(val)) {
1630  SwigPyObject_acquire(v,args);
1631  } else {
1632  SwigPyObject_disown(v,args);
1633  }
1634  }
1635  return obj;
1636  }
1637 }
1638 
1639 static PyMethodDef
1641  {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"},
1642  {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"},
1643  {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"},
1644  {"append", SwigPyObject_append, METH_O, "appends another 'this' object"},
1645  {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"},
1646  {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"},
1647  {0, 0, 0, 0}
1648 };
1649 
1650 SWIGRUNTIME PyTypeObject*
1652  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1653 
1654  static PyNumberMethods SwigPyObject_as_number = {
1655  (binaryfunc)0, /*nb_add*/
1656  (binaryfunc)0, /*nb_subtract*/
1657  (binaryfunc)0, /*nb_multiply*/
1658  /* nb_divide removed in Python 3 */
1659 #if PY_VERSION_HEX < 0x03000000
1660  (binaryfunc)0, /*nb_divide*/
1661 #endif
1662  (binaryfunc)0, /*nb_remainder*/
1663  (binaryfunc)0, /*nb_divmod*/
1664  (ternaryfunc)0,/*nb_power*/
1665  (unaryfunc)0, /*nb_negative*/
1666  (unaryfunc)0, /*nb_positive*/
1667  (unaryfunc)0, /*nb_absolute*/
1668  (inquiry)0, /*nb_nonzero*/
1669  0, /*nb_invert*/
1670  0, /*nb_lshift*/
1671  0, /*nb_rshift*/
1672  0, /*nb_and*/
1673  0, /*nb_xor*/
1674  0, /*nb_or*/
1675 #if PY_VERSION_HEX < 0x03000000
1676  0, /*nb_coerce*/
1677 #endif
1678  (unaryfunc)SwigPyObject_long, /*nb_int*/
1679 #if PY_VERSION_HEX < 0x03000000
1680  (unaryfunc)SwigPyObject_long, /*nb_long*/
1681 #else
1682  0, /*nb_reserved*/
1683 #endif
1684  (unaryfunc)0, /*nb_float*/
1685 #if PY_VERSION_HEX < 0x03000000
1686  (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1687  (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1688 #endif
1689 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1690  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1691 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1692  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1693 #else
1694  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1695 #endif
1696  };
1697 
1698  static PyTypeObject swigpyobject_type;
1699  static int type_init = 0;
1700  if (!type_init) {
1701  const PyTypeObject tmp = {
1702 #if PY_VERSION_HEX >= 0x03000000
1703  PyVarObject_HEAD_INIT(NULL, 0)
1704 #else
1705  PyObject_HEAD_INIT(NULL)
1706  0, /* ob_size */
1707 #endif
1708  "SwigPyObject", /* tp_name */
1709  sizeof(SwigPyObject), /* tp_basicsize */
1710  0, /* tp_itemsize */
1711  (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1712  0, /* tp_print */
1713  (getattrfunc)0, /* tp_getattr */
1714  (setattrfunc)0, /* tp_setattr */
1715 #if PY_VERSION_HEX >= 0x03000000
1716  0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1717 #else
1718  (cmpfunc)SwigPyObject_compare, /* tp_compare */
1719 #endif
1720  (reprfunc)SwigPyObject_repr, /* tp_repr */
1721  &SwigPyObject_as_number, /* tp_as_number */
1722  0, /* tp_as_sequence */
1723  0, /* tp_as_mapping */
1724  (hashfunc)0, /* tp_hash */
1725  (ternaryfunc)0, /* tp_call */
1726  0, /* tp_str */
1727  PyObject_GenericGetAttr, /* tp_getattro */
1728  0, /* tp_setattro */
1729  0, /* tp_as_buffer */
1730  Py_TPFLAGS_DEFAULT, /* tp_flags */
1731  swigobject_doc, /* tp_doc */
1732  0, /* tp_traverse */
1733  0, /* tp_clear */
1734  (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1735  0, /* tp_weaklistoffset */
1736  0, /* tp_iter */
1737  0, /* tp_iternext */
1738  swigobject_methods, /* tp_methods */
1739  0, /* tp_members */
1740  0, /* tp_getset */
1741  0, /* tp_base */
1742  0, /* tp_dict */
1743  0, /* tp_descr_get */
1744  0, /* tp_descr_set */
1745  0, /* tp_dictoffset */
1746  0, /* tp_init */
1747  0, /* tp_alloc */
1748  0, /* tp_new */
1749  0, /* tp_free */
1750  0, /* tp_is_gc */
1751  0, /* tp_bases */
1752  0, /* tp_mro */
1753  0, /* tp_cache */
1754  0, /* tp_subclasses */
1755  0, /* tp_weaklist */
1756  0, /* tp_del */
1757  0, /* tp_version_tag */
1758 #if PY_VERSION_HEX >= 0x03040000
1759  0, /* tp_finalize */
1760 #endif
1761 #ifdef COUNT_ALLOCS
1762  0, /* tp_allocs */
1763  0, /* tp_frees */
1764  0, /* tp_maxalloc */
1765  0, /* tp_prev */
1766  0 /* tp_next */
1767 #endif
1768  };
1769  swigpyobject_type = tmp;
1770  type_init = 1;
1771  if (PyType_Ready(&swigpyobject_type) < 0)
1772  return NULL;
1773  }
1774  return &swigpyobject_type;
1775 }
1776 
1777 SWIGRUNTIME PyObject *
1778 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1779 {
1780  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1781  if (sobj) {
1782  sobj->ptr = ptr;
1783  sobj->ty = ty;
1784  sobj->own = own;
1785  sobj->next = 0;
1786  }
1787  return (PyObject *)sobj;
1788 }
1789 
1790 /* -----------------------------------------------------------------------------
1791  * Implements a simple Swig Packed type, and use it instead of string
1792  * ----------------------------------------------------------------------------- */
1793 
1794 typedef struct {
1795  PyObject_HEAD
1796  void *pack;
1797  swig_type_info *ty;
1798  size_t size;
1799 } SwigPyPacked;
1800 
1801 SWIGRUNTIME PyObject *
1803 {
1804  char result[SWIG_BUFFER_SIZE];
1805  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1806  return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1807  } else {
1808  return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1809  }
1810 }
1811 
1812 SWIGRUNTIME PyObject *
1814 {
1815  char result[SWIG_BUFFER_SIZE];
1816  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1817  return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1818  } else {
1819  return SWIG_Python_str_FromChar(v->ty->name);
1820  }
1821 }
1822 
1823 SWIGRUNTIME int
1825 {
1826  size_t i = v->size;
1827  size_t j = w->size;
1828  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1829  return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1830 }
1831 
1832 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1833 
1834 SWIGRUNTIME PyTypeObject*
1836  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1837  return type;
1838 }
1839 
1841 SwigPyPacked_Check(PyObject *op) {
1842  return ((op)->ob_type == SwigPyPacked_TypeOnce())
1843  || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1844 }
1845 
1846 SWIGRUNTIME void
1848 {
1849  if (SwigPyPacked_Check(v)) {
1850  SwigPyPacked *sobj = (SwigPyPacked *) v;
1851  free(sobj->pack);
1852  }
1853  PyObject_DEL(v);
1854 }
1855 
1856 SWIGRUNTIME PyTypeObject*
1858  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1859  static PyTypeObject swigpypacked_type;
1860  static int type_init = 0;
1861  if (!type_init) {
1862  const PyTypeObject tmp = {
1863 #if PY_VERSION_HEX>=0x03000000
1864  PyVarObject_HEAD_INIT(NULL, 0)
1865 #else
1866  PyObject_HEAD_INIT(NULL)
1867  0, /* ob_size */
1868 #endif
1869  "SwigPyPacked", /* tp_name */
1870  sizeof(SwigPyPacked), /* tp_basicsize */
1871  0, /* tp_itemsize */
1872  (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1873  0, /* tp_print */
1874  (getattrfunc)0, /* tp_getattr */
1875  (setattrfunc)0, /* tp_setattr */
1876 #if PY_VERSION_HEX>=0x03000000
1877  0, /* tp_reserved in 3.0.1 */
1878 #else
1879  (cmpfunc)SwigPyPacked_compare, /* tp_compare */
1880 #endif
1881  (reprfunc)SwigPyPacked_repr, /* tp_repr */
1882  0, /* tp_as_number */
1883  0, /* tp_as_sequence */
1884  0, /* tp_as_mapping */
1885  (hashfunc)0, /* tp_hash */
1886  (ternaryfunc)0, /* tp_call */
1887  (reprfunc)SwigPyPacked_str, /* tp_str */
1888  PyObject_GenericGetAttr, /* tp_getattro */
1889  0, /* tp_setattro */
1890  0, /* tp_as_buffer */
1891  Py_TPFLAGS_DEFAULT, /* tp_flags */
1892  swigpacked_doc, /* tp_doc */
1893  0, /* tp_traverse */
1894  0, /* tp_clear */
1895  0, /* tp_richcompare */
1896  0, /* tp_weaklistoffset */
1897  0, /* tp_iter */
1898  0, /* tp_iternext */
1899  0, /* tp_methods */
1900  0, /* tp_members */
1901  0, /* tp_getset */
1902  0, /* tp_base */
1903  0, /* tp_dict */
1904  0, /* tp_descr_get */
1905  0, /* tp_descr_set */
1906  0, /* tp_dictoffset */
1907  0, /* tp_init */
1908  0, /* tp_alloc */
1909  0, /* tp_new */
1910  0, /* tp_free */
1911  0, /* tp_is_gc */
1912  0, /* tp_bases */
1913  0, /* tp_mro */
1914  0, /* tp_cache */
1915  0, /* tp_subclasses */
1916  0, /* tp_weaklist */
1917  0, /* tp_del */
1918  0, /* tp_version_tag */
1919 #if PY_VERSION_HEX >= 0x03040000
1920  0, /* tp_finalize */
1921 #endif
1922 #ifdef COUNT_ALLOCS
1923  0, /* tp_allocs */
1924  0, /* tp_frees */
1925  0, /* tp_maxalloc */
1926  0, /* tp_prev */
1927  0 /* tp_next */
1928 #endif
1929  };
1930  swigpypacked_type = tmp;
1931  type_init = 1;
1932  if (PyType_Ready(&swigpypacked_type) < 0)
1933  return NULL;
1934  }
1935  return &swigpypacked_type;
1936 }
1937 
1938 SWIGRUNTIME PyObject *
1939 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1940 {
1941  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1942  if (sobj) {
1943  void *pack = malloc(size);
1944  if (pack) {
1945  memcpy(pack, ptr, size);
1946  sobj->pack = pack;
1947  sobj->ty = ty;
1948  sobj->size = size;
1949  } else {
1950  PyObject_DEL((PyObject *) sobj);
1951  sobj = 0;
1952  }
1953  }
1954  return (PyObject *) sobj;
1955 }
1956 
1958 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1959 {
1960  if (SwigPyPacked_Check(obj)) {
1961  SwigPyPacked *sobj = (SwigPyPacked *)obj;
1962  if (sobj->size != size) return 0;
1963  memcpy(ptr, sobj->pack, size);
1964  return sobj->ty;
1965  } else {
1966  return 0;
1967  }
1968 }
1969 
1970 /* -----------------------------------------------------------------------------
1971  * pointers/data manipulation
1972  * ----------------------------------------------------------------------------- */
1973 
1974 static PyObject *Swig_This_global = NULL;
1975 
1976 SWIGRUNTIME PyObject *
1978 {
1979  if (Swig_This_global == NULL)
1981  return Swig_This_global;
1982 }
1983 
1984 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1985 
1986 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
1987 #if PY_VERSION_HEX>=0x03000000
1988 #define SWIG_PYTHON_SLOW_GETSET_THIS
1989 #endif
1990 
1992 SWIG_Python_GetSwigThis(PyObject *pyobj)
1993 {
1994  PyObject *obj;
1995 
1996  if (SwigPyObject_Check(pyobj))
1997  return (SwigPyObject *) pyobj;
1998 
1999 #ifdef SWIGPYTHON_BUILTIN
2000  (void)obj;
2001 # ifdef PyWeakref_CheckProxy
2002  if (PyWeakref_CheckProxy(pyobj)) {
2003  pyobj = PyWeakref_GET_OBJECT(pyobj);
2004  if (pyobj && SwigPyObject_Check(pyobj))
2005  return (SwigPyObject*) pyobj;
2006  }
2007 # endif
2008  return NULL;
2009 #else
2010 
2011  obj = 0;
2012 
2013 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2014  if (PyInstance_Check(pyobj)) {
2015  obj = _PyInstance_Lookup(pyobj, SWIG_This());
2016  } else {
2017  PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2018  if (dictptr != NULL) {
2019  PyObject *dict = *dictptr;
2020  obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2021  } else {
2022 #ifdef PyWeakref_CheckProxy
2023  if (PyWeakref_CheckProxy(pyobj)) {
2024  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2025  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2026  }
2027 #endif
2028  obj = PyObject_GetAttr(pyobj,SWIG_This());
2029  if (obj) {
2030  Py_DECREF(obj);
2031  } else {
2032  if (PyErr_Occurred()) PyErr_Clear();
2033  return 0;
2034  }
2035  }
2036  }
2037 #else
2038  obj = PyObject_GetAttr(pyobj,SWIG_This());
2039  if (obj) {
2040  Py_DECREF(obj);
2041  } else {
2042  if (PyErr_Occurred()) PyErr_Clear();
2043  return 0;
2044  }
2045 #endif
2046  if (obj && !SwigPyObject_Check(obj)) {
2047  /* a PyObject is called 'this', try to get the 'real this'
2048  SwigPyObject from it */
2049  return SWIG_Python_GetSwigThis(obj);
2050  }
2051  return (SwigPyObject *)obj;
2052 #endif
2053 }
2054 
2055 /* Acquire a pointer value */
2056 
2057 SWIGRUNTIME int
2058 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2059  if (own == SWIG_POINTER_OWN) {
2061  if (sobj) {
2062  int oldown = sobj->own;
2063  sobj->own = own;
2064  return oldown;
2065  }
2066  }
2067  return 0;
2068 }
2069 
2070 /* Convert a pointer value */
2071 
2072 SWIGRUNTIME int
2073 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2074  int res;
2075  SwigPyObject *sobj;
2076  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2077 
2078  if (!obj)
2079  return SWIG_ERROR;
2080  if (obj == Py_None && !implicit_conv) {
2081  if (ptr)
2082  *ptr = 0;
2084  }
2085 
2086  res = SWIG_ERROR;
2087 
2088  sobj = SWIG_Python_GetSwigThis(obj);
2089  if (own)
2090  *own = 0;
2091  while (sobj) {
2092  void *vptr = sobj->ptr;
2093  if (ty) {
2094  swig_type_info *to = sobj->ty;
2095  if (to == ty) {
2096  /* no type cast needed */
2097  if (ptr) *ptr = vptr;
2098  break;
2099  } else {
2100  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2101  if (!tc) {
2102  sobj = (SwigPyObject *)sobj->next;
2103  } else {
2104  if (ptr) {
2105  int newmemory = 0;
2106  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2107  if (newmemory == SWIG_CAST_NEW_MEMORY) {
2108  assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2109  if (own)
2110  *own = *own | SWIG_CAST_NEW_MEMORY;
2111  }
2112  }
2113  break;
2114  }
2115  }
2116  } else {
2117  if (ptr) *ptr = vptr;
2118  break;
2119  }
2120  }
2121  if (sobj) {
2122  if (own)
2123  *own = *own | sobj->own;
2124  if (flags & SWIG_POINTER_DISOWN) {
2125  sobj->own = 0;
2126  }
2127  res = SWIG_OK;
2128  } else {
2129  if (implicit_conv) {
2130  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2131  if (data && !data->implicitconv) {
2132  PyObject *klass = data->klass;
2133  if (klass) {
2134  PyObject *impconv;
2135  data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2136  impconv = SWIG_Python_CallFunctor(klass, obj);
2137  data->implicitconv = 0;
2138  if (PyErr_Occurred()) {
2139  PyErr_Clear();
2140  impconv = 0;
2141  }
2142  if (impconv) {
2143  SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2144  if (iobj) {
2145  void *vptr;
2146  res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2147  if (SWIG_IsOK(res)) {
2148  if (ptr) {
2149  *ptr = vptr;
2150  /* transfer the ownership to 'ptr' */
2151  iobj->own = 0;
2152  res = SWIG_AddCast(res);
2153  res = SWIG_AddNewMask(res);
2154  } else {
2155  res = SWIG_AddCast(res);
2156  }
2157  }
2158  }
2159  Py_DECREF(impconv);
2160  }
2161  }
2162  }
2163  if (!SWIG_IsOK(res) && obj == Py_None) {
2164  if (ptr)
2165  *ptr = 0;
2166  if (PyErr_Occurred())
2167  PyErr_Clear();
2168  res = SWIG_OK;
2169  }
2170  }
2171  }
2172  return res;
2173 }
2174 
2175 /* Convert a function ptr value */
2176 
2177 SWIGRUNTIME int
2178 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2179  if (!PyCFunction_Check(obj)) {
2180  return SWIG_ConvertPtr(obj, ptr, ty, 0);
2181  } else {
2182  void *vptr = 0;
2183  swig_cast_info *tc;
2184 
2185  /* here we get the method pointer for callbacks */
2186  const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2187  const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2188  if (desc)
2189  desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2190  if (!desc)
2191  return SWIG_ERROR;
2192  tc = SWIG_TypeCheck(desc,ty);
2193  if (tc) {
2194  int newmemory = 0;
2195  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2196  assert(!newmemory); /* newmemory handling not yet implemented */
2197  } else {
2198  return SWIG_ERROR;
2199  }
2200  return SWIG_OK;
2201  }
2202 }
2203 
2204 /* Convert a packed pointer value */
2205 
2206 SWIGRUNTIME int
2207 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2208  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2209  if (!to) return SWIG_ERROR;
2210  if (ty) {
2211  if (to != ty) {
2212  /* check type cast? */
2213  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2214  if (!tc) return SWIG_ERROR;
2215  }
2216  }
2217  return SWIG_OK;
2218 }
2219 
2220 /* -----------------------------------------------------------------------------
2221  * Create a new pointer object
2222  * ----------------------------------------------------------------------------- */
2223 
2224 /*
2225  Create a new instance object, without calling __init__, and set the
2226  'this' attribute.
2227 */
2228 
2229 SWIGRUNTIME PyObject*
2231 {
2232  PyObject *inst = 0;
2233  PyObject *newraw = data->newraw;
2234  if (newraw) {
2235  inst = PyObject_Call(newraw, data->newargs, NULL);
2236  if (inst) {
2237 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2238  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2239  if (dictptr != NULL) {
2240  PyObject *dict = *dictptr;
2241  if (dict == NULL) {
2242  dict = PyDict_New();
2243  *dictptr = dict;
2244  PyDict_SetItem(dict, SWIG_This(), swig_this);
2245  }
2246  }
2247 #else
2248  PyObject *key = SWIG_This();
2249  PyObject_SetAttr(inst, key, swig_this);
2250 #endif
2251  }
2252  } else {
2253 #if PY_VERSION_HEX >= 0x03000000
2254  PyObject *empty_args = PyTuple_New(0);
2255  if (empty_args) {
2256  PyObject *empty_kwargs = PyDict_New();
2257  if (empty_kwargs) {
2258  inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2259  Py_DECREF(empty_kwargs);
2260  if (inst) {
2261  PyObject_SetAttr(inst, SWIG_This(), swig_this);
2262  Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2263  }
2264  }
2265  Py_DECREF(empty_args);
2266  }
2267 #else
2268  PyObject *dict = PyDict_New();
2269  if (dict) {
2270  PyDict_SetItem(dict, SWIG_This(), swig_this);
2271  inst = PyInstance_NewRaw(data->newargs, dict);
2272  Py_DECREF(dict);
2273  }
2274 #endif
2275  }
2276  return inst;
2277 }
2278 
2279 SWIGRUNTIME void
2280 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2281 {
2282  PyObject *dict;
2283 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2284  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2285  if (dictptr != NULL) {
2286  dict = *dictptr;
2287  if (dict == NULL) {
2288  dict = PyDict_New();
2289  *dictptr = dict;
2290  }
2291  PyDict_SetItem(dict, SWIG_This(), swig_this);
2292  return;
2293  }
2294 #endif
2295  dict = PyObject_GetAttrString(inst, "__dict__");
2296  PyDict_SetItem(dict, SWIG_This(), swig_this);
2297  Py_DECREF(dict);
2298 }
2299 
2300 
2301 SWIGINTERN PyObject *
2303  PyObject *obj[2];
2304  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2305  return NULL;
2306  } else {
2307  SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2308  if (sthis) {
2309  SwigPyObject_append((PyObject*) sthis, obj[1]);
2310  } else {
2311  SWIG_Python_SetSwigThis(obj[0], obj[1]);
2312  }
2313  return SWIG_Py_Void();
2314  }
2315 }
2316 
2317 /* Create a new pointer object */
2318 
2319 SWIGRUNTIME PyObject *
2320 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2321  SwigPyClientData *clientdata;
2322  PyObject * robj;
2323  int own;
2324 
2325  if (!ptr)
2326  return SWIG_Py_Void();
2327 
2328  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2329  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2330  if (clientdata && clientdata->pytype) {
2331  SwigPyObject *newobj;
2332  if (flags & SWIG_BUILTIN_TP_INIT) {
2333  newobj = (SwigPyObject*) self;
2334  if (newobj->ptr) {
2335  PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2336  while (newobj->next)
2337  newobj = (SwigPyObject *) newobj->next;
2338  newobj->next = next_self;
2339  newobj = (SwigPyObject *)next_self;
2340 #ifdef SWIGPYTHON_BUILTIN
2341  newobj->dict = 0;
2342 #endif
2343  }
2344  } else {
2345  newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2346 #ifdef SWIGPYTHON_BUILTIN
2347  newobj->dict = 0;
2348 #endif
2349  }
2350  if (newobj) {
2351  newobj->ptr = ptr;
2352  newobj->ty = type;
2353  newobj->own = own;
2354  newobj->next = 0;
2355  return (PyObject*) newobj;
2356  }
2357  return SWIG_Py_Void();
2358  }
2359 
2360  assert(!(flags & SWIG_BUILTIN_TP_INIT));
2361 
2362  robj = SwigPyObject_New(ptr, type, own);
2363  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2364  PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2365  Py_DECREF(robj);
2366  robj = inst;
2367  }
2368  return robj;
2369 }
2370 
2371 /* Create a new packed object */
2372 
2373 SWIGRUNTIMEINLINE PyObject *
2374 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2375  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2376 }
2377 
2378 /* -----------------------------------------------------------------------------*
2379  * Get type list
2380  * -----------------------------------------------------------------------------*/
2381 
2382 #ifdef SWIG_LINK_RUNTIME
2383 void *SWIG_ReturnGlobalTypeList(void *);
2384 #endif
2385 
2388  static void *type_pointer = (void *)0;
2389  /* first check if module already created */
2390  if (!type_pointer) {
2391 #ifdef SWIG_LINK_RUNTIME
2392  type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2393 #else
2394  type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2395  if (PyErr_Occurred()) {
2396  PyErr_Clear();
2397  type_pointer = (void *)0;
2398  }
2399 #endif
2400  }
2401  return (swig_module_info *) type_pointer;
2402 }
2403 
2404 SWIGRUNTIME void
2406 {
2407  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2408  swig_type_info **types = swig_module->types;
2409  size_t i;
2410  for (i =0; i < swig_module->size; ++i) {
2411  swig_type_info *ty = types[i];
2412  if (ty->owndata) {
2414  if (data) SwigPyClientData_Del(data);
2415  }
2416  }
2417  Py_DECREF(SWIG_This());
2418  Swig_This_global = NULL;
2419 }
2420 
2421 SWIGRUNTIME void
2423 #if PY_VERSION_HEX >= 0x03000000
2424  /* Add a dummy module object into sys.modules */
2425  PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2426 #else
2427  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2428  PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2429 #endif
2430  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2431  if (pointer && module) {
2432  PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2433  } else {
2434  Py_XDECREF(pointer);
2435  }
2436 }
2437 
2438 /* The python cached type query */
2439 SWIGRUNTIME PyObject *
2441  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2442  return cache;
2443 }
2444 
2446 SWIG_Python_TypeQuery(const char *type)
2447 {
2448  PyObject *cache = SWIG_Python_TypeCache();
2449  PyObject *key = SWIG_Python_str_FromChar(type);
2450  PyObject *obj = PyDict_GetItem(cache, key);
2451  swig_type_info *descriptor;
2452  if (obj) {
2453  descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2454  } else {
2456  descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2457  if (descriptor) {
2458  obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2459  PyDict_SetItem(cache, key, obj);
2460  Py_DECREF(obj);
2461  }
2462  }
2463  Py_DECREF(key);
2464  return descriptor;
2465 }
2466 
2467 /*
2468  For backward compatibility only
2469 */
2470 #define SWIG_POINTER_EXCEPTION 0
2471 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2472 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2473 
2474 SWIGRUNTIME int
2475 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2476 {
2477  if (PyErr_Occurred()) {
2478  PyObject *type = 0;
2479  PyObject *value = 0;
2480  PyObject *traceback = 0;
2481  PyErr_Fetch(&type, &value, &traceback);
2482  if (value) {
2483  PyObject *old_str = PyObject_Str(value);
2484  const char *tmp = SWIG_Python_str_AsChar(old_str);
2485  const char *errmesg = tmp ? tmp : "Invalid error message";
2486  Py_XINCREF(type);
2487  PyErr_Clear();
2488  if (infront) {
2489  PyErr_Format(type, "%s %s", mesg, errmesg);
2490  } else {
2491  PyErr_Format(type, "%s %s", errmesg, mesg);
2492  }
2494  Py_DECREF(old_str);
2495  }
2496  return 1;
2497  } else {
2498  return 0;
2499  }
2500 }
2501 
2502 SWIGRUNTIME int
2504 {
2505  if (PyErr_Occurred()) {
2506  /* add information about failing argument */
2507  char mesg[256];
2508  PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2509  return SWIG_Python_AddErrMesg(mesg, 1);
2510  } else {
2511  return 0;
2512  }
2513 }
2514 
2515 SWIGRUNTIMEINLINE const char *
2516 SwigPyObject_GetDesc(PyObject *self)
2517 {
2518  SwigPyObject *v = (SwigPyObject *)self;
2519  swig_type_info *ty = v ? v->ty : 0;
2520  return ty ? ty->str : "";
2521 }
2522 
2523 SWIGRUNTIME void
2524 SWIG_Python_TypeError(const char *type, PyObject *obj)
2525 {
2526  if (type) {
2527 #if defined(SWIG_COBJECT_TYPES)
2528  if (obj && SwigPyObject_Check(obj)) {
2529  const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2530  if (otype) {
2531  PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2532  type, otype);
2533  return;
2534  }
2535  } else
2536 #endif
2537  {
2538  const char *otype = (obj ? obj->ob_type->tp_name : 0);
2539  if (otype) {
2540  PyObject *str = PyObject_Str(obj);
2541  const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2542  if (cstr) {
2543  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2544  type, otype, cstr);
2546  } else {
2547  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2548  type, otype);
2549  }
2550  Py_XDECREF(str);
2551  return;
2552  }
2553  }
2554  PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2555  } else {
2556  PyErr_Format(PyExc_TypeError, "unexpected type is received");
2557  }
2558 }
2559 
2560 
2561 /* Convert a pointer value, signal an exception on a type mismatch */
2562 SWIGRUNTIME void *
2563 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2564  void *result;
2565  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2566  PyErr_Clear();
2567 #if SWIG_POINTER_EXCEPTION
2568  if (flags) {
2570  SWIG_Python_ArgFail(argnum);
2571  }
2572 #endif
2573  }
2574  return result;
2575 }
2576 
2577 #ifdef SWIGPYTHON_BUILTIN
2578 SWIGRUNTIME int
2579 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2580  PyTypeObject *tp = obj->ob_type;
2581  PyObject *descr;
2582  PyObject *encoded_name;
2583  descrsetfunc f;
2584  int res = -1;
2585 
2586 # ifdef Py_USING_UNICODE
2587  if (PyString_Check(name)) {
2588  name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2589  if (!name)
2590  return -1;
2591  } else if (!PyUnicode_Check(name))
2592 # else
2593  if (!PyString_Check(name))
2594 # endif
2595  {
2596  PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2597  return -1;
2598  } else {
2599  Py_INCREF(name);
2600  }
2601 
2602  if (!tp->tp_dict) {
2603  if (PyType_Ready(tp) < 0)
2604  goto done;
2605  }
2606 
2607  descr = _PyType_Lookup(tp, name);
2608  f = NULL;
2609  if (descr != NULL)
2610  f = descr->ob_type->tp_descr_set;
2611  if (!f) {
2612  if (PyString_Check(name)) {
2613  encoded_name = name;
2614  Py_INCREF(name);
2615  } else {
2616  encoded_name = PyUnicode_AsUTF8String(name);
2617  if (!encoded_name)
2618  return -1;
2619  }
2620  PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2621  Py_DECREF(encoded_name);
2622  } else {
2623  res = f(descr, obj, value);
2624  }
2625 
2626  done:
2627  Py_DECREF(name);
2628  return res;
2629 }
2630 #endif
2631 
2632 
2633 #ifdef __cplusplus
2634 }
2635 #endif
2636 
2637 
2638 
2639 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2640 
2641 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2642 
2643 
2644 
2645 #ifdef __cplusplus
2646 extern "C" {
2647 #endif
2648 
2649 /* Method creation and docstring support functions */
2650 
2651 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
2652 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2653 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2654 
2655 #ifdef __cplusplus
2656 }
2657 #endif
2658 
2659 
2660  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2661 
2662 /* -----------------------------------------------------------------------------
2663  * director_common.swg
2664  *
2665  * This file contains support for director classes which is common between
2666  * languages.
2667  * ----------------------------------------------------------------------------- */
2668 
2669 /*
2670  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
2671  'Swig' namespace. This could be useful for multi-modules projects.
2672 */
2673 #ifdef SWIG_DIRECTOR_STATIC
2674 /* Force anonymous (static) namespace */
2675 #define Swig
2676 #endif
2677 /* -----------------------------------------------------------------------------
2678  * director.swg
2679  *
2680  * This file contains support for director classes so that Python proxy
2681  * methods can be called from C++.
2682  * ----------------------------------------------------------------------------- */
2683 
2684 #ifndef SWIG_DIRECTOR_PYTHON_HEADER_
2685 #define SWIG_DIRECTOR_PYTHON_HEADER_
2686 
2687 #include <string>
2688 #include <iostream>
2689 #include <exception>
2690 #include <vector>
2691 #include <map>
2692 
2693 
2694 /*
2695  Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual
2696  table', and avoid multiple GetAttr calls to retrieve the python
2697  methods.
2698 */
2699 
2700 #ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE
2701 #ifndef SWIG_PYTHON_DIRECTOR_VTABLE
2702 #define SWIG_PYTHON_DIRECTOR_VTABLE
2703 #endif
2704 #endif
2705 
2706 
2707 
2708 /*
2709  Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the
2710  Undefined Exception Handler provided by swig.
2711 */
2712 #ifndef SWIG_DIRECTOR_NO_UEH
2713 #ifndef SWIG_DIRECTOR_UEH
2714 #define SWIG_DIRECTOR_UEH
2715 #endif
2716 #endif
2717 
2718 
2719 /*
2720  Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the
2721  native C++ RTTI and dynamic_cast<>. But be aware that directors
2722  could stop working when using this option.
2723 */
2724 #ifdef SWIG_DIRECTOR_NORTTI
2725 /*
2726  When we don't use the native C++ RTTI, we implement a minimal one
2727  only for Directors.
2728 */
2729 # ifndef SWIG_DIRECTOR_RTDIR
2730 # define SWIG_DIRECTOR_RTDIR
2731 
2732 namespace Swig {
2733  class Director;
2734  SWIGINTERN std::map<void *, Director *>& get_rtdir_map() {
2735  static std::map<void *, Director *> rtdir_map;
2736  return rtdir_map;
2737  }
2738 
2739  SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) {
2740  get_rtdir_map()[vptr] = rtdir;
2741  }
2742 
2743  SWIGINTERNINLINE Director *get_rtdir(void *vptr) {
2744  std::map<void *, Director *>::const_iterator pos = get_rtdir_map().find(vptr);
2745  Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0;
2746  return rtdir;
2747  }
2748 }
2749 # endif /* SWIG_DIRECTOR_RTDIR */
2750 
2751 # define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast<void *>(ARG))
2752 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast<void *>(ARG1), ARG2)
2753 
2754 #else
2755 
2756 # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG)
2757 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
2758 
2759 #endif /* SWIG_DIRECTOR_NORTTI */
2760 
2761 extern "C" {
2762  struct swig_type_info;
2763 }
2764 
2765 namespace Swig {
2766 
2767  /* memory handler */
2768  struct GCItem {
2769  virtual ~GCItem() {}
2770 
2771  virtual int get_own() const {
2772  return 0;
2773  }
2774  };
2775 
2776  struct GCItem_var {
2777  GCItem_var(GCItem *item = 0) : _item(item) {
2778  }
2779 
2781  GCItem *tmp = _item;
2782  _item = item;
2783  delete tmp;
2784  return *this;
2785  }
2786 
2788  delete _item;
2789  }
2790 
2791  GCItem * operator->() const {
2792  return _item;
2793  }
2794 
2795  private:
2796  GCItem *_item;
2797  };
2798 
2799  struct GCItem_Object : GCItem {
2800  GCItem_Object(int own) : _own(own) {
2801  }
2802 
2803  virtual ~GCItem_Object() {
2804  }
2805 
2806  int get_own() const {
2807  return _own;
2808  }
2809 
2810  private:
2811  int _own;
2812  };
2813 
2814  template <typename Type>
2815  struct GCItem_T : GCItem {
2816  GCItem_T(Type *ptr) : _ptr(ptr) {
2817  }
2818 
2819  virtual ~GCItem_T() {
2820  delete _ptr;
2821  }
2822 
2823  private:
2824  Type *_ptr;
2825  };
2826 
2827  template <typename Type>
2828  struct GCArray_T : GCItem {
2829  GCArray_T(Type *ptr) : _ptr(ptr) {
2830  }
2831 
2832  virtual ~GCArray_T() {
2833  delete[] _ptr;
2834  }
2835 
2836  private:
2837  Type *_ptr;
2838  };
2839 
2840  /* base class for director exceptions */
2841  class DirectorException : public std::exception {
2842  protected:
2843  std::string swig_msg;
2844  public:
2845  DirectorException(PyObject *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) {
2847  if (msg[0]) {
2848  swig_msg += " ";
2849  swig_msg += msg;
2850  }
2851  if (!PyErr_Occurred()) {
2852  PyErr_SetString(error, what());
2853  }
2855  }
2856 
2857  virtual ~DirectorException() throw() {
2858  }
2859 
2860  /* Deprecated, use what() instead */
2861  const char *getMessage() const {
2862  return what();
2863  }
2864 
2865  const char *what() const throw() {
2866  return swig_msg.c_str();
2867  }
2868 
2869  static void raise(PyObject *error, const char *msg) {
2870  throw DirectorException(error, msg);
2871  }
2872 
2873  static void raise(const char *msg) {
2874  raise(PyExc_RuntimeError, msg);
2875  }
2876  };
2877 
2878  /* type mismatch in the return value from a python method call */
2879  class DirectorTypeMismatchException : public DirectorException {
2880  public:
2881  DirectorTypeMismatchException(PyObject *error, const char *msg="")
2882  : DirectorException(error, "SWIG director type mismatch", msg) {
2883  }
2884 
2885  DirectorTypeMismatchException(const char *msg="")
2886  : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) {
2887  }
2888 
2889  static void raise(PyObject *error, const char *msg) {
2890  throw DirectorTypeMismatchException(error, msg);
2891  }
2892 
2893  static void raise(const char *msg) {
2894  throw DirectorTypeMismatchException(msg);
2895  }
2896  };
2897 
2898  /* any python exception that occurs during a director method call */
2899  class DirectorMethodException : public DirectorException {
2900  public:
2901  DirectorMethodException(const char *msg = "")
2902  : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) {
2903  }
2904 
2905  static void raise(const char *msg) {
2906  throw DirectorMethodException(msg);
2907  }
2908  };
2909 
2910  /* attempt to call a pure virtual method via a director method */
2911  class DirectorPureVirtualException : public DirectorException {
2912  public:
2913  DirectorPureVirtualException(const char *msg = "")
2914  : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) {
2915  }
2916 
2917  static void raise(const char *msg) {
2918  throw DirectorPureVirtualException(msg);
2919  }
2920  };
2921 
2922 
2923 #if defined(SWIG_PYTHON_THREADS)
2924 /* __THREAD__ is the old macro to activate some thread support */
2925 # if !defined(__THREAD__)
2926 # define __THREAD__ 1
2927 # endif
2928 #endif
2929 
2930 #ifdef __THREAD__
2931 # include "pythread.h"
2932  class Guard {
2933  PyThread_type_lock &mutex_;
2934 
2935  public:
2936  Guard(PyThread_type_lock & mutex) : mutex_(mutex) {
2937  PyThread_acquire_lock(mutex_, WAIT_LOCK);
2938  }
2939 
2941  PyThread_release_lock(mutex_);
2942  }
2943  };
2944 # define SWIG_GUARD(mutex) Guard _guard(mutex)
2945 #else
2946 # define SWIG_GUARD(mutex)
2947 #endif
2948 
2949  /* director base class */
2950  class Director {
2951  private:
2952  /* pointer to the wrapped python object */
2953  PyObject *swig_self;
2954  /* flag indicating whether the object is owned by python or c++ */
2955  mutable bool swig_disown_flag;
2956 
2957  /* decrement the reference count of the wrapped python object */
2958  void swig_decref() const {
2959  if (swig_disown_flag) {
2961  Py_DECREF(swig_self);
2963  }
2964  }
2965 
2966  public:
2967  /* wrap a python object. */
2968  Director(PyObject *self) : swig_self(self), swig_disown_flag(false) {
2969  }
2970 
2971  /* discard our reference at destruction */
2972  virtual ~Director() {
2973  swig_decref();
2974  }
2975 
2976  /* return a pointer to the wrapped python object */
2977  PyObject *swig_get_self() const {
2978  return swig_self;
2979  }
2980 
2981  /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */
2982  void swig_disown() const {
2983  if (!swig_disown_flag) {
2984  swig_disown_flag=true;
2985  swig_incref();
2986  }
2987  }
2988 
2989  /* increase the reference count of the wrapped python object */
2990  void swig_incref() const {
2991  if (swig_disown_flag) {
2992  Py_INCREF(swig_self);
2993  }
2994  }
2995 
2996  /* methods to implement pseudo protected director members */
2997  virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const {
2998  return true;
2999  }
3000 
3001  virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const {
3002  }
3003 
3004  /* ownership management */
3005  private:
3006  typedef std::map<void *, GCItem_var> swig_ownership_map;
3007  mutable swig_ownership_map swig_owner;
3008 #ifdef __THREAD__
3009  static PyThread_type_lock swig_mutex_own;
3010 #endif
3011 
3012  public:
3013  template <typename Type>
3014  void swig_acquire_ownership_array(Type *vptr) const {
3015  if (vptr) {
3016  SWIG_GUARD(swig_mutex_own);
3017  swig_owner[vptr] = new GCArray_T<Type>(vptr);
3018  }
3019  }
3020 
3021  template <typename Type>
3022  void swig_acquire_ownership(Type *vptr) const {
3023  if (vptr) {
3024  SWIG_GUARD(swig_mutex_own);
3025  swig_owner[vptr] = new GCItem_T<Type>(vptr);
3026  }
3027  }
3028 
3029  void swig_acquire_ownership_obj(void *vptr, int own) const {
3030  if (vptr && own) {
3031  SWIG_GUARD(swig_mutex_own);
3032  swig_owner[vptr] = new GCItem_Object(own);
3033  }
3034  }
3035 
3036  int swig_release_ownership(void *vptr) const {
3037  int own = 0;
3038  if (vptr) {
3039  SWIG_GUARD(swig_mutex_own);
3040  swig_ownership_map::iterator iter = swig_owner.find(vptr);
3041  if (iter != swig_owner.end()) {
3042  own = iter->second->get_own();
3043  swig_owner.erase(iter);
3044  }
3045  }
3046  return own;
3047  }
3048 
3049  template <typename Type>
3050  static PyObject *swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args)) {
3051  SwigPyObject *sobj = (SwigPyObject *)pyobj;
3052  sobj->own = 0;
3053  Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast<Type *>(sobj->ptr));
3054  if (d)
3055  d->swig_disown();
3056  return PyWeakref_NewProxy(pyobj, NULL);
3057  }
3058  };
3059 
3060 #ifdef __THREAD__
3061  PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock();
3062 #endif
3063 }
3064 
3065 #endif
3066 
3067 /* -------- TYPES TABLE (BEGIN) -------- */
3068 
3069 #define SWIGTYPE_p_char swig_types[0]
3070 #define SWIGTYPE_p_int swig_types[1]
3071 #define SWIGTYPE_p_long swig_types[2]
3072 #define SWIGTYPE_p_operations_research__Domain swig_types[3]
3073 #define SWIGTYPE_p_operations_research__sat__CpSatHelper swig_types[4]
3074 #define SWIGTYPE_p_operations_research__sat__IntegerVariableProto swig_types[5]
3075 #define SWIGTYPE_p_operations_research__sat__SolutionCallback swig_types[6]
3076 #define SWIGTYPE_p_operations_research__sat__SolveWrapper swig_types[7]
3077 #define SWIGTYPE_p_short swig_types[8]
3078 #define SWIGTYPE_p_signed_char swig_types[9]
3079 #define SWIGTYPE_p_unsigned_char swig_types[10]
3080 #define SWIGTYPE_p_unsigned_int swig_types[11]
3081 #define SWIGTYPE_p_unsigned_long swig_types[12]
3082 #define SWIGTYPE_p_unsigned_short swig_types[13]
3084 static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
3085 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3086 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3087 
3088 /* -------- TYPES TABLE (END) -------- */
3089 
3090 #ifdef SWIG_TypeQuery
3091 # undef SWIG_TypeQuery
3092 #endif
3093 #define SWIG_TypeQuery SWIG_Python_TypeQuery
3094 
3095 /*-----------------------------------------------
3096  @(target):= _pywrapsat.so
3097  ------------------------------------------------*/
3098 #if PY_VERSION_HEX >= 0x03000000
3099 # define SWIG_init PyInit__pywrapsat
3100 
3101 #else
3102 # define SWIG_init init_pywrapsat
3103 
3104 #endif
3105 #define SWIG_name "_pywrapsat"
3106 
3107 #define SWIGVERSION 0x040001
3108 #define SWIG_VERSION SWIGVERSION
3109 
3110 
3111 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3112 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3113 
3114 
3115 #include <stdexcept>
3116 
3117 
3118 namespace swig {
3119  class SwigPtr_PyObject {
3120  protected:
3121  PyObject *_obj;
3122 
3123  public:
3125  {
3126  }
3127 
3129  {
3131  Py_XINCREF(_obj);
3133  }
3134 
3135  SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3136  {
3137  if (initial_ref) {
3139  Py_XINCREF(_obj);
3141  }
3142  }
3143 
3145  {
3147  Py_XINCREF(item._obj);
3148  Py_XDECREF(_obj);
3149  _obj = item._obj;
3151  return *this;
3152  }
3153 
3155  {
3157  Py_XDECREF(_obj);
3159  }
3160 
3161  operator PyObject *() const
3162  {
3163  return _obj;
3164  }
3165 
3166  PyObject *operator->() const
3167  {
3168  return _obj;
3169  }
3170  };
3171 }
3172 
3173 
3174 namespace swig {
3175  struct SwigVar_PyObject : SwigPtr_PyObject {
3176  SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3177 
3179  {
3180  Py_XDECREF(_obj);
3181  _obj = obj;
3182  return *this;
3183  }
3184  };
3185 }
3186 
3187 
3188 #include <cstdint>
3189 #include <string>
3190 #include <vector>
3191 
3192 #include "ortools/base/basictypes.h"
3193 
3194 
3195 #include <stdint.h> // Use the C99 official header
3196 
3197 
3198 #define SWIGWORDSIZE64
3199 #ifndef LONG_MAX
3200 #include <limits.h>
3201 #endif
3202 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
3203 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
3204 #endif
3205 
3206 
3207 #include <string>
3208 
3209 
3210 #include "ortools/base/python-swig.h"
3211 
3212 
3213 #include <functional>
3214 
3215 // A copyable, ref-counted python pointer.
3216 // TODO(user): Make it movable-only when we support generalized lambda
3217 // capture.
3218 class SharedPyPtr {
3219  public:
3220  explicit SharedPyPtr(PyObject* obj) : obj_(obj) { Py_INCREF(obj_); }
3221  SharedPyPtr(const SharedPyPtr& other) : obj_(other.obj_) { Py_INCREF(obj_); }
3222 
3223  ~SharedPyPtr() { Py_DECREF(obj_); }
3224 
3225  PyObject* get() const { return obj_; }
3226 
3227  private:
3228  // We do not follow the rule of three as we only want to copy construct.
3229  SharedPyPtr& operator=(const SharedPyPtr&);
3230 
3231  PyObject* const obj_;
3232 };
3233 
3234 template <typename ReturnT>
3235 static ReturnT HandleResult(PyObject* pyresult) {
3236  // This zero-initializes builtin types.
3237  ReturnT result = ReturnT();
3238  if (!pyresult) {
3239  if (!PyErr_Occurred()) {
3240  PyErr_SetString(PyExc_RuntimeError,
3241  "SWIG std::function invocation failed.");
3242  }
3243  return result;
3244  } else {
3245  if (!PyObjAs<ReturnT>(pyresult, &result)) {
3246  if (!PyErr_Occurred()) {
3247  PyErr_SetString(PyExc_RuntimeError,
3248  "SWIG std::function invocation failed.");
3249  }
3250  }
3251  Py_DECREF(pyresult);
3252  }
3253  return result;
3254 }
3255 
3256 template <>
3257 void HandleResult<void>(PyObject * pyresult) {
3258  if (!pyresult) {
3259  if (!PyErr_Occurred()) {
3260  PyErr_SetString(PyExc_RuntimeError,
3261  "SWIG std::function invocation failed.");
3262  }
3263  } else {
3264  Py_DECREF(pyresult);
3265  }
3266 }
3267 
3268 template <typename ReturnT, typename... Args>
3269 static ReturnT InvokePythonCallableReturning(PyObject* pyfunc,
3270  const char* format, Args... args) {
3271  // The const_cast is safe (it's here only because the python API is not
3272  // const-correct).
3273  return HandleResult<ReturnT>(
3274  PyObject_CallFunction(pyfunc, const_cast<char*>(format), args...));
3275 }
3276 
3277 template <typename ReturnT>
3278 static ReturnT InvokePythonCallableReturning(PyObject* pyfunc) {
3279  return HandleResult<ReturnT>(PyObject_CallFunctionObjArgs(pyfunc, nullptr));
3280 }
3281 
3282 
3283 
3284 #include "ortools/sat/cp_model.pb.h"
3286 #include "ortools/sat/swig_helper.h"
3287 
3288 
3289  #define SWIG_From_long PyInt_FromLong
3290 
3291 
3292  #define SWIG_From_double PyFloat_FromDouble
3293 
3294 
3295 #include <limits.h>
3296 #if !defined(SWIG_NO_LLONG_MAX)
3297 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3298 # define LLONG_MAX __LONG_LONG_MAX__
3299 # define LLONG_MIN (-LLONG_MAX - 1LL)
3300 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3301 # endif
3302 #endif
3303 
3304 
3305 SWIGINTERN int
3306 SWIG_AsVal_double (PyObject *obj, double *val)
3307 {
3308  int res = SWIG_TypeError;
3309  if (PyFloat_Check(obj)) {
3310  if (val) *val = PyFloat_AsDouble(obj);
3311  return SWIG_OK;
3312 #if PY_VERSION_HEX < 0x03000000
3313  } else if (PyInt_Check(obj)) {
3314  if (val) *val = (double) PyInt_AsLong(obj);
3315  return SWIG_OK;
3316 #endif
3317  } else if (PyLong_Check(obj)) {
3318  double v = PyLong_AsDouble(obj);
3319  if (!PyErr_Occurred()) {
3320  if (val) *val = v;
3321  return SWIG_OK;
3322  } else {
3323  PyErr_Clear();
3324  }
3325  }
3326 #ifdef SWIG_PYTHON_CAST_MODE
3327  {
3328  int dispatch = 0;
3329  double d = PyFloat_AsDouble(obj);
3330  if (!PyErr_Occurred()) {
3331  if (val) *val = d;
3332  return SWIG_AddCast(SWIG_OK);
3333  } else {
3334  PyErr_Clear();
3335  }
3336  if (!dispatch) {
3337  long v = PyLong_AsLong(obj);
3338  if (!PyErr_Occurred()) {
3339  if (val) *val = v;
3341  } else {
3342  PyErr_Clear();
3343  }
3344  }
3345  }
3346 #endif
3347  return res;
3348 }
3349 
3350 
3351 #include <float.h>
3352 
3353 
3354 #include <math.h>
3355 
3356 
3357 SWIGINTERNINLINE int
3358 SWIG_CanCastAsInteger(double *d, double min, double max) {
3359  double x = *d;
3360  if ((min <= x && x <= max)) {
3361  double fx = floor(x);
3362  double cx = ceil(x);
3363  double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3364  if ((errno == EDOM) || (errno == ERANGE)) {
3365  errno = 0;
3366  } else {
3367  double summ, reps, diff;
3368  if (rd < x) {
3369  diff = x - rd;
3370  } else if (rd > x) {
3371  diff = rd - x;
3372  } else {
3373  return 1;
3374  }
3375  summ = rd + x;
3376  reps = diff/summ;
3377  if (reps < 8*DBL_EPSILON) {
3378  *d = rd;
3379  return 1;
3380  }
3381  }
3382  }
3383  return 0;
3384 }
3385 
3386 
3387 SWIGINTERN int
3388 SWIG_AsVal_long (PyObject *obj, long* val)
3389 {
3390 #if PY_VERSION_HEX < 0x03000000
3391  if (PyInt_Check(obj)) {
3392  if (val) *val = PyInt_AsLong(obj);
3393  return SWIG_OK;
3394  } else
3395 #endif
3396  if (PyLong_Check(obj)) {
3397  long v = PyLong_AsLong(obj);
3398  if (!PyErr_Occurred()) {
3399  if (val) *val = v;
3400  return SWIG_OK;
3401  } else {
3402  PyErr_Clear();
3403  return SWIG_OverflowError;
3404  }
3405  }
3406 #ifdef SWIG_PYTHON_CAST_MODE
3407  {
3408  int dispatch = 0;
3409  long v = PyInt_AsLong(obj);
3410  if (!PyErr_Occurred()) {
3411  if (val) *val = v;
3412  return SWIG_AddCast(SWIG_OK);
3413  } else {
3414  PyErr_Clear();
3415  }
3416  if (!dispatch) {
3417  double d;
3418  int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3419  if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3420  if (val) *val = (long)(d);
3421  return res;
3422  }
3423  }
3424  }
3425 #endif
3426  return SWIG_TypeError;
3427 }
3428 
3429 
3430 SWIGINTERN int
3431 SWIG_AsVal_int (PyObject * obj, int *val)
3432 {
3433  long v;
3434  int res = SWIG_AsVal_long (obj, &v);
3435  if (SWIG_IsOK(res)) {
3436  if ((v < INT_MIN || v > INT_MAX)) {
3437  return SWIG_OverflowError;
3438  } else {
3439  if (val) *val = static_cast< int >(v);
3440  }
3441  }
3442  return res;
3443 }
3444 
3445 
3446 SWIGINTERNINLINE PyObject*
3448 {
3449  return PyBool_FromLong(value ? 1 : 0);
3450 }
3451 
3452 
3455 {
3456  static int init = 0;
3457  static swig_type_info* info = 0;
3458  if (!init) {
3459  info = SWIG_TypeQuery("_p_char");
3460  init = 1;
3461  }
3462  return info;
3463 }
3464 
3465 
3466 SWIGINTERNINLINE PyObject *
3467 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3468 {
3469  if (carray) {
3470  if (size > INT_MAX) {
3471  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3472  return pchar_descriptor ?
3473  SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3474  } else {
3475 #if PY_VERSION_HEX >= 0x03000000
3476 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3477  return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3478 #else
3479  return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3480 #endif
3481 #else
3482  return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3483 #endif
3484  }
3485  } else {
3486  return SWIG_Py_Void();
3487  }
3488 }
3489 
3490 
3491 SWIGINTERNINLINE PyObject *
3492 SWIG_From_std_string (const std::string& s)
3493 {
3494  return SWIG_FromCharPtrAndSize(s.data(), s.size());
3495 }
3496 
3497 
3498 SWIGINTERN int
3499 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3500 {
3501 #if PY_VERSION_HEX>=0x03000000
3502 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3503  if (PyBytes_Check(obj))
3504 #else
3505  if (PyUnicode_Check(obj))
3506 #endif
3507 #else
3508  if (PyString_Check(obj))
3509 #endif
3510  {
3511  char *cstr; Py_ssize_t len;
3512  int ret = SWIG_OK;
3513 #if PY_VERSION_HEX>=0x03000000
3514 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3515  if (!alloc && cptr) {
3516  /* We can't allow converting without allocation, since the internal
3517  representation of string in Python 3 is UCS-2/UCS-4 but we require
3518  a UTF-8 representation.
3519  TODO(bhy) More detailed explanation */
3520  return SWIG_RuntimeError;
3521  }
3522  obj = PyUnicode_AsUTF8String(obj);
3523  if (!obj)
3524  return SWIG_TypeError;
3525  if (alloc)
3526  *alloc = SWIG_NEWOBJ;
3527 #endif
3528  PyBytes_AsStringAndSize(obj, &cstr, &len);
3529 #else
3530  PyString_AsStringAndSize(obj, &cstr, &len);
3531 #endif
3532  if (cptr) {
3533  if (alloc) {
3534  if (*alloc == SWIG_NEWOBJ) {
3535  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3536  *alloc = SWIG_NEWOBJ;
3537  } else {
3538  *cptr = cstr;
3539  *alloc = SWIG_OLDOBJ;
3540  }
3541  } else {
3542 #if PY_VERSION_HEX>=0x03000000
3543 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3544  *cptr = PyBytes_AsString(obj);
3545 #else
3546  assert(0); /* Should never reach here with Unicode strings in Python 3 */
3547 #endif
3548 #else
3549  *cptr = SWIG_Python_str_AsChar(obj);
3550  if (!*cptr)
3551  ret = SWIG_TypeError;
3552 #endif
3553  }
3554  }
3555  if (psize) *psize = len + 1;
3556 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3557  Py_XDECREF(obj);
3558 #endif
3559  return ret;
3560  } else {
3561 #if defined(SWIG_PYTHON_2_UNICODE)
3562 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3563 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3564 #endif
3565 #if PY_VERSION_HEX<0x03000000
3566  if (PyUnicode_Check(obj)) {
3567  char *cstr; Py_ssize_t len;
3568  if (!alloc && cptr) {
3569  return SWIG_RuntimeError;
3570  }
3571  obj = PyUnicode_AsUTF8String(obj);
3572  if (!obj)
3573  return SWIG_TypeError;
3574  if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3575  if (cptr) {
3576  if (alloc) *alloc = SWIG_NEWOBJ;
3577  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3578  }
3579  if (psize) *psize = len + 1;
3580 
3581  Py_XDECREF(obj);
3582  return SWIG_OK;
3583  } else {
3584  Py_XDECREF(obj);
3585  }
3586  }
3587 #endif
3588 #endif
3589 
3590  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3591  if (pchar_descriptor) {
3592  void* vptr = 0;
3593  if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3594  if (cptr) *cptr = (char *) vptr;
3595  if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3596  if (alloc) *alloc = SWIG_OLDOBJ;
3597  return SWIG_OK;
3598  }
3599  }
3600  }
3601  return SWIG_TypeError;
3602 }
3603 
3604 
3605 SWIGINTERN int
3606 SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
3607 {
3608  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
3609  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
3610  if (buf) {
3611  if (val) *val = new std::string(buf, size - 1);
3612  if (alloc == SWIG_NEWOBJ) delete[] buf;
3613  return SWIG_NEWOBJ;
3614  } else {
3615  if (val) *val = 0;
3616  return SWIG_OLDOBJ;
3617  }
3618  } else {
3619  static int init = 0;
3620  static swig_type_info* descriptor = 0;
3621  if (!init) {
3622  descriptor = SWIG_TypeQuery("std::string" " *");
3623  init = 1;
3624  }
3625  if (descriptor) {
3626  std::string *vptr;
3627  int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
3628  if (SWIG_IsOK(res) && val) *val = vptr;
3629  return res;
3630  }
3631  }
3632  return SWIG_ERROR;
3633 }
3634 
3635 
3636 
3637 /* ---------------------------------------------------
3638  * C++ director class methods
3639  * --------------------------------------------------- */
3640 
3641 #include "sat_python_wrap.h"
3642 
3643 SwigDirector_SolutionCallback::SwigDirector_SolutionCallback(PyObject *self): operations_research::sat::SolutionCallback(), Swig::Director(self) {
3644  SWIG_DIRECTOR_RGTR((operations_research::sat::SolutionCallback *)this, this);
3645 }
3646 
3647 
3648 
3649 
3651 }
3652 
3655  {
3656  if (!swig_get_self()) {
3657  Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call SolutionCallback.__init__.");
3658  }
3659 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
3660  const size_t swig_method_index = 0;
3661  const char *const swig_method_name = "OnSolutionCallback";
3662  PyObject *method = swig_get_method(swig_method_index, swig_method_name);
3663  swig::SwigVar_PyObject args = PyTuple_New(0);
3664  swig::SwigVar_PyObject result = PyObject_Call(method, (PyObject *) args, NULL);
3665 #else
3666  swig::SwigVar_PyObject swig_method_name = SWIG_Python_str_FromChar("OnSolutionCallback");
3667  swig::SwigVar_PyObject result = PyObject_CallMethodObjArgs(swig_get_self(), (PyObject *) swig_method_name, NULL);
3668 #endif
3669  if (!result) {
3670  PyObject *error = PyErr_Occurred();
3671  if (error) {
3672  Swig::DirectorMethodException::raise("Error detected when calling 'SolutionCallback.OnSolutionCallback'");
3673  }
3674  }
3675  }
3677 }
3678 
3679 
3680 #ifdef __cplusplus
3681 extern "C" {
3682 #endif
3683 SWIGINTERN PyObject *_wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3684  PyObject *resultobj = 0;
3685  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3686  void *argp1 = 0 ;
3687  int res1 = 0 ;
3688  PyObject *swig_obj[1] ;
3689 
3690  if (!args) SWIG_fail;
3691  swig_obj[0] = args;
3693  if (!SWIG_IsOK(res1)) {
3694  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3695  }
3696  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3697  {
3699  delete arg1;
3701  }
3702  resultobj = SWIG_Py_Void();
3703  return resultobj;
3704 fail:
3705  return NULL;
3706 }
3707 
3708 
3709 SWIGINTERN PyObject *_wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3710  PyObject *resultobj = 0;
3711  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3712  void *argp1 = 0 ;
3713  int res1 = 0 ;
3714  PyObject *swig_obj[1] ;
3715  Swig::Director *director = 0;
3716  bool upcall = false;
3717 
3718  if (!args) SWIG_fail;
3719  swig_obj[0] = args;
3720  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3721  if (!SWIG_IsOK(res1)) {
3722  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_OnSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3723  }
3724  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3725  director = SWIG_DIRECTOR_CAST(arg1);
3726  upcall = (director && (director->swig_get_self()==swig_obj[0]));
3727  try {
3728  if (upcall) {
3729  Swig::DirectorPureVirtualException::raise("operations_research::sat::SolutionCallback::OnSolutionCallback");
3730  } else {
3731  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
3732  }
3733  } catch (Swig::DirectorException&) {
3734  SWIG_fail;
3735  }
3736  resultobj = SWIG_Py_Void();
3737  return resultobj;
3738 fail:
3739  return NULL;
3740 }
3741 
3742 
3743 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3744  PyObject *resultobj = 0;
3745  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3746  void *argp1 = 0 ;
3747  int res1 = 0 ;
3748  PyObject *swig_obj[1] ;
3749  int64_t result;
3750 
3751  if (!args) SWIG_fail;
3752  swig_obj[0] = args;
3753  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3754  if (!SWIG_IsOK(res1)) {
3755  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBooleans" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3756  }
3757  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3758  {
3760  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
3762  }
3763  resultobj = SWIG_From_long(static_cast< long >(result));
3764  return resultobj;
3765 fail:
3766  return NULL;
3767 }
3768 
3769 
3770 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3771  PyObject *resultobj = 0;
3772  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3773  void *argp1 = 0 ;
3774  int res1 = 0 ;
3775  PyObject *swig_obj[1] ;
3776  int64_t result;
3777 
3778  if (!args) SWIG_fail;
3779  swig_obj[0] = args;
3780  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3781  if (!SWIG_IsOK(res1)) {
3782  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBranches" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3783  }
3784  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3785  {
3787  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
3789  }
3790  resultobj = SWIG_From_long(static_cast< long >(result));
3791  return resultobj;
3792 fail:
3793  return NULL;
3794 }
3795 
3796 
3797 SWIGINTERN PyObject *_wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3798  PyObject *resultobj = 0;
3799  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3800  void *argp1 = 0 ;
3801  int res1 = 0 ;
3802  PyObject *swig_obj[1] ;
3803  int64_t result;
3804 
3805  if (!args) SWIG_fail;
3806  swig_obj[0] = args;
3807  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3808  if (!SWIG_IsOK(res1)) {
3809  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumConflicts" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3810  }
3811  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3812  {
3814  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
3816  }
3817  resultobj = SWIG_From_long(static_cast< long >(result));
3818  return resultobj;
3819 fail:
3820  return NULL;
3821 }
3822 
3823 
3824 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3825  PyObject *resultobj = 0;
3826  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3827  void *argp1 = 0 ;
3828  int res1 = 0 ;
3829  PyObject *swig_obj[1] ;
3830  int64_t result;
3831 
3832  if (!args) SWIG_fail;
3833  swig_obj[0] = args;
3834  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3835  if (!SWIG_IsOK(res1)) {
3836  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBinaryPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3837  }
3838  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3839  {
3841  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
3843  }
3844  resultobj = SWIG_From_long(static_cast< long >(result));
3845  return resultobj;
3846 fail:
3847  return NULL;
3848 }
3849 
3850 
3852  PyObject *resultobj = 0;
3853  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3854  void *argp1 = 0 ;
3855  int res1 = 0 ;
3856  PyObject *swig_obj[1] ;
3857  int64_t result;
3858 
3859  if (!args) SWIG_fail;
3860  swig_obj[0] = args;
3861  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3862  if (!SWIG_IsOK(res1)) {
3863  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumIntegerPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3864  }
3865  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3866  {
3868  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
3870  }
3871  resultobj = SWIG_From_long(static_cast< long >(result));
3872  return resultobj;
3873 fail:
3874  return NULL;
3875 }
3876 
3877 
3878 SWIGINTERN PyObject *_wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3879  PyObject *resultobj = 0;
3880  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3881  void *argp1 = 0 ;
3882  int res1 = 0 ;
3883  PyObject *swig_obj[1] ;
3884  double result;
3885 
3886  if (!args) SWIG_fail;
3887  swig_obj[0] = args;
3888  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3889  if (!SWIG_IsOK(res1)) {
3890  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_WallTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3891  }
3892  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3893  {
3895  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
3897  }
3898  resultobj = SWIG_From_double(static_cast< double >(result));
3899  return resultobj;
3900 fail:
3901  return NULL;
3902 }
3903 
3904 
3905 SWIGINTERN PyObject *_wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3906  PyObject *resultobj = 0;
3907  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3908  void *argp1 = 0 ;
3909  int res1 = 0 ;
3910  PyObject *swig_obj[1] ;
3911  double result;
3912 
3913  if (!args) SWIG_fail;
3914  swig_obj[0] = args;
3915  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3916  if (!SWIG_IsOK(res1)) {
3917  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_UserTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3918  }
3919  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3920  {
3922  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
3924  }
3925  resultobj = SWIG_From_double(static_cast< double >(result));
3926  return resultobj;
3927 fail:
3928  return NULL;
3929 }
3930 
3931 
3932 SWIGINTERN PyObject *_wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3933  PyObject *resultobj = 0;
3934  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3935  void *argp1 = 0 ;
3936  int res1 = 0 ;
3937  PyObject *swig_obj[1] ;
3938  double result;
3939 
3940  if (!args) SWIG_fail;
3941  swig_obj[0] = args;
3942  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3943  if (!SWIG_IsOK(res1)) {
3944  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_ObjectiveValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3945  }
3946  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3947  {
3949  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
3951  }
3952  resultobj = SWIG_From_double(static_cast< double >(result));
3953  return resultobj;
3954 fail:
3955  return NULL;
3956 }
3957 
3958 
3959 SWIGINTERN PyObject *_wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3960  PyObject *resultobj = 0;
3961  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3962  void *argp1 = 0 ;
3963  int res1 = 0 ;
3964  PyObject *swig_obj[1] ;
3965  double result;
3966 
3967  if (!args) SWIG_fail;
3968  swig_obj[0] = args;
3969  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3970  if (!SWIG_IsOK(res1)) {
3971  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_BestObjectiveBound" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3972  }
3973  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3974  {
3976  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
3978  }
3979  resultobj = SWIG_From_double(static_cast< double >(result));
3980  return resultobj;
3981 fail:
3982  return NULL;
3983 }
3984 
3985 
3986 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3987  PyObject *resultobj = 0;
3988  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3989  int arg2 ;
3990  void *argp1 = 0 ;
3991  int res1 = 0 ;
3992  int val2 ;
3993  int ecode2 = 0 ;
3994  PyObject *swig_obj[2] ;
3995  int64_t result;
3996 
3997  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionIntegerValue", 2, 2, swig_obj)) SWIG_fail;
3998  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3999  if (!SWIG_IsOK(res1)) {
4000  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4001  }
4002  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4003  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
4004  if (!SWIG_IsOK(ecode2)) {
4005  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "2"" of type '" "int""'");
4006  }
4007  arg2 = static_cast< int >(val2);
4008  {
4010  result = (int64_t)(arg1)->SolutionIntegerValue(arg2);
4012  }
4013  resultobj = SWIG_From_long(static_cast< long >(result));
4014  return resultobj;
4015 fail:
4016  return NULL;
4017 }
4018 
4019 
4020 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4021  PyObject *resultobj = 0;
4022  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4023  int arg2 ;
4024  void *argp1 = 0 ;
4025  int res1 = 0 ;
4026  int val2 ;
4027  int ecode2 = 0 ;
4028  PyObject *swig_obj[2] ;
4029  bool result;
4030 
4031  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionBooleanValue", 2, 2, swig_obj)) SWIG_fail;
4032  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4033  if (!SWIG_IsOK(res1)) {
4034  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4035  }
4036  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4037  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
4038  if (!SWIG_IsOK(ecode2)) {
4039  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "2"" of type '" "int""'");
4040  }
4041  arg2 = static_cast< int >(val2);
4042  {
4044  result = (bool)(arg1)->SolutionBooleanValue(arg2);
4046  }
4047  resultobj = SWIG_From_bool(static_cast< bool >(result));
4048  return resultobj;
4049 fail:
4050  return NULL;
4051 }
4052 
4053 
4054 SWIGINTERN PyObject *_wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4055  PyObject *resultobj = 0;
4056  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4057  void *argp1 = 0 ;
4058  int res1 = 0 ;
4059  PyObject *swig_obj[1] ;
4060 
4061  if (!args) SWIG_fail;
4062  swig_obj[0] = args;
4063  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4064  if (!SWIG_IsOK(res1)) {
4065  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4066  }
4067  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4068  {
4070  (arg1)->StopSearch();
4072  }
4073  resultobj = SWIG_Py_Void();
4074  return resultobj;
4075 fail:
4076  return NULL;
4077 }
4078 
4079 
4080 SWIGINTERN PyObject *_wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4081  PyObject *resultobj = 0;
4082  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4083  void *argp1 = 0 ;
4084  int res1 = 0 ;
4085  PyObject *swig_obj[1] ;
4087 
4088  if (!args) SWIG_fail;
4089  swig_obj[0] = args;
4090  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4091  if (!SWIG_IsOK(res1)) {
4092  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_Response" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4093  }
4094  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4095  {
4097  result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
4099  }
4100  {
4101  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4102  if (module != nullptr) {
4103  PyObject* const dict = PyModule_GetDict(module);
4104  if (dict != nullptr) {
4105  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4106  if (clss != nullptr) {
4107  std::string encoded_protobuf;
4108  (&result)->SerializeToString(&encoded_protobuf);
4109 
4110  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4111  encoded_protobuf.c_str(), encoded_protobuf.size());
4112 
4113 
4114 
4115 
4116  PyObject* const result = PyObject_CallMethod(
4117  clss, const_cast<char*>("FromString"),
4118  const_cast<char*>("(O)"),
4119  python_encoded_protobuf);
4120  Py_DECREF(python_encoded_protobuf);
4121  resultobj = result;
4122  }
4123  }
4124  Py_DECREF(module);
4125  }
4126  }
4127  return resultobj;
4128 fail:
4129  return NULL;
4130 }
4131 
4132 
4133 SWIGINTERN PyObject *_wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4134  PyObject *resultobj = 0;
4135  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4136  void *argp1 = 0 ;
4137  int res1 = 0 ;
4138  PyObject *swig_obj[1] ;
4139  bool result;
4140 
4141  if (!args) SWIG_fail;
4142  swig_obj[0] = args;
4143  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4144  if (!SWIG_IsOK(res1)) {
4145  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_HasResponse" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4146  }
4147  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4148  {
4150  result = (bool)((operations_research::sat::SolutionCallback const *)arg1)->HasResponse();
4152  }
4153  resultobj = SWIG_From_bool(static_cast< bool >(result));
4154  return resultobj;
4155 fail:
4156  return NULL;
4157 }
4158 
4159 
4160 SWIGINTERN PyObject *_wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4161  PyObject *resultobj = 0;
4162  PyObject *arg1 = (PyObject *) 0 ;
4163  PyObject *swig_obj[1] ;
4164  operations_research::sat::SolutionCallback *result = 0 ;
4165 
4166  if (!args) SWIG_fail;
4167  swig_obj[0] = args;
4168  arg1 = swig_obj[0];
4169  {
4171  if ( arg1 != Py_None ) {
4172  /* subclassed */
4173  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback(arg1);
4174  } else {
4175  SWIG_SetErrorMsg(PyExc_RuntimeError,"accessing abstract class or protected constructor");
4176  SWIG_fail;
4177  }
4178 
4180  }
4182  return resultobj;
4183 fail:
4184  return NULL;
4185 }
4186 
4187 
4188 SWIGINTERN PyObject *_wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4189  PyObject *resultobj = 0;
4190  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4191  void *argp1 = 0 ;
4192  int res1 = 0 ;
4193  PyObject *swig_obj[1] ;
4194 
4195  if (!args) SWIG_fail;
4196  swig_obj[0] = args;
4197  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4198  if (!SWIG_IsOK(res1)) {
4199  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "disown_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4200  }
4201  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4202  {
4204  {
4205  Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
4206  if (director) director->swig_disown();
4207  }
4208 
4210  }
4211  resultobj = SWIG_Py_Void();
4212  return resultobj;
4213 fail:
4214  return NULL;
4215 }
4216 
4217 
4218 SWIGINTERN PyObject *SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4219  PyObject *obj;
4220  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4222  return SWIG_Py_Void();
4223 }
4224 
4225 SWIGINTERN PyObject *SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4226  return SWIG_Python_InitShadowInstance(args);
4227 }
4228 
4229 SWIGINTERN PyObject *_wrap_SolveWrapper_SetParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4230  PyObject *resultobj = 0;
4231  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4233  void *argp1 = 0 ;
4234  int res1 = 0 ;
4235  PyObject *swig_obj[2] ;
4236 
4237  if (!SWIG_Python_UnpackTuple(args, "SolveWrapper_SetParameters", 2, 2, swig_obj)) SWIG_fail;
4238  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4239  if (!SWIG_IsOK(res1)) {
4240  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_SetParameters" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4241  }
4242  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4243  {
4245  PyObject* const pyresult = PyObject_CallMethod(
4246  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4247  if (pyresult != nullptr) {
4248  char* buffer = nullptr;
4249  Py_ssize_t length = 0;
4250  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4251  if (buffer != nullptr) {
4252  arg2->ParseFromArray(buffer, length);
4253  }
4254  Py_DECREF(pyresult);
4255  }
4256  }
4257  {
4259  (arg1)->SetParameters((operations_research::sat::SatParameters const &)*arg2);
4261  }
4262  resultobj = SWIG_Py_Void();
4263  {
4264  delete arg2;
4265  }
4266  return resultobj;
4267 fail:
4268  {
4269  delete arg2;
4270  }
4271  return NULL;
4272 }
4273 
4274 
4275 SWIGINTERN PyObject *_wrap_SolveWrapper_AddSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4276  PyObject *resultobj = 0;
4277  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4278  operations_research::sat::SolutionCallback *arg2 = 0 ;
4279  void *argp1 = 0 ;
4280  int res1 = 0 ;
4281  void *argp2 = 0 ;
4282  int res2 = 0 ;
4283  PyObject *swig_obj[2] ;
4284 
4285  if (!SWIG_Python_UnpackTuple(args, "SolveWrapper_AddSolutionCallback", 2, 2, swig_obj)) SWIG_fail;
4286  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4287  if (!SWIG_IsOK(res1)) {
4288  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_AddSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4289  }
4290  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4291  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0);
4292  if (!SWIG_IsOK(res2)) {
4293  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4294  }
4295  if (!argp2) {
4296  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4297  }
4298  arg2 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp2);
4299  {
4301  (arg1)->AddSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
4303  }
4304  resultobj = SWIG_Py_Void();
4305  return resultobj;
4306 fail:
4307  return NULL;
4308 }
4309 
4310 
4311 SWIGINTERN PyObject *_wrap_SolveWrapper_ClearSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4312  PyObject *resultobj = 0;
4313  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4314  operations_research::sat::SolutionCallback *arg2 = 0 ;
4315  void *argp1 = 0 ;
4316  int res1 = 0 ;
4317  void *argp2 = 0 ;
4318  int res2 = 0 ;
4319  PyObject *swig_obj[2] ;
4320 
4321  if (!SWIG_Python_UnpackTuple(args, "SolveWrapper_ClearSolutionCallback", 2, 2, swig_obj)) SWIG_fail;
4322  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4323  if (!SWIG_IsOK(res1)) {
4324  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4325  }
4326  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4327  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0);
4328  if (!SWIG_IsOK(res2)) {
4329  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4330  }
4331  if (!argp2) {
4332  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4333  }
4334  arg2 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp2);
4335  {
4337  (arg1)->ClearSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
4339  }
4340  resultobj = SWIG_Py_Void();
4341  return resultobj;
4342 fail:
4343  return NULL;
4344 }
4345 
4346 
4347 SWIGINTERN PyObject *_wrap_SolveWrapper_AddLogCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4348  PyObject *resultobj = 0;
4349  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4350  SwigValueWrapper< std::function< void (std::string const &) > > arg2 ;
4351  void *argp1 = 0 ;
4352  int res1 = 0 ;
4353  PyObject *swig_obj[2] ;
4354 
4355  if (!SWIG_Python_UnpackTuple(args, "SolveWrapper_AddLogCallback", 2, 2, swig_obj)) SWIG_fail;
4356  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4357  if (!SWIG_IsOK(res1)) {
4358  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_AddLogCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4359  }
4360  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4361  {
4362  SharedPyPtr input(swig_obj[1]);
4363  arg2 = [input](const std::string& str) {
4364  PyObject* py_str = PyUnicode_FromStringAndSize(str.c_str(), str.size());
4365  PyObject* result;
4367  result = PyObject_CallFunction(input.get(), "O", py_str);
4369  Py_DECREF(py_str);
4370  return result;
4371  };
4372  }
4373  {
4375  (arg1)->AddLogCallback(arg2);
4377  }
4378  resultobj = SWIG_Py_Void();
4379  return resultobj;
4380 fail:
4381  return NULL;
4382 }
4383 
4384 
4385 SWIGINTERN PyObject *_wrap_SolveWrapper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4386  PyObject *resultobj = 0;
4387  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4389  void *argp1 = 0 ;
4390  int res1 = 0 ;
4391  PyObject *swig_obj[2] ;
4393 
4394  if (!SWIG_Python_UnpackTuple(args, "SolveWrapper_Solve", 2, 2, swig_obj)) SWIG_fail;
4395  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4396  if (!SWIG_IsOK(res1)) {
4397  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_Solve" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4398  }
4399  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4400  {
4402  PyObject* const pyresult = PyObject_CallMethod(
4403  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4404  if (pyresult != nullptr) {
4405  char* buffer = nullptr;
4406  Py_ssize_t length = 0;
4407  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4408  if (buffer != nullptr) {
4409  arg2->ParseFromArray(buffer, length);
4410  }
4411  Py_DECREF(pyresult);
4412  }
4413  }
4414  {
4416  result = (arg1)->Solve((operations_research::sat::CpModelProto const &)*arg2);
4418  }
4419  {
4420  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4421  if (module != nullptr) {
4422  PyObject* const dict = PyModule_GetDict(module);
4423  if (dict != nullptr) {
4424  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4425  if (clss != nullptr) {
4426  std::string encoded_protobuf;
4427  (&result)->SerializeToString(&encoded_protobuf);
4428 
4429  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4430  encoded_protobuf.c_str(), encoded_protobuf.size());
4431 
4432 
4433 
4434 
4435  PyObject* const result = PyObject_CallMethod(
4436  clss, const_cast<char*>("FromString"),
4437  const_cast<char*>("(O)"),
4438  python_encoded_protobuf);
4439  Py_DECREF(python_encoded_protobuf);
4440  resultobj = result;
4441  }
4442  }
4443  Py_DECREF(module);
4444  }
4445  }
4446  {
4447  delete arg2;
4448  }
4449  return resultobj;
4450 fail:
4451  {
4452  delete arg2;
4453  }
4454  return NULL;
4455 }
4456 
4457 
4458 SWIGINTERN PyObject *_wrap_SolveWrapper_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4459  PyObject *resultobj = 0;
4460  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4461  void *argp1 = 0 ;
4462  int res1 = 0 ;
4463  PyObject *swig_obj[1] ;
4464 
4465  if (!args) SWIG_fail;
4466  swig_obj[0] = args;
4467  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolveWrapper, 0 | 0 );
4468  if (!SWIG_IsOK(res1)) {
4469  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolveWrapper_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4470  }
4471  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4472  {
4474  (arg1)->StopSearch();
4476  }
4477  resultobj = SWIG_Py_Void();
4478  return resultobj;
4479 fail:
4480  return NULL;
4481 }
4482 
4483 
4484 SWIGINTERN PyObject *_wrap_new_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4485  PyObject *resultobj = 0;
4486  operations_research::sat::SolveWrapper *result = 0 ;
4487 
4488  if (!SWIG_Python_UnpackTuple(args, "new_SolveWrapper", 0, 0, 0)) SWIG_fail;
4489  {
4491  result = (operations_research::sat::SolveWrapper *)new operations_research::sat::SolveWrapper();
4493  }
4495  return resultobj;
4496 fail:
4497  return NULL;
4498 }
4499 
4500 
4501 SWIGINTERN PyObject *_wrap_delete_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4502  PyObject *resultobj = 0;
4503  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4504  void *argp1 = 0 ;
4505  int res1 = 0 ;
4506  PyObject *swig_obj[1] ;
4507 
4508  if (!args) SWIG_fail;
4509  swig_obj[0] = args;
4511  if (!SWIG_IsOK(res1)) {
4512  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SolveWrapper" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4513  }
4514  arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4515  {
4517  delete arg1;
4519  }
4520  resultobj = SWIG_Py_Void();
4521  return resultobj;
4522 fail:
4523  return NULL;
4524 }
4525 
4526 
4527 SWIGINTERN PyObject *SolveWrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4528  PyObject *obj;
4529  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4531  return SWIG_Py_Void();
4532 }
4533 
4534 SWIGINTERN PyObject *SolveWrapper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4535  return SWIG_Python_InitShadowInstance(args);
4536 }
4537 
4538 SWIGINTERN PyObject *_wrap_CpSatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4539  PyObject *resultobj = 0;
4541  PyObject *swig_obj[1] ;
4542  std::string result;
4543 
4544  if (!args) SWIG_fail;
4545  swig_obj[0] = args;
4546  {
4548  PyObject* const pyresult = PyObject_CallMethod(
4549  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4550  if (pyresult != nullptr) {
4551  char* buffer = nullptr;
4552  Py_ssize_t length = 0;
4553  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4554  if (buffer != nullptr) {
4555  arg1->ParseFromArray(buffer, length);
4556  }
4557  Py_DECREF(pyresult);
4558  }
4559  }
4560  {
4562  result = operations_research::sat::CpSatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
4564  }
4565  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4566  {
4567  delete arg1;
4568  }
4569  return resultobj;
4570 fail:
4571  {
4572  delete arg1;
4573  }
4574  return NULL;
4575 }
4576 
4577 
4578 SWIGINTERN PyObject *_wrap_CpSatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4579  PyObject *resultobj = 0;
4581  PyObject *swig_obj[1] ;
4582  std::string result;
4583 
4584  if (!args) SWIG_fail;
4585  swig_obj[0] = args;
4586  {
4588  PyObject* const pyresult = PyObject_CallMethod(
4589  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4590  if (pyresult != nullptr) {
4591  char* buffer = nullptr;
4592  Py_ssize_t length = 0;
4593  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4594  if (buffer != nullptr) {
4595  arg1->ParseFromArray(buffer, length);
4596  }
4597  Py_DECREF(pyresult);
4598  }
4599  }
4600  {
4602  result = operations_research::sat::CpSatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
4604  }
4605  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4606  {
4607  delete arg1;
4608  }
4609  return resultobj;
4610 fail:
4611  {
4612  delete arg1;
4613  }
4614  return NULL;
4615 }
4616 
4617 
4618 SWIGINTERN PyObject *_wrap_CpSatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4619  PyObject *resultobj = 0;
4621  PyObject *swig_obj[1] ;
4622  std::string result;
4623 
4624  if (!args) SWIG_fail;
4625  swig_obj[0] = args;
4626  {
4628  PyObject* const pyresult = PyObject_CallMethod(
4629  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4630  if (pyresult != nullptr) {
4631  char* buffer = nullptr;
4632  Py_ssize_t length = 0;
4633  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4634  if (buffer != nullptr) {
4635  arg1->ParseFromArray(buffer, length);
4636  }
4637  Py_DECREF(pyresult);
4638  }
4639  }
4640  {
4644  }
4645  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4646  {
4647  delete arg1;
4648  }
4649  return resultobj;
4650 fail:
4651  {
4652  delete arg1;
4653  }
4654  return NULL;
4655 }
4656 
4657 
4658 SWIGINTERN PyObject *_wrap_CpSatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4659  PyObject *resultobj = 0;
4661  void *argp1 = 0 ;
4662  int res1 = 0 ;
4663  PyObject *swig_obj[1] ;
4665 
4666  if (!args) SWIG_fail;
4667  swig_obj[0] = args;
4669  if (!SWIG_IsOK(res1)) {
4670  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4671  }
4672  if (!argp1) {
4673  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4674  }
4675  arg1 = reinterpret_cast< operations_research::sat::IntegerVariableProto * >(argp1);
4676  {
4678  result = operations_research::sat::CpSatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
4680  }
4681  resultobj = SWIG_NewPointerObj((new operations_research::Domain(static_cast< const operations_research::Domain& >(result))), SWIGTYPE_p_operations_research__Domain, SWIG_POINTER_OWN | 0 );
4682  return resultobj;
4683 fail:
4684  return NULL;
4685 }
4686 
4687 
4688 SWIGINTERN PyObject *_wrap_CpSatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4689  PyObject *resultobj = 0;
4691  std::string *arg2 = 0 ;
4692  int res2 = SWIG_OLDOBJ ;
4693  PyObject *swig_obj[2] ;
4694  bool result;
4695 
4696  if (!SWIG_Python_UnpackTuple(args, "CpSatHelper_WriteModelToFile", 2, 2, swig_obj)) SWIG_fail;
4697  {
4699  PyObject* const pyresult = PyObject_CallMethod(
4700  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4701  if (pyresult != nullptr) {
4702  char* buffer = nullptr;
4703  Py_ssize_t length = 0;
4704  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4705  if (buffer != nullptr) {
4706  arg1->ParseFromArray(buffer, length);
4707  }
4708  Py_DECREF(pyresult);
4709  }
4710  }
4711  {
4712  std::string *ptr = (std::string *)0;
4713  res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4714  if (!SWIG_IsOK(res2)) {
4715  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CpSatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4716  }
4717  if (!ptr) {
4718  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CpSatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4719  }
4720  arg2 = ptr;
4721  }
4722  {
4724  result = (bool)operations_research::sat::CpSatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
4726  }
4727  resultobj = SWIG_From_bool(static_cast< bool >(result));
4728  {
4729  delete arg1;
4730  }
4731  if (SWIG_IsNewObj(res2)) delete arg2;
4732  return resultobj;
4733 fail:
4734  {
4735  delete arg1;
4736  }
4737  if (SWIG_IsNewObj(res2)) delete arg2;
4738  return NULL;
4739 }
4740 
4741 
4742 SWIGINTERN PyObject *_wrap_new_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4743  PyObject *resultobj = 0;
4744  operations_research::sat::CpSatHelper *result = 0 ;
4745 
4746  if (!SWIG_Python_UnpackTuple(args, "new_CpSatHelper", 0, 0, 0)) SWIG_fail;
4747  {
4749  result = (operations_research::sat::CpSatHelper *)new operations_research::sat::CpSatHelper();
4751  }
4753  return resultobj;
4754 fail:
4755  return NULL;
4756 }
4757 
4758 
4759 SWIGINTERN PyObject *_wrap_delete_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4760  PyObject *resultobj = 0;
4761  operations_research::sat::CpSatHelper *arg1 = (operations_research::sat::CpSatHelper *) 0 ;
4762  void *argp1 = 0 ;
4763  int res1 = 0 ;
4764  PyObject *swig_obj[1] ;
4765 
4766  if (!args) SWIG_fail;
4767  swig_obj[0] = args;
4769  if (!SWIG_IsOK(res1)) {
4770  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CpSatHelper" "', argument " "1"" of type '" "operations_research::sat::CpSatHelper *""'");
4771  }
4772  arg1 = reinterpret_cast< operations_research::sat::CpSatHelper * >(argp1);
4773  {
4775  delete arg1;
4777  }
4778  resultobj = SWIG_Py_Void();
4779  return resultobj;
4780 fail:
4781  return NULL;
4782 }
4783 
4784 
4785 SWIGINTERN PyObject *CpSatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4786  PyObject *obj;
4787  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4789  return SWIG_Py_Void();
4790 }
4791 
4792 SWIGINTERN PyObject *CpSatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4793  return SWIG_Python_InitShadowInstance(args);
4794 }
4795 
4796 static PyMethodDef SwigMethods[] = {
4797  { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
4798  { "delete_SolutionCallback", _wrap_delete_SolutionCallback, METH_O, NULL},
4799  { "SolutionCallback_OnSolutionCallback", _wrap_SolutionCallback_OnSolutionCallback, METH_O, NULL},
4800  { "SolutionCallback_NumBooleans", _wrap_SolutionCallback_NumBooleans, METH_O, NULL},
4801  { "SolutionCallback_NumBranches", _wrap_SolutionCallback_NumBranches, METH_O, NULL},
4802  { "SolutionCallback_NumConflicts", _wrap_SolutionCallback_NumConflicts, METH_O, NULL},
4803  { "SolutionCallback_NumBinaryPropagations", _wrap_SolutionCallback_NumBinaryPropagations, METH_O, NULL},
4804  { "SolutionCallback_NumIntegerPropagations", _wrap_SolutionCallback_NumIntegerPropagations, METH_O, NULL},
4805  { "SolutionCallback_WallTime", _wrap_SolutionCallback_WallTime, METH_O, NULL},
4806  { "SolutionCallback_UserTime", _wrap_SolutionCallback_UserTime, METH_O, NULL},
4807  { "SolutionCallback_ObjectiveValue", _wrap_SolutionCallback_ObjectiveValue, METH_O, NULL},
4808  { "SolutionCallback_BestObjectiveBound", _wrap_SolutionCallback_BestObjectiveBound, METH_O, NULL},
4809  { "SolutionCallback_SolutionIntegerValue", _wrap_SolutionCallback_SolutionIntegerValue, METH_VARARGS, NULL},
4810  { "SolutionCallback_SolutionBooleanValue", _wrap_SolutionCallback_SolutionBooleanValue, METH_VARARGS, NULL},
4811  { "SolutionCallback_StopSearch", _wrap_SolutionCallback_StopSearch, METH_O, NULL},
4812  { "SolutionCallback_Response", _wrap_SolutionCallback_Response, METH_O, NULL},
4813  { "SolutionCallback_HasResponse", _wrap_SolutionCallback_HasResponse, METH_O, NULL},
4814  { "new_SolutionCallback", _wrap_new_SolutionCallback, METH_O, NULL},
4815  { "disown_SolutionCallback", _wrap_disown_SolutionCallback, METH_O, NULL},
4816  { "SolutionCallback_swigregister", SolutionCallback_swigregister, METH_O, NULL},
4817  { "SolutionCallback_swiginit", SolutionCallback_swiginit, METH_VARARGS, NULL},
4818  { "SolveWrapper_SetParameters", _wrap_SolveWrapper_SetParameters, METH_VARARGS, NULL},
4819  { "SolveWrapper_AddSolutionCallback", _wrap_SolveWrapper_AddSolutionCallback, METH_VARARGS, NULL},
4820  { "SolveWrapper_ClearSolutionCallback", _wrap_SolveWrapper_ClearSolutionCallback, METH_VARARGS, NULL},
4821  { "SolveWrapper_AddLogCallback", _wrap_SolveWrapper_AddLogCallback, METH_VARARGS, NULL},
4822  { "SolveWrapper_Solve", _wrap_SolveWrapper_Solve, METH_VARARGS, NULL},
4823  { "SolveWrapper_StopSearch", _wrap_SolveWrapper_StopSearch, METH_O, NULL},
4824  { "new_SolveWrapper", _wrap_new_SolveWrapper, METH_NOARGS, NULL},
4825  { "delete_SolveWrapper", _wrap_delete_SolveWrapper, METH_O, NULL},
4826  { "SolveWrapper_swigregister", SolveWrapper_swigregister, METH_O, NULL},
4827  { "SolveWrapper_swiginit", SolveWrapper_swiginit, METH_VARARGS, NULL},
4828  { "CpSatHelper_ModelStats", _wrap_CpSatHelper_ModelStats, METH_O, NULL},
4829  { "CpSatHelper_SolverResponseStats", _wrap_CpSatHelper_SolverResponseStats, METH_O, NULL},
4830  { "CpSatHelper_ValidateModel", _wrap_CpSatHelper_ValidateModel, METH_O, NULL},
4831  { "CpSatHelper_VariableDomain", _wrap_CpSatHelper_VariableDomain, METH_O, NULL},
4832  { "CpSatHelper_WriteModelToFile", _wrap_CpSatHelper_WriteModelToFile, METH_VARARGS, NULL},
4833  { "new_CpSatHelper", _wrap_new_CpSatHelper, METH_NOARGS, NULL},
4834  { "delete_CpSatHelper", _wrap_delete_CpSatHelper, METH_O, NULL},
4835  { "CpSatHelper_swigregister", CpSatHelper_swigregister, METH_O, NULL},
4836  { "CpSatHelper_swiginit", CpSatHelper_swiginit, METH_VARARGS, NULL},
4837  { NULL, NULL, 0, NULL }
4838 };
4839 
4840 static PyMethodDef SwigMethods_proxydocs[] = {
4841  { NULL, NULL, 0, NULL }
4842 };
4843 
4844 
4845 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4846 
4847 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4848 static swig_type_info _swigt__p_int = {"_p_int", "int *|int_least32_t *|int32_t *", 0, 0, (void*)0, 0};
4849 static swig_type_info _swigt__p_long = {"_p_long", "intptr_t *|int_least64_t *|int_fast32_t *|int_fast64_t *|int64_t *|long *|int_fast16_t *|intmax_t *", 0, 0, (void*)0, 0};
4850 static swig_type_info _swigt__p_operations_research__Domain = {"_p_operations_research__Domain", "operations_research::Domain *", 0, 0, (void*)0, 0};
4851 static swig_type_info _swigt__p_operations_research__sat__CpSatHelper = {"_p_operations_research__sat__CpSatHelper", "operations_research::sat::CpSatHelper *", 0, 0, (void*)0, 0};
4852 static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto = {"_p_operations_research__sat__IntegerVariableProto", "operations_research::sat::IntegerVariableProto *", 0, 0, (void*)0, 0};
4853 static swig_type_info _swigt__p_operations_research__sat__SolutionCallback = {"_p_operations_research__sat__SolutionCallback", "operations_research::sat::SolutionCallback *", 0, 0, (void*)0, 0};
4854 static swig_type_info _swigt__p_operations_research__sat__SolveWrapper = {"_p_operations_research__sat__SolveWrapper", "operations_research::sat::SolveWrapper *", 0, 0, (void*)0, 0};
4855 static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
4856 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
4857 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
4858 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint_least32_t *|uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
4859 static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uintptr_t *|uint_least64_t *|uint_fast32_t *|uint_fast64_t *|uint64_t *|unsigned long *|uint_fast16_t *|uintmax_t *", 0, 0, (void*)0, 0};
4860 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
4861 
4863  &_swigt__p_char,
4864  &_swigt__p_int,
4865  &_swigt__p_long,
4871  &_swigt__p_short,
4877 };
4878 
4879 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4880 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4881 static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
4887 static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
4888 static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
4889 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4890 static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
4891 static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
4893 
4896  _swigc__p_int,
4909 };
4910 
4911 
4912 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4913 
4915 {0, 0, 0, 0.0, 0, 0}};
4916 
4917 #ifdef __cplusplus
4918 }
4919 #endif
4920 /* -----------------------------------------------------------------------------
4921  * Type initialization:
4922  * This problem is tough by the requirement that no dynamic
4923  * memory is used. Also, since swig_type_info structures store pointers to
4924  * swig_cast_info structures and swig_cast_info structures store pointers back
4925  * to swig_type_info structures, we need some lookup code at initialization.
4926  * The idea is that swig generates all the structures that are needed.
4927  * The runtime then collects these partially filled structures.
4928  * The SWIG_InitializeModule function takes these initial arrays out of
4929  * swig_module, and does all the lookup, filling in the swig_module.types
4930  * array with the correct data and linking the correct swig_cast_info
4931  * structures together.
4932  *
4933  * The generated swig_type_info structures are assigned statically to an initial
4934  * array. We just loop through that array, and handle each type individually.
4935  * First we lookup if this type has been already loaded, and if so, use the
4936  * loaded structure instead of the generated one. Then we have to fill in the
4937  * cast linked list. The cast data is initially stored in something like a
4938  * two-dimensional array. Each row corresponds to a type (there are the same
4939  * number of rows as there are in the swig_type_initial array). Each entry in
4940  * a column is one of the swig_cast_info structures for that type.
4941  * The cast_initial array is actually an array of arrays, because each row has
4942  * a variable number of columns. So to actually build the cast linked list,
4943  * we find the array of casts associated with the type, and loop through it
4944  * adding the casts to the list. The one last trick we need to do is making
4945  * sure the type pointer in the swig_cast_info struct is correct.
4946  *
4947  * First off, we lookup the cast->type name to see if it is already loaded.
4948  * There are three cases to handle:
4949  * 1) If the cast->type has already been loaded AND the type we are adding
4950  * casting info to has not been loaded (it is in this module), THEN we
4951  * replace the cast->type pointer with the type pointer that has already
4952  * been loaded.
4953  * 2) If BOTH types (the one we are adding casting info to, and the
4954  * cast->type) are loaded, THEN the cast info has already been loaded by
4955  * the previous module so we just ignore it.
4956  * 3) Finally, if cast->type has not already been loaded, then we add that
4957  * swig_cast_info to the linked list (because the cast->type) pointer will
4958  * be correct.
4959  * ----------------------------------------------------------------------------- */
4960 
4961 #ifdef __cplusplus
4962 extern "C" {
4963 #if 0
4964 } /* c-mode */
4965 #endif
4966 #endif
4967 
4968 #if 0
4969 #define SWIGRUNTIME_DEBUG
4970 #endif
4971 
4972 
4973 SWIGRUNTIME void
4974 SWIG_InitializeModule(void *clientdata) {
4975  size_t i;
4976  swig_module_info *module_head, *iter;
4977  int init;
4978 
4979  /* check to see if the circular list has been setup, if not, set it up */
4980  if (swig_module.next==0) {
4981  /* Initialize the swig_module */
4985  init = 1;
4986  } else {
4987  init = 0;
4988  }
4989 
4990  /* Try and load any already created modules */
4991  module_head = SWIG_GetModule(clientdata);
4992  if (!module_head) {
4993  /* This is the first module loaded for this interpreter */
4994  /* so set the swig module into the interpreter */
4995  SWIG_SetModule(clientdata, &swig_module);
4996  } else {
4997  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4998  iter=module_head;
4999  do {
5000  if (iter==&swig_module) {
5001  /* Our module is already in the list, so there's nothing more to do. */
5002  return;
5003  }
5004  iter=iter->next;
5005  } while (iter!= module_head);
5006 
5007  /* otherwise we must add our module into the list */
5008  swig_module.next = module_head->next;
5009  module_head->next = &swig_module;
5010  }
5011 
5012  /* When multiple interpreters are used, a module could have already been initialized in
5013  a different interpreter, but not yet have a pointer in this interpreter.
5014  In this case, we do not want to continue adding types... everything should be
5015  set up already */
5016  if (init == 0) return;
5017 
5018  /* Now work on filling in swig_module.types */
5019 #ifdef SWIGRUNTIME_DEBUG
5020  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
5021 #endif
5022  for (i = 0; i < swig_module.size; ++i) {
5023  swig_type_info *type = 0;
5024  swig_type_info *ret;
5025  swig_cast_info *cast;
5026 
5027 #ifdef SWIGRUNTIME_DEBUG
5028  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5029 #endif
5030 
5031  /* if there is another module already loaded */
5032  if (swig_module.next != &swig_module) {
5034  }
5035  if (type) {
5036  /* Overwrite clientdata field */
5037 #ifdef SWIGRUNTIME_DEBUG
5038  printf("SWIG_InitializeModule: found type %s\n", type->name);
5039 #endif
5042 #ifdef SWIGRUNTIME_DEBUG
5043  printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
5044 #endif
5045  }
5046  } else {
5047  type = swig_module.type_initial[i];
5048  }
5049 
5050  /* Insert casting types */
5051  cast = swig_module.cast_initial[i];
5052  while (cast->type) {
5053  /* Don't need to add information already in the list */
5054  ret = 0;
5055 #ifdef SWIGRUNTIME_DEBUG
5056  printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
5057 #endif
5058  if (swig_module.next != &swig_module) {
5060 #ifdef SWIGRUNTIME_DEBUG
5061  if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
5062 #endif
5063  }
5064  if (ret) {
5065  if (type == swig_module.type_initial[i]) {
5066 #ifdef SWIGRUNTIME_DEBUG
5067  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
5068 #endif
5069  cast->type = ret;
5070  ret = 0;
5071  } else {
5072  /* Check for casting already in the list */
5073  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
5074 #ifdef SWIGRUNTIME_DEBUG
5075  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
5076 #endif
5077  if (!ocast) ret = 0;
5078  }
5079  }
5080 
5081  if (!ret) {
5082 #ifdef SWIGRUNTIME_DEBUG
5083  printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
5084 #endif
5085  if (type->cast) {
5086  type->cast->prev = cast;
5087  cast->next = type->cast;
5088  }
5089  type->cast = cast;
5090  }
5091  cast++;
5092  }
5093  /* Set entry in modules->types array equal to the type */
5094  swig_module.types[i] = type;
5095  }
5096  swig_module.types[i] = 0;
5097 
5098 #ifdef SWIGRUNTIME_DEBUG
5099  printf("**** SWIG_InitializeModule: Cast List ******\n");
5100  for (i = 0; i < swig_module.size; ++i) {
5101  int j = 0;
5103  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5104  while (cast->type) {
5105  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
5106  cast++;
5107  ++j;
5108  }
5109  printf("---- Total casts: %d\n",j);
5110  }
5111  printf("**** SWIG_InitializeModule: Cast List ******\n");
5112 #endif
5113 }
5114 
5115 /* This function will propagate the clientdata field of type to
5116 * any new swig_type_info structures that have been added into the list
5117 * of equivalent types. It is like calling
5118 * SWIG_TypeClientData(type, clientdata) a second time.
5119 */
5120 SWIGRUNTIME void
5122  size_t i;
5123  swig_cast_info *equiv;
5124  static int init_run = 0;
5125 
5126  if (init_run) return;
5127  init_run = 1;
5128 
5129  for (i = 0; i < swig_module.size; i++) {
5130  if (swig_module.types[i]->clientdata) {
5131  equiv = swig_module.types[i]->cast;
5132  while (equiv) {
5133  if (!equiv->converter) {
5134  if (equiv->type && !equiv->type->clientdata)
5136  }
5137  equiv = equiv->next;
5138  }
5139  }
5140  }
5141 }
5142 
5143 #ifdef __cplusplus
5144 #if 0
5145 {
5146  /* c-mode */
5147 #endif
5148 }
5149 #endif
5150 
5151 
5152 
5153 #ifdef __cplusplus
5154 extern "C" {
5155 #endif
5156 
5157  /* Python-specific SWIG API */
5158 #define SWIG_newvarlink() SWIG_Python_newvarlink()
5159 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
5160 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
5161 
5162  /* -----------------------------------------------------------------------------
5163  * global variable support code.
5164  * ----------------------------------------------------------------------------- */
5165 
5166  typedef struct swig_globalvar {
5167  char *name; /* Name of global variable */
5168  PyObject *(*get_attr)(void); /* Return the current value */
5169  int (*set_attr)(PyObject *); /* Set the value */
5170  struct swig_globalvar *next;
5171  } swig_globalvar;
5172 
5173  typedef struct swig_varlinkobject {
5174  PyObject_HEAD
5177 
5178  SWIGINTERN PyObject *
5180 #if PY_VERSION_HEX >= 0x03000000
5181  return PyUnicode_InternFromString("<Swig global variables>");
5182 #else
5183  return PyString_FromString("<Swig global variables>");
5184 #endif
5185  }
5186 
5187  SWIGINTERN PyObject *
5189 #if PY_VERSION_HEX >= 0x03000000
5190  PyObject *str = PyUnicode_InternFromString("(");
5191  PyObject *tail;
5192  PyObject *joined;
5194  for (var = v->vars; var; var=var->next) {
5195  tail = PyUnicode_FromString(var->name);
5196  joined = PyUnicode_Concat(str, tail);
5197  Py_DecRef(str);
5198  Py_DecRef(tail);
5199  str = joined;
5200  if (var->next) {
5201  tail = PyUnicode_InternFromString(", ");
5202  joined = PyUnicode_Concat(str, tail);
5203  Py_DecRef(str);
5204  Py_DecRef(tail);
5205  str = joined;
5206  }
5207  }
5208  tail = PyUnicode_InternFromString(")");
5209  joined = PyUnicode_Concat(str, tail);
5210  Py_DecRef(str);
5211  Py_DecRef(tail);
5212  str = joined;
5213 #else
5214  PyObject *str = PyString_FromString("(");
5216  for (var = v->vars; var; var=var->next) {
5217  PyString_ConcatAndDel(&str,PyString_FromString(var->name));
5218  if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
5219  }
5220  PyString_ConcatAndDel(&str,PyString_FromString(")"));
5221 #endif
5222  return str;
5223  }
5224 
5225  SWIGINTERN void
5227  swig_globalvar *var = v->vars;
5228  while (var) {
5229  swig_globalvar *n = var->next;
5230  free(var->name);
5231  free(var);
5232  var = n;
5233  }
5234  }
5235 
5236  SWIGINTERN PyObject *
5238  PyObject *res = NULL;
5239  swig_globalvar *var = v->vars;
5240  while (var) {
5241  if (strcmp(var->name,n) == 0) {
5242  res = (*var->get_attr)();
5243  break;
5244  }
5245  var = var->next;
5246  }
5247  if (res == NULL && !PyErr_Occurred()) {
5248  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5249  }
5250  return res;
5251  }
5252 
5253  SWIGINTERN int
5254  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
5255  int res = 1;
5256  swig_globalvar *var = v->vars;
5257  while (var) {
5258  if (strcmp(var->name,n) == 0) {
5259  res = (*var->set_attr)(p);
5260  break;
5261  }
5262  var = var->next;
5263  }
5264  if (res == 1 && !PyErr_Occurred()) {
5265  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5266  }
5267  return res;
5268  }
5269 
5270  SWIGINTERN PyTypeObject*
5272  static char varlink__doc__[] = "Swig var link object";
5273  static PyTypeObject varlink_type;
5274  static int type_init = 0;
5275  if (!type_init) {
5276  const PyTypeObject tmp = {
5277 #if PY_VERSION_HEX >= 0x03000000
5278  PyVarObject_HEAD_INIT(NULL, 0)
5279 #else
5280  PyObject_HEAD_INIT(NULL)
5281  0, /* ob_size */
5282 #endif
5283  "swigvarlink", /* tp_name */
5284  sizeof(swig_varlinkobject), /* tp_basicsize */
5285  0, /* tp_itemsize */
5286  (destructor) swig_varlink_dealloc, /* tp_dealloc */
5287  0, /* tp_print */
5288  (getattrfunc) swig_varlink_getattr, /* tp_getattr */
5289  (setattrfunc) swig_varlink_setattr, /* tp_setattr */
5290  0, /* tp_compare */
5291  (reprfunc) swig_varlink_repr, /* tp_repr */
5292  0, /* tp_as_number */
5293  0, /* tp_as_sequence */
5294  0, /* tp_as_mapping */
5295  0, /* tp_hash */
5296  0, /* tp_call */
5297  (reprfunc) swig_varlink_str, /* tp_str */
5298  0, /* tp_getattro */
5299  0, /* tp_setattro */
5300  0, /* tp_as_buffer */
5301  0, /* tp_flags */
5302  varlink__doc__, /* tp_doc */
5303  0, /* tp_traverse */
5304  0, /* tp_clear */
5305  0, /* tp_richcompare */
5306  0, /* tp_weaklistoffset */
5307  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
5308  0, /* tp_del */
5309  0, /* tp_version_tag */
5310 #if PY_VERSION_HEX >= 0x03040000
5311  0, /* tp_finalize */
5312 #endif
5313 #ifdef COUNT_ALLOCS
5314  0, /* tp_allocs */
5315  0, /* tp_frees */
5316  0, /* tp_maxalloc */
5317  0, /* tp_prev */
5318  0 /* tp_next */
5319 #endif
5320  };
5321  varlink_type = tmp;
5322  type_init = 1;
5323  if (PyType_Ready(&varlink_type) < 0)
5324  return NULL;
5325  }
5326  return &varlink_type;
5327  }
5328 
5329  /* Create a variable linking object for use later */
5330  SWIGINTERN PyObject *
5332  swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
5333  if (result) {
5334  result->vars = 0;
5335  }
5336  return ((PyObject*) result);
5337  }
5338 
5339  SWIGINTERN void
5340  SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
5343  if (gv) {
5344  size_t size = strlen(name)+1;
5345  gv->name = (char *)malloc(size);
5346  if (gv->name) {
5347  memcpy(gv->name, name, size);
5348  gv->get_attr = get_attr;
5349  gv->set_attr = set_attr;
5350  gv->next = v->vars;
5351  }
5352  }
5353  v->vars = gv;
5354  }
5355 
5356  SWIGINTERN PyObject *
5358  static PyObject *globals = 0;
5359  if (!globals) {
5360  globals = SWIG_newvarlink();
5361  }
5362  return globals;
5363  }
5364 
5365  /* -----------------------------------------------------------------------------
5366  * constants/methods manipulation
5367  * ----------------------------------------------------------------------------- */
5368 
5369  /* Install Constants */
5370  SWIGINTERN void
5371  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
5372  PyObject *obj = 0;
5373  size_t i;
5374  for (i = 0; constants[i].type; ++i) {
5375  switch(constants[i].type) {
5376  case SWIG_PY_POINTER:
5377  obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
5378  break;
5379  case SWIG_PY_BINARY:
5380  obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
5381  break;
5382  default:
5383  obj = 0;
5384  break;
5385  }
5386  if (obj) {
5387  PyDict_SetItemString(d, constants[i].name, obj);
5388  Py_DECREF(obj);
5389  }
5390  }
5391  }
5392 
5393  /* -----------------------------------------------------------------------------*/
5394  /* Fix SwigMethods to carry the callback ptrs when needed */
5395  /* -----------------------------------------------------------------------------*/
5396 
5397  SWIGINTERN void
5398  SWIG_Python_FixMethods(PyMethodDef *methods,
5399  swig_const_info *const_table,
5400  swig_type_info **types,
5401  swig_type_info **types_initial) {
5402  size_t i;
5403  for (i = 0; methods[i].ml_name; ++i) {
5404  const char *c = methods[i].ml_doc;
5405  if (!c) continue;
5406  c = strstr(c, "swig_ptr: ");
5407  if (c) {
5408  int j;
5409  swig_const_info *ci = 0;
5410  const char *name = c + 10;
5411  for (j = 0; const_table[j].type; ++j) {
5412  if (strncmp(const_table[j].name, name,
5413  strlen(const_table[j].name)) == 0) {
5414  ci = &(const_table[j]);
5415  break;
5416  }
5417  }
5418  if (ci) {
5419  void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
5420  if (ptr) {
5421  size_t shift = (ci->ptype) - types;
5422  swig_type_info *ty = types_initial[shift];
5423  size_t ldoc = (c - methods[i].ml_doc);
5424  size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
5425  char *ndoc = (char*)malloc(ldoc + lptr + 10);
5426  if (ndoc) {
5427  char *buff = ndoc;
5428  memcpy(buff, methods[i].ml_doc, ldoc);
5429  buff += ldoc;
5430  memcpy(buff, "swig_ptr: ", 10);
5431  buff += 10;
5432  SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
5433  methods[i].ml_doc = ndoc;
5434  }
5435  }
5436  }
5437  }
5438  }
5439  }
5440 
5441  /* -----------------------------------------------------------------------------
5442  * Method creation and docstring support functions
5443  * ----------------------------------------------------------------------------- */
5444 
5445  /* -----------------------------------------------------------------------------
5446  * Function to find the method definition with the correct docstring for the
5447  * proxy module as opposed to the low-level API
5448  * ----------------------------------------------------------------------------- */
5449 
5450  SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
5451  /* Find the function in the modified method table */
5452  size_t offset = 0;
5453  int found = 0;
5454  while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
5455  if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
5456  found = 1;
5457  break;
5458  }
5459  offset++;
5460  }
5461  /* Use the copy with the modified docstring if available */
5462  return found ? &SwigMethods_proxydocs[offset] : NULL;
5463  }
5464 
5465  /* -----------------------------------------------------------------------------
5466  * Wrapper of PyInstanceMethod_New() used in Python 3
5467  * It is exported to the generated module, used for -fastproxy
5468  * ----------------------------------------------------------------------------- */
5469 
5470  SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5471  if (PyCFunction_Check(func)) {
5472  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5473  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5474  if (ml)
5475  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5476  }
5477 #if PY_VERSION_HEX >= 0x03000000
5478  return PyInstanceMethod_New(func);
5479 #else
5480  return PyMethod_New(func, NULL, NULL);
5481 #endif
5482  }
5483 
5484  /* -----------------------------------------------------------------------------
5485  * Wrapper of PyStaticMethod_New()
5486  * It is exported to the generated module, used for -fastproxy
5487  * ----------------------------------------------------------------------------- */
5488 
5489  SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5490  if (PyCFunction_Check(func)) {
5491  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5492  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5493  if (ml)
5494  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5495  }
5496  return PyStaticMethod_New(func);
5497  }
5498 
5499 #ifdef __cplusplus
5500 }
5501 #endif
5502 
5503 /* -----------------------------------------------------------------------------*
5504  * Partial Init method
5505  * -----------------------------------------------------------------------------*/
5506 
5507 #ifdef __cplusplus
5508 extern "C"
5509 #endif
5510 
5511 SWIGEXPORT
5512 #if PY_VERSION_HEX >= 0x03000000
5513 PyObject*
5514 #else
5515 void
5516 #endif
5517 SWIG_init(void) {
5518  PyObject *m, *d, *md, *globals;
5519 
5520 #if PY_VERSION_HEX >= 0x03000000
5521  static struct PyModuleDef SWIG_module = {
5522  PyModuleDef_HEAD_INIT,
5523  SWIG_name,
5524  NULL,
5525  -1,
5526  SwigMethods,
5527  NULL,
5528  NULL,
5529  NULL,
5530  NULL
5531  };
5532 #endif
5533 
5534 #if defined(SWIGPYTHON_BUILTIN)
5535  static SwigPyClientData SwigPyObject_clientdata = {
5536  0, 0, 0, 0, 0, 0, 0
5537  };
5538  static PyGetSetDef this_getset_def = {
5539  (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
5540  };
5541  static SwigPyGetSet thisown_getset_closure = {
5544  };
5545  static PyGetSetDef thisown_getset_def = {
5546  (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
5547  };
5548  PyTypeObject *builtin_pytype;
5549  int builtin_base_count;
5550  swig_type_info *builtin_basetype;
5551  PyObject *tuple;
5552  PyGetSetDescrObject *static_getset;
5553  PyTypeObject *metatype;
5554  PyTypeObject *swigpyobject;
5555  SwigPyClientData *cd;
5556  PyObject *public_interface, *public_symbol;
5557  PyObject *this_descr;
5558  PyObject *thisown_descr;
5559  PyObject *self = 0;
5560  int i;
5561 
5562  (void)builtin_pytype;
5563  (void)builtin_base_count;
5564  (void)builtin_basetype;
5565  (void)tuple;
5566  (void)static_getset;
5567  (void)self;
5568 
5569  /* Metaclass is used to implement static member variables */
5570  metatype = SwigPyObjectType();
5571  assert(metatype);
5572 #endif
5573 
5574  (void)globals;
5575 
5576  /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
5577  SWIG_This();
5580 #ifndef SWIGPYTHON_BUILTIN
5582 #endif
5583 
5584  /* Fix SwigMethods to carry the callback ptrs when needed */
5586 
5587 #if PY_VERSION_HEX >= 0x03000000
5588  m = PyModule_Create(&SWIG_module);
5589 #else
5590  m = Py_InitModule(SWIG_name, SwigMethods);
5591 #endif
5592 
5593  md = d = PyModule_GetDict(m);
5594  (void)md;
5595 
5597 
5598 #ifdef SWIGPYTHON_BUILTIN
5599  swigpyobject = SwigPyObject_TypeOnce();
5600 
5601  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
5602  assert(SwigPyObject_stype);
5603  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
5604  if (!cd) {
5605  SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
5606  SwigPyObject_clientdata.pytype = swigpyobject;
5607  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
5608  PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
5609 # if PY_VERSION_HEX >= 0x03000000
5610  return NULL;
5611 # else
5612  return;
5613 # endif
5614  }
5615 
5616  /* All objects have a 'this' attribute */
5617  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
5618  (void)this_descr;
5619 
5620  /* All objects have a 'thisown' attribute */
5621  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
5622  (void)thisown_descr;
5623 
5624  public_interface = PyList_New(0);
5625  public_symbol = 0;
5626  (void)public_symbol;
5627 
5628  PyDict_SetItemString(md, "__all__", public_interface);
5629  Py_DECREF(public_interface);
5630  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
5631  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
5632  for (i = 0; swig_const_table[i].name != 0; ++i)
5633  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
5634 #endif
5635 
5637 
5638 
5639  /* Initialize threading */
5641 #if PY_VERSION_HEX >= 0x03000000
5642  return m;
5643 #else
5644  return;
5645 #endif
5646 }
5647 
SWIGINTERN PyObject * SolveWrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_init
#define SWIG_POINTER_OWN
static swig_type_info _swigt__p_int
#define SWIGEXPORT
SWIGINTERN PyObject * _wrap_CpSatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
SWIGINTERN PyObject * _wrap_SolveWrapper_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
virtual void OnSolutionCallback() const
SWIGINTERN PyObject * CpSatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_cast_info * cast
static swig_cast_info _swigc__p_operations_research__Domain[]
PyObject * get() const
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
struct swig_cast_info * next
int64_t min
Definition: alldiff_cst.cc:139
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static swig_type_info _swigt__p_unsigned_int
PyObject * swig_get_self() const
#define SWIG_PY_BINARY
SWIGRUNTIME PyObject * SWIG_This(void)
#define SWIG_POINTER_NEW
#define SWIG_MangledTypeQuery(name)
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
void *(* swig_converter_func)(void *, int *)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
#define Py_TYPE(op)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGINTERN PyObject * _wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
static swig_cast_info _swigc__p_operations_research__sat__IntegerVariableProto[]
static swig_cast_info _swigc__p_unsigned_short[]
SWIGINTERN PyObject * CpSatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
#define SWIGTYPE_p_operations_research__Domain
SWIGINTERN PyObject * _wrap_CpSatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
struct swig_cast_info swig_cast_info
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
#define SWIG_NEWOBJ
#define SWIG_NullReferenceError
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
static swig_type_info _swigt__p_signed_char
static swig_cast_info _swigc__p_signed_char[]
const std::string name
PyObject * operator->() const
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
struct swig_type_info swig_type_info
DirectorMethodException(const char *msg="")
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
#define SWIGINTERN
#define SWIG_RUNTIME_VERSION
#define SWIG_IOError
SWIGINTERN PyObject * _wrap_new_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolveWrapper_AddLogCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
#define PyObject_DEL
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
#define SWIGINTERNINLINE
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
#define SWIG_IsOK(r)
SharedPyPtr(const SharedPyPtr &other)
SWIGRUNTIME void SWIG_PropagateClientData(void)
virtual int get_own() const
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
#define SWIG_SystemError
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
SWIGINTERN PyObject * _wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
#define SWIG_OverflowError
static swig_cast_info _swigc__p_short[]
#define SWIG_STATIC_POINTER(var)
Director(PyObject *self)
#define SWIG_ERROR
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
SWIGINTERN PyObject * _wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
SWIGINTERN PyObject * _wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGINTERN PyObject * SolveWrapper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolveWrapper_AddSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
int64_t tail
GCItem_var(GCItem *item=0)
#define SWIGPY_CAPSULE_NAME
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
PyObject_HEAD void * pack
#define SWIG_SetModule(clientdata, pointer)
GCItem * operator->() const
PyObject *(* get_attr)(void)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
PyObject_HEAD swig_globalvar * vars
static swig_type_info _swigt__p_operations_research__sat__SolutionCallback
void swig_acquire_ownership(Type *vptr) const
struct swig_type_info *(* swig_dycast_func)(void **)
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
static swig_type_info * swig_type_initial[]
#define SWIG_MemoryError
virtual void swig_set_inner(const char *, bool) const
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
static PyMethodDef SwigMethods_proxydocs[]
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SWIGINTERN PyObject * _wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
#define SWIG_name
void swig_acquire_ownership_array(Type *vptr) const
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
#define SWIG_PYTHON_INITIALIZE_THREADS
struct swig_globalvar * next
SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
int64_t max
Definition: alldiff_cst.cc:140
Block * next
#define SWIGTYPE_p_operations_research__sat__CpSatHelper
SWIGINTERN PyObject * _wrap_delete_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_Python_str_FromFormat
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_POINTER_NO_NULL
static PyMethodDef swigobject_methods[]
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * _wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
#define SWIGUNUSEDPARM(p)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumIntegerPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_cast_info * prev
void swig_disown() const
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
SWIGINTERN PyObject * SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_DISOWN
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
static swig_cast_info _swigc__p_operations_research__sat__SolutionCallback[]
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
SWIGINTERN PyObject * _wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AddNewMask(r)
static swig_cast_info _swigc__p_operations_research__sat__CpSatHelper[]
#define SWIG_POINTER_NOSHADOW
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
static swig_cast_info _swigc__p_unsigned_char[]
#define SWIG_NewPackedObj(ptr, sz, type)
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_unsigned_long[]
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
struct swig_module_info swig_module_info
#define SWIG_exception_fail(code, msg)
#define SWIG_GetModule(clientdata)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
static swig_type_info _swigt__p_char
#define SWIG_NewPointerObj(ptr, type, flags)
static ReturnT HandleResult(PyObject *pyresult)
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto
#define SWIGTYPE_p_operations_research__sat__SolveWrapper
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
static void raise(JNIEnv *jenv, jthrowable throwable)
#define SWIG_DIRECTOR_CAST(ARG)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
#define SWIG_GUARD(mutex)
struct swig_varlinkobject swig_varlinkobject
#define SWIG_OLDOBJ
static int input(yyscan_t yyscanner)
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
#define SWIG_TypeQuery(name)
static swig_const_info swig_const_table[]
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
SwigVar_PyObject(PyObject *obj=0)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_module_info * next
DirectorException(PyObject *error, const char *hdr="", const char *msg="")
SWIGINTERN PyObject * _wrap_SolveWrapper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * _wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
std::string message
Definition: trace.cc:398
#define SWIG_BUILTIN_TP_INIT
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
#define SWIG_From_long
#define SWIG_NewClientData(obj)
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_delete_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
struct swig_const_info swig_const_info
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static PyMethodDef SwigMethods[]
#define SWIG_CAST_NEW_MEMORY
static swig_module_info swig_module
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
#define SWIG_RuntimeError
DirectorTypeMismatchException(PyObject *error, const char *msg="")
#define SWIGTYPE_p_operations_research__sat__IntegerVariableProto
static swig_cast_info _swigc__p_int[]
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
#define SWIG_TYPE_TABLE_NAME
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
#define SWIG_PY_POINTER
static swig_type_info _swigt__p_operations_research__sat__CpSatHelper
#define SWIGRUNTIMEINLINE
#define SWIG_ConvertPtr(obj, pptr, type, flags)
SwigVar_PyObject & operator=(PyObject *obj)
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
static swig_cast_info _swigc__p_char[]
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
We call domain any subset of Int64 = [kint64min, kint64max].
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
SWIGINTERN PyObject * _wrap_SolveWrapper_ClearSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
PyObject_HEAD void * ptr
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
SWIGINTERN PyObject * _wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_unsigned_long
#define SWIG_TypeError
SharedPyPtr(PyObject *obj)
SWIGINTERN PyObject * _wrap_CpSatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGRUNTIME
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__sat__SolutionCallback
#define SWIG_OK
#define SWIG_From_double
SWIGINTERN PyObject * _wrap_SolveWrapper_SetParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
#define SWIG_AddCast(r)
void * malloc(YYSIZE_T)
#define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
void HandleResult< void >(PyObject *pyresult)
SWIGINTERN PyObject * _wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_globals(void)
#define SWIG_CheckState(r)
struct swig_globalvar swig_globalvar
static swig_type_info _swigt__p_unsigned_short
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AttributeError
SWIGINTERN PyObject * _wrap_CpSatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
static PyObject * swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
absl::Status ValidateModel(const ModelProto &model, const bool check_names)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
#define SWIG_BUFFER_SIZE
Collection of objects used to extend the Constraint Solver library.
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
#define SWIG_fail
DirectorPureVirtualException(const char *msg="")
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
Guard(PyThread_type_lock &mutex)
GCItem_var & operator=(GCItem *item)
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
#define SWIG_PYTHON_THREAD_END_BLOCK
#define SWIG_as_voidptr(a)
const char * getMessage() const
void swig_acquire_ownership_obj(void *vptr, int own) const
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
jobject swig_get_self(JNIEnv *jenv) const
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
static swig_type_info _swigt__p_operations_research__Domain
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
IntVar * var
Definition: expr_array.cc:1874
static swig_type_info _swigt__p_unsigned_char
#define SWIG_newvarlink()
#define SWIG_PYTHON_THREAD_END_ALLOW
void free(void *)
swig_converter_func converter
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
virtual bool swig_get_inner(const char *) const
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
static swig_cast_info _swigc__p_unsigned_int[]
DirectorTypeMismatchException(const char *msg="")
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static swig_cast_info _swigc__p_long[]
static swig_cast_info _swigc__p_operations_research__sat__SolveWrapper[]
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
#define SWIG_IndexError
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
int swig_release_ownership(void *vptr) const
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
#define SWIG_SetErrorMsg
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
static swig_type_info * swig_types[15]
#define SWIG_DivisionByZero
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN PyObject * _wrap_CpSatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_IMPLICIT_CONV
static ReturnT InvokePythonCallableReturning(PyObject *pyfunc, const char *format, Args... args)
static swig_type_info _swigt__p_long
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
#define SWIG_SyntaxError
#define SWIG_IsNewObj(r)
#define SWIG_ValueError
if(!yyg->yy_init)
Definition: parser.yy.cc:965
int64_t value
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
#define SWIG_InstallConstants(d, constants)
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
static swig_type_info _swigt__p_operations_research__sat__SolveWrapper
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGINTERN PyObject * _wrap_new_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
static swig_type_info _swigt__p_short
SWIGINTERN PyObject * SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyObject * Swig_This_global
#define SWIG_ArgError(r)
SwigPtr_PyObject(const SwigPtr_PyObject &item)