OR-Tools  8.2
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.2
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 >= 0x03030000
814  return (char *)PyUnicode_AsUTF8(str);
815 #elif PY_VERSION_HEX >= 0x03000000
816  char *newstr = 0;
817  str = PyUnicode_AsUTF8String(str);
818  if (str) {
819  char *cstr;
820  Py_ssize_t len;
821  if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
822  newstr = (char *) malloc(len+1);
823  if (newstr)
824  memcpy(newstr, cstr, len+1);
825  }
826  Py_XDECREF(str);
827  }
828  return newstr;
829 #else
830  return PyString_AsString(str);
831 #endif
832 }
833 
834 #if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
835 # define SWIG_Python_str_DelForPy3(x)
836 #else
837 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
838 #endif
839 
840 
841 SWIGINTERN PyObject*
843 {
844 #if PY_VERSION_HEX >= 0x03000000
845  return PyUnicode_FromString(c);
846 #else
847  return PyString_FromString(c);
848 #endif
849 }
850 
851 #ifndef PyObject_DEL
852 # define PyObject_DEL PyObject_Del
853 #endif
854 
855 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
856 // interface files check for it.
857 # define SWIGPY_USE_CAPSULE
858 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
859 
860 #if PY_VERSION_HEX < 0x03020000
861 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
862 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
863 #define Py_hash_t long
864 #endif
865 
866 /* -----------------------------------------------------------------------------
867  * error manipulation
868  * ----------------------------------------------------------------------------- */
869 
870 SWIGRUNTIME PyObject*
872  PyObject* type = 0;
873  switch(code) {
874  case SWIG_MemoryError:
875  type = PyExc_MemoryError;
876  break;
877  case SWIG_IOError:
878  type = PyExc_IOError;
879  break;
880  case SWIG_RuntimeError:
881  type = PyExc_RuntimeError;
882  break;
883  case SWIG_IndexError:
884  type = PyExc_IndexError;
885  break;
886  case SWIG_TypeError:
887  type = PyExc_TypeError;
888  break;
889  case SWIG_DivisionByZero:
890  type = PyExc_ZeroDivisionError;
891  break;
892  case SWIG_OverflowError:
893  type = PyExc_OverflowError;
894  break;
895  case SWIG_SyntaxError:
896  type = PyExc_SyntaxError;
897  break;
898  case SWIG_ValueError:
899  type = PyExc_ValueError;
900  break;
901  case SWIG_SystemError:
902  type = PyExc_SystemError;
903  break;
904  case SWIG_AttributeError:
905  type = PyExc_AttributeError;
906  break;
907  default:
908  type = PyExc_RuntimeError;
909  }
910  return type;
911 }
912 
913 
914 SWIGRUNTIME void
915 SWIG_Python_AddErrorMsg(const char* mesg)
916 {
917  PyObject *type = 0;
918  PyObject *value = 0;
919  PyObject *traceback = 0;
920 
921  if (PyErr_Occurred())
922  PyErr_Fetch(&type, &value, &traceback);
923  if (value) {
924  PyObject *old_str = PyObject_Str(value);
925  const char *tmp = SWIG_Python_str_AsChar(old_str);
926  PyErr_Clear();
927  Py_XINCREF(type);
928  if (tmp)
929  PyErr_Format(type, "%s %s", tmp, mesg);
930  else
931  PyErr_Format(type, "%s", mesg);
933  Py_DECREF(old_str);
934  Py_DECREF(value);
935  } else {
936  PyErr_SetString(PyExc_RuntimeError, mesg);
937  }
938 }
939 
940 SWIGRUNTIME int
942 {
943  PyObject *error;
944  if (obj)
945  return 0;
946  error = PyErr_Occurred();
947  return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
948 }
949 
950 SWIGRUNTIME void
952 {
953  if (SWIG_Python_TypeErrorOccurred(NULL)) {
954  /* Use existing TypeError to preserve stacktrace and enhance with given message */
955  PyObject *newvalue;
956  PyObject *type = NULL, *value = NULL, *traceback = NULL;
957  PyErr_Fetch(&type, &value, &traceback);
958 #if PY_VERSION_HEX >= 0x03000000
959  newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
960 #else
961  newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
962 #endif
963  Py_XDECREF(value);
964  PyErr_Restore(type, newvalue, traceback);
965  } else {
966  /* Raise TypeError using given message */
967  PyErr_SetString(PyExc_TypeError, message);
968  }
969 }
970 
971 #if defined(SWIG_PYTHON_NO_THREADS)
972 # if defined(SWIG_PYTHON_THREADS)
973 # undef SWIG_PYTHON_THREADS
974 # endif
975 #endif
976 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
977 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
978 # define SWIG_PYTHON_USE_GIL
979 # endif
980 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
981 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
982 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
983 # endif
984 # ifdef __cplusplus /* C++ code */
985  class SWIG_Python_Thread_Block {
986  bool status;
987  PyGILState_STATE state;
988  public:
989  void end() { if (status) { PyGILState_Release(state); status = false;} }
990  SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
991  ~SWIG_Python_Thread_Block() { end(); }
992  };
993  class SWIG_Python_Thread_Allow {
994  bool status;
995  PyThreadState *save;
996  public:
997  void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
998  SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
999  ~SWIG_Python_Thread_Allow() { end(); }
1000  };
1001 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1002 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1003 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1004 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1005 # else /* C code */
1006 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1007 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1008 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1009 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1010 # endif
1011 # else /* Old thread way, not implemented, user must provide it */
1012 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1013 # define SWIG_PYTHON_INITIALIZE_THREADS
1014 # endif
1015 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1016 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1017 # endif
1018 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1019 # define SWIG_PYTHON_THREAD_END_BLOCK
1020 # endif
1021 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1022 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1023 # endif
1024 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1025 # define SWIG_PYTHON_THREAD_END_ALLOW
1026 # endif
1027 # endif
1028 #else /* No thread support */
1029 # define SWIG_PYTHON_INITIALIZE_THREADS
1030 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1031 # define SWIG_PYTHON_THREAD_END_BLOCK
1032 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1033 # define SWIG_PYTHON_THREAD_END_ALLOW
1034 #endif
1035 
1036 /* -----------------------------------------------------------------------------
1037  * Python API portion that goes into the runtime
1038  * ----------------------------------------------------------------------------- */
1039 
1040 #ifdef __cplusplus
1041 extern "C" {
1042 #endif
1043 
1044 /* -----------------------------------------------------------------------------
1045  * Constant declarations
1046  * ----------------------------------------------------------------------------- */
1047 
1048 /* Constant Types */
1049 #define SWIG_PY_POINTER 4
1050 #define SWIG_PY_BINARY 5
1051 
1052 /* Constant information structure */
1053 typedef struct swig_const_info {
1054  int type;
1055  const char *name;
1056  long lvalue;
1057  double dvalue;
1058  void *pvalue;
1061 
1062 #ifdef __cplusplus
1063 }
1064 #endif
1065 
1066 
1067 /* -----------------------------------------------------------------------------
1068  * pyrun.swg
1069  *
1070  * This file contains the runtime support for Python modules
1071  * and includes code for managing global variables and pointer
1072  * type checking.
1073  *
1074  * ----------------------------------------------------------------------------- */
1075 
1076 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1077 # error "This version of SWIG only supports Python >= 2.7"
1078 #endif
1079 
1080 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1081 # error "This version of SWIG only supports Python 3 >= 3.2"
1082 #endif
1083 
1084 /* Common SWIG API */
1085 
1086 /* for raw pointers */
1087 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1088 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1089 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1090 
1091 #ifdef SWIGPYTHON_BUILTIN
1092 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1093 #else
1094 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1095 #endif
1096 
1097 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1098 
1099 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1100 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1101 #define swig_owntype int
1102 
1103 /* for raw packed data */
1104 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1105 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1106 
1107 /* for class or struct pointers */
1108 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1109 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1110 
1111 /* for C or C++ function pointers */
1112 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1113 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1114 
1115 /* for C++ member pointers, ie, member methods */
1116 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1117 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1118 
1119 
1120 /* Runtime API */
1121 
1122 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1123 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1124 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1125 
1126 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1127 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1128 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1129 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1130 #define SWIG_fail goto fail
1131 
1132 
1133 /* Runtime API implementation */
1134 
1135 /* Error manipulation */
1136 
1137 SWIGINTERN void
1138 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1140  PyErr_SetObject(errtype, obj);
1141  Py_DECREF(obj);
1143 }
1144 
1145 SWIGINTERN void
1146 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1148  PyErr_SetString(errtype, msg);
1150 }
1151 
1152 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1153 
1154 /* Set a constant value */
1155 
1156 #if defined(SWIGPYTHON_BUILTIN)
1157 
1158 SWIGINTERN void
1159 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1160  PyObject *s = PyString_InternFromString(key);
1161  PyList_Append(seq, s);
1162  Py_DECREF(s);
1163 }
1164 
1165 SWIGINTERN void
1166 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1167  PyDict_SetItemString(d, name, obj);
1168  Py_DECREF(obj);
1169  if (public_interface)
1170  SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1171 }
1172 
1173 #else
1174 
1175 SWIGINTERN void
1176 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1177  PyDict_SetItemString(d, name, obj);
1178  Py_DECREF(obj);
1179 }
1180 
1181 #endif
1182 
1183 /* Append a value to the result obj */
1184 
1185 SWIGINTERN PyObject*
1186 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1187  if (!result) {
1188  result = obj;
1189  } else if (result == Py_None) {
1190  Py_DECREF(result);
1191  result = obj;
1192  } else {
1193  if (!PyList_Check(result)) {
1194  PyObject *o2 = result;
1195  result = PyList_New(1);
1196  PyList_SetItem(result, 0, o2);
1197  }
1198  PyList_Append(result,obj);
1199  Py_DECREF(obj);
1200  }
1201  return result;
1202 }
1203 
1204 /* Unpack the argument tuple */
1205 
1206 SWIGINTERN Py_ssize_t
1207 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1208 {
1209  if (!args) {
1210  if (!min && !max) {
1211  return 1;
1212  } else {
1213  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1214  name, (min == max ? "" : "at least "), (int)min);
1215  return 0;
1216  }
1217  }
1218  if (!PyTuple_Check(args)) {
1219  if (min <= 1 && max >= 1) {
1220  Py_ssize_t i;
1221  objs[0] = args;
1222  for (i = 1; i < max; ++i) {
1223  objs[i] = 0;
1224  }
1225  return 2;
1226  }
1227  PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1228  return 0;
1229  } else {
1230  Py_ssize_t l = PyTuple_GET_SIZE(args);
1231  if (l < min) {
1232  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1233  name, (min == max ? "" : "at least "), (int)min, (int)l);
1234  return 0;
1235  } else if (l > max) {
1236  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1237  name, (min == max ? "" : "at most "), (int)max, (int)l);
1238  return 0;
1239  } else {
1240  Py_ssize_t i;
1241  for (i = 0; i < l; ++i) {
1242  objs[i] = PyTuple_GET_ITEM(args, i);
1243  }
1244  for (; l < max; ++l) {
1245  objs[l] = 0;
1246  }
1247  return i + 1;
1248  }
1249  }
1250 }
1251 
1252 SWIGINTERN int
1253 SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1254  int no_kwargs = 1;
1255  if (kwargs) {
1256  assert(PyDict_Check(kwargs));
1257  if (PyDict_Size(kwargs) > 0) {
1258  PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1259  no_kwargs = 0;
1260  }
1261  }
1262  return no_kwargs;
1263 }
1264 
1265 /* A functor is a function object with one single object argument */
1266 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1267 
1268 /*
1269  Helper for static pointer initialization for both C and C++ code, for example
1270  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1271 */
1272 #ifdef __cplusplus
1273 #define SWIG_STATIC_POINTER(var) var
1274 #else
1275 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1276 #endif
1277 
1278 /* -----------------------------------------------------------------------------
1279  * Pointer declarations
1280  * ----------------------------------------------------------------------------- */
1281 
1282 /* Flags for new pointer objects */
1283 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1284 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1285 
1286 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1287 
1288 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1289 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1290 
1291 #ifdef __cplusplus
1292 extern "C" {
1293 #endif
1294 
1295 /* The python void return value */
1296 
1297 SWIGRUNTIMEINLINE PyObject *
1299 {
1300  PyObject *none = Py_None;
1301  Py_INCREF(none);
1302  return none;
1303 }
1304 
1305 /* SwigPyClientData */
1306 
1307 typedef struct {
1308  PyObject *klass;
1309  PyObject *newraw;
1310  PyObject *newargs;
1311  PyObject *destroy;
1312  int delargs;
1313  int implicitconv;
1314  PyTypeObject *pytype;
1316 
1317 SWIGRUNTIMEINLINE int
1319 {
1321  int fail = data ? data->implicitconv : 0;
1322  if (fail)
1323  PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1324  return fail;
1325 }
1326 
1327 SWIGRUNTIMEINLINE PyObject *
1329  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1330  PyObject *klass = data ? data->klass : 0;
1331  return (klass ? klass : PyExc_RuntimeError);
1332 }
1333 
1334 
1336 SwigPyClientData_New(PyObject* obj)
1337 {
1338  if (!obj) {
1339  return 0;
1340  } else {
1342  /* the klass element */
1343  data->klass = obj;
1344  Py_INCREF(data->klass);
1345  /* the newraw method and newargs arguments used to create a new raw instance */
1346  if (PyClass_Check(obj)) {
1347  data->newraw = 0;
1348  data->newargs = obj;
1349  Py_INCREF(obj);
1350  } else {
1351  data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1352  if (data->newraw) {
1353  Py_INCREF(data->newraw);
1354  data->newargs = PyTuple_New(1);
1355  PyTuple_SetItem(data->newargs, 0, obj);
1356  } else {
1357  data->newargs = obj;
1358  }
1359  Py_INCREF(data->newargs);
1360  }
1361  /* the destroy method, aka as the C++ delete method */
1362  data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1363  if (PyErr_Occurred()) {
1364  PyErr_Clear();
1365  data->destroy = 0;
1366  }
1367  if (data->destroy) {
1368  int flags;
1369  Py_INCREF(data->destroy);
1370  flags = PyCFunction_GET_FLAGS(data->destroy);
1371  data->delargs = !(flags & (METH_O));
1372  } else {
1373  data->delargs = 0;
1374  }
1375  data->implicitconv = 0;
1376  data->pytype = 0;
1377  return data;
1378  }
1379 }
1380 
1381 SWIGRUNTIME void
1383  Py_XDECREF(data->newraw);
1384  Py_XDECREF(data->newargs);
1385  Py_XDECREF(data->destroy);
1386 }
1387 
1388 /* =============== SwigPyObject =====================*/
1389 
1390 typedef struct {
1391  PyObject_HEAD
1392  void *ptr;
1393  swig_type_info *ty;
1394  int own;
1395  PyObject *next;
1396 #ifdef SWIGPYTHON_BUILTIN
1397  PyObject *dict;
1398 #endif
1399 } SwigPyObject;
1400 
1401 
1402 #ifdef SWIGPYTHON_BUILTIN
1403 
1404 SWIGRUNTIME PyObject *
1405 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1406 {
1407  SwigPyObject *sobj = (SwigPyObject *)v;
1408 
1409  if (!sobj->dict)
1410  sobj->dict = PyDict_New();
1411 
1412  Py_INCREF(sobj->dict);
1413  return sobj->dict;
1414 }
1415 
1416 #endif
1417 
1418 SWIGRUNTIME PyObject *
1420 {
1421  return PyLong_FromVoidPtr(v->ptr);
1422 }
1423 
1424 SWIGRUNTIME PyObject *
1425 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1426 {
1427  PyObject *res = NULL;
1428  PyObject *args = PyTuple_New(1);
1429  if (args) {
1430  if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1431  PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1432  if (ofmt) {
1433 #if PY_VERSION_HEX >= 0x03000000
1434  res = PyUnicode_Format(ofmt,args);
1435 #else
1436  res = PyString_Format(ofmt,args);
1437 #endif
1438  Py_DECREF(ofmt);
1439  }
1440  Py_DECREF(args);
1441  }
1442  }
1443  return res;
1444 }
1445 
1446 SWIGRUNTIME PyObject *
1448 {
1449  return SwigPyObject_format("%o",v);
1450 }
1451 
1452 SWIGRUNTIME PyObject *
1454 {
1455  return SwigPyObject_format("%x",v);
1456 }
1457 
1458 SWIGRUNTIME PyObject *
1460 {
1461  const char *name = SWIG_TypePrettyName(v->ty);
1462  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1463  if (v->next) {
1464  PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1465 # if PY_VERSION_HEX >= 0x03000000
1466  PyObject *joined = PyUnicode_Concat(repr, nrep);
1467  Py_DecRef(repr);
1468  Py_DecRef(nrep);
1469  repr = joined;
1470 # else
1471  PyString_ConcatAndDel(&repr,nrep);
1472 # endif
1473  }
1474  return repr;
1475 }
1476 
1477 /* We need a version taking two PyObject* parameters so it's a valid
1478  * PyCFunction to use in swigobject_methods[]. */
1479 SWIGRUNTIME PyObject *
1480 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1481 {
1482  return SwigPyObject_repr((SwigPyObject*)v);
1483 }
1484 
1485 SWIGRUNTIME int
1487 {
1488  void *i = v->ptr;
1489  void *j = w->ptr;
1490  return (i < j) ? -1 : ((i > j) ? 1 : 0);
1491 }
1492 
1493 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1494 SWIGRUNTIME PyObject*
1496 {
1497  PyObject* res;
1498  if( op != Py_EQ && op != Py_NE ) {
1499  Py_INCREF(Py_NotImplemented);
1500  return Py_NotImplemented;
1501  }
1502  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1503  return res;
1504 }
1505 
1506 
1507 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1508 
1509 #ifdef SWIGPYTHON_BUILTIN
1510 static swig_type_info *SwigPyObject_stype = 0;
1511 SWIGRUNTIME PyTypeObject*
1512 SwigPyObject_type(void) {
1513  SwigPyClientData *cd;
1514  assert(SwigPyObject_stype);
1515  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1516  assert(cd);
1517  assert(cd->pytype);
1518  return cd->pytype;
1519 }
1520 #else
1521 SWIGRUNTIME PyTypeObject*
1523  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1524  return type;
1525 }
1526 #endif
1527 
1529 SwigPyObject_Check(PyObject *op) {
1530 #ifdef SWIGPYTHON_BUILTIN
1531  PyTypeObject *target_tp = SwigPyObject_type();
1532  if (PyType_IsSubtype(op->ob_type, target_tp))
1533  return 1;
1534  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1535 #else
1536  return (Py_TYPE(op) == SwigPyObject_type())
1537  || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1538 #endif
1539 }
1540 
1541 SWIGRUNTIME PyObject *
1542 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1543 
1544 SWIGRUNTIME void
1546 {
1547  SwigPyObject *sobj = (SwigPyObject *) v;
1548  PyObject *next = sobj->next;
1549  if (sobj->own == SWIG_POINTER_OWN) {
1550  swig_type_info *ty = sobj->ty;
1551  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1552  PyObject *destroy = data ? data->destroy : 0;
1553  if (destroy) {
1554  /* destroy is always a VARARGS method */
1555  PyObject *res;
1556 
1557  /* PyObject_CallFunction() has the potential to silently drop
1558  the active exception. In cases of unnamed temporary
1559  variable or where we just finished iterating over a generator
1560  StopIteration will be active right now, and this needs to
1561  remain true upon return from SwigPyObject_dealloc. So save
1562  and restore. */
1563 
1564  PyObject *type = NULL, *value = NULL, *traceback = NULL;
1565  PyErr_Fetch(&type, &value, &traceback);
1566 
1567  if (data->delargs) {
1568  /* we need to create a temporary object to carry the destroy operation */
1569  PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1570  res = SWIG_Python_CallFunctor(destroy, tmp);
1571  Py_DECREF(tmp);
1572  } else {
1573  PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1574  PyObject *mself = PyCFunction_GET_SELF(destroy);
1575  res = ((*meth)(mself, v));
1576  }
1577  if (!res)
1578  PyErr_WriteUnraisable(destroy);
1579 
1580  PyErr_Restore(type, value, traceback);
1581 
1582  Py_XDECREF(res);
1583  }
1584 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1585  else {
1586  const char *name = SWIG_TypePrettyName(ty);
1587  printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1588  }
1589 #endif
1590  }
1591  Py_XDECREF(next);
1592  PyObject_DEL(v);
1593 }
1594 
1595 SWIGRUNTIME PyObject*
1596 SwigPyObject_append(PyObject* v, PyObject* next)
1597 {
1598  SwigPyObject *sobj = (SwigPyObject *) v;
1599  if (!SwigPyObject_Check(next)) {
1600  PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1601  return NULL;
1602  }
1603  sobj->next = next;
1604  Py_INCREF(next);
1605  return SWIG_Py_Void();
1606 }
1607 
1608 SWIGRUNTIME PyObject*
1609 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1610 {
1611  SwigPyObject *sobj = (SwigPyObject *) v;
1612  if (sobj->next) {
1613  Py_INCREF(sobj->next);
1614  return sobj->next;
1615  } else {
1616  return SWIG_Py_Void();
1617  }
1618 }
1619 
1620 SWIGINTERN PyObject*
1621 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1622 {
1623  SwigPyObject *sobj = (SwigPyObject *)v;
1624  sobj->own = 0;
1625  return SWIG_Py_Void();
1626 }
1627 
1628 SWIGINTERN PyObject*
1629 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1630 {
1631  SwigPyObject *sobj = (SwigPyObject *)v;
1632  sobj->own = SWIG_POINTER_OWN;
1633  return SWIG_Py_Void();
1634 }
1635 
1636 SWIGINTERN PyObject*
1637 SwigPyObject_own(PyObject *v, PyObject *args)
1638 {
1639  PyObject *val = 0;
1640  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1641  return NULL;
1642  } else {
1643  SwigPyObject *sobj = (SwigPyObject *)v;
1644  PyObject *obj = PyBool_FromLong(sobj->own);
1645  if (val) {
1646  if (PyObject_IsTrue(val)) {
1647  SwigPyObject_acquire(v,args);
1648  } else {
1649  SwigPyObject_disown(v,args);
1650  }
1651  }
1652  return obj;
1653  }
1654 }
1655 
1656 static PyMethodDef
1658  {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"},
1659  {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"},
1660  {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"},
1661  {"append", SwigPyObject_append, METH_O, "appends another 'this' object"},
1662  {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"},
1663  {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"},
1664  {0, 0, 0, 0}
1665 };
1666 
1667 SWIGRUNTIME PyTypeObject*
1669  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1670 
1671  static PyNumberMethods SwigPyObject_as_number = {
1672  (binaryfunc)0, /*nb_add*/
1673  (binaryfunc)0, /*nb_subtract*/
1674  (binaryfunc)0, /*nb_multiply*/
1675  /* nb_divide removed in Python 3 */
1676 #if PY_VERSION_HEX < 0x03000000
1677  (binaryfunc)0, /*nb_divide*/
1678 #endif
1679  (binaryfunc)0, /*nb_remainder*/
1680  (binaryfunc)0, /*nb_divmod*/
1681  (ternaryfunc)0,/*nb_power*/
1682  (unaryfunc)0, /*nb_negative*/
1683  (unaryfunc)0, /*nb_positive*/
1684  (unaryfunc)0, /*nb_absolute*/
1685  (inquiry)0, /*nb_nonzero*/
1686  0, /*nb_invert*/
1687  0, /*nb_lshift*/
1688  0, /*nb_rshift*/
1689  0, /*nb_and*/
1690  0, /*nb_xor*/
1691  0, /*nb_or*/
1692 #if PY_VERSION_HEX < 0x03000000
1693  0, /*nb_coerce*/
1694 #endif
1695  (unaryfunc)SwigPyObject_long, /*nb_int*/
1696 #if PY_VERSION_HEX < 0x03000000
1697  (unaryfunc)SwigPyObject_long, /*nb_long*/
1698 #else
1699  0, /*nb_reserved*/
1700 #endif
1701  (unaryfunc)0, /*nb_float*/
1702 #if PY_VERSION_HEX < 0x03000000
1703  (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1704  (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1705 #endif
1706 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1707  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1708 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1709  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1710 #else
1711  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1712 #endif
1713  };
1714 
1715  static PyTypeObject swigpyobject_type;
1716  static int type_init = 0;
1717  if (!type_init) {
1718  const PyTypeObject tmp = {
1719 #if PY_VERSION_HEX >= 0x03000000
1720  PyVarObject_HEAD_INIT(NULL, 0)
1721 #else
1722  PyObject_HEAD_INIT(NULL)
1723  0, /* ob_size */
1724 #endif
1725  "SwigPyObject", /* tp_name */
1726  sizeof(SwigPyObject), /* tp_basicsize */
1727  0, /* tp_itemsize */
1728  (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1729  0, /* tp_print */
1730  (getattrfunc)0, /* tp_getattr */
1731  (setattrfunc)0, /* tp_setattr */
1732 #if PY_VERSION_HEX >= 0x03000000
1733  0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1734 #else
1735  (cmpfunc)SwigPyObject_compare, /* tp_compare */
1736 #endif
1737  (reprfunc)SwigPyObject_repr, /* tp_repr */
1738  &SwigPyObject_as_number, /* tp_as_number */
1739  0, /* tp_as_sequence */
1740  0, /* tp_as_mapping */
1741  (hashfunc)0, /* tp_hash */
1742  (ternaryfunc)0, /* tp_call */
1743  0, /* tp_str */
1744  PyObject_GenericGetAttr, /* tp_getattro */
1745  0, /* tp_setattro */
1746  0, /* tp_as_buffer */
1747  Py_TPFLAGS_DEFAULT, /* tp_flags */
1748  swigobject_doc, /* tp_doc */
1749  0, /* tp_traverse */
1750  0, /* tp_clear */
1751  (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1752  0, /* tp_weaklistoffset */
1753  0, /* tp_iter */
1754  0, /* tp_iternext */
1755  swigobject_methods, /* tp_methods */
1756  0, /* tp_members */
1757  0, /* tp_getset */
1758  0, /* tp_base */
1759  0, /* tp_dict */
1760  0, /* tp_descr_get */
1761  0, /* tp_descr_set */
1762  0, /* tp_dictoffset */
1763  0, /* tp_init */
1764  0, /* tp_alloc */
1765  0, /* tp_new */
1766  0, /* tp_free */
1767  0, /* tp_is_gc */
1768  0, /* tp_bases */
1769  0, /* tp_mro */
1770  0, /* tp_cache */
1771  0, /* tp_subclasses */
1772  0, /* tp_weaklist */
1773  0, /* tp_del */
1774  0, /* tp_version_tag */
1775 #if PY_VERSION_HEX >= 0x03040000
1776  0, /* tp_finalize */
1777 #endif
1778 #if PY_VERSION_HEX >= 0x03080000
1779  0, /* tp_vectorcall */
1780 #endif
1781 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1782  0, /* tp_print */
1783 #endif
1784 #ifdef COUNT_ALLOCS
1785  0, /* tp_allocs */
1786  0, /* tp_frees */
1787  0, /* tp_maxalloc */
1788  0, /* tp_prev */
1789  0 /* tp_next */
1790 #endif
1791  };
1792  swigpyobject_type = tmp;
1793  type_init = 1;
1794  if (PyType_Ready(&swigpyobject_type) < 0)
1795  return NULL;
1796  }
1797  return &swigpyobject_type;
1798 }
1799 
1800 SWIGRUNTIME PyObject *
1801 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1802 {
1803  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1804  if (sobj) {
1805  sobj->ptr = ptr;
1806  sobj->ty = ty;
1807  sobj->own = own;
1808  sobj->next = 0;
1809  }
1810  return (PyObject *)sobj;
1811 }
1812 
1813 /* -----------------------------------------------------------------------------
1814  * Implements a simple Swig Packed type, and use it instead of string
1815  * ----------------------------------------------------------------------------- */
1816 
1817 typedef struct {
1818  PyObject_HEAD
1819  void *pack;
1820  swig_type_info *ty;
1821  size_t size;
1822 } SwigPyPacked;
1823 
1824 SWIGRUNTIME PyObject *
1826 {
1827  char result[SWIG_BUFFER_SIZE];
1828  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1829  return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1830  } else {
1831  return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1832  }
1833 }
1834 
1835 SWIGRUNTIME PyObject *
1837 {
1838  char result[SWIG_BUFFER_SIZE];
1839  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1840  return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1841  } else {
1842  return SWIG_Python_str_FromChar(v->ty->name);
1843  }
1844 }
1845 
1846 SWIGRUNTIME int
1848 {
1849  size_t i = v->size;
1850  size_t j = w->size;
1851  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1852  return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1853 }
1854 
1855 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1856 
1857 SWIGRUNTIME PyTypeObject*
1859  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1860  return type;
1861 }
1862 
1864 SwigPyPacked_Check(PyObject *op) {
1865  return ((op)->ob_type == SwigPyPacked_TypeOnce())
1866  || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1867 }
1868 
1869 SWIGRUNTIME void
1871 {
1872  if (SwigPyPacked_Check(v)) {
1873  SwigPyPacked *sobj = (SwigPyPacked *) v;
1874  free(sobj->pack);
1875  }
1876  PyObject_DEL(v);
1877 }
1878 
1879 SWIGRUNTIME PyTypeObject*
1881  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1882  static PyTypeObject swigpypacked_type;
1883  static int type_init = 0;
1884  if (!type_init) {
1885  const PyTypeObject tmp = {
1886 #if PY_VERSION_HEX>=0x03000000
1887  PyVarObject_HEAD_INIT(NULL, 0)
1888 #else
1889  PyObject_HEAD_INIT(NULL)
1890  0, /* ob_size */
1891 #endif
1892  "SwigPyPacked", /* tp_name */
1893  sizeof(SwigPyPacked), /* tp_basicsize */
1894  0, /* tp_itemsize */
1895  (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1896  0, /* tp_print */
1897  (getattrfunc)0, /* tp_getattr */
1898  (setattrfunc)0, /* tp_setattr */
1899 #if PY_VERSION_HEX>=0x03000000
1900  0, /* tp_reserved in 3.0.1 */
1901 #else
1902  (cmpfunc)SwigPyPacked_compare, /* tp_compare */
1903 #endif
1904  (reprfunc)SwigPyPacked_repr, /* tp_repr */
1905  0, /* tp_as_number */
1906  0, /* tp_as_sequence */
1907  0, /* tp_as_mapping */
1908  (hashfunc)0, /* tp_hash */
1909  (ternaryfunc)0, /* tp_call */
1910  (reprfunc)SwigPyPacked_str, /* tp_str */
1911  PyObject_GenericGetAttr, /* tp_getattro */
1912  0, /* tp_setattro */
1913  0, /* tp_as_buffer */
1914  Py_TPFLAGS_DEFAULT, /* tp_flags */
1915  swigpacked_doc, /* tp_doc */
1916  0, /* tp_traverse */
1917  0, /* tp_clear */
1918  0, /* tp_richcompare */
1919  0, /* tp_weaklistoffset */
1920  0, /* tp_iter */
1921  0, /* tp_iternext */
1922  0, /* tp_methods */
1923  0, /* tp_members */
1924  0, /* tp_getset */
1925  0, /* tp_base */
1926  0, /* tp_dict */
1927  0, /* tp_descr_get */
1928  0, /* tp_descr_set */
1929  0, /* tp_dictoffset */
1930  0, /* tp_init */
1931  0, /* tp_alloc */
1932  0, /* tp_new */
1933  0, /* tp_free */
1934  0, /* tp_is_gc */
1935  0, /* tp_bases */
1936  0, /* tp_mro */
1937  0, /* tp_cache */
1938  0, /* tp_subclasses */
1939  0, /* tp_weaklist */
1940  0, /* tp_del */
1941  0, /* tp_version_tag */
1942 #if PY_VERSION_HEX >= 0x03040000
1943  0, /* tp_finalize */
1944 #endif
1945 #if PY_VERSION_HEX >= 0x03080000
1946  0, /* tp_vectorcall */
1947 #endif
1948 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1949  0, /* tp_print */
1950 #endif
1951 #ifdef COUNT_ALLOCS
1952  0, /* tp_allocs */
1953  0, /* tp_frees */
1954  0, /* tp_maxalloc */
1955  0, /* tp_prev */
1956  0 /* tp_next */
1957 #endif
1958  };
1959  swigpypacked_type = tmp;
1960  type_init = 1;
1961  if (PyType_Ready(&swigpypacked_type) < 0)
1962  return NULL;
1963  }
1964  return &swigpypacked_type;
1965 }
1966 
1967 SWIGRUNTIME PyObject *
1968 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1969 {
1970  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1971  if (sobj) {
1972  void *pack = malloc(size);
1973  if (pack) {
1974  memcpy(pack, ptr, size);
1975  sobj->pack = pack;
1976  sobj->ty = ty;
1977  sobj->size = size;
1978  } else {
1979  PyObject_DEL((PyObject *) sobj);
1980  sobj = 0;
1981  }
1982  }
1983  return (PyObject *) sobj;
1984 }
1985 
1987 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1988 {
1989  if (SwigPyPacked_Check(obj)) {
1990  SwigPyPacked *sobj = (SwigPyPacked *)obj;
1991  if (sobj->size != size) return 0;
1992  memcpy(ptr, sobj->pack, size);
1993  return sobj->ty;
1994  } else {
1995  return 0;
1996  }
1997 }
1998 
1999 /* -----------------------------------------------------------------------------
2000  * pointers/data manipulation
2001  * ----------------------------------------------------------------------------- */
2002 
2003 static PyObject *Swig_This_global = NULL;
2004 
2005 SWIGRUNTIME PyObject *
2007 {
2008  if (Swig_This_global == NULL)
2010  return Swig_This_global;
2011 }
2012 
2013 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2014 
2015 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2016 #if PY_VERSION_HEX>=0x03000000
2017 #define SWIG_PYTHON_SLOW_GETSET_THIS
2018 #endif
2019 
2021 SWIG_Python_GetSwigThis(PyObject *pyobj)
2022 {
2023  PyObject *obj;
2024 
2025  if (SwigPyObject_Check(pyobj))
2026  return (SwigPyObject *) pyobj;
2027 
2028 #ifdef SWIGPYTHON_BUILTIN
2029  (void)obj;
2030 # ifdef PyWeakref_CheckProxy
2031  if (PyWeakref_CheckProxy(pyobj)) {
2032  pyobj = PyWeakref_GET_OBJECT(pyobj);
2033  if (pyobj && SwigPyObject_Check(pyobj))
2034  return (SwigPyObject*) pyobj;
2035  }
2036 # endif
2037  return NULL;
2038 #else
2039 
2040  obj = 0;
2041 
2042 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2043  if (PyInstance_Check(pyobj)) {
2044  obj = _PyInstance_Lookup(pyobj, SWIG_This());
2045  } else {
2046  PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2047  if (dictptr != NULL) {
2048  PyObject *dict = *dictptr;
2049  obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2050  } else {
2051 #ifdef PyWeakref_CheckProxy
2052  if (PyWeakref_CheckProxy(pyobj)) {
2053  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2054  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2055  }
2056 #endif
2057  obj = PyObject_GetAttr(pyobj,SWIG_This());
2058  if (obj) {
2059  Py_DECREF(obj);
2060  } else {
2061  if (PyErr_Occurred()) PyErr_Clear();
2062  return 0;
2063  }
2064  }
2065  }
2066 #else
2067  obj = PyObject_GetAttr(pyobj,SWIG_This());
2068  if (obj) {
2069  Py_DECREF(obj);
2070  } else {
2071  if (PyErr_Occurred()) PyErr_Clear();
2072  return 0;
2073  }
2074 #endif
2075  if (obj && !SwigPyObject_Check(obj)) {
2076  /* a PyObject is called 'this', try to get the 'real this'
2077  SwigPyObject from it */
2078  return SWIG_Python_GetSwigThis(obj);
2079  }
2080  return (SwigPyObject *)obj;
2081 #endif
2082 }
2083 
2084 /* Acquire a pointer value */
2085 
2086 SWIGRUNTIME int
2087 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2088  if (own == SWIG_POINTER_OWN) {
2090  if (sobj) {
2091  int oldown = sobj->own;
2092  sobj->own = own;
2093  return oldown;
2094  }
2095  }
2096  return 0;
2097 }
2098 
2099 /* Convert a pointer value */
2100 
2101 SWIGRUNTIME int
2102 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2103  int res;
2104  SwigPyObject *sobj;
2105  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2106 
2107  if (!obj)
2108  return SWIG_ERROR;
2109  if (obj == Py_None && !implicit_conv) {
2110  if (ptr)
2111  *ptr = 0;
2113  }
2114 
2115  res = SWIG_ERROR;
2116 
2117  sobj = SWIG_Python_GetSwigThis(obj);
2118  if (own)
2119  *own = 0;
2120  while (sobj) {
2121  void *vptr = sobj->ptr;
2122  if (ty) {
2123  swig_type_info *to = sobj->ty;
2124  if (to == ty) {
2125  /* no type cast needed */
2126  if (ptr) *ptr = vptr;
2127  break;
2128  } else {
2129  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2130  if (!tc) {
2131  sobj = (SwigPyObject *)sobj->next;
2132  } else {
2133  if (ptr) {
2134  int newmemory = 0;
2135  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2136  if (newmemory == SWIG_CAST_NEW_MEMORY) {
2137  assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2138  if (own)
2139  *own = *own | SWIG_CAST_NEW_MEMORY;
2140  }
2141  }
2142  break;
2143  }
2144  }
2145  } else {
2146  if (ptr) *ptr = vptr;
2147  break;
2148  }
2149  }
2150  if (sobj) {
2151  if (own)
2152  *own = *own | sobj->own;
2153  if (flags & SWIG_POINTER_DISOWN) {
2154  sobj->own = 0;
2155  }
2156  res = SWIG_OK;
2157  } else {
2158  if (implicit_conv) {
2159  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2160  if (data && !data->implicitconv) {
2161  PyObject *klass = data->klass;
2162  if (klass) {
2163  PyObject *impconv;
2164  data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2165  impconv = SWIG_Python_CallFunctor(klass, obj);
2166  data->implicitconv = 0;
2167  if (PyErr_Occurred()) {
2168  PyErr_Clear();
2169  impconv = 0;
2170  }
2171  if (impconv) {
2172  SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2173  if (iobj) {
2174  void *vptr;
2175  res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2176  if (SWIG_IsOK(res)) {
2177  if (ptr) {
2178  *ptr = vptr;
2179  /* transfer the ownership to 'ptr' */
2180  iobj->own = 0;
2181  res = SWIG_AddCast(res);
2182  res = SWIG_AddNewMask(res);
2183  } else {
2184  res = SWIG_AddCast(res);
2185  }
2186  }
2187  }
2188  Py_DECREF(impconv);
2189  }
2190  }
2191  }
2192  if (!SWIG_IsOK(res) && obj == Py_None) {
2193  if (ptr)
2194  *ptr = 0;
2195  if (PyErr_Occurred())
2196  PyErr_Clear();
2197  res = SWIG_OK;
2198  }
2199  }
2200  }
2201  return res;
2202 }
2203 
2204 /* Convert a function ptr value */
2205 
2206 SWIGRUNTIME int
2207 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2208  if (!PyCFunction_Check(obj)) {
2209  return SWIG_ConvertPtr(obj, ptr, ty, 0);
2210  } else {
2211  void *vptr = 0;
2212  swig_cast_info *tc;
2213 
2214  /* here we get the method pointer for callbacks */
2215  const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2216  const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2217  if (desc)
2218  desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2219  if (!desc)
2220  return SWIG_ERROR;
2221  tc = SWIG_TypeCheck(desc,ty);
2222  if (tc) {
2223  int newmemory = 0;
2224  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2225  assert(!newmemory); /* newmemory handling not yet implemented */
2226  } else {
2227  return SWIG_ERROR;
2228  }
2229  return SWIG_OK;
2230  }
2231 }
2232 
2233 /* Convert a packed pointer value */
2234 
2235 SWIGRUNTIME int
2236 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2237  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2238  if (!to) return SWIG_ERROR;
2239  if (ty) {
2240  if (to != ty) {
2241  /* check type cast? */
2242  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2243  if (!tc) return SWIG_ERROR;
2244  }
2245  }
2246  return SWIG_OK;
2247 }
2248 
2249 /* -----------------------------------------------------------------------------
2250  * Create a new pointer object
2251  * ----------------------------------------------------------------------------- */
2252 
2253 /*
2254  Create a new instance object, without calling __init__, and set the
2255  'this' attribute.
2256 */
2257 
2258 SWIGRUNTIME PyObject*
2260 {
2261  PyObject *inst = 0;
2262  PyObject *newraw = data->newraw;
2263  if (newraw) {
2264  inst = PyObject_Call(newraw, data->newargs, NULL);
2265  if (inst) {
2266 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2267  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2268  if (dictptr != NULL) {
2269  PyObject *dict = *dictptr;
2270  if (dict == NULL) {
2271  dict = PyDict_New();
2272  *dictptr = dict;
2273  PyDict_SetItem(dict, SWIG_This(), swig_this);
2274  }
2275  }
2276 #else
2277  if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2278  Py_DECREF(inst);
2279  inst = 0;
2280  }
2281 #endif
2282  }
2283  } else {
2284 #if PY_VERSION_HEX >= 0x03000000
2285  PyObject *empty_args = PyTuple_New(0);
2286  if (empty_args) {
2287  PyObject *empty_kwargs = PyDict_New();
2288  if (empty_kwargs) {
2289  inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2290  Py_DECREF(empty_kwargs);
2291  if (inst) {
2292  if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2293  Py_DECREF(inst);
2294  inst = 0;
2295  } else {
2296  Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2297  }
2298  }
2299  }
2300  Py_DECREF(empty_args);
2301  }
2302 #else
2303  PyObject *dict = PyDict_New();
2304  if (dict) {
2305  PyDict_SetItem(dict, SWIG_This(), swig_this);
2306  inst = PyInstance_NewRaw(data->newargs, dict);
2307  Py_DECREF(dict);
2308  }
2309 #endif
2310  }
2311  return inst;
2312 }
2313 
2314 SWIGRUNTIME int
2315 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2316 {
2317 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2318  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2319  if (dictptr != NULL) {
2320  PyObject *dict = *dictptr;
2321  if (dict == NULL) {
2322  dict = PyDict_New();
2323  *dictptr = dict;
2324  }
2325  return PyDict_SetItem(dict, SWIG_This(), swig_this);
2326  }
2327 #endif
2328  return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2329 }
2330 
2331 
2332 SWIGINTERN PyObject *
2334  PyObject *obj[2];
2335  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2336  return NULL;
2337  } else {
2338  SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2339  if (sthis) {
2340  SwigPyObject_append((PyObject*) sthis, obj[1]);
2341  } else {
2342  if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2343  return NULL;
2344  }
2345  return SWIG_Py_Void();
2346  }
2347 }
2348 
2349 /* Create a new pointer object */
2350 
2351 SWIGRUNTIME PyObject *
2352 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2353  SwigPyClientData *clientdata;
2354  PyObject * robj;
2355  int own;
2356 
2357  if (!ptr)
2358  return SWIG_Py_Void();
2359 
2360  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2361  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2362  if (clientdata && clientdata->pytype) {
2363  SwigPyObject *newobj;
2364  if (flags & SWIG_BUILTIN_TP_INIT) {
2365  newobj = (SwigPyObject*) self;
2366  if (newobj->ptr) {
2367  PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2368  while (newobj->next)
2369  newobj = (SwigPyObject *) newobj->next;
2370  newobj->next = next_self;
2371  newobj = (SwigPyObject *)next_self;
2372 #ifdef SWIGPYTHON_BUILTIN
2373  newobj->dict = 0;
2374 #endif
2375  }
2376  } else {
2377  newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2378 #ifdef SWIGPYTHON_BUILTIN
2379  newobj->dict = 0;
2380 #endif
2381  }
2382  if (newobj) {
2383  newobj->ptr = ptr;
2384  newobj->ty = type;
2385  newobj->own = own;
2386  newobj->next = 0;
2387  return (PyObject*) newobj;
2388  }
2389  return SWIG_Py_Void();
2390  }
2391 
2392  assert(!(flags & SWIG_BUILTIN_TP_INIT));
2393 
2394  robj = SwigPyObject_New(ptr, type, own);
2395  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2396  PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2397  Py_DECREF(robj);
2398  robj = inst;
2399  }
2400  return robj;
2401 }
2402 
2403 /* Create a new packed object */
2404 
2405 SWIGRUNTIMEINLINE PyObject *
2406 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2407  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2408 }
2409 
2410 /* -----------------------------------------------------------------------------*
2411  * Get type list
2412  * -----------------------------------------------------------------------------*/
2413 
2414 #ifdef SWIG_LINK_RUNTIME
2415 void *SWIG_ReturnGlobalTypeList(void *);
2416 #endif
2417 
2420  static void *type_pointer = (void *)0;
2421  /* first check if module already created */
2422  if (!type_pointer) {
2423 #ifdef SWIG_LINK_RUNTIME
2424  type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2425 #else
2426  type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2427  if (PyErr_Occurred()) {
2428  PyErr_Clear();
2429  type_pointer = (void *)0;
2430  }
2431 #endif
2432  }
2433  return (swig_module_info *) type_pointer;
2434 }
2435 
2436 SWIGRUNTIME void
2438 {
2439  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2440  swig_type_info **types = swig_module->types;
2441  size_t i;
2442  for (i =0; i < swig_module->size; ++i) {
2443  swig_type_info *ty = types[i];
2444  if (ty->owndata) {
2446  if (data) SwigPyClientData_Del(data);
2447  }
2448  }
2449  Py_DECREF(SWIG_This());
2450  Swig_This_global = NULL;
2451 }
2452 
2453 SWIGRUNTIME void
2455 #if PY_VERSION_HEX >= 0x03000000
2456  /* Add a dummy module object into sys.modules */
2457  PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2458 #else
2459  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2460  PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2461 #endif
2462  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2463  if (pointer && module) {
2464  PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2465  } else {
2466  Py_XDECREF(pointer);
2467  }
2468 }
2469 
2470 /* The python cached type query */
2471 SWIGRUNTIME PyObject *
2473  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2474  return cache;
2475 }
2476 
2478 SWIG_Python_TypeQuery(const char *type)
2479 {
2480  PyObject *cache = SWIG_Python_TypeCache();
2481  PyObject *key = SWIG_Python_str_FromChar(type);
2482  PyObject *obj = PyDict_GetItem(cache, key);
2483  swig_type_info *descriptor;
2484  if (obj) {
2485  descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2486  } else {
2488  descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2489  if (descriptor) {
2490  obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2491  PyDict_SetItem(cache, key, obj);
2492  Py_DECREF(obj);
2493  }
2494  }
2495  Py_DECREF(key);
2496  return descriptor;
2497 }
2498 
2499 /*
2500  For backward compatibility only
2501 */
2502 #define SWIG_POINTER_EXCEPTION 0
2503 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2504 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2505 
2506 SWIGRUNTIME int
2507 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2508 {
2509  if (PyErr_Occurred()) {
2510  PyObject *type = 0;
2511  PyObject *value = 0;
2512  PyObject *traceback = 0;
2513  PyErr_Fetch(&type, &value, &traceback);
2514  if (value) {
2515  PyObject *old_str = PyObject_Str(value);
2516  const char *tmp = SWIG_Python_str_AsChar(old_str);
2517  const char *errmesg = tmp ? tmp : "Invalid error message";
2518  Py_XINCREF(type);
2519  PyErr_Clear();
2520  if (infront) {
2521  PyErr_Format(type, "%s %s", mesg, errmesg);
2522  } else {
2523  PyErr_Format(type, "%s %s", errmesg, mesg);
2524  }
2526  Py_DECREF(old_str);
2527  }
2528  return 1;
2529  } else {
2530  return 0;
2531  }
2532 }
2533 
2534 SWIGRUNTIME int
2536 {
2537  if (PyErr_Occurred()) {
2538  /* add information about failing argument */
2539  char mesg[256];
2540  PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2541  return SWIG_Python_AddErrMesg(mesg, 1);
2542  } else {
2543  return 0;
2544  }
2545 }
2546 
2547 SWIGRUNTIMEINLINE const char *
2548 SwigPyObject_GetDesc(PyObject *self)
2549 {
2550  SwigPyObject *v = (SwigPyObject *)self;
2551  swig_type_info *ty = v ? v->ty : 0;
2552  return ty ? ty->str : "";
2553 }
2554 
2555 SWIGRUNTIME void
2556 SWIG_Python_TypeError(const char *type, PyObject *obj)
2557 {
2558  if (type) {
2559 #if defined(SWIG_COBJECT_TYPES)
2560  if (obj && SwigPyObject_Check(obj)) {
2561  const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2562  if (otype) {
2563  PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2564  type, otype);
2565  return;
2566  }
2567  } else
2568 #endif
2569  {
2570  const char *otype = (obj ? obj->ob_type->tp_name : 0);
2571  if (otype) {
2572  PyObject *str = PyObject_Str(obj);
2573  const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2574  if (cstr) {
2575  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2576  type, otype, cstr);
2578  } else {
2579  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2580  type, otype);
2581  }
2582  Py_XDECREF(str);
2583  return;
2584  }
2585  }
2586  PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2587  } else {
2588  PyErr_Format(PyExc_TypeError, "unexpected type is received");
2589  }
2590 }
2591 
2592 
2593 /* Convert a pointer value, signal an exception on a type mismatch */
2594 SWIGRUNTIME void *
2595 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2596  void *result;
2597  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2598  PyErr_Clear();
2599 #if SWIG_POINTER_EXCEPTION
2600  if (flags) {
2602  SWIG_Python_ArgFail(argnum);
2603  }
2604 #endif
2605  }
2606  return result;
2607 }
2608 
2609 #ifdef SWIGPYTHON_BUILTIN
2610 SWIGRUNTIME int
2611 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2612  PyTypeObject *tp = obj->ob_type;
2613  PyObject *descr;
2614  PyObject *encoded_name;
2615  descrsetfunc f;
2616  int res = -1;
2617 
2618 # ifdef Py_USING_UNICODE
2619  if (PyString_Check(name)) {
2620  name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2621  if (!name)
2622  return -1;
2623  } else if (!PyUnicode_Check(name))
2624 # else
2625  if (!PyString_Check(name))
2626 # endif
2627  {
2628  PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2629  return -1;
2630  } else {
2631  Py_INCREF(name);
2632  }
2633 
2634  if (!tp->tp_dict) {
2635  if (PyType_Ready(tp) < 0)
2636  goto done;
2637  }
2638 
2639  descr = _PyType_Lookup(tp, name);
2640  f = NULL;
2641  if (descr != NULL)
2642  f = descr->ob_type->tp_descr_set;
2643  if (!f) {
2644  if (PyString_Check(name)) {
2645  encoded_name = name;
2646  Py_INCREF(name);
2647  } else {
2648  encoded_name = PyUnicode_AsUTF8String(name);
2649  if (!encoded_name)
2650  return -1;
2651  }
2652  PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2653  Py_DECREF(encoded_name);
2654  } else {
2655  res = f(descr, obj, value);
2656  }
2657 
2658  done:
2659  Py_DECREF(name);
2660  return res;
2661 }
2662 #endif
2663 
2664 
2665 #ifdef __cplusplus
2666 }
2667 #endif
2668 
2669 
2670 
2671 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2672 
2673 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2674 
2675 
2676 
2677 #ifdef __cplusplus
2678 extern "C" {
2679 #endif
2680 
2681 /* Method creation and docstring support functions */
2682 
2683 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
2684 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2685 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2686 
2687 #ifdef __cplusplus
2688 }
2689 #endif
2690 
2691 
2692  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2693 
2694 /* -----------------------------------------------------------------------------
2695  * director_common.swg
2696  *
2697  * This file contains support for director classes which is common between
2698  * languages.
2699  * ----------------------------------------------------------------------------- */
2700 
2701 /*
2702  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
2703  'Swig' namespace. This could be useful for multi-modules projects.
2704 */
2705 #ifdef SWIG_DIRECTOR_STATIC
2706 /* Force anonymous (static) namespace */
2707 #define Swig
2708 #endif
2709 /* -----------------------------------------------------------------------------
2710  * director.swg
2711  *
2712  * This file contains support for director classes so that Python proxy
2713  * methods can be called from C++.
2714  * ----------------------------------------------------------------------------- */
2715 
2716 #ifndef SWIG_DIRECTOR_PYTHON_HEADER_
2717 #define SWIG_DIRECTOR_PYTHON_HEADER_
2718 
2719 #include <string>
2720 #include <iostream>
2721 #include <exception>
2722 #include <vector>
2723 #include <map>
2724 
2725 
2726 /*
2727  Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual
2728  table', and avoid multiple GetAttr calls to retrieve the python
2729  methods.
2730 */
2731 
2732 #ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE
2733 #ifndef SWIG_PYTHON_DIRECTOR_VTABLE
2734 #define SWIG_PYTHON_DIRECTOR_VTABLE
2735 #endif
2736 #endif
2737 
2738 
2739 
2740 /*
2741  Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the
2742  Undefined Exception Handler provided by swig.
2743 */
2744 #ifndef SWIG_DIRECTOR_NO_UEH
2745 #ifndef SWIG_DIRECTOR_UEH
2746 #define SWIG_DIRECTOR_UEH
2747 #endif
2748 #endif
2749 
2750 
2751 /*
2752  Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the
2753  native C++ RTTI and dynamic_cast<>. But be aware that directors
2754  could stop working when using this option.
2755 */
2756 #ifdef SWIG_DIRECTOR_NORTTI
2757 /*
2758  When we don't use the native C++ RTTI, we implement a minimal one
2759  only for Directors.
2760 */
2761 # ifndef SWIG_DIRECTOR_RTDIR
2762 # define SWIG_DIRECTOR_RTDIR
2763 
2764 namespace Swig {
2765  class Director;
2766  SWIGINTERN std::map<void *, Director *>& get_rtdir_map() {
2767  static std::map<void *, Director *> rtdir_map;
2768  return rtdir_map;
2769  }
2770 
2771  SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) {
2772  get_rtdir_map()[vptr] = rtdir;
2773  }
2774 
2775  SWIGINTERNINLINE Director *get_rtdir(void *vptr) {
2776  std::map<void *, Director *>::const_iterator pos = get_rtdir_map().find(vptr);
2777  Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0;
2778  return rtdir;
2779  }
2780 }
2781 # endif /* SWIG_DIRECTOR_RTDIR */
2782 
2783 # define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast<void *>(ARG))
2784 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast<void *>(ARG1), ARG2)
2785 
2786 #else
2787 
2788 # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG)
2789 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
2790 
2791 #endif /* SWIG_DIRECTOR_NORTTI */
2792 
2793 extern "C" {
2794  struct swig_type_info;
2795 }
2796 
2797 namespace Swig {
2798 
2799  /* memory handler */
2800  struct GCItem {
2801  virtual ~GCItem() {}
2802 
2803  virtual int get_own() const {
2804  return 0;
2805  }
2806  };
2807 
2808  struct GCItem_var {
2809  GCItem_var(GCItem *item = 0) : _item(item) {
2810  }
2811 
2813  GCItem *tmp = _item;
2814  _item = item;
2815  delete tmp;
2816  return *this;
2817  }
2818 
2820  delete _item;
2821  }
2822 
2823  GCItem * operator->() const {
2824  return _item;
2825  }
2826 
2827  private:
2828  GCItem *_item;
2829  };
2830 
2831  struct GCItem_Object : GCItem {
2832  GCItem_Object(int own) : _own(own) {
2833  }
2834 
2835  virtual ~GCItem_Object() {
2836  }
2837 
2838  int get_own() const {
2839  return _own;
2840  }
2841 
2842  private:
2843  int _own;
2844  };
2845 
2846  template <typename Type>
2847  struct GCItem_T : GCItem {
2848  GCItem_T(Type *ptr) : _ptr(ptr) {
2849  }
2850 
2851  virtual ~GCItem_T() {
2852  delete _ptr;
2853  }
2854 
2855  private:
2856  Type *_ptr;
2857  };
2858 
2859  template <typename Type>
2860  struct GCArray_T : GCItem {
2861  GCArray_T(Type *ptr) : _ptr(ptr) {
2862  }
2863 
2864  virtual ~GCArray_T() {
2865  delete[] _ptr;
2866  }
2867 
2868  private:
2869  Type *_ptr;
2870  };
2871 
2872  /* base class for director exceptions */
2873  class DirectorException : public std::exception {
2874  protected:
2875  std::string swig_msg;
2876  public:
2877  DirectorException(PyObject *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) {
2879  if (msg[0]) {
2880  swig_msg += " ";
2881  swig_msg += msg;
2882  }
2883  if (!PyErr_Occurred()) {
2884  PyErr_SetString(error, what());
2885  }
2887  }
2888 
2889  virtual ~DirectorException() throw() {
2890  }
2891 
2892  /* Deprecated, use what() instead */
2893  const char *getMessage() const {
2894  return what();
2895  }
2896 
2897  const char *what() const throw() {
2898  return swig_msg.c_str();
2899  }
2900 
2901  static void raise(PyObject *error, const char *msg) {
2902  throw DirectorException(error, msg);
2903  }
2904 
2905  static void raise(const char *msg) {
2906  raise(PyExc_RuntimeError, msg);
2907  }
2908  };
2909 
2910  /* type mismatch in the return value from a python method call */
2911  class DirectorTypeMismatchException : public DirectorException {
2912  public:
2913  DirectorTypeMismatchException(PyObject *error, const char *msg="")
2914  : DirectorException(error, "SWIG director type mismatch", msg) {
2915  }
2916 
2917  DirectorTypeMismatchException(const char *msg="")
2918  : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) {
2919  }
2920 
2921  static void raise(PyObject *error, const char *msg) {
2922  throw DirectorTypeMismatchException(error, msg);
2923  }
2924 
2925  static void raise(const char *msg) {
2926  throw DirectorTypeMismatchException(msg);
2927  }
2928  };
2929 
2930  /* any python exception that occurs during a director method call */
2931  class DirectorMethodException : public DirectorException {
2932  public:
2933  DirectorMethodException(const char *msg = "")
2934  : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) {
2935  }
2936 
2937  static void raise(const char *msg) {
2938  throw DirectorMethodException(msg);
2939  }
2940  };
2941 
2942  /* attempt to call a pure virtual method via a director method */
2943  class DirectorPureVirtualException : public DirectorException {
2944  public:
2945  DirectorPureVirtualException(const char *msg = "")
2946  : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) {
2947  }
2948 
2949  static void raise(const char *msg) {
2950  throw DirectorPureVirtualException(msg);
2951  }
2952  };
2953 
2954 
2955 #if defined(SWIG_PYTHON_THREADS)
2956 /* __THREAD__ is the old macro to activate some thread support */
2957 # if !defined(__THREAD__)
2958 # define __THREAD__ 1
2959 # endif
2960 #endif
2961 
2962 #ifdef __THREAD__
2963 # include "pythread.h"
2964  class Guard {
2965  PyThread_type_lock &mutex_;
2966 
2967  public:
2968  Guard(PyThread_type_lock & mutex) : mutex_(mutex) {
2969  PyThread_acquire_lock(mutex_, WAIT_LOCK);
2970  }
2971 
2973  PyThread_release_lock(mutex_);
2974  }
2975  };
2976 # define SWIG_GUARD(mutex) Guard _guard(mutex)
2977 #else
2978 # define SWIG_GUARD(mutex)
2979 #endif
2980 
2981  /* director base class */
2982  class Director {
2983  private:
2984  /* pointer to the wrapped python object */
2985  PyObject *swig_self;
2986  /* flag indicating whether the object is owned by python or c++ */
2987  mutable bool swig_disown_flag;
2988 
2989  /* decrement the reference count of the wrapped python object */
2990  void swig_decref() const {
2991  if (swig_disown_flag) {
2993  Py_DECREF(swig_self);
2995  }
2996  }
2997 
2998  public:
2999  /* wrap a python object. */
3000  Director(PyObject *self) : swig_self(self), swig_disown_flag(false) {
3001  }
3002 
3003  /* discard our reference at destruction */
3004  virtual ~Director() {
3005  swig_decref();
3006  }
3007 
3008  /* return a pointer to the wrapped python object */
3009  PyObject *swig_get_self() const {
3010  return swig_self;
3011  }
3012 
3013  /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */
3014  void swig_disown() const {
3015  if (!swig_disown_flag) {
3016  swig_disown_flag=true;
3017  swig_incref();
3018  }
3019  }
3020 
3021  /* increase the reference count of the wrapped python object */
3022  void swig_incref() const {
3023  if (swig_disown_flag) {
3024  Py_INCREF(swig_self);
3025  }
3026  }
3027 
3028  /* methods to implement pseudo protected director members */
3029  virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const {
3030  return true;
3031  }
3032 
3033  virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const {
3034  }
3035 
3036  /* ownership management */
3037  private:
3038  typedef std::map<void *, GCItem_var> swig_ownership_map;
3039  mutable swig_ownership_map swig_owner;
3040 #ifdef __THREAD__
3041  static PyThread_type_lock swig_mutex_own;
3042 #endif
3043 
3044  public:
3045  template <typename Type>
3046  void swig_acquire_ownership_array(Type *vptr) const {
3047  if (vptr) {
3048  SWIG_GUARD(swig_mutex_own);
3049  swig_owner[vptr] = new GCArray_T<Type>(vptr);
3050  }
3051  }
3052 
3053  template <typename Type>
3054  void swig_acquire_ownership(Type *vptr) const {
3055  if (vptr) {
3056  SWIG_GUARD(swig_mutex_own);
3057  swig_owner[vptr] = new GCItem_T<Type>(vptr);
3058  }
3059  }
3060 
3061  void swig_acquire_ownership_obj(void *vptr, int own) const {
3062  if (vptr && own) {
3063  SWIG_GUARD(swig_mutex_own);
3064  swig_owner[vptr] = new GCItem_Object(own);
3065  }
3066  }
3067 
3068  int swig_release_ownership(void *vptr) const {
3069  int own = 0;
3070  if (vptr) {
3071  SWIG_GUARD(swig_mutex_own);
3072  swig_ownership_map::iterator iter = swig_owner.find(vptr);
3073  if (iter != swig_owner.end()) {
3074  own = iter->second->get_own();
3075  swig_owner.erase(iter);
3076  }
3077  }
3078  return own;
3079  }
3080 
3081  template <typename Type>
3082  static PyObject *swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args)) {
3083  SwigPyObject *sobj = (SwigPyObject *)pyobj;
3084  sobj->own = 0;
3085  Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast<Type *>(sobj->ptr));
3086  if (d)
3087  d->swig_disown();
3088  return PyWeakref_NewProxy(pyobj, NULL);
3089  }
3090  };
3091 
3092 #ifdef __THREAD__
3093  PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock();
3094 #endif
3095 }
3096 
3097 #endif
3098 
3099 /* -------- TYPES TABLE (BEGIN) -------- */
3100 
3101 #define SWIGTYPE_p_char swig_types[0]
3102 #define SWIGTYPE_p_int swig_types[1]
3103 #define SWIGTYPE_p_long swig_types[2]
3104 #define SWIGTYPE_p_operations_research__Domain swig_types[3]
3105 #define SWIGTYPE_p_operations_research__sat__IntegerVariableProto swig_types[4]
3106 #define SWIGTYPE_p_operations_research__sat__SatHelper swig_types[5]
3107 #define SWIGTYPE_p_operations_research__sat__SolutionCallback swig_types[6]
3108 #define SWIGTYPE_p_short swig_types[7]
3109 #define SWIGTYPE_p_signed_char swig_types[8]
3110 #define SWIGTYPE_p_unsigned_char swig_types[9]
3111 #define SWIGTYPE_p_unsigned_int swig_types[10]
3112 #define SWIGTYPE_p_unsigned_long swig_types[11]
3113 #define SWIGTYPE_p_unsigned_short swig_types[12]
3115 static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
3116 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3117 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3118 
3119 /* -------- TYPES TABLE (END) -------- */
3120 
3121 #ifdef SWIG_TypeQuery
3122 # undef SWIG_TypeQuery
3123 #endif
3124 #define SWIG_TypeQuery SWIG_Python_TypeQuery
3125 
3126 /*-----------------------------------------------
3127  @(target):= _pywrapsat.so
3128  ------------------------------------------------*/
3129 #if PY_VERSION_HEX >= 0x03000000
3130 # define SWIG_init PyInit__pywrapsat
3131 
3132 #else
3133 # define SWIG_init init_pywrapsat
3134 
3135 #endif
3136 #define SWIG_name "_pywrapsat"
3137 
3138 #define SWIGVERSION 0x040002
3139 #define SWIG_VERSION SWIGVERSION
3140 
3141 
3142 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3143 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3144 
3145 
3146 #include <stdexcept>
3147 
3148 
3149 namespace swig {
3150  class SwigPtr_PyObject {
3151  protected:
3152  PyObject *_obj;
3153 
3154  public:
3156  {
3157  }
3158 
3160  {
3162  Py_XINCREF(_obj);
3164  }
3165 
3166  SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3167  {
3168  if (initial_ref) {
3170  Py_XINCREF(_obj);
3172  }
3173  }
3174 
3176  {
3178  Py_XINCREF(item._obj);
3179  Py_XDECREF(_obj);
3180  _obj = item._obj;
3182  return *this;
3183  }
3184 
3186  {
3188  Py_XDECREF(_obj);
3190  }
3191 
3192  operator PyObject *() const
3193  {
3194  return _obj;
3195  }
3196 
3197  PyObject *operator->() const
3198  {
3199  return _obj;
3200  }
3201  };
3202 }
3203 
3204 
3205 namespace swig {
3206  struct SwigVar_PyObject : SwigPtr_PyObject {
3207  SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3208 
3210  {
3211  Py_XDECREF(_obj);
3212  _obj = obj;
3213  return *this;
3214  }
3215  };
3216 }
3217 
3218 
3219 #include <stdint.h> // Use the C99 official header
3220 
3221 
3222 #define SWIGWORDSIZE64
3223 #ifndef LONG_MAX
3224 #include <limits.h>
3225 #endif
3226 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
3227 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
3228 #endif
3229 
3230 
3231 #include <cstdint>
3232 #include <string>
3233 #include <vector>
3234 
3235 #include "ortools/base/basictypes.h"
3236 
3237 
3238 #include <string>
3239 
3240 
3241 #include "ortools/base/python-swig.h"
3242 
3243 
3244 #include <functional>
3245 
3246 // A copyable, ref-counted python pointer.
3247 // TODO(user): Make it movable-only when we support generalized lambda
3248 // capture.
3249 class SharedPyPtr {
3250  public:
3251  explicit SharedPyPtr(PyObject* obj) : obj_(obj) { Py_INCREF(obj_); }
3252  SharedPyPtr(const SharedPyPtr& other) : obj_(other.obj_) { Py_INCREF(obj_); }
3253 
3254  ~SharedPyPtr() { Py_DECREF(obj_); }
3255 
3256  PyObject* get() const { return obj_; }
3257 
3258  private:
3259  // We do not follow the rule of three as we only want to copy construct.
3260  SharedPyPtr& operator=(const SharedPyPtr&);
3261 
3262  PyObject* const obj_;
3263 };
3264 
3265 template <typename ReturnT>
3266 static ReturnT HandleResult(PyObject* pyresult) {
3267  // This zero-initializes builtin types.
3268  ReturnT result = ReturnT();
3269  if (!pyresult) {
3270  if (!PyErr_Occurred()) {
3271  PyErr_SetString(PyExc_RuntimeError,
3272  "SWIG std::function invocation failed.");
3273  }
3274  return result;
3275  } else {
3276  if (!PyObjAs<ReturnT>(pyresult, &result)) {
3277  if (!PyErr_Occurred()) {
3278  PyErr_SetString(PyExc_RuntimeError,
3279  "SWIG std::function invocation failed.");
3280  }
3281  }
3282  Py_DECREF(pyresult);
3283  }
3284  return result;
3285 }
3286 
3287 template <>
3288 void HandleResult<void>(PyObject * pyresult) {
3289  if (!pyresult) {
3290  if (!PyErr_Occurred()) {
3291  PyErr_SetString(PyExc_RuntimeError,
3292  "SWIG std::function invocation failed.");
3293  }
3294  } else {
3295  Py_DECREF(pyresult);
3296  }
3297 }
3298 
3299 template <typename ReturnT, typename... Args>
3300 static ReturnT InvokePythonCallableReturning(PyObject* pyfunc,
3301  const char* format, Args... args) {
3302  // The const_cast is safe (it's here only because the python API is not
3303  // const-correct).
3304  return HandleResult<ReturnT>(
3305  PyObject_CallFunction(pyfunc, const_cast<char*>(format), args...));
3306 }
3307 
3308 template <typename ReturnT>
3309 static ReturnT InvokePythonCallableReturning(PyObject* pyfunc) {
3310  return HandleResult<ReturnT>(PyObject_CallFunctionObjArgs(pyfunc, nullptr));
3311 }
3312 
3313 
3314 
3315 #include "ortools/sat/cp_model.pb.h"
3317 #include "ortools/sat/swig_helper.h"
3318 
3319 
3320  #define SWIG_From_long PyInt_FromLong
3321 
3322 
3323  #define SWIG_From_double PyFloat_FromDouble
3324 
3325 
3326 #include <limits.h>
3327 #if !defined(SWIG_NO_LLONG_MAX)
3328 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3329 # define LLONG_MAX __LONG_LONG_MAX__
3330 # define LLONG_MIN (-LLONG_MAX - 1LL)
3331 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3332 # endif
3333 #endif
3334 
3335 
3336 SWIGINTERN int
3337 SWIG_AsVal_double (PyObject *obj, double *val)
3338 {
3339  int res = SWIG_TypeError;
3340  if (PyFloat_Check(obj)) {
3341  if (val) *val = PyFloat_AsDouble(obj);
3342  return SWIG_OK;
3343 #if PY_VERSION_HEX < 0x03000000
3344  } else if (PyInt_Check(obj)) {
3345  if (val) *val = (double) PyInt_AsLong(obj);
3346  return SWIG_OK;
3347 #endif
3348  } else if (PyLong_Check(obj)) {
3349  double v = PyLong_AsDouble(obj);
3350  if (!PyErr_Occurred()) {
3351  if (val) *val = v;
3352  return SWIG_OK;
3353  } else {
3354  PyErr_Clear();
3355  }
3356  }
3357 #ifdef SWIG_PYTHON_CAST_MODE
3358  {
3359  int dispatch = 0;
3360  double d = PyFloat_AsDouble(obj);
3361  if (!PyErr_Occurred()) {
3362  if (val) *val = d;
3363  return SWIG_AddCast(SWIG_OK);
3364  } else {
3365  PyErr_Clear();
3366  }
3367  if (!dispatch) {
3368  long v = PyLong_AsLong(obj);
3369  if (!PyErr_Occurred()) {
3370  if (val) *val = v;
3372  } else {
3373  PyErr_Clear();
3374  }
3375  }
3376  }
3377 #endif
3378  return res;
3379 }
3380 
3381 
3382 #include <float.h>
3383 
3384 
3385 #include <math.h>
3386 
3387 
3388 SWIGINTERNINLINE int
3389 SWIG_CanCastAsInteger(double *d, double min, double max) {
3390  double x = *d;
3391  if ((min <= x && x <= max)) {
3392  double fx = floor(x);
3393  double cx = ceil(x);
3394  double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3395  if ((errno == EDOM) || (errno == ERANGE)) {
3396  errno = 0;
3397  } else {
3398  double summ, reps, diff;
3399  if (rd < x) {
3400  diff = x - rd;
3401  } else if (rd > x) {
3402  diff = rd - x;
3403  } else {
3404  return 1;
3405  }
3406  summ = rd + x;
3407  reps = diff/summ;
3408  if (reps < 8*DBL_EPSILON) {
3409  *d = rd;
3410  return 1;
3411  }
3412  }
3413  }
3414  return 0;
3415 }
3416 
3417 
3418 SWIGINTERN int
3419 SWIG_AsVal_long (PyObject *obj, long* val)
3420 {
3421 #if PY_VERSION_HEX < 0x03000000
3422  if (PyInt_Check(obj)) {
3423  if (val) *val = PyInt_AsLong(obj);
3424  return SWIG_OK;
3425  } else
3426 #endif
3427  if (PyLong_Check(obj)) {
3428  long v = PyLong_AsLong(obj);
3429  if (!PyErr_Occurred()) {
3430  if (val) *val = v;
3431  return SWIG_OK;
3432  } else {
3433  PyErr_Clear();
3434  return SWIG_OverflowError;
3435  }
3436  }
3437 #ifdef SWIG_PYTHON_CAST_MODE
3438  {
3439  int dispatch = 0;
3440  long v = PyInt_AsLong(obj);
3441  if (!PyErr_Occurred()) {
3442  if (val) *val = v;
3443  return SWIG_AddCast(SWIG_OK);
3444  } else {
3445  PyErr_Clear();
3446  }
3447  if (!dispatch) {
3448  double d;
3449  int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3450  if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3451  if (val) *val = (long)(d);
3452  return res;
3453  }
3454  }
3455  }
3456 #endif
3457  return SWIG_TypeError;
3458 }
3459 
3460 
3461 SWIGINTERN int
3462 SWIG_AsVal_int (PyObject * obj, int *val)
3463 {
3464  long v;
3465  int res = SWIG_AsVal_long (obj, &v);
3466  if (SWIG_IsOK(res)) {
3467  if ((v < INT_MIN || v > INT_MAX)) {
3468  return SWIG_OverflowError;
3469  } else {
3470  if (val) *val = static_cast< int >(v);
3471  }
3472  }
3473  return res;
3474 }
3475 
3476 
3477 SWIGINTERNINLINE PyObject*
3479 {
3480  return PyBool_FromLong(value ? 1 : 0);
3481 }
3482 
3483 
3486 {
3487  static int init = 0;
3488  static swig_type_info* info = 0;
3489  if (!init) {
3490  info = SWIG_TypeQuery("_p_char");
3491  init = 1;
3492  }
3493  return info;
3494 }
3495 
3496 
3497 SWIGINTERNINLINE PyObject *
3498 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3499 {
3500  if (carray) {
3501  if (size > INT_MAX) {
3502  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3503  return pchar_descriptor ?
3504  SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3505  } else {
3506 #if PY_VERSION_HEX >= 0x03000000
3507 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3508  return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3509 #else
3510  return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3511 #endif
3512 #else
3513  return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3514 #endif
3515  }
3516  } else {
3517  return SWIG_Py_Void();
3518  }
3519 }
3520 
3521 
3522 SWIGINTERNINLINE PyObject *
3523 SWIG_From_std_string (const std::string& s)
3524 {
3525  return SWIG_FromCharPtrAndSize(s.data(), s.size());
3526 }
3527 
3528 
3529 SWIGINTERN int
3530 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3531 {
3532 #if PY_VERSION_HEX>=0x03000000
3533 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3534  if (PyBytes_Check(obj))
3535 #else
3536  if (PyUnicode_Check(obj))
3537 #endif
3538 #else
3539  if (PyString_Check(obj))
3540 #endif
3541  {
3542  char *cstr; Py_ssize_t len;
3543  int ret = SWIG_OK;
3544 #if PY_VERSION_HEX>=0x03000000
3545 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3546  if (!alloc && cptr) {
3547  /* We can't allow converting without allocation, since the internal
3548  representation of string in Python 3 is UCS-2/UCS-4 but we require
3549  a UTF-8 representation.
3550  TODO(bhy) More detailed explanation */
3551  return SWIG_RuntimeError;
3552  }
3553  obj = PyUnicode_AsUTF8String(obj);
3554  if (!obj)
3555  return SWIG_TypeError;
3556  if (alloc)
3557  *alloc = SWIG_NEWOBJ;
3558 #endif
3559  if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
3560  return SWIG_TypeError;
3561 #else
3562  if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
3563  return SWIG_TypeError;
3564 #endif
3565  if (cptr) {
3566  if (alloc) {
3567  if (*alloc == SWIG_NEWOBJ) {
3568  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3569  *alloc = SWIG_NEWOBJ;
3570  } else {
3571  *cptr = cstr;
3572  *alloc = SWIG_OLDOBJ;
3573  }
3574  } else {
3575 #if PY_VERSION_HEX>=0x03000000
3576 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3577  *cptr = PyBytes_AsString(obj);
3578 #else
3579  assert(0); /* Should never reach here with Unicode strings in Python 3 */
3580 #endif
3581 #else
3582  *cptr = SWIG_Python_str_AsChar(obj);
3583  if (!*cptr)
3584  ret = SWIG_TypeError;
3585 #endif
3586  }
3587  }
3588  if (psize) *psize = len + 1;
3589 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3590  Py_XDECREF(obj);
3591 #endif
3592  return ret;
3593  } else {
3594 #if defined(SWIG_PYTHON_2_UNICODE)
3595 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3596 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3597 #endif
3598 #if PY_VERSION_HEX<0x03000000
3599  if (PyUnicode_Check(obj)) {
3600  char *cstr; Py_ssize_t len;
3601  if (!alloc && cptr) {
3602  return SWIG_RuntimeError;
3603  }
3604  obj = PyUnicode_AsUTF8String(obj);
3605  if (!obj)
3606  return SWIG_TypeError;
3607  if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3608  if (cptr) {
3609  if (alloc) *alloc = SWIG_NEWOBJ;
3610  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3611  }
3612  if (psize) *psize = len + 1;
3613 
3614  Py_XDECREF(obj);
3615  return SWIG_OK;
3616  } else {
3617  Py_XDECREF(obj);
3618  }
3619  }
3620 #endif
3621 #endif
3622 
3623  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3624  if (pchar_descriptor) {
3625  void* vptr = 0;
3626  if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3627  if (cptr) *cptr = (char *) vptr;
3628  if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3629  if (alloc) *alloc = SWIG_OLDOBJ;
3630  return SWIG_OK;
3631  }
3632  }
3633  }
3634  return SWIG_TypeError;
3635 }
3636 
3637 
3638 SWIGINTERN int
3639 SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
3640 {
3641  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
3642  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
3643  if (buf) {
3644  if (val) *val = new std::string(buf, size - 1);
3645  if (alloc == SWIG_NEWOBJ) delete[] buf;
3646  return SWIG_NEWOBJ;
3647  } else {
3648  if (val) *val = 0;
3649  return SWIG_OLDOBJ;
3650  }
3651  } else {
3652  static int init = 0;
3653  static swig_type_info* descriptor = 0;
3654  if (!init) {
3655  descriptor = SWIG_TypeQuery("std::string" " *");
3656  init = 1;
3657  }
3658  if (descriptor) {
3659  std::string *vptr;
3660  int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
3661  if (SWIG_IsOK(res) && val) *val = vptr;
3662  return res;
3663  }
3664  }
3665  return SWIG_ERROR;
3666 }
3667 
3668 
3669 
3670 /* ---------------------------------------------------
3671  * C++ director class methods
3672  * --------------------------------------------------- */
3673 
3674 #include "sat_python_wrap.h"
3675 
3676 SwigDirector_SolutionCallback::SwigDirector_SolutionCallback(PyObject *self): operations_research::sat::SolutionCallback(), Swig::Director(self) {
3677  SWIG_DIRECTOR_RGTR((operations_research::sat::SolutionCallback *)this, this);
3678 }
3679 
3680 
3681 
3682 
3684 }
3685 
3688  {
3689  if (!swig_get_self()) {
3690  Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call SolutionCallback.__init__.");
3691  }
3692 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
3693  const size_t swig_method_index = 0;
3694  const char *const swig_method_name = "OnSolutionCallback";
3695  PyObject *method = swig_get_method(swig_method_index, swig_method_name);
3696  swig::SwigVar_PyObject args = PyTuple_New(0);
3697  swig::SwigVar_PyObject result = PyObject_Call(method, (PyObject *) args, NULL);
3698 #else
3699  swig::SwigVar_PyObject swig_method_name = SWIG_Python_str_FromChar("OnSolutionCallback");
3700  swig::SwigVar_PyObject result = PyObject_CallMethodObjArgs(swig_get_self(), (PyObject *) swig_method_name, NULL);
3701 #endif
3702  if (!result) {
3703  PyObject *error = PyErr_Occurred();
3704  if (error) {
3705  Swig::DirectorMethodException::raise("Error detected when calling 'SolutionCallback.OnSolutionCallback'");
3706  }
3707  }
3708  }
3710 }
3711 
3712 
3713 #ifdef __cplusplus
3714 extern "C" {
3715 #endif
3716 SWIGINTERN PyObject *_wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3717  PyObject *resultobj = 0;
3718  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3719  void *argp1 = 0 ;
3720  int res1 = 0 ;
3721  PyObject *swig_obj[1] ;
3722 
3723  if (!args) SWIG_fail;
3724  swig_obj[0] = args;
3726  if (!SWIG_IsOK(res1)) {
3727  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3728  }
3729  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3730  {
3732  delete arg1;
3734  }
3735  resultobj = SWIG_Py_Void();
3736  return resultobj;
3737 fail:
3738  return NULL;
3739 }
3740 
3741 
3742 SWIGINTERN PyObject *_wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3743  PyObject *resultobj = 0;
3744  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3745  void *argp1 = 0 ;
3746  int res1 = 0 ;
3747  PyObject *swig_obj[1] ;
3748  Swig::Director *director = 0;
3749  bool upcall = false;
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_OnSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3756  }
3757  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3758  director = SWIG_DIRECTOR_CAST(arg1);
3759  upcall = (director && (director->swig_get_self()==swig_obj[0]));
3760  try {
3761  if (upcall) {
3762  Swig::DirectorPureVirtualException::raise("operations_research::sat::SolutionCallback::OnSolutionCallback");
3763  } else {
3764  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
3765  }
3766  } catch (Swig::DirectorException&) {
3767  SWIG_fail;
3768  }
3769  resultobj = SWIG_Py_Void();
3770  return resultobj;
3771 fail:
3772  return NULL;
3773 }
3774 
3775 
3776 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3777  PyObject *resultobj = 0;
3778  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3779  void *argp1 = 0 ;
3780  int res1 = 0 ;
3781  PyObject *swig_obj[1] ;
3782  int64 result;
3783 
3784  if (!args) SWIG_fail;
3785  swig_obj[0] = args;
3786  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3787  if (!SWIG_IsOK(res1)) {
3788  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBooleans" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3789  }
3790  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3791  {
3793  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
3795  }
3796  resultobj = SWIG_From_long(static_cast< long >(result));
3797  return resultobj;
3798 fail:
3799  return NULL;
3800 }
3801 
3802 
3803 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3804  PyObject *resultobj = 0;
3805  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3806  void *argp1 = 0 ;
3807  int res1 = 0 ;
3808  PyObject *swig_obj[1] ;
3809  int64 result;
3810 
3811  if (!args) SWIG_fail;
3812  swig_obj[0] = args;
3813  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3814  if (!SWIG_IsOK(res1)) {
3815  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBranches" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3816  }
3817  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3818  {
3820  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
3822  }
3823  resultobj = SWIG_From_long(static_cast< long >(result));
3824  return resultobj;
3825 fail:
3826  return NULL;
3827 }
3828 
3829 
3830 SWIGINTERN PyObject *_wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3831  PyObject *resultobj = 0;
3832  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3833  void *argp1 = 0 ;
3834  int res1 = 0 ;
3835  PyObject *swig_obj[1] ;
3836  int64 result;
3837 
3838  if (!args) SWIG_fail;
3839  swig_obj[0] = args;
3840  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3841  if (!SWIG_IsOK(res1)) {
3842  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumConflicts" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3843  }
3844  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3845  {
3847  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
3849  }
3850  resultobj = SWIG_From_long(static_cast< long >(result));
3851  return resultobj;
3852 fail:
3853  return NULL;
3854 }
3855 
3856 
3857 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3858  PyObject *resultobj = 0;
3859  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3860  void *argp1 = 0 ;
3861  int res1 = 0 ;
3862  PyObject *swig_obj[1] ;
3863  int64 result;
3864 
3865  if (!args) SWIG_fail;
3866  swig_obj[0] = args;
3867  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3868  if (!SWIG_IsOK(res1)) {
3869  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBinaryPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3870  }
3871  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3872  {
3874  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
3876  }
3877  resultobj = SWIG_From_long(static_cast< long >(result));
3878  return resultobj;
3879 fail:
3880  return NULL;
3881 }
3882 
3883 
3885  PyObject *resultobj = 0;
3886  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3887  void *argp1 = 0 ;
3888  int res1 = 0 ;
3889  PyObject *swig_obj[1] ;
3890  int64 result;
3891 
3892  if (!args) SWIG_fail;
3893  swig_obj[0] = args;
3894  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3895  if (!SWIG_IsOK(res1)) {
3896  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumIntegerPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3897  }
3898  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3899  {
3901  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
3903  }
3904  resultobj = SWIG_From_long(static_cast< long >(result));
3905  return resultobj;
3906 fail:
3907  return NULL;
3908 }
3909 
3910 
3911 SWIGINTERN PyObject *_wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3912  PyObject *resultobj = 0;
3913  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3914  void *argp1 = 0 ;
3915  int res1 = 0 ;
3916  PyObject *swig_obj[1] ;
3917  double result;
3918 
3919  if (!args) SWIG_fail;
3920  swig_obj[0] = args;
3921  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3922  if (!SWIG_IsOK(res1)) {
3923  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_WallTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3924  }
3925  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3926  {
3928  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
3930  }
3931  resultobj = SWIG_From_double(static_cast< double >(result));
3932  return resultobj;
3933 fail:
3934  return NULL;
3935 }
3936 
3937 
3938 SWIGINTERN PyObject *_wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3939  PyObject *resultobj = 0;
3940  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3941  void *argp1 = 0 ;
3942  int res1 = 0 ;
3943  PyObject *swig_obj[1] ;
3944  double result;
3945 
3946  if (!args) SWIG_fail;
3947  swig_obj[0] = args;
3948  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3949  if (!SWIG_IsOK(res1)) {
3950  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_UserTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3951  }
3952  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3953  {
3955  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
3957  }
3958  resultobj = SWIG_From_double(static_cast< double >(result));
3959  return resultobj;
3960 fail:
3961  return NULL;
3962 }
3963 
3964 
3965 SWIGINTERN PyObject *_wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3966  PyObject *resultobj = 0;
3967  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3968  void *argp1 = 0 ;
3969  int res1 = 0 ;
3970  PyObject *swig_obj[1] ;
3971  double result;
3972 
3973  if (!args) SWIG_fail;
3974  swig_obj[0] = args;
3975  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3976  if (!SWIG_IsOK(res1)) {
3977  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_ObjectiveValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3978  }
3979  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3980  {
3982  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
3984  }
3985  resultobj = SWIG_From_double(static_cast< double >(result));
3986  return resultobj;
3987 fail:
3988  return NULL;
3989 }
3990 
3991 
3992 SWIGINTERN PyObject *_wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3993  PyObject *resultobj = 0;
3994  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3995  void *argp1 = 0 ;
3996  int res1 = 0 ;
3997  PyObject *swig_obj[1] ;
3998  double result;
3999 
4000  if (!args) SWIG_fail;
4001  swig_obj[0] = args;
4002  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4003  if (!SWIG_IsOK(res1)) {
4004  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_BestObjectiveBound" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4005  }
4006  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4007  {
4009  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
4011  }
4012  resultobj = SWIG_From_double(static_cast< double >(result));
4013  return resultobj;
4014 fail:
4015  return NULL;
4016 }
4017 
4018 
4019 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4020  PyObject *resultobj = 0;
4021  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4022  int arg2 ;
4023  void *argp1 = 0 ;
4024  int res1 = 0 ;
4025  int val2 ;
4026  int ecode2 = 0 ;
4027  PyObject *swig_obj[2] ;
4028  int64 result;
4029 
4030  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionIntegerValue", 2, 2, swig_obj)) SWIG_fail;
4031  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4032  if (!SWIG_IsOK(res1)) {
4033  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4034  }
4035  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4036  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
4037  if (!SWIG_IsOK(ecode2)) {
4038  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "2"" of type '" "int""'");
4039  }
4040  arg2 = static_cast< int >(val2);
4041  {
4043  result = (int64)(arg1)->SolutionIntegerValue(arg2);
4045  }
4046  resultobj = SWIG_From_long(static_cast< long >(result));
4047  return resultobj;
4048 fail:
4049  return NULL;
4050 }
4051 
4052 
4053 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4054  PyObject *resultobj = 0;
4055  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4056  int arg2 ;
4057  void *argp1 = 0 ;
4058  int res1 = 0 ;
4059  int val2 ;
4060  int ecode2 = 0 ;
4061  PyObject *swig_obj[2] ;
4062  bool result;
4063 
4064  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionBooleanValue", 2, 2, swig_obj)) SWIG_fail;
4065  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4066  if (!SWIG_IsOK(res1)) {
4067  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4068  }
4069  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4070  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
4071  if (!SWIG_IsOK(ecode2)) {
4072  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "2"" of type '" "int""'");
4073  }
4074  arg2 = static_cast< int >(val2);
4075  {
4077  result = (bool)(arg1)->SolutionBooleanValue(arg2);
4079  }
4080  resultobj = SWIG_From_bool(static_cast< bool >(result));
4081  return resultobj;
4082 fail:
4083  return NULL;
4084 }
4085 
4086 
4087 SWIGINTERN PyObject *_wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4088  PyObject *resultobj = 0;
4089  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4090  void *argp1 = 0 ;
4091  int res1 = 0 ;
4092  PyObject *swig_obj[1] ;
4093 
4094  if (!args) SWIG_fail;
4095  swig_obj[0] = args;
4096  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4097  if (!SWIG_IsOK(res1)) {
4098  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4099  }
4100  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4101  {
4103  (arg1)->StopSearch();
4105  }
4106  resultobj = SWIG_Py_Void();
4107  return resultobj;
4108 fail:
4109  return NULL;
4110 }
4111 
4112 
4113 SWIGINTERN PyObject *_wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4114  PyObject *resultobj = 0;
4115  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4116  void *argp1 = 0 ;
4117  int res1 = 0 ;
4118  PyObject *swig_obj[1] ;
4119  operations_research::sat::CpSolverResponse result;
4120 
4121  if (!args) SWIG_fail;
4122  swig_obj[0] = args;
4123  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4124  if (!SWIG_IsOK(res1)) {
4125  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_Response" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4126  }
4127  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4128  {
4130  result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
4132  }
4133  {
4134  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4135  if (module != nullptr) {
4136  PyObject* const dict = PyModule_GetDict(module);
4137  if (dict != nullptr) {
4138  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4139  if (clss != nullptr) {
4140  std::string encoded_protobuf;
4141  (&result)->SerializeToString(&encoded_protobuf);
4142 
4143  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4144  encoded_protobuf.c_str(), encoded_protobuf.size());
4145 
4146 
4147 
4148 
4149  PyObject* const result = PyObject_CallMethod(
4150  clss, const_cast<char*>("FromString"),
4151  const_cast<char*>("(O)"),
4152  python_encoded_protobuf);
4153  Py_DECREF(python_encoded_protobuf);
4154  resultobj = result;
4155  }
4156  }
4157  Py_DECREF(module);
4158  }
4159  }
4160  return resultobj;
4161 fail:
4162  return NULL;
4163 }
4164 
4165 
4166 SWIGINTERN PyObject *_wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4167  PyObject *resultobj = 0;
4168  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4169  void *argp1 = 0 ;
4170  int res1 = 0 ;
4171  PyObject *swig_obj[1] ;
4172  bool result;
4173 
4174  if (!args) SWIG_fail;
4175  swig_obj[0] = args;
4176  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4177  if (!SWIG_IsOK(res1)) {
4178  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_HasResponse" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4179  }
4180  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4181  {
4183  result = (bool)((operations_research::sat::SolutionCallback const *)arg1)->HasResponse();
4185  }
4186  resultobj = SWIG_From_bool(static_cast< bool >(result));
4187  return resultobj;
4188 fail:
4189  return NULL;
4190 }
4191 
4192 
4193 SWIGINTERN PyObject *_wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4194  PyObject *resultobj = 0;
4195  PyObject *arg1 = (PyObject *) 0 ;
4196  PyObject *swig_obj[1] ;
4197  operations_research::sat::SolutionCallback *result = 0 ;
4198 
4199  if (!args) SWIG_fail;
4200  swig_obj[0] = args;
4201  arg1 = swig_obj[0];
4202  {
4204  if ( arg1 != Py_None ) {
4205  /* subclassed */
4206  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback(arg1);
4207  } else {
4208  SWIG_SetErrorMsg(PyExc_RuntimeError,"accessing abstract class or protected constructor");
4209  SWIG_fail;
4210  }
4211 
4213  }
4215  return resultobj;
4216 fail:
4217  return NULL;
4218 }
4219 
4220 
4221 SWIGINTERN PyObject *_wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4222  PyObject *resultobj = 0;
4223  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4224  void *argp1 = 0 ;
4225  int res1 = 0 ;
4226  PyObject *swig_obj[1] ;
4227 
4228  if (!args) SWIG_fail;
4229  swig_obj[0] = args;
4230  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4231  if (!SWIG_IsOK(res1)) {
4232  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "disown_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4233  }
4234  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4235  {
4237  {
4238  Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
4239  if (director) director->swig_disown();
4240  }
4241 
4243  }
4244  resultobj = SWIG_Py_Void();
4245  return resultobj;
4246 fail:
4247  return NULL;
4248 }
4249 
4250 
4251 SWIGINTERN PyObject *SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4252  PyObject *obj;
4253  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4255  return SWIG_Py_Void();
4256 }
4257 
4258 SWIGINTERN PyObject *SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4259  return SWIG_Python_InitShadowInstance(args);
4260 }
4261 
4262 SWIGINTERN PyObject *_wrap_SatHelper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4263  PyObject *resultobj = 0;
4264  operations_research::sat::CpModelProto *arg1 = 0 ;
4265  PyObject *swig_obj[1] ;
4266  operations_research::sat::CpSolverResponse result;
4267 
4268  if (!args) SWIG_fail;
4269  swig_obj[0] = args;
4270  {
4271  arg1 = new operations_research::sat::CpModelProto;
4272  PyObject* const pyresult = PyObject_CallMethod(
4273  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4274  if (pyresult != nullptr) {
4275  char* buffer = nullptr;
4276  Py_ssize_t length = 0;
4277  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4278  if (buffer != nullptr) {
4279  arg1->ParseFromArray(buffer, length);
4280  }
4281  Py_DECREF(pyresult);
4282  }
4283  }
4284  {
4286  result = operations_research::sat::SatHelper::Solve((operations_research::sat::CpModelProto const &)*arg1);
4288  }
4289  {
4290  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4291  if (module != nullptr) {
4292  PyObject* const dict = PyModule_GetDict(module);
4293  if (dict != nullptr) {
4294  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4295  if (clss != nullptr) {
4296  std::string encoded_protobuf;
4297  (&result)->SerializeToString(&encoded_protobuf);
4298 
4299  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4300  encoded_protobuf.c_str(), encoded_protobuf.size());
4301 
4302 
4303 
4304 
4305  PyObject* const result = PyObject_CallMethod(
4306  clss, const_cast<char*>("FromString"),
4307  const_cast<char*>("(O)"),
4308  python_encoded_protobuf);
4309  Py_DECREF(python_encoded_protobuf);
4310  resultobj = result;
4311  }
4312  }
4313  Py_DECREF(module);
4314  }
4315  }
4316  {
4317  delete arg1;
4318  }
4319  return resultobj;
4320 fail:
4321  {
4322  delete arg1;
4323  }
4324  return NULL;
4325 }
4326 
4327 
4328 SWIGINTERN PyObject *_wrap_SatHelper_SolveWithParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4329  PyObject *resultobj = 0;
4330  operations_research::sat::CpModelProto *arg1 = 0 ;
4331  operations_research::sat::SatParameters *arg2 = 0 ;
4332  PyObject *swig_obj[2] ;
4333  operations_research::sat::CpSolverResponse result;
4334 
4335  if (!SWIG_Python_UnpackTuple(args, "SatHelper_SolveWithParameters", 2, 2, swig_obj)) SWIG_fail;
4336  {
4337  arg1 = new operations_research::sat::CpModelProto;
4338  PyObject* const pyresult = PyObject_CallMethod(
4339  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4340  if (pyresult != nullptr) {
4341  char* buffer = nullptr;
4342  Py_ssize_t length = 0;
4343  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4344  if (buffer != nullptr) {
4345  arg1->ParseFromArray(buffer, length);
4346  }
4347  Py_DECREF(pyresult);
4348  }
4349  }
4350  {
4351  arg2 = new operations_research::sat::SatParameters;
4352  PyObject* const pyresult = PyObject_CallMethod(
4353  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4354  if (pyresult != nullptr) {
4355  char* buffer = nullptr;
4356  Py_ssize_t length = 0;
4357  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4358  if (buffer != nullptr) {
4359  arg2->ParseFromArray(buffer, length);
4360  }
4361  Py_DECREF(pyresult);
4362  }
4363  }
4364  {
4366  result = operations_research::sat::SatHelper::SolveWithParameters((operations_research::sat::CpModelProto const &)*arg1,(operations_research::sat::SatParameters const &)*arg2);
4368  }
4369  {
4370  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4371  if (module != nullptr) {
4372  PyObject* const dict = PyModule_GetDict(module);
4373  if (dict != nullptr) {
4374  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4375  if (clss != nullptr) {
4376  std::string encoded_protobuf;
4377  (&result)->SerializeToString(&encoded_protobuf);
4378 
4379  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4380  encoded_protobuf.c_str(), encoded_protobuf.size());
4381 
4382 
4383 
4384 
4385  PyObject* const result = PyObject_CallMethod(
4386  clss, const_cast<char*>("FromString"),
4387  const_cast<char*>("(O)"),
4388  python_encoded_protobuf);
4389  Py_DECREF(python_encoded_protobuf);
4390  resultobj = result;
4391  }
4392  }
4393  Py_DECREF(module);
4394  }
4395  }
4396  {
4397  delete arg1;
4398  }
4399  {
4400  delete arg2;
4401  }
4402  return resultobj;
4403 fail:
4404  {
4405  delete arg1;
4406  }
4407  {
4408  delete arg2;
4409  }
4410  return NULL;
4411 }
4412 
4413 
4415  PyObject *resultobj = 0;
4416  operations_research::sat::CpModelProto *arg1 = 0 ;
4417  operations_research::sat::SatParameters *arg2 = 0 ;
4418  operations_research::sat::SolutionCallback *arg3 = 0 ;
4419  void *argp3 = 0 ;
4420  int res3 = 0 ;
4421  PyObject *swig_obj[3] ;
4422  operations_research::sat::CpSolverResponse result;
4423 
4424  if (!SWIG_Python_UnpackTuple(args, "SatHelper_SolveWithParametersAndSolutionCallback", 3, 3, swig_obj)) SWIG_fail;
4425  {
4426  arg1 = new operations_research::sat::CpModelProto;
4427  PyObject* const pyresult = PyObject_CallMethod(
4428  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4429  if (pyresult != nullptr) {
4430  char* buffer = nullptr;
4431  Py_ssize_t length = 0;
4432  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4433  if (buffer != nullptr) {
4434  arg1->ParseFromArray(buffer, length);
4435  }
4436  Py_DECREF(pyresult);
4437  }
4438  }
4439  {
4440  arg2 = new operations_research::sat::SatParameters;
4441  PyObject* const pyresult = PyObject_CallMethod(
4442  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4443  if (pyresult != nullptr) {
4444  char* buffer = nullptr;
4445  Py_ssize_t length = 0;
4446  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4447  if (buffer != nullptr) {
4448  arg2->ParseFromArray(buffer, length);
4449  }
4450  Py_DECREF(pyresult);
4451  }
4452  }
4453  res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0);
4454  if (!SWIG_IsOK(res3)) {
4455  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SatHelper_SolveWithParametersAndSolutionCallback" "', argument " "3"" of type '" "operations_research::sat::SolutionCallback const &""'");
4456  }
4457  if (!argp3) {
4458  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SatHelper_SolveWithParametersAndSolutionCallback" "', argument " "3"" of type '" "operations_research::sat::SolutionCallback const &""'");
4459  }
4460  arg3 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp3);
4461  {
4463  result = operations_research::sat::SatHelper::SolveWithParametersAndSolutionCallback((operations_research::sat::CpModelProto const &)*arg1,(operations_research::sat::SatParameters const &)*arg2,(operations_research::sat::SolutionCallback const &)*arg3);
4465  }
4466  {
4467  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4468  if (module != nullptr) {
4469  PyObject* const dict = PyModule_GetDict(module);
4470  if (dict != nullptr) {
4471  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4472  if (clss != nullptr) {
4473  std::string encoded_protobuf;
4474  (&result)->SerializeToString(&encoded_protobuf);
4475 
4476  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4477  encoded_protobuf.c_str(), encoded_protobuf.size());
4478 
4479 
4480 
4481 
4482  PyObject* const result = PyObject_CallMethod(
4483  clss, const_cast<char*>("FromString"),
4484  const_cast<char*>("(O)"),
4485  python_encoded_protobuf);
4486  Py_DECREF(python_encoded_protobuf);
4487  resultobj = result;
4488  }
4489  }
4490  Py_DECREF(module);
4491  }
4492  }
4493  {
4494  delete arg1;
4495  }
4496  {
4497  delete arg2;
4498  }
4499  return resultobj;
4500 fail:
4501  {
4502  delete arg1;
4503  }
4504  {
4505  delete arg2;
4506  }
4507  return NULL;
4508 }
4509 
4510 
4511 SWIGINTERN PyObject *_wrap_SatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4512  PyObject *resultobj = 0;
4513  operations_research::sat::CpModelProto *arg1 = 0 ;
4514  PyObject *swig_obj[1] ;
4515  std::string result;
4516 
4517  if (!args) SWIG_fail;
4518  swig_obj[0] = args;
4519  {
4520  arg1 = new operations_research::sat::CpModelProto;
4521  PyObject* const pyresult = PyObject_CallMethod(
4522  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4523  if (pyresult != nullptr) {
4524  char* buffer = nullptr;
4525  Py_ssize_t length = 0;
4526  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4527  if (buffer != nullptr) {
4528  arg1->ParseFromArray(buffer, length);
4529  }
4530  Py_DECREF(pyresult);
4531  }
4532  }
4533  {
4535  result = operations_research::sat::SatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
4537  }
4538  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4539  {
4540  delete arg1;
4541  }
4542  return resultobj;
4543 fail:
4544  {
4545  delete arg1;
4546  }
4547  return NULL;
4548 }
4549 
4550 
4551 SWIGINTERN PyObject *_wrap_SatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4552  PyObject *resultobj = 0;
4553  operations_research::sat::CpSolverResponse *arg1 = 0 ;
4554  PyObject *swig_obj[1] ;
4555  std::string result;
4556 
4557  if (!args) SWIG_fail;
4558  swig_obj[0] = args;
4559  {
4560  arg1 = new operations_research::sat::CpSolverResponse;
4561  PyObject* const pyresult = PyObject_CallMethod(
4562  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4563  if (pyresult != nullptr) {
4564  char* buffer = nullptr;
4565  Py_ssize_t length = 0;
4566  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4567  if (buffer != nullptr) {
4568  arg1->ParseFromArray(buffer, length);
4569  }
4570  Py_DECREF(pyresult);
4571  }
4572  }
4573  {
4575  result = operations_research::sat::SatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
4577  }
4578  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4579  {
4580  delete arg1;
4581  }
4582  return resultobj;
4583 fail:
4584  {
4585  delete arg1;
4586  }
4587  return NULL;
4588 }
4589 
4590 
4591 SWIGINTERN PyObject *_wrap_SatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4592  PyObject *resultobj = 0;
4593  operations_research::sat::CpModelProto *arg1 = 0 ;
4594  PyObject *swig_obj[1] ;
4595  std::string result;
4596 
4597  if (!args) SWIG_fail;
4598  swig_obj[0] = args;
4599  {
4600  arg1 = new operations_research::sat::CpModelProto;
4601  PyObject* const pyresult = PyObject_CallMethod(
4602  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4603  if (pyresult != nullptr) {
4604  char* buffer = nullptr;
4605  Py_ssize_t length = 0;
4606  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4607  if (buffer != nullptr) {
4608  arg1->ParseFromArray(buffer, length);
4609  }
4610  Py_DECREF(pyresult);
4611  }
4612  }
4613  {
4615  result = operations_research::sat::SatHelper::ValidateModel((operations_research::sat::CpModelProto const &)*arg1);
4617  }
4618  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4619  {
4620  delete arg1;
4621  }
4622  return resultobj;
4623 fail:
4624  {
4625  delete arg1;
4626  }
4627  return NULL;
4628 }
4629 
4630 
4631 SWIGINTERN PyObject *_wrap_SatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4632  PyObject *resultobj = 0;
4633  operations_research::sat::IntegerVariableProto *arg1 = 0 ;
4634  void *argp1 = 0 ;
4635  int res1 = 0 ;
4636  PyObject *swig_obj[1] ;
4638 
4639  if (!args) SWIG_fail;
4640  swig_obj[0] = args;
4642  if (!SWIG_IsOK(res1)) {
4643  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4644  }
4645  if (!argp1) {
4646  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4647  }
4648  arg1 = reinterpret_cast< operations_research::sat::IntegerVariableProto * >(argp1);
4649  {
4651  result = operations_research::sat::SatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
4653  }
4655  return resultobj;
4656 fail:
4657  return NULL;
4658 }
4659 
4660 
4661 SWIGINTERN PyObject *_wrap_SatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4662  PyObject *resultobj = 0;
4663  operations_research::sat::CpModelProto *arg1 = 0 ;
4664  std::string *arg2 = 0 ;
4665  int res2 = SWIG_OLDOBJ ;
4666  PyObject *swig_obj[2] ;
4667  bool result;
4668 
4669  if (!SWIG_Python_UnpackTuple(args, "SatHelper_WriteModelToFile", 2, 2, swig_obj)) SWIG_fail;
4670  {
4671  arg1 = new operations_research::sat::CpModelProto;
4672  PyObject* const pyresult = PyObject_CallMethod(
4673  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4674  if (pyresult != nullptr) {
4675  char* buffer = nullptr;
4676  Py_ssize_t length = 0;
4677  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4678  if (buffer != nullptr) {
4679  arg1->ParseFromArray(buffer, length);
4680  }
4681  Py_DECREF(pyresult);
4682  }
4683  }
4684  {
4685  std::string *ptr = (std::string *)0;
4686  res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4687  if (!SWIG_IsOK(res2)) {
4688  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4689  }
4690  if (!ptr) {
4691  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4692  }
4693  arg2 = ptr;
4694  }
4695  {
4697  result = (bool)operations_research::sat::SatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
4699  }
4700  resultobj = SWIG_From_bool(static_cast< bool >(result));
4701  {
4702  delete arg1;
4703  }
4704  if (SWIG_IsNewObj(res2)) delete arg2;
4705  return resultobj;
4706 fail:
4707  {
4708  delete arg1;
4709  }
4710  if (SWIG_IsNewObj(res2)) delete arg2;
4711  return NULL;
4712 }
4713 
4714 
4715 SWIGINTERN PyObject *_wrap_new_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4716  PyObject *resultobj = 0;
4717  operations_research::sat::SatHelper *result = 0 ;
4718 
4719  if (!SWIG_Python_UnpackTuple(args, "new_SatHelper", 0, 0, 0)) SWIG_fail;
4720  {
4722  result = (operations_research::sat::SatHelper *)new operations_research::sat::SatHelper();
4724  }
4726  return resultobj;
4727 fail:
4728  return NULL;
4729 }
4730 
4731 
4732 SWIGINTERN PyObject *_wrap_delete_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4733  PyObject *resultobj = 0;
4734  operations_research::sat::SatHelper *arg1 = (operations_research::sat::SatHelper *) 0 ;
4735  void *argp1 = 0 ;
4736  int res1 = 0 ;
4737  PyObject *swig_obj[1] ;
4738 
4739  if (!args) SWIG_fail;
4740  swig_obj[0] = args;
4742  if (!SWIG_IsOK(res1)) {
4743  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SatHelper" "', argument " "1"" of type '" "operations_research::sat::SatHelper *""'");
4744  }
4745  arg1 = reinterpret_cast< operations_research::sat::SatHelper * >(argp1);
4746  {
4748  delete arg1;
4750  }
4751  resultobj = SWIG_Py_Void();
4752  return resultobj;
4753 fail:
4754  return NULL;
4755 }
4756 
4757 
4758 SWIGINTERN PyObject *SatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4759  PyObject *obj;
4760  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4762  return SWIG_Py_Void();
4763 }
4764 
4765 SWIGINTERN PyObject *SatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4766  return SWIG_Python_InitShadowInstance(args);
4767 }
4768 
4769 static PyMethodDef SwigMethods[] = {
4770  { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
4771  { "delete_SolutionCallback", _wrap_delete_SolutionCallback, METH_O, NULL},
4772  { "SolutionCallback_OnSolutionCallback", _wrap_SolutionCallback_OnSolutionCallback, METH_O, NULL},
4773  { "SolutionCallback_NumBooleans", _wrap_SolutionCallback_NumBooleans, METH_O, NULL},
4774  { "SolutionCallback_NumBranches", _wrap_SolutionCallback_NumBranches, METH_O, NULL},
4775  { "SolutionCallback_NumConflicts", _wrap_SolutionCallback_NumConflicts, METH_O, NULL},
4776  { "SolutionCallback_NumBinaryPropagations", _wrap_SolutionCallback_NumBinaryPropagations, METH_O, NULL},
4777  { "SolutionCallback_NumIntegerPropagations", _wrap_SolutionCallback_NumIntegerPropagations, METH_O, NULL},
4778  { "SolutionCallback_WallTime", _wrap_SolutionCallback_WallTime, METH_O, NULL},
4779  { "SolutionCallback_UserTime", _wrap_SolutionCallback_UserTime, METH_O, NULL},
4780  { "SolutionCallback_ObjectiveValue", _wrap_SolutionCallback_ObjectiveValue, METH_O, NULL},
4781  { "SolutionCallback_BestObjectiveBound", _wrap_SolutionCallback_BestObjectiveBound, METH_O, NULL},
4782  { "SolutionCallback_SolutionIntegerValue", _wrap_SolutionCallback_SolutionIntegerValue, METH_VARARGS, NULL},
4783  { "SolutionCallback_SolutionBooleanValue", _wrap_SolutionCallback_SolutionBooleanValue, METH_VARARGS, NULL},
4784  { "SolutionCallback_StopSearch", _wrap_SolutionCallback_StopSearch, METH_O, NULL},
4785  { "SolutionCallback_Response", _wrap_SolutionCallback_Response, METH_O, NULL},
4786  { "SolutionCallback_HasResponse", _wrap_SolutionCallback_HasResponse, METH_O, NULL},
4787  { "new_SolutionCallback", _wrap_new_SolutionCallback, METH_O, NULL},
4788  { "disown_SolutionCallback", _wrap_disown_SolutionCallback, METH_O, NULL},
4789  { "SolutionCallback_swigregister", SolutionCallback_swigregister, METH_O, NULL},
4790  { "SolutionCallback_swiginit", SolutionCallback_swiginit, METH_VARARGS, NULL},
4791  { "SatHelper_Solve", _wrap_SatHelper_Solve, METH_O, NULL},
4792  { "SatHelper_SolveWithParameters", _wrap_SatHelper_SolveWithParameters, METH_VARARGS, NULL},
4793  { "SatHelper_SolveWithParametersAndSolutionCallback", _wrap_SatHelper_SolveWithParametersAndSolutionCallback, METH_VARARGS, NULL},
4794  { "SatHelper_ModelStats", _wrap_SatHelper_ModelStats, METH_O, NULL},
4795  { "SatHelper_SolverResponseStats", _wrap_SatHelper_SolverResponseStats, METH_O, NULL},
4796  { "SatHelper_ValidateModel", _wrap_SatHelper_ValidateModel, METH_O, NULL},
4797  { "SatHelper_VariableDomain", _wrap_SatHelper_VariableDomain, METH_O, NULL},
4798  { "SatHelper_WriteModelToFile", _wrap_SatHelper_WriteModelToFile, METH_VARARGS, NULL},
4799  { "new_SatHelper", _wrap_new_SatHelper, METH_NOARGS, NULL},
4800  { "delete_SatHelper", _wrap_delete_SatHelper, METH_O, NULL},
4801  { "SatHelper_swigregister", SatHelper_swigregister, METH_O, NULL},
4802  { "SatHelper_swiginit", SatHelper_swiginit, METH_VARARGS, NULL},
4803  { NULL, NULL, 0, NULL }
4804 };
4805 
4806 static PyMethodDef SwigMethods_proxydocs[] = {
4807  { NULL, NULL, 0, NULL }
4808 };
4809 
4810 
4811 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4812 
4813 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4814 static swig_type_info _swigt__p_int = {"_p_int", "int *|int_least32_t *|int32 *|int32_t *", 0, 0, (void*)0, 0};
4815 static swig_type_info _swigt__p_long = {"_p_long", "intptr_t *|int_least64_t *|int_fast32_t *|int_fast64_t *|int64 *|int64_t *|long *|int_fast16_t *|intmax_t *", 0, 0, (void*)0, 0};
4816 static swig_type_info _swigt__p_operations_research__Domain = {"_p_operations_research__Domain", "operations_research::Domain *", 0, 0, (void*)0, 0};
4817 static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto = {"_p_operations_research__sat__IntegerVariableProto", "operations_research::sat::IntegerVariableProto *", 0, 0, (void*)0, 0};
4818 static swig_type_info _swigt__p_operations_research__sat__SatHelper = {"_p_operations_research__sat__SatHelper", "operations_research::sat::SatHelper *", 0, 0, (void*)0, 0};
4819 static swig_type_info _swigt__p_operations_research__sat__SolutionCallback = {"_p_operations_research__sat__SolutionCallback", "operations_research::sat::SolutionCallback *", 0, 0, (void*)0, 0};
4820 static swig_type_info _swigt__p_short = {"_p_short", "int16 *|short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
4821 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int8 *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
4822 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint8 *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
4823 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint_least32_t *|uint32 *|uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
4824 static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uintptr_t *|uint_least64_t *|uint_fast32_t *|uint_fast64_t *|uint64 *|uint64_t *|unsigned long *|uint_fast16_t *|uintmax_t *", 0, 0, (void*)0, 0};
4825 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16 *|unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
4826 
4828  &_swigt__p_char,
4829  &_swigt__p_int,
4830  &_swigt__p_long,
4835  &_swigt__p_short,
4841 };
4842 
4843 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4844 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4845 static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
4850 static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
4851 static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
4852 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4853 static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
4854 static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
4856 
4859  _swigc__p_int,
4871 };
4872 
4873 
4874 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4875 
4877 {0, 0, 0, 0.0, 0, 0}};
4878 
4879 #ifdef __cplusplus
4880 }
4881 #endif
4882 /* -----------------------------------------------------------------------------
4883  * Type initialization:
4884  * This problem is tough by the requirement that no dynamic
4885  * memory is used. Also, since swig_type_info structures store pointers to
4886  * swig_cast_info structures and swig_cast_info structures store pointers back
4887  * to swig_type_info structures, we need some lookup code at initialization.
4888  * The idea is that swig generates all the structures that are needed.
4889  * The runtime then collects these partially filled structures.
4890  * The SWIG_InitializeModule function takes these initial arrays out of
4891  * swig_module, and does all the lookup, filling in the swig_module.types
4892  * array with the correct data and linking the correct swig_cast_info
4893  * structures together.
4894  *
4895  * The generated swig_type_info structures are assigned statically to an initial
4896  * array. We just loop through that array, and handle each type individually.
4897  * First we lookup if this type has been already loaded, and if so, use the
4898  * loaded structure instead of the generated one. Then we have to fill in the
4899  * cast linked list. The cast data is initially stored in something like a
4900  * two-dimensional array. Each row corresponds to a type (there are the same
4901  * number of rows as there are in the swig_type_initial array). Each entry in
4902  * a column is one of the swig_cast_info structures for that type.
4903  * The cast_initial array is actually an array of arrays, because each row has
4904  * a variable number of columns. So to actually build the cast linked list,
4905  * we find the array of casts associated with the type, and loop through it
4906  * adding the casts to the list. The one last trick we need to do is making
4907  * sure the type pointer in the swig_cast_info struct is correct.
4908  *
4909  * First off, we lookup the cast->type name to see if it is already loaded.
4910  * There are three cases to handle:
4911  * 1) If the cast->type has already been loaded AND the type we are adding
4912  * casting info to has not been loaded (it is in this module), THEN we
4913  * replace the cast->type pointer with the type pointer that has already
4914  * been loaded.
4915  * 2) If BOTH types (the one we are adding casting info to, and the
4916  * cast->type) are loaded, THEN the cast info has already been loaded by
4917  * the previous module so we just ignore it.
4918  * 3) Finally, if cast->type has not already been loaded, then we add that
4919  * swig_cast_info to the linked list (because the cast->type) pointer will
4920  * be correct.
4921  * ----------------------------------------------------------------------------- */
4922 
4923 #ifdef __cplusplus
4924 extern "C" {
4925 #if 0
4926 } /* c-mode */
4927 #endif
4928 #endif
4929 
4930 #if 0
4931 #define SWIGRUNTIME_DEBUG
4932 #endif
4933 
4934 
4935 SWIGRUNTIME void
4936 SWIG_InitializeModule(void *clientdata) {
4937  size_t i;
4938  swig_module_info *module_head, *iter;
4939  int init;
4940 
4941  /* check to see if the circular list has been setup, if not, set it up */
4942  if (swig_module.next==0) {
4943  /* Initialize the swig_module */
4947  init = 1;
4948  } else {
4949  init = 0;
4950  }
4951 
4952  /* Try and load any already created modules */
4953  module_head = SWIG_GetModule(clientdata);
4954  if (!module_head) {
4955  /* This is the first module loaded for this interpreter */
4956  /* so set the swig module into the interpreter */
4957  SWIG_SetModule(clientdata, &swig_module);
4958  } else {
4959  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4960  iter=module_head;
4961  do {
4962  if (iter==&swig_module) {
4963  /* Our module is already in the list, so there's nothing more to do. */
4964  return;
4965  }
4966  iter=iter->next;
4967  } while (iter!= module_head);
4968 
4969  /* otherwise we must add our module into the list */
4970  swig_module.next = module_head->next;
4971  module_head->next = &swig_module;
4972  }
4973 
4974  /* When multiple interpreters are used, a module could have already been initialized in
4975  a different interpreter, but not yet have a pointer in this interpreter.
4976  In this case, we do not want to continue adding types... everything should be
4977  set up already */
4978  if (init == 0) return;
4979 
4980  /* Now work on filling in swig_module.types */
4981 #ifdef SWIGRUNTIME_DEBUG
4982  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
4983 #endif
4984  for (i = 0; i < swig_module.size; ++i) {
4985  swig_type_info *type = 0;
4986  swig_type_info *ret;
4987  swig_cast_info *cast;
4988 
4989 #ifdef SWIGRUNTIME_DEBUG
4990  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
4991 #endif
4992 
4993  /* if there is another module already loaded */
4994  if (swig_module.next != &swig_module) {
4996  }
4997  if (type) {
4998  /* Overwrite clientdata field */
4999 #ifdef SWIGRUNTIME_DEBUG
5000  printf("SWIG_InitializeModule: found type %s\n", type->name);
5001 #endif
5004 #ifdef SWIGRUNTIME_DEBUG
5005  printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
5006 #endif
5007  }
5008  } else {
5009  type = swig_module.type_initial[i];
5010  }
5011 
5012  /* Insert casting types */
5013  cast = swig_module.cast_initial[i];
5014  while (cast->type) {
5015  /* Don't need to add information already in the list */
5016  ret = 0;
5017 #ifdef SWIGRUNTIME_DEBUG
5018  printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
5019 #endif
5020  if (swig_module.next != &swig_module) {
5022 #ifdef SWIGRUNTIME_DEBUG
5023  if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
5024 #endif
5025  }
5026  if (ret) {
5027  if (type == swig_module.type_initial[i]) {
5028 #ifdef SWIGRUNTIME_DEBUG
5029  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
5030 #endif
5031  cast->type = ret;
5032  ret = 0;
5033  } else {
5034  /* Check for casting already in the list */
5035  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
5036 #ifdef SWIGRUNTIME_DEBUG
5037  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
5038 #endif
5039  if (!ocast) ret = 0;
5040  }
5041  }
5042 
5043  if (!ret) {
5044 #ifdef SWIGRUNTIME_DEBUG
5045  printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
5046 #endif
5047  if (type->cast) {
5048  type->cast->prev = cast;
5049  cast->next = type->cast;
5050  }
5051  type->cast = cast;
5052  }
5053  cast++;
5054  }
5055  /* Set entry in modules->types array equal to the type */
5056  swig_module.types[i] = type;
5057  }
5058  swig_module.types[i] = 0;
5059 
5060 #ifdef SWIGRUNTIME_DEBUG
5061  printf("**** SWIG_InitializeModule: Cast List ******\n");
5062  for (i = 0; i < swig_module.size; ++i) {
5063  int j = 0;
5065  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5066  while (cast->type) {
5067  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
5068  cast++;
5069  ++j;
5070  }
5071  printf("---- Total casts: %d\n",j);
5072  }
5073  printf("**** SWIG_InitializeModule: Cast List ******\n");
5074 #endif
5075 }
5076 
5077 /* This function will propagate the clientdata field of type to
5078 * any new swig_type_info structures that have been added into the list
5079 * of equivalent types. It is like calling
5080 * SWIG_TypeClientData(type, clientdata) a second time.
5081 */
5082 SWIGRUNTIME void
5084  size_t i;
5085  swig_cast_info *equiv;
5086  static int init_run = 0;
5087 
5088  if (init_run) return;
5089  init_run = 1;
5090 
5091  for (i = 0; i < swig_module.size; i++) {
5092  if (swig_module.types[i]->clientdata) {
5093  equiv = swig_module.types[i]->cast;
5094  while (equiv) {
5095  if (!equiv->converter) {
5096  if (equiv->type && !equiv->type->clientdata)
5098  }
5099  equiv = equiv->next;
5100  }
5101  }
5102  }
5103 }
5104 
5105 #ifdef __cplusplus
5106 #if 0
5107 {
5108  /* c-mode */
5109 #endif
5110 }
5111 #endif
5112 
5113 
5114 
5115 #ifdef __cplusplus
5116 extern "C" {
5117 #endif
5118 
5119  /* Python-specific SWIG API */
5120 #define SWIG_newvarlink() SWIG_Python_newvarlink()
5121 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
5122 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
5123 
5124  /* -----------------------------------------------------------------------------
5125  * global variable support code.
5126  * ----------------------------------------------------------------------------- */
5127 
5128  typedef struct swig_globalvar {
5129  char *name; /* Name of global variable */
5130  PyObject *(*get_attr)(void); /* Return the current value */
5131  int (*set_attr)(PyObject *); /* Set the value */
5132  struct swig_globalvar *next;
5134 
5135  typedef struct swig_varlinkobject {
5136  PyObject_HEAD
5139 
5140  SWIGINTERN PyObject *
5142 #if PY_VERSION_HEX >= 0x03000000
5143  return PyUnicode_InternFromString("<Swig global variables>");
5144 #else
5145  return PyString_FromString("<Swig global variables>");
5146 #endif
5147  }
5148 
5149  SWIGINTERN PyObject *
5151 #if PY_VERSION_HEX >= 0x03000000
5152  PyObject *str = PyUnicode_InternFromString("(");
5153  PyObject *tail;
5154  PyObject *joined;
5156  for (var = v->vars; var; var=var->next) {
5157  tail = PyUnicode_FromString(var->name);
5158  joined = PyUnicode_Concat(str, tail);
5159  Py_DecRef(str);
5160  Py_DecRef(tail);
5161  str = joined;
5162  if (var->next) {
5163  tail = PyUnicode_InternFromString(", ");
5164  joined = PyUnicode_Concat(str, tail);
5165  Py_DecRef(str);
5166  Py_DecRef(tail);
5167  str = joined;
5168  }
5169  }
5170  tail = PyUnicode_InternFromString(")");
5171  joined = PyUnicode_Concat(str, tail);
5172  Py_DecRef(str);
5173  Py_DecRef(tail);
5174  str = joined;
5175 #else
5176  PyObject *str = PyString_FromString("(");
5178  for (var = v->vars; var; var=var->next) {
5179  PyString_ConcatAndDel(&str,PyString_FromString(var->name));
5180  if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
5181  }
5182  PyString_ConcatAndDel(&str,PyString_FromString(")"));
5183 #endif
5184  return str;
5185  }
5186 
5187  SWIGINTERN void
5189  swig_globalvar *var = v->vars;
5190  while (var) {
5191  swig_globalvar *n = var->next;
5192  free(var->name);
5193  free(var);
5194  var = n;
5195  }
5196  }
5197 
5198  SWIGINTERN PyObject *
5200  PyObject *res = NULL;
5201  swig_globalvar *var = v->vars;
5202  while (var) {
5203  if (strcmp(var->name,n) == 0) {
5204  res = (*var->get_attr)();
5205  break;
5206  }
5207  var = var->next;
5208  }
5209  if (res == NULL && !PyErr_Occurred()) {
5210  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5211  }
5212  return res;
5213  }
5214 
5215  SWIGINTERN int
5216  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
5217  int res = 1;
5218  swig_globalvar *var = v->vars;
5219  while (var) {
5220  if (strcmp(var->name,n) == 0) {
5221  res = (*var->set_attr)(p);
5222  break;
5223  }
5224  var = var->next;
5225  }
5226  if (res == 1 && !PyErr_Occurred()) {
5227  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5228  }
5229  return res;
5230  }
5231 
5232  SWIGINTERN PyTypeObject*
5234  static char varlink__doc__[] = "Swig var link object";
5235  static PyTypeObject varlink_type;
5236  static int type_init = 0;
5237  if (!type_init) {
5238  const PyTypeObject tmp = {
5239 #if PY_VERSION_HEX >= 0x03000000
5240  PyVarObject_HEAD_INIT(NULL, 0)
5241 #else
5242  PyObject_HEAD_INIT(NULL)
5243  0, /* ob_size */
5244 #endif
5245  "swigvarlink", /* tp_name */
5246  sizeof(swig_varlinkobject), /* tp_basicsize */
5247  0, /* tp_itemsize */
5248  (destructor) swig_varlink_dealloc, /* tp_dealloc */
5249  0, /* tp_print */
5250  (getattrfunc) swig_varlink_getattr, /* tp_getattr */
5251  (setattrfunc) swig_varlink_setattr, /* tp_setattr */
5252  0, /* tp_compare */
5253  (reprfunc) swig_varlink_repr, /* tp_repr */
5254  0, /* tp_as_number */
5255  0, /* tp_as_sequence */
5256  0, /* tp_as_mapping */
5257  0, /* tp_hash */
5258  0, /* tp_call */
5259  (reprfunc) swig_varlink_str, /* tp_str */
5260  0, /* tp_getattro */
5261  0, /* tp_setattro */
5262  0, /* tp_as_buffer */
5263  0, /* tp_flags */
5264  varlink__doc__, /* tp_doc */
5265  0, /* tp_traverse */
5266  0, /* tp_clear */
5267  0, /* tp_richcompare */
5268  0, /* tp_weaklistoffset */
5269  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
5270  0, /* tp_del */
5271  0, /* tp_version_tag */
5272 #if PY_VERSION_HEX >= 0x03040000
5273  0, /* tp_finalize */
5274 #endif
5275 #if PY_VERSION_HEX >= 0x03080000
5276  0, /* tp_vectorcall */
5277 #endif
5278 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
5279  0, /* tp_print */
5280 #endif
5281 #ifdef COUNT_ALLOCS
5282  0, /* tp_allocs */
5283  0, /* tp_frees */
5284  0, /* tp_maxalloc */
5285  0, /* tp_prev */
5286  0 /* tp_next */
5287 #endif
5288  };
5289  varlink_type = tmp;
5290  type_init = 1;
5291  if (PyType_Ready(&varlink_type) < 0)
5292  return NULL;
5293  }
5294  return &varlink_type;
5295  }
5296 
5297  /* Create a variable linking object for use later */
5298  SWIGINTERN PyObject *
5300  swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
5301  if (result) {
5302  result->vars = 0;
5303  }
5304  return ((PyObject*) result);
5305  }
5306 
5307  SWIGINTERN void
5308  SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
5311  if (gv) {
5312  size_t size = strlen(name)+1;
5313  gv->name = (char *)malloc(size);
5314  if (gv->name) {
5315  memcpy(gv->name, name, size);
5316  gv->get_attr = get_attr;
5317  gv->set_attr = set_attr;
5318  gv->next = v->vars;
5319  }
5320  }
5321  v->vars = gv;
5322  }
5323 
5324  SWIGINTERN PyObject *
5326  static PyObject *globals = 0;
5327  if (!globals) {
5328  globals = SWIG_newvarlink();
5329  }
5330  return globals;
5331  }
5332 
5333  /* -----------------------------------------------------------------------------
5334  * constants/methods manipulation
5335  * ----------------------------------------------------------------------------- */
5336 
5337  /* Install Constants */
5338  SWIGINTERN void
5339  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
5340  PyObject *obj = 0;
5341  size_t i;
5342  for (i = 0; constants[i].type; ++i) {
5343  switch(constants[i].type) {
5344  case SWIG_PY_POINTER:
5345  obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
5346  break;
5347  case SWIG_PY_BINARY:
5348  obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
5349  break;
5350  default:
5351  obj = 0;
5352  break;
5353  }
5354  if (obj) {
5355  PyDict_SetItemString(d, constants[i].name, obj);
5356  Py_DECREF(obj);
5357  }
5358  }
5359  }
5360 
5361  /* -----------------------------------------------------------------------------*/
5362  /* Fix SwigMethods to carry the callback ptrs when needed */
5363  /* -----------------------------------------------------------------------------*/
5364 
5365  SWIGINTERN void
5366  SWIG_Python_FixMethods(PyMethodDef *methods,
5367  swig_const_info *const_table,
5368  swig_type_info **types,
5369  swig_type_info **types_initial) {
5370  size_t i;
5371  for (i = 0; methods[i].ml_name; ++i) {
5372  const char *c = methods[i].ml_doc;
5373  if (!c) continue;
5374  c = strstr(c, "swig_ptr: ");
5375  if (c) {
5376  int j;
5377  swig_const_info *ci = 0;
5378  const char *name = c + 10;
5379  for (j = 0; const_table[j].type; ++j) {
5380  if (strncmp(const_table[j].name, name,
5381  strlen(const_table[j].name)) == 0) {
5382  ci = &(const_table[j]);
5383  break;
5384  }
5385  }
5386  if (ci) {
5387  void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
5388  if (ptr) {
5389  size_t shift = (ci->ptype) - types;
5390  swig_type_info *ty = types_initial[shift];
5391  size_t ldoc = (c - methods[i].ml_doc);
5392  size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
5393  char *ndoc = (char*)malloc(ldoc + lptr + 10);
5394  if (ndoc) {
5395  char *buff = ndoc;
5396  memcpy(buff, methods[i].ml_doc, ldoc);
5397  buff += ldoc;
5398  memcpy(buff, "swig_ptr: ", 10);
5399  buff += 10;
5400  SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
5401  methods[i].ml_doc = ndoc;
5402  }
5403  }
5404  }
5405  }
5406  }
5407  }
5408 
5409  /* -----------------------------------------------------------------------------
5410  * Method creation and docstring support functions
5411  * ----------------------------------------------------------------------------- */
5412 
5413  /* -----------------------------------------------------------------------------
5414  * Function to find the method definition with the correct docstring for the
5415  * proxy module as opposed to the low-level API
5416  * ----------------------------------------------------------------------------- */
5417 
5418  SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
5419  /* Find the function in the modified method table */
5420  size_t offset = 0;
5421  int found = 0;
5422  while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
5423  if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
5424  found = 1;
5425  break;
5426  }
5427  offset++;
5428  }
5429  /* Use the copy with the modified docstring if available */
5430  return found ? &SwigMethods_proxydocs[offset] : NULL;
5431  }
5432 
5433  /* -----------------------------------------------------------------------------
5434  * Wrapper of PyInstanceMethod_New() used in Python 3
5435  * It is exported to the generated module, used for -fastproxy
5436  * ----------------------------------------------------------------------------- */
5437 
5438  SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5439  if (PyCFunction_Check(func)) {
5440  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5441  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5442  if (ml)
5443  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5444  }
5445 #if PY_VERSION_HEX >= 0x03000000
5446  return PyInstanceMethod_New(func);
5447 #else
5448  return PyMethod_New(func, NULL, NULL);
5449 #endif
5450  }
5451 
5452  /* -----------------------------------------------------------------------------
5453  * Wrapper of PyStaticMethod_New()
5454  * It is exported to the generated module, used for -fastproxy
5455  * ----------------------------------------------------------------------------- */
5456 
5457  SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5458  if (PyCFunction_Check(func)) {
5459  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5460  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5461  if (ml)
5462  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5463  }
5464  return PyStaticMethod_New(func);
5465  }
5466 
5467 #ifdef __cplusplus
5468 }
5469 #endif
5470 
5471 /* -----------------------------------------------------------------------------*
5472  * Partial Init method
5473  * -----------------------------------------------------------------------------*/
5474 
5475 #ifdef __cplusplus
5476 extern "C"
5477 #endif
5478 
5479 SWIGEXPORT
5480 #if PY_VERSION_HEX >= 0x03000000
5481 PyObject*
5482 #else
5483 void
5484 #endif
5485 SWIG_init(void) {
5486  PyObject *m, *d, *md, *globals;
5487 
5488 #if PY_VERSION_HEX >= 0x03000000
5489  static struct PyModuleDef SWIG_module = {
5490  PyModuleDef_HEAD_INIT,
5491  SWIG_name,
5492  NULL,
5493  -1,
5494  SwigMethods,
5495  NULL,
5496  NULL,
5497  NULL,
5498  NULL
5499  };
5500 #endif
5501 
5502 #if defined(SWIGPYTHON_BUILTIN)
5503  static SwigPyClientData SwigPyObject_clientdata = {
5504  0, 0, 0, 0, 0, 0, 0
5505  };
5506  static PyGetSetDef this_getset_def = {
5507  (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
5508  };
5509  static SwigPyGetSet thisown_getset_closure = {
5512  };
5513  static PyGetSetDef thisown_getset_def = {
5514  (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
5515  };
5516  PyTypeObject *builtin_pytype;
5517  int builtin_base_count;
5518  swig_type_info *builtin_basetype;
5519  PyObject *tuple;
5520  PyGetSetDescrObject *static_getset;
5521  PyTypeObject *metatype;
5522  PyTypeObject *swigpyobject;
5523  SwigPyClientData *cd;
5524  PyObject *public_interface, *public_symbol;
5525  PyObject *this_descr;
5526  PyObject *thisown_descr;
5527  PyObject *self = 0;
5528  int i;
5529 
5530  (void)builtin_pytype;
5531  (void)builtin_base_count;
5532  (void)builtin_basetype;
5533  (void)tuple;
5534  (void)static_getset;
5535  (void)self;
5536 
5537  /* Metaclass is used to implement static member variables */
5538  metatype = SwigPyObjectType();
5539  assert(metatype);
5540 #endif
5541 
5542  (void)globals;
5543 
5544  /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
5545  SWIG_This();
5548 #ifndef SWIGPYTHON_BUILTIN
5550 #endif
5551 
5552  /* Fix SwigMethods to carry the callback ptrs when needed */
5554 
5555 #if PY_VERSION_HEX >= 0x03000000
5556  m = PyModule_Create(&SWIG_module);
5557 #else
5558  m = Py_InitModule(SWIG_name, SwigMethods);
5559 #endif
5560 
5561  md = d = PyModule_GetDict(m);
5562  (void)md;
5563 
5565 
5566 #ifdef SWIGPYTHON_BUILTIN
5567  swigpyobject = SwigPyObject_TypeOnce();
5568 
5569  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
5570  assert(SwigPyObject_stype);
5571  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
5572  if (!cd) {
5573  SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
5574  SwigPyObject_clientdata.pytype = swigpyobject;
5575  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
5576  PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
5577 # if PY_VERSION_HEX >= 0x03000000
5578  return NULL;
5579 # else
5580  return;
5581 # endif
5582  }
5583 
5584  /* All objects have a 'this' attribute */
5585  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
5586  (void)this_descr;
5587 
5588  /* All objects have a 'thisown' attribute */
5589  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
5590  (void)thisown_descr;
5591 
5592  public_interface = PyList_New(0);
5593  public_symbol = 0;
5594  (void)public_symbol;
5595 
5596  PyDict_SetItemString(md, "__all__", public_interface);
5597  Py_DECREF(public_interface);
5598  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
5599  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
5600  for (i = 0; swig_const_table[i].name != 0; ++i)
5601  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
5602 #endif
5603 
5605 
5606 
5607  /* Initialize threading */
5609 #if PY_VERSION_HEX >= 0x03000000
5610  return m;
5611 #else
5612  return;
5613 #endif
5614 }
5615 
int64 min
Definition: alldiff_cst.cc:138
int64 max
Definition: alldiff_cst.cc:139
SharedPyPtr(const SharedPyPtr &other)
PyObject * get() const
SharedPyPtr(PyObject *obj)
static void raise(JNIEnv *jenv, jthrowable throwable)
const char * getMessage() const
DirectorException(PyObject *error, const char *hdr="", const char *msg="")
PyObject * swig_get_self() const
int swig_release_ownership(void *vptr) const
jobject swig_get_self(JNIEnv *jenv) const
virtual void swig_set_inner(const char *, bool) const
void swig_disown() const
static PyObject * swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
void swig_acquire_ownership_array(Type *vptr) const
void swig_acquire_ownership_obj(void *vptr, int own) const
Director(PyObject *self)
virtual bool swig_get_inner(const char *) const
void swig_acquire_ownership(Type *vptr) const
DirectorMethodException(const char *msg="")
DirectorPureVirtualException(const char *msg="")
DirectorTypeMismatchException(PyObject *error, const char *msg="")
DirectorTypeMismatchException(const char *msg="")
Guard(PyThread_type_lock &mutex)
virtual void OnSolutionCallback() const
We call domain any subset of Int64 = [kint64min, kint64max].
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
SwigPtr_PyObject(const SwigPtr_PyObject &item)
PyObject * operator->() const
Block * next
const std::string name
int64 value
IntVar * var
Definition: expr_array.cc:1858
int64_t int64
CpSolverResponse SolveWithParameters(const CpModelProto &model_proto, const SatParameters &params)
Solves the given CpModelProto with the given parameters.
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
void * malloc(YYSIZE_T)
void free(void *)
if(!yyg->yy_init)
Definition: parser.yy.cc:965
int64 tail
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
#define SWIG_MangledTypeQuery(name)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGINTERN PyObject * _wrap_SatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyObject * Swig_This_global
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
static swig_type_info _swigt__p_operations_research__Domain
#define SWIG_TypeQuery(name)
SWIGINTERN PyObject * _wrap_SatHelper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_OWN
#define SWIG_SyntaxError
#define SWIG_POINTER_NEW
#define SWIG_CheckState(r)
static swig_cast_info _swigc__p_int[]
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
#define SWIG_BUFFER_SIZE
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
#define SWIG_TypeError
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
#define SWIG_POINTER_IMPLICIT_CONV
SWIGINTERN PyObject * _wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static ReturnT HandleResult(PyObject *pyresult)
#define SWIG_PY_POINTER
struct swig_cast_info swig_cast_info
SWIGINTERN PyObject * _wrap_delete_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_init
#define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
#define SWIG_PYTHON_THREAD_END_BLOCK
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
#define SWIG_RuntimeError
struct swig_varlinkobject swig_varlinkobject
#define SWIG_NewClientData(obj)
static swig_type_info _swigt__p_operations_research__sat__SolutionCallback
SWIGINTERN PyObject * _wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define PyObject_DEL
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
static swig_type_info _swigt__p_unsigned_char
static swig_cast_info _swigc__p_operations_research__sat__IntegerVariableProto[]
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
#define SWIGRUNTIME
static swig_type_info * swig_types[14]
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * _wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_PY_BINARY
#define SWIG_SetErrorMsg
#define SWIG_RUNTIME_VERSION
#define SWIG_POINTER_NOSHADOW
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_OLDOBJ
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
static swig_type_info _swigt__p_short
#define SWIG_ValueError
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
static PyMethodDef swigobject_methods[]
#define SWIG_AddCast(r)
#define SWIG_IsNewObj(r)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
#define SWIG_exception_fail(code, msg)
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
#define SWIG_DIRECTOR_CAST(ARG)
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
#define SWIG_AttributeError
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_module_info swig_module
static swig_cast_info _swigc__p_unsigned_char[]
static swig_cast_info _swigc__p_short[]
#define SWIG_From_long
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
#define SWIG_SetModule(clientdata, pointer)
SWIGINTERN PyObject * _wrap_SatHelper_SolveWithParametersAndSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGINTERN PyObject * _wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
SWIGINTERN PyObject * _wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGUNUSEDPARM(p)
SWIGRUNTIME PyObject * SWIG_This(void)
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
#define SWIG_as_voidptr(a)
static swig_const_info swig_const_table[]
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
static swig_type_info _swigt__p_unsigned_short
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
SWIGINTERN PyObject * _wrap_SatHelper_SolveWithParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
struct swig_const_info swig_const_info
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
void HandleResult< void >(PyObject *pyresult)
SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name)
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
#define SWIGTYPE_p_operations_research__sat__SatHelper
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
SWIGINTERN PyObject * _wrap_new_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
SWIGINTERN PyObject * _wrap_SatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_newvarlink()
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
static swig_type_info _swigt__p_unsigned_long
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_char[]
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
SWIGINTERN PyObject * SatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGINTERN
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGINTERN PyObject * SatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
#define SWIG_From_double
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
static swig_cast_info _swigc__p_unsigned_short[]
struct swig_globalvar swig_globalvar
#define SWIGPY_CAPSULE_NAME
#define SWIG_ArgError(r)
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_NewPointerObj(ptr, type, flags)
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
#define SWIG_GUARD(mutex)
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
void *(* swig_converter_func)(void *, int *)
#define SWIG_POINTER_NO_NULL
#define SWIG_Python_str_FromFormat
#define SWIG_InstallConstants(d, constants)
SWIGINTERN PyObject * _wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_IOError
static PyMethodDef SwigMethods[]
#define SWIGTYPE_p_operations_research__sat__SolutionCallback
#define SWIG_NullReferenceError
#define SWIG_POINTER_DISOWN
#define SWIG_STATIC_POINTER(var)
struct swig_type_info swig_type_info
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGINTERN PyObject * _wrap_SatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_NEWOBJ
static swig_type_info _swigt__p_signed_char
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGINTERN PyObject * SWIG_globals(void)
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGINTERN PyObject * _wrap_SatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
#define SWIG_NewPackedObj(ptr, sz, type)
static swig_cast_info _swigc__p_operations_research__sat__SatHelper[]
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
#define SWIG_GetModule(clientdata)
static swig_type_info _swigt__p_operations_research__sat__SatHelper
static swig_cast_info _swigc__p_unsigned_int[]
#define SWIG_fail
static swig_type_info _swigt__p_int
SWIGINTERN PyObject * _wrap_SolutionCallback_NumIntegerPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_PropagateClientData(void)
static swig_cast_info _swigc__p_unsigned_long[]
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGINTERN PyObject * _wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
#define SWIGTYPE_p_operations_research__Domain
static swig_type_info _swigt__p_long
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
static PyMethodDef SwigMethods_proxydocs[]
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
#define SWIG_TYPE_TABLE_NAME
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
#define SWIG_BUILTIN_TP_INIT
static swig_type_info _swigt__p_unsigned_int
#define SWIG_CAST_NEW_MEMORY
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
SWIGINTERN PyObject * _wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_PYTHON_THREAD_END_ALLOW
struct swig_module_info swig_module_info
SWIGINTERN PyObject * _wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_ERROR
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
#define SWIG_name
static swig_cast_info _swigc__p_operations_research__sat__SolutionCallback[]
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_long[]
static swig_type_info * swig_type_initial[]
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
static ReturnT InvokePythonCallableReturning(PyObject *pyfunc, const char *format, Args... args)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
SWIGINTERN PyObject * SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_MemoryError
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto
#define SWIG_SystemError
#define SWIG_DivisionByZero
static swig_type_info _swigt__p_char
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
static swig_cast_info _swigc__p_operations_research__Domain[]
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
#define SWIG_OverflowError
#define SWIGEXPORT
#define SWIG_IsOK(r)
SWIGINTERN PyObject * _wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
struct swig_type_info *(* swig_dycast_func)(void **)
#define SWIGTYPE_p_operations_research__sat__IntegerVariableProto
#define SWIG_IndexError
#define SWIG_PYTHON_INITIALIZE_THREADS
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
#define SWIG_AddNewMask(r)
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
#define SWIG_OK
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
#define SWIGINTERNINLINE
static swig_cast_info _swigc__p_signed_char[]
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
#define Py_TYPE(op)
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
#define SWIGRUNTIMEINLINE
GCItem_var(GCItem *item=0)
GCItem_var & operator=(GCItem *item)
GCItem * operator->() const
virtual int get_own() const
PyObject_HEAD void * ptr
PyObject_HEAD void * pack
SwigVar_PyObject(PyObject *obj=0)
SwigVar_PyObject & operator=(PyObject *obj)
struct swig_cast_info * prev
struct swig_cast_info * next
swig_converter_func converter
struct swig_globalvar * next
PyObject *(* get_attr)(void)
struct swig_module_info * next
struct swig_cast_info * cast
PyObject_HEAD swig_globalvar * vars
std::string message
Definition: trace.cc:395