OR-Tools  8.0
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
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)
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)
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
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)
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)
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)
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)
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)
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
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)
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);
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)
1286 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1288 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1289 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
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)
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)
2673 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
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)
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_
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)
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)
3119 /* -------- TYPES TABLE (END) -------- */
3120 
3121 #ifdef SWIG_TypeQuery
3122 # undef SWIG_TypeQuery
3123 #endif
3124 #define SWIG_TypeQuery SWIG_Python_TypeQuery
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
3135 #endif
3136 #define SWIG_name "_pywrapsat"
3138 #define SWIGVERSION 0x040002
3139 #define SWIG_VERSION SWIGVERSION
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))
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
3322 
3323  #define SWIG_From_double PyFloat_FromDouble
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 
3530 /* ---------------------------------------------------
3531  * C++ director class methods
3532  * --------------------------------------------------- */
3533 
3534 #include "sat_python_wrap.h"
3535 
3536 SwigDirector_SolutionCallback::SwigDirector_SolutionCallback(PyObject *self): operations_research::sat::SolutionCallback(), Swig::Director(self) {
3537  SWIG_DIRECTOR_RGTR((operations_research::sat::SolutionCallback *)this, this);
3538 }
3539 
3540 
3541 
3542 
3544 }
3545 
3548  {
3549  if (!swig_get_self()) {
3550  Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call SolutionCallback.__init__.");
3551  }
3552 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
3553  const size_t swig_method_index = 0;
3554  const char *const swig_method_name = "OnSolutionCallback";
3555  PyObject *method = swig_get_method(swig_method_index, swig_method_name);
3556  swig::SwigVar_PyObject args = PyTuple_New(0);
3557  swig::SwigVar_PyObject result = PyObject_Call(method, (PyObject *) args, NULL);
3558 #else
3559  swig::SwigVar_PyObject swig_method_name = SWIG_Python_str_FromChar("OnSolutionCallback");
3560  swig::SwigVar_PyObject result = PyObject_CallMethodObjArgs(swig_get_self(), (PyObject *) swig_method_name, NULL);
3561 #endif
3562  if (!result) {
3563  PyObject *error = PyErr_Occurred();
3564  if (error) {
3565  Swig::DirectorMethodException::raise("Error detected when calling 'SolutionCallback.OnSolutionCallback'");
3566  }
3567  }
3568  }
3570 }
3571 
3572 
3573 #ifdef __cplusplus
3574 extern "C" {
3575 #endif
3576 SWIGINTERN PyObject *_wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3577  PyObject *resultobj = 0;
3578  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3579  void *argp1 = 0 ;
3580  int res1 = 0 ;
3581  PyObject *swig_obj[1] ;
3582 
3583  if (!args) SWIG_fail;
3584  swig_obj[0] = args;
3586  if (!SWIG_IsOK(res1)) {
3587  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3588  }
3589  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3590  {
3592  delete arg1;
3594  }
3595  resultobj = SWIG_Py_Void();
3596  return resultobj;
3597 fail:
3598  return NULL;
3599 }
3600 
3601 
3602 SWIGINTERN PyObject *_wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3603  PyObject *resultobj = 0;
3604  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3605  void *argp1 = 0 ;
3606  int res1 = 0 ;
3607  PyObject *swig_obj[1] ;
3608  Swig::Director *director = 0;
3609  bool upcall = false;
3610 
3611  if (!args) SWIG_fail;
3612  swig_obj[0] = args;
3613  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3614  if (!SWIG_IsOK(res1)) {
3615  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_OnSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3616  }
3617  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3618  director = SWIG_DIRECTOR_CAST(arg1);
3619  upcall = (director && (director->swig_get_self()==swig_obj[0]));
3620  try {
3621  if (upcall) {
3622  Swig::DirectorPureVirtualException::raise("operations_research::sat::SolutionCallback::OnSolutionCallback");
3623  } else {
3624  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
3625  }
3626  } catch (Swig::DirectorException&) {
3627  SWIG_fail;
3628  }
3629  resultobj = SWIG_Py_Void();
3630  return resultobj;
3631 fail:
3632  return NULL;
3633 }
3634 
3635 
3636 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3637  PyObject *resultobj = 0;
3638  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3639  void *argp1 = 0 ;
3640  int res1 = 0 ;
3641  PyObject *swig_obj[1] ;
3642  int64 result;
3643 
3644  if (!args) SWIG_fail;
3645  swig_obj[0] = args;
3646  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3647  if (!SWIG_IsOK(res1)) {
3648  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBooleans" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3649  }
3650  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3651  {
3653  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
3655  }
3656  resultobj = SWIG_From_long(static_cast< long >(result));
3657  return resultobj;
3658 fail:
3659  return NULL;
3660 }
3661 
3662 
3663 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3664  PyObject *resultobj = 0;
3665  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3666  void *argp1 = 0 ;
3667  int res1 = 0 ;
3668  PyObject *swig_obj[1] ;
3669  int64 result;
3670 
3671  if (!args) SWIG_fail;
3672  swig_obj[0] = args;
3673  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3674  if (!SWIG_IsOK(res1)) {
3675  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBranches" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3676  }
3677  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3678  {
3680  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
3682  }
3683  resultobj = SWIG_From_long(static_cast< long >(result));
3684  return resultobj;
3685 fail:
3686  return NULL;
3687 }
3688 
3689 
3690 SWIGINTERN PyObject *_wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3691  PyObject *resultobj = 0;
3692  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3693  void *argp1 = 0 ;
3694  int res1 = 0 ;
3695  PyObject *swig_obj[1] ;
3696  int64 result;
3697 
3698  if (!args) SWIG_fail;
3699  swig_obj[0] = args;
3700  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3701  if (!SWIG_IsOK(res1)) {
3702  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumConflicts" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3703  }
3704  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3705  {
3707  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
3709  }
3710  resultobj = SWIG_From_long(static_cast< long >(result));
3711  return resultobj;
3712 fail:
3713  return NULL;
3714 }
3715 
3716 
3717 SWIGINTERN PyObject *_wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3718  PyObject *resultobj = 0;
3719  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3720  void *argp1 = 0 ;
3721  int res1 = 0 ;
3722  PyObject *swig_obj[1] ;
3723  int64 result;
3724 
3725  if (!args) SWIG_fail;
3726  swig_obj[0] = args;
3727  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3728  if (!SWIG_IsOK(res1)) {
3729  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumBinaryPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3730  }
3731  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3732  {
3734  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
3736  }
3737  resultobj = SWIG_From_long(static_cast< long >(result));
3738  return resultobj;
3739 fail:
3740  return NULL;
3741 }
3742 
3743 
3745  PyObject *resultobj = 0;
3746  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3747  void *argp1 = 0 ;
3748  int res1 = 0 ;
3749  PyObject *swig_obj[1] ;
3750  int64 result;
3751 
3752  if (!args) SWIG_fail;
3753  swig_obj[0] = args;
3754  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3755  if (!SWIG_IsOK(res1)) {
3756  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_NumIntegerPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3757  }
3758  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3759  {
3761  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
3763  }
3764  resultobj = SWIG_From_long(static_cast< long >(result));
3765  return resultobj;
3766 fail:
3767  return NULL;
3768 }
3769 
3770 
3771 SWIGINTERN PyObject *_wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3772  PyObject *resultobj = 0;
3773  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3774  void *argp1 = 0 ;
3775  int res1 = 0 ;
3776  PyObject *swig_obj[1] ;
3777  double result;
3778 
3779  if (!args) SWIG_fail;
3780  swig_obj[0] = args;
3781  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3782  if (!SWIG_IsOK(res1)) {
3783  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_WallTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3784  }
3785  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3786  {
3788  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
3790  }
3791  resultobj = SWIG_From_double(static_cast< double >(result));
3792  return resultobj;
3793 fail:
3794  return NULL;
3795 }
3796 
3797 
3798 SWIGINTERN PyObject *_wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3799  PyObject *resultobj = 0;
3800  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3801  void *argp1 = 0 ;
3802  int res1 = 0 ;
3803  PyObject *swig_obj[1] ;
3804  double result;
3805 
3806  if (!args) SWIG_fail;
3807  swig_obj[0] = args;
3808  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3809  if (!SWIG_IsOK(res1)) {
3810  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_UserTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3811  }
3812  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3813  {
3815  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
3817  }
3818  resultobj = SWIG_From_double(static_cast< double >(result));
3819  return resultobj;
3820 fail:
3821  return NULL;
3822 }
3823 
3824 
3825 SWIGINTERN PyObject *_wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3826  PyObject *resultobj = 0;
3827  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3828  void *argp1 = 0 ;
3829  int res1 = 0 ;
3830  PyObject *swig_obj[1] ;
3831  double result;
3832 
3833  if (!args) SWIG_fail;
3834  swig_obj[0] = args;
3835  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3836  if (!SWIG_IsOK(res1)) {
3837  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_ObjectiveValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3838  }
3839  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3840  {
3842  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
3844  }
3845  resultobj = SWIG_From_double(static_cast< double >(result));
3846  return resultobj;
3847 fail:
3848  return NULL;
3849 }
3850 
3851 
3852 SWIGINTERN PyObject *_wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3853  PyObject *resultobj = 0;
3854  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3855  void *argp1 = 0 ;
3856  int res1 = 0 ;
3857  PyObject *swig_obj[1] ;
3858  double result;
3859 
3860  if (!args) SWIG_fail;
3861  swig_obj[0] = args;
3862  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3863  if (!SWIG_IsOK(res1)) {
3864  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_BestObjectiveBound" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3865  }
3866  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3867  {
3869  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
3871  }
3872  resultobj = SWIG_From_double(static_cast< double >(result));
3873  return resultobj;
3874 fail:
3875  return NULL;
3876 }
3877 
3878 
3879 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3880  PyObject *resultobj = 0;
3881  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3882  int arg2 ;
3883  void *argp1 = 0 ;
3884  int res1 = 0 ;
3885  int val2 ;
3886  int ecode2 = 0 ;
3887  PyObject *swig_obj[2] ;
3888  int64 result;
3889 
3890  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionIntegerValue", 2, 2, swig_obj)) SWIG_fail;
3891  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3892  if (!SWIG_IsOK(res1)) {
3893  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3894  }
3895  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3896  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3897  if (!SWIG_IsOK(ecode2)) {
3898  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "2"" of type '" "int""'");
3899  }
3900  arg2 = static_cast< int >(val2);
3901  {
3903  result = (int64)(arg1)->SolutionIntegerValue(arg2);
3905  }
3906  resultobj = SWIG_From_long(static_cast< long >(result));
3907  return resultobj;
3908 fail:
3909  return NULL;
3910 }
3911 
3912 
3913 SWIGINTERN PyObject *_wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3914  PyObject *resultobj = 0;
3915  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3916  int arg2 ;
3917  void *argp1 = 0 ;
3918  int res1 = 0 ;
3919  int val2 ;
3920  int ecode2 = 0 ;
3921  PyObject *swig_obj[2] ;
3922  bool result;
3923 
3924  if (!SWIG_Python_UnpackTuple(args, "SolutionCallback_SolutionBooleanValue", 2, 2, swig_obj)) SWIG_fail;
3925  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3926  if (!SWIG_IsOK(res1)) {
3927  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3928  }
3929  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3930  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3931  if (!SWIG_IsOK(ecode2)) {
3932  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "2"" of type '" "int""'");
3933  }
3934  arg2 = static_cast< int >(val2);
3935  {
3937  result = (bool)(arg1)->SolutionBooleanValue(arg2);
3939  }
3940  resultobj = SWIG_From_bool(static_cast< bool >(result));
3941  return resultobj;
3942 fail:
3943  return NULL;
3944 }
3945 
3946 
3947 SWIGINTERN PyObject *_wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3948  PyObject *resultobj = 0;
3949  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3950  void *argp1 = 0 ;
3951  int res1 = 0 ;
3952  PyObject *swig_obj[1] ;
3953 
3954  if (!args) SWIG_fail;
3955  swig_obj[0] = args;
3956  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3957  if (!SWIG_IsOK(res1)) {
3958  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3959  }
3960  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3961  {
3963  (arg1)->StopSearch();
3965  }
3966  resultobj = SWIG_Py_Void();
3967  return resultobj;
3968 fail:
3969  return NULL;
3970 }
3971 
3972 
3973 SWIGINTERN PyObject *_wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3974  PyObject *resultobj = 0;
3975  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3976  void *argp1 = 0 ;
3977  int res1 = 0 ;
3978  PyObject *swig_obj[1] ;
3980 
3981  if (!args) SWIG_fail;
3982  swig_obj[0] = args;
3983  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
3984  if (!SWIG_IsOK(res1)) {
3985  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_Response" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3986  }
3987  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3988  {
3990  result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
3992  }
3993  {
3994  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
3995  if (module != nullptr) {
3996  PyObject* const dict = PyModule_GetDict(module);
3997  if (dict != nullptr) {
3998  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
3999  if (clss != nullptr) {
4000  std::string encoded_protobuf;
4001  (&result)->SerializeToString(&encoded_protobuf);
4002 
4003  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4004  encoded_protobuf.c_str(), encoded_protobuf.size());
4005 
4006 
4007 
4008 
4009  PyObject* const result = PyObject_CallMethod(
4010  clss, const_cast<char*>("FromString"),
4011  const_cast<char*>("(O)"),
4012  python_encoded_protobuf);
4013  Py_DECREF(python_encoded_protobuf);
4014  resultobj = result;
4015  }
4016  }
4017  Py_DECREF(module);
4018  }
4019  }
4020  return resultobj;
4021 fail:
4022  return NULL;
4023 }
4024 
4025 
4026 SWIGINTERN PyObject *_wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4027  PyObject *resultobj = 0;
4028  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4029  void *argp1 = 0 ;
4030  int res1 = 0 ;
4031  PyObject *swig_obj[1] ;
4032  bool result;
4033 
4034  if (!args) SWIG_fail;
4035  swig_obj[0] = args;
4036  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4037  if (!SWIG_IsOK(res1)) {
4038  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SolutionCallback_HasResponse" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4039  }
4040  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4041  {
4043  result = (bool)((operations_research::sat::SolutionCallback const *)arg1)->HasResponse();
4045  }
4046  resultobj = SWIG_From_bool(static_cast< bool >(result));
4047  return resultobj;
4048 fail:
4049  return NULL;
4050 }
4051 
4052 
4053 SWIGINTERN PyObject *_wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4054  PyObject *resultobj = 0;
4055  PyObject *arg1 = (PyObject *) 0 ;
4056  PyObject *swig_obj[1] ;
4057  operations_research::sat::SolutionCallback *result = 0 ;
4058 
4059  if (!args) SWIG_fail;
4060  swig_obj[0] = args;
4061  arg1 = swig_obj[0];
4062  {
4064  if ( arg1 != Py_None ) {
4065  /* subclassed */
4066  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback(arg1);
4067  } else {
4068  SWIG_SetErrorMsg(PyExc_RuntimeError,"accessing abstract class or protected constructor");
4069  SWIG_fail;
4070  }
4071 
4073  }
4075  return resultobj;
4076 fail:
4077  return NULL;
4078 }
4079 
4080 
4081 SWIGINTERN PyObject *_wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4082  PyObject *resultobj = 0;
4083  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4084  void *argp1 = 0 ;
4085  int res1 = 0 ;
4086  PyObject *swig_obj[1] ;
4087 
4088  if (!args) SWIG_fail;
4089  swig_obj[0] = args;
4090  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0 );
4091  if (!SWIG_IsOK(res1)) {
4092  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "disown_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4093  }
4094  arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4095  {
4097  {
4098  Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
4099  if (director) director->swig_disown();
4100  }
4101 
4103  }
4104  resultobj = SWIG_Py_Void();
4105  return resultobj;
4106 fail:
4107  return NULL;
4108 }
4109 
4110 
4111 SWIGINTERN PyObject *SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4112  PyObject *obj;
4113  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4115  return SWIG_Py_Void();
4116 }
4117 
4118 SWIGINTERN PyObject *SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4119  return SWIG_Python_InitShadowInstance(args);
4120 }
4121 
4122 SWIGINTERN PyObject *_wrap_SatHelper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4123  PyObject *resultobj = 0;
4125  PyObject *swig_obj[1] ;
4127 
4128  if (!args) SWIG_fail;
4129  swig_obj[0] = args;
4130  {
4132  PyObject* const pyresult = PyObject_CallMethod(
4133  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4134  if (pyresult != nullptr) {
4135  char* buffer = nullptr;
4136  Py_ssize_t length = 0;
4137  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4138  if (buffer != nullptr) {
4139  arg1->ParseFromArray(buffer, length);
4140  }
4141  Py_DECREF(pyresult);
4142  }
4143  }
4144  {
4148  }
4149  {
4150  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4151  if (module != nullptr) {
4152  PyObject* const dict = PyModule_GetDict(module);
4153  if (dict != nullptr) {
4154  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4155  if (clss != nullptr) {
4156  std::string encoded_protobuf;
4157  (&result)->SerializeToString(&encoded_protobuf);
4158 
4159  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4160  encoded_protobuf.c_str(), encoded_protobuf.size());
4161 
4162 
4163 
4164 
4165  PyObject* const result = PyObject_CallMethod(
4166  clss, const_cast<char*>("FromString"),
4167  const_cast<char*>("(O)"),
4168  python_encoded_protobuf);
4169  Py_DECREF(python_encoded_protobuf);
4170  resultobj = result;
4171  }
4172  }
4173  Py_DECREF(module);
4174  }
4175  }
4176  {
4177  delete arg1;
4178  }
4179  return resultobj;
4180 fail:
4181  {
4182  delete arg1;
4183  }
4184  return NULL;
4185 }
4186 
4187 
4188 SWIGINTERN PyObject *_wrap_SatHelper_SolveWithParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4189  PyObject *resultobj = 0;
4192  PyObject *swig_obj[2] ;
4194 
4195  if (!SWIG_Python_UnpackTuple(args, "SatHelper_SolveWithParameters", 2, 2, swig_obj)) SWIG_fail;
4196  {
4198  PyObject* const pyresult = PyObject_CallMethod(
4199  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4200  if (pyresult != nullptr) {
4201  char* buffer = nullptr;
4202  Py_ssize_t length = 0;
4203  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4204  if (buffer != nullptr) {
4205  arg1->ParseFromArray(buffer, length);
4206  }
4207  Py_DECREF(pyresult);
4208  }
4209  }
4210  {
4212  PyObject* const pyresult = PyObject_CallMethod(
4213  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4214  if (pyresult != nullptr) {
4215  char* buffer = nullptr;
4216  Py_ssize_t length = 0;
4217  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4218  if (buffer != nullptr) {
4219  arg2->ParseFromArray(buffer, length);
4220  }
4221  Py_DECREF(pyresult);
4222  }
4223  }
4224  {
4228  }
4229  {
4230  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4231  if (module != nullptr) {
4232  PyObject* const dict = PyModule_GetDict(module);
4233  if (dict != nullptr) {
4234  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4235  if (clss != nullptr) {
4236  std::string encoded_protobuf;
4237  (&result)->SerializeToString(&encoded_protobuf);
4238 
4239  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4240  encoded_protobuf.c_str(), encoded_protobuf.size());
4241 
4242 
4243 
4244 
4245  PyObject* const result = PyObject_CallMethod(
4246  clss, const_cast<char*>("FromString"),
4247  const_cast<char*>("(O)"),
4248  python_encoded_protobuf);
4249  Py_DECREF(python_encoded_protobuf);
4250  resultobj = result;
4251  }
4252  }
4253  Py_DECREF(module);
4254  }
4255  }
4256  {
4257  delete arg1;
4258  }
4259  {
4260  delete arg2;
4261  }
4262  return resultobj;
4263 fail:
4264  {
4265  delete arg1;
4266  }
4267  {
4268  delete arg2;
4269  }
4270  return NULL;
4271 }
4272 
4273 
4275  PyObject *resultobj = 0;
4278  operations_research::sat::SolutionCallback *arg3 = 0 ;
4279  void *argp3 = 0 ;
4280  int res3 = 0 ;
4281  PyObject *swig_obj[3] ;
4283 
4284  if (!SWIG_Python_UnpackTuple(args, "SatHelper_SolveWithParametersAndSolutionCallback", 3, 3, swig_obj)) SWIG_fail;
4285  {
4287  PyObject* const pyresult = PyObject_CallMethod(
4288  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4289  if (pyresult != nullptr) {
4290  char* buffer = nullptr;
4291  Py_ssize_t length = 0;
4292  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4293  if (buffer != nullptr) {
4294  arg1->ParseFromArray(buffer, length);
4295  }
4296  Py_DECREF(pyresult);
4297  }
4298  }
4299  {
4301  PyObject* const pyresult = PyObject_CallMethod(
4302  swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4303  if (pyresult != nullptr) {
4304  char* buffer = nullptr;
4305  Py_ssize_t length = 0;
4306  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4307  if (buffer != nullptr) {
4308  arg2->ParseFromArray(buffer, length);
4309  }
4310  Py_DECREF(pyresult);
4311  }
4312  }
4313  res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_operations_research__sat__SolutionCallback, 0 | 0);
4314  if (!SWIG_IsOK(res3)) {
4315  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SatHelper_SolveWithParametersAndSolutionCallback" "', argument " "3"" of type '" "operations_research::sat::SolutionCallback const &""'");
4316  }
4317  if (!argp3) {
4318  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SatHelper_SolveWithParametersAndSolutionCallback" "', argument " "3"" of type '" "operations_research::sat::SolutionCallback const &""'");
4319  }
4320  arg3 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp3);
4321  {
4323  result = operations_research::sat::SatHelper::SolveWithParametersAndSolutionCallback((operations_research::sat::CpModelProto const &)*arg1,(operations_research::sat::SatParameters const &)*arg2,(operations_research::sat::SolutionCallback const &)*arg3);
4325  }
4326  {
4327  PyObject* const module = PyImport_ImportModule("ortools.sat.cp_model_pb2");
4328  if (module != nullptr) {
4329  PyObject* const dict = PyModule_GetDict(module);
4330  if (dict != nullptr) {
4331  PyObject* const clss = PyDict_GetItemString(dict, "CpSolverResponse");
4332  if (clss != nullptr) {
4333  std::string encoded_protobuf;
4334  (&result)->SerializeToString(&encoded_protobuf);
4335 
4336  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
4337  encoded_protobuf.c_str(), encoded_protobuf.size());
4338 
4339 
4340 
4341 
4342  PyObject* const result = PyObject_CallMethod(
4343  clss, const_cast<char*>("FromString"),
4344  const_cast<char*>("(O)"),
4345  python_encoded_protobuf);
4346  Py_DECREF(python_encoded_protobuf);
4347  resultobj = result;
4348  }
4349  }
4350  Py_DECREF(module);
4351  }
4352  }
4353  {
4354  delete arg1;
4355  }
4356  {
4357  delete arg2;
4358  }
4359  return resultobj;
4360 fail:
4361  {
4362  delete arg1;
4363  }
4364  {
4365  delete arg2;
4366  }
4367  return NULL;
4368 }
4369 
4370 
4371 SWIGINTERN PyObject *_wrap_SatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4372  PyObject *resultobj = 0;
4374  PyObject *swig_obj[1] ;
4375  std::string result;
4376 
4377  if (!args) SWIG_fail;
4378  swig_obj[0] = args;
4379  {
4381  PyObject* const pyresult = PyObject_CallMethod(
4382  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4383  if (pyresult != nullptr) {
4384  char* buffer = nullptr;
4385  Py_ssize_t length = 0;
4386  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4387  if (buffer != nullptr) {
4388  arg1->ParseFromArray(buffer, length);
4389  }
4390  Py_DECREF(pyresult);
4391  }
4392  }
4393  {
4395  result = operations_research::sat::SatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
4397  }
4398  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4399  {
4400  delete arg1;
4401  }
4402  return resultobj;
4403 fail:
4404  {
4405  delete arg1;
4406  }
4407  return NULL;
4408 }
4409 
4410 
4411 SWIGINTERN PyObject *_wrap_SatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4412  PyObject *resultobj = 0;
4414  PyObject *swig_obj[1] ;
4415  std::string result;
4416 
4417  if (!args) SWIG_fail;
4418  swig_obj[0] = args;
4419  {
4421  PyObject* const pyresult = PyObject_CallMethod(
4422  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4423  if (pyresult != nullptr) {
4424  char* buffer = nullptr;
4425  Py_ssize_t length = 0;
4426  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4427  if (buffer != nullptr) {
4428  arg1->ParseFromArray(buffer, length);
4429  }
4430  Py_DECREF(pyresult);
4431  }
4432  }
4433  {
4435  result = operations_research::sat::SatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
4437  }
4438  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4439  {
4440  delete arg1;
4441  }
4442  return resultobj;
4443 fail:
4444  {
4445  delete arg1;
4446  }
4447  return NULL;
4448 }
4449 
4450 
4451 SWIGINTERN PyObject *_wrap_SatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4452  PyObject *resultobj = 0;
4454  PyObject *swig_obj[1] ;
4455  std::string result;
4456 
4457  if (!args) SWIG_fail;
4458  swig_obj[0] = args;
4459  {
4461  PyObject* const pyresult = PyObject_CallMethod(
4462  swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4463  if (pyresult != nullptr) {
4464  char* buffer = nullptr;
4465  Py_ssize_t length = 0;
4466  int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4467  if (buffer != nullptr) {
4468  arg1->ParseFromArray(buffer, length);
4469  }
4470  Py_DECREF(pyresult);
4471  }
4472  }
4473  {
4475  result = operations_research::sat::SatHelper::ValidateModel((operations_research::sat::CpModelProto const &)*arg1);
4477  }
4478  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4479  {
4480  delete arg1;
4481  }
4482  return resultobj;
4483 fail:
4484  {
4485  delete arg1;
4486  }
4487  return NULL;
4488 }
4489 
4490 
4491 SWIGINTERN PyObject *_wrap_SatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4492  PyObject *resultobj = 0;
4494  void *argp1 = 0 ;
4495  int res1 = 0 ;
4496  PyObject *swig_obj[1] ;
4498 
4499  if (!args) SWIG_fail;
4500  swig_obj[0] = args;
4502  if (!SWIG_IsOK(res1)) {
4503  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4504  }
4505  if (!argp1) {
4506  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4507  }
4508  arg1 = reinterpret_cast< operations_research::sat::IntegerVariableProto * >(argp1);
4509  {
4511  result = operations_research::sat::SatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
4513  }
4515  return resultobj;
4516 fail:
4517  return NULL;
4518 }
4519 
4520 
4521 SWIGINTERN PyObject *_wrap_new_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4522  PyObject *resultobj = 0;
4523  operations_research::sat::SatHelper *result = 0 ;
4524 
4525  if (!SWIG_Python_UnpackTuple(args, "new_SatHelper", 0, 0, 0)) SWIG_fail;
4526  {
4528  result = (operations_research::sat::SatHelper *)new operations_research::sat::SatHelper();
4530  }
4532  return resultobj;
4533 fail:
4534  return NULL;
4535 }
4536 
4537 
4538 SWIGINTERN PyObject *_wrap_delete_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4539  PyObject *resultobj = 0;
4540  operations_research::sat::SatHelper *arg1 = (operations_research::sat::SatHelper *) 0 ;
4541  void *argp1 = 0 ;
4542  int res1 = 0 ;
4543  PyObject *swig_obj[1] ;
4544 
4545  if (!args) SWIG_fail;
4546  swig_obj[0] = args;
4548  if (!SWIG_IsOK(res1)) {
4549  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SatHelper" "', argument " "1"" of type '" "operations_research::sat::SatHelper *""'");
4550  }
4551  arg1 = reinterpret_cast< operations_research::sat::SatHelper * >(argp1);
4552  {
4554  delete arg1;
4556  }
4557  resultobj = SWIG_Py_Void();
4558  return resultobj;
4559 fail:
4560  return NULL;
4561 }
4562 
4563 
4564 SWIGINTERN PyObject *SatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4565  PyObject *obj;
4566  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
4568  return SWIG_Py_Void();
4569 }
4570 
4571 SWIGINTERN PyObject *SatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4572  return SWIG_Python_InitShadowInstance(args);
4573 }
4574 
4575 static PyMethodDef SwigMethods[] = {
4576  { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
4577  { "delete_SolutionCallback", _wrap_delete_SolutionCallback, METH_O, NULL},
4578  { "SolutionCallback_OnSolutionCallback", _wrap_SolutionCallback_OnSolutionCallback, METH_O, NULL},
4579  { "SolutionCallback_NumBooleans", _wrap_SolutionCallback_NumBooleans, METH_O, NULL},
4580  { "SolutionCallback_NumBranches", _wrap_SolutionCallback_NumBranches, METH_O, NULL},
4581  { "SolutionCallback_NumConflicts", _wrap_SolutionCallback_NumConflicts, METH_O, NULL},
4582  { "SolutionCallback_NumBinaryPropagations", _wrap_SolutionCallback_NumBinaryPropagations, METH_O, NULL},
4583  { "SolutionCallback_NumIntegerPropagations", _wrap_SolutionCallback_NumIntegerPropagations, METH_O, NULL},
4584  { "SolutionCallback_WallTime", _wrap_SolutionCallback_WallTime, METH_O, NULL},
4585  { "SolutionCallback_UserTime", _wrap_SolutionCallback_UserTime, METH_O, NULL},
4586  { "SolutionCallback_ObjectiveValue", _wrap_SolutionCallback_ObjectiveValue, METH_O, NULL},
4587  { "SolutionCallback_BestObjectiveBound", _wrap_SolutionCallback_BestObjectiveBound, METH_O, NULL},
4588  { "SolutionCallback_SolutionIntegerValue", _wrap_SolutionCallback_SolutionIntegerValue, METH_VARARGS, NULL},
4589  { "SolutionCallback_SolutionBooleanValue", _wrap_SolutionCallback_SolutionBooleanValue, METH_VARARGS, NULL},
4590  { "SolutionCallback_StopSearch", _wrap_SolutionCallback_StopSearch, METH_O, NULL},
4591  { "SolutionCallback_Response", _wrap_SolutionCallback_Response, METH_O, NULL},
4592  { "SolutionCallback_HasResponse", _wrap_SolutionCallback_HasResponse, METH_O, NULL},
4593  { "new_SolutionCallback", _wrap_new_SolutionCallback, METH_O, NULL},
4594  { "disown_SolutionCallback", _wrap_disown_SolutionCallback, METH_O, NULL},
4595  { "SolutionCallback_swigregister", SolutionCallback_swigregister, METH_O, NULL},
4596  { "SolutionCallback_swiginit", SolutionCallback_swiginit, METH_VARARGS, NULL},
4597  { "SatHelper_Solve", _wrap_SatHelper_Solve, METH_O, NULL},
4598  { "SatHelper_SolveWithParameters", _wrap_SatHelper_SolveWithParameters, METH_VARARGS, NULL},
4599  { "SatHelper_SolveWithParametersAndSolutionCallback", _wrap_SatHelper_SolveWithParametersAndSolutionCallback, METH_VARARGS, NULL},
4600  { "SatHelper_ModelStats", _wrap_SatHelper_ModelStats, METH_O, NULL},
4601  { "SatHelper_SolverResponseStats", _wrap_SatHelper_SolverResponseStats, METH_O, NULL},
4602  { "SatHelper_ValidateModel", _wrap_SatHelper_ValidateModel, METH_O, NULL},
4603  { "SatHelper_VariableDomain", _wrap_SatHelper_VariableDomain, METH_O, NULL},
4604  { "new_SatHelper", _wrap_new_SatHelper, METH_NOARGS, NULL},
4605  { "delete_SatHelper", _wrap_delete_SatHelper, METH_O, NULL},
4606  { "SatHelper_swigregister", SatHelper_swigregister, METH_O, NULL},
4607  { "SatHelper_swiginit", SatHelper_swiginit, METH_VARARGS, NULL},
4608  { NULL, NULL, 0, NULL }
4609 };
4610 
4611 static PyMethodDef SwigMethods_proxydocs[] = {
4612  { NULL, NULL, 0, NULL }
4613 };
4614 
4615 
4616 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4617 
4618 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4619 static swig_type_info _swigt__p_int = {"_p_int", "int *|int_least32_t *|int32 *|int32_t *", 0, 0, (void*)0, 0};
4620 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};
4621 static swig_type_info _swigt__p_operations_research__Domain = {"_p_operations_research__Domain", "operations_research::Domain *", 0, 0, (void*)0, 0};
4622 static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto = {"_p_operations_research__sat__IntegerVariableProto", "operations_research::sat::IntegerVariableProto *", 0, 0, (void*)0, 0};
4623 static swig_type_info _swigt__p_operations_research__sat__SatHelper = {"_p_operations_research__sat__SatHelper", "operations_research::sat::SatHelper *", 0, 0, (void*)0, 0};
4624 static swig_type_info _swigt__p_operations_research__sat__SolutionCallback = {"_p_operations_research__sat__SolutionCallback", "operations_research::sat::SolutionCallback *", 0, 0, (void*)0, 0};
4625 static swig_type_info _swigt__p_short = {"_p_short", "int16 *|short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
4626 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};
4627 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};
4628 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint_least32_t *|uint32 *|uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
4629 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};
4630 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16 *|unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
4631 
4633  &_swigt__p_char,
4634  &_swigt__p_int,
4635  &_swigt__p_long,
4640  &_swigt__p_short,
4646 };
4647 
4648 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4649 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4650 static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
4655 static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
4656 static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
4657 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4658 static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
4659 static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
4661 
4664  _swigc__p_int,
4676 };
4677 
4678 
4679 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4680 
4682 {0, 0, 0, 0.0, 0, 0}};
4683 
4684 #ifdef __cplusplus
4685 }
4686 #endif
4687 /* -----------------------------------------------------------------------------
4688  * Type initialization:
4689  * This problem is tough by the requirement that no dynamic
4690  * memory is used. Also, since swig_type_info structures store pointers to
4691  * swig_cast_info structures and swig_cast_info structures store pointers back
4692  * to swig_type_info structures, we need some lookup code at initialization.
4693  * The idea is that swig generates all the structures that are needed.
4694  * The runtime then collects these partially filled structures.
4695  * The SWIG_InitializeModule function takes these initial arrays out of
4696  * swig_module, and does all the lookup, filling in the swig_module.types
4697  * array with the correct data and linking the correct swig_cast_info
4698  * structures together.
4699  *
4700  * The generated swig_type_info structures are assigned statically to an initial
4701  * array. We just loop through that array, and handle each type individually.
4702  * First we lookup if this type has been already loaded, and if so, use the
4703  * loaded structure instead of the generated one. Then we have to fill in the
4704  * cast linked list. The cast data is initially stored in something like a
4705  * two-dimensional array. Each row corresponds to a type (there are the same
4706  * number of rows as there are in the swig_type_initial array). Each entry in
4707  * a column is one of the swig_cast_info structures for that type.
4708  * The cast_initial array is actually an array of arrays, because each row has
4709  * a variable number of columns. So to actually build the cast linked list,
4710  * we find the array of casts associated with the type, and loop through it
4711  * adding the casts to the list. The one last trick we need to do is making
4712  * sure the type pointer in the swig_cast_info struct is correct.
4713  *
4714  * First off, we lookup the cast->type name to see if it is already loaded.
4715  * There are three cases to handle:
4716  * 1) If the cast->type has already been loaded AND the type we are adding
4717  * casting info to has not been loaded (it is in this module), THEN we
4718  * replace the cast->type pointer with the type pointer that has already
4719  * been loaded.
4720  * 2) If BOTH types (the one we are adding casting info to, and the
4721  * cast->type) are loaded, THEN the cast info has already been loaded by
4722  * the previous module so we just ignore it.
4723  * 3) Finally, if cast->type has not already been loaded, then we add that
4724  * swig_cast_info to the linked list (because the cast->type) pointer will
4725  * be correct.
4726  * ----------------------------------------------------------------------------- */
4727 
4728 #ifdef __cplusplus
4729 extern "C" {
4730 #if 0
4731 } /* c-mode */
4732 #endif
4733 #endif
4734 
4735 #if 0
4736 #define SWIGRUNTIME_DEBUG
4737 #endif
4738 
4739 
4740 SWIGRUNTIME void
4741 SWIG_InitializeModule(void *clientdata) {
4742  size_t i;
4743  swig_module_info *module_head, *iter;
4744  int init;
4745 
4746  /* check to see if the circular list has been setup, if not, set it up */
4747  if (swig_module.next==0) {
4748  /* Initialize the swig_module */
4752  init = 1;
4753  } else {
4754  init = 0;
4755  }
4756 
4757  /* Try and load any already created modules */
4758  module_head = SWIG_GetModule(clientdata);
4759  if (!module_head) {
4760  /* This is the first module loaded for this interpreter */
4761  /* so set the swig module into the interpreter */
4762  SWIG_SetModule(clientdata, &swig_module);
4763  } else {
4764  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4765  iter=module_head;
4766  do {
4767  if (iter==&swig_module) {
4768  /* Our module is already in the list, so there's nothing more to do. */
4769  return;
4770  }
4771  iter=iter->next;
4772  } while (iter!= module_head);
4773 
4774  /* otherwise we must add our module into the list */
4775  swig_module.next = module_head->next;
4776  module_head->next = &swig_module;
4777  }
4778 
4779  /* When multiple interpreters are used, a module could have already been initialized in
4780  a different interpreter, but not yet have a pointer in this interpreter.
4781  In this case, we do not want to continue adding types... everything should be
4782  set up already */
4783  if (init == 0) return;
4784 
4785  /* Now work on filling in swig_module.types */
4786 #ifdef SWIGRUNTIME_DEBUG
4787  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
4788 #endif
4789  for (i = 0; i < swig_module.size; ++i) {
4790  swig_type_info *type = 0;
4791  swig_type_info *ret;
4792  swig_cast_info *cast;
4793 
4794 #ifdef SWIGRUNTIME_DEBUG
4795  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
4796 #endif
4797 
4798  /* if there is another module already loaded */
4799  if (swig_module.next != &swig_module) {
4801  }
4802  if (type) {
4803  /* Overwrite clientdata field */
4804 #ifdef SWIGRUNTIME_DEBUG
4805  printf("SWIG_InitializeModule: found type %s\n", type->name);
4806 #endif
4809 #ifdef SWIGRUNTIME_DEBUG
4810  printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4811 #endif
4812  }
4813  } else {
4814  type = swig_module.type_initial[i];
4815  }
4816 
4817  /* Insert casting types */
4818  cast = swig_module.cast_initial[i];
4819  while (cast->type) {
4820  /* Don't need to add information already in the list */
4821  ret = 0;
4822 #ifdef SWIGRUNTIME_DEBUG
4823  printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4824 #endif
4825  if (swig_module.next != &swig_module) {
4827 #ifdef SWIGRUNTIME_DEBUG
4828  if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4829 #endif
4830  }
4831  if (ret) {
4832  if (type == swig_module.type_initial[i]) {
4833 #ifdef SWIGRUNTIME_DEBUG
4834  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4835 #endif
4836  cast->type = ret;
4837  ret = 0;
4838  } else {
4839  /* Check for casting already in the list */
4840  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4841 #ifdef SWIGRUNTIME_DEBUG
4842  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4843 #endif
4844  if (!ocast) ret = 0;
4845  }
4846  }
4847 
4848  if (!ret) {
4849 #ifdef SWIGRUNTIME_DEBUG
4850  printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4851 #endif
4852  if (type->cast) {
4853  type->cast->prev = cast;
4854  cast->next = type->cast;
4855  }
4856  type->cast = cast;
4857  }
4858  cast++;
4859  }
4860  /* Set entry in modules->types array equal to the type */
4861  swig_module.types[i] = type;
4862  }
4863  swig_module.types[i] = 0;
4864 
4865 #ifdef SWIGRUNTIME_DEBUG
4866  printf("**** SWIG_InitializeModule: Cast List ******\n");
4867  for (i = 0; i < swig_module.size; ++i) {
4868  int j = 0;
4870  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
4871  while (cast->type) {
4872  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4873  cast++;
4874  ++j;
4875  }
4876  printf("---- Total casts: %d\n",j);
4877  }
4878  printf("**** SWIG_InitializeModule: Cast List ******\n");
4879 #endif
4880 }
4881 
4882 /* This function will propagate the clientdata field of type to
4883 * any new swig_type_info structures that have been added into the list
4884 * of equivalent types. It is like calling
4885 * SWIG_TypeClientData(type, clientdata) a second time.
4886 */
4887 SWIGRUNTIME void
4889  size_t i;
4890  swig_cast_info *equiv;
4891  static int init_run = 0;
4892 
4893  if (init_run) return;
4894  init_run = 1;
4895 
4896  for (i = 0; i < swig_module.size; i++) {
4897  if (swig_module.types[i]->clientdata) {
4898  equiv = swig_module.types[i]->cast;
4899  while (equiv) {
4900  if (!equiv->converter) {
4901  if (equiv->type && !equiv->type->clientdata)
4903  }
4904  equiv = equiv->next;
4905  }
4906  }
4907  }
4908 }
4909 
4910 #ifdef __cplusplus
4911 #if 0
4912 {
4913  /* c-mode */
4914 #endif
4915 }
4916 #endif
4917 
4918 
4919 
4920 #ifdef __cplusplus
4921 extern "C" {
4922 #endif
4923 
4924  /* Python-specific SWIG API */
4925 #define SWIG_newvarlink() SWIG_Python_newvarlink()
4926 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
4927 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
4929  /* -----------------------------------------------------------------------------
4930  * global variable support code.
4931  * ----------------------------------------------------------------------------- */
4932 
4933  typedef struct swig_globalvar {
4934  char *name; /* Name of global variable */
4935  PyObject *(*get_attr)(void); /* Return the current value */
4936  int (*set_attr)(PyObject *); /* Set the value */
4937  struct swig_globalvar *next;
4939 
4940  typedef struct swig_varlinkobject {
4941  PyObject_HEAD
4944 
4945  SWIGINTERN PyObject *
4947 #if PY_VERSION_HEX >= 0x03000000
4948  return PyUnicode_InternFromString("<Swig global variables>");
4949 #else
4950  return PyString_FromString("<Swig global variables>");
4951 #endif
4952  }
4953 
4954  SWIGINTERN PyObject *
4956 #if PY_VERSION_HEX >= 0x03000000
4957  PyObject *str = PyUnicode_InternFromString("(");
4958  PyObject *tail;
4959  PyObject *joined;
4961  for (var = v->vars; var; var=var->next) {
4962  tail = PyUnicode_FromString(var->name);
4963  joined = PyUnicode_Concat(str, tail);
4964  Py_DecRef(str);
4965  Py_DecRef(tail);
4966  str = joined;
4967  if (var->next) {
4968  tail = PyUnicode_InternFromString(", ");
4969  joined = PyUnicode_Concat(str, tail);
4970  Py_DecRef(str);
4971  Py_DecRef(tail);
4972  str = joined;
4973  }
4974  }
4975  tail = PyUnicode_InternFromString(")");
4976  joined = PyUnicode_Concat(str, tail);
4977  Py_DecRef(str);
4978  Py_DecRef(tail);
4979  str = joined;
4980 #else
4981  PyObject *str = PyString_FromString("(");
4983  for (var = v->vars; var; var=var->next) {
4984  PyString_ConcatAndDel(&str,PyString_FromString(var->name));
4985  if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
4986  }
4987  PyString_ConcatAndDel(&str,PyString_FromString(")"));
4988 #endif
4989  return str;
4990  }
4991 
4992  SWIGINTERN void
4994  swig_globalvar *var = v->vars;
4995  while (var) {
4996  swig_globalvar *n = var->next;
4997  free(var->name);
4998  free(var);
4999  var = n;
5000  }
5001  }
5002 
5003  SWIGINTERN PyObject *
5005  PyObject *res = NULL;
5006  swig_globalvar *var = v->vars;
5007  while (var) {
5008  if (strcmp(var->name,n) == 0) {
5009  res = (*var->get_attr)();
5010  break;
5011  }
5012  var = var->next;
5013  }
5014  if (res == NULL && !PyErr_Occurred()) {
5015  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5016  }
5017  return res;
5018  }
5019 
5020  SWIGINTERN int
5021  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
5022  int res = 1;
5023  swig_globalvar *var = v->vars;
5024  while (var) {
5025  if (strcmp(var->name,n) == 0) {
5026  res = (*var->set_attr)(p);
5027  break;
5028  }
5029  var = var->next;
5030  }
5031  if (res == 1 && !PyErr_Occurred()) {
5032  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
5033  }
5034  return res;
5035  }
5036 
5037  SWIGINTERN PyTypeObject*
5039  static char varlink__doc__[] = "Swig var link object";
5040  static PyTypeObject varlink_type;
5041  static int type_init = 0;
5042  if (!type_init) {
5043  const PyTypeObject tmp = {
5044 #if PY_VERSION_HEX >= 0x03000000
5045  PyVarObject_HEAD_INIT(NULL, 0)
5046 #else
5047  PyObject_HEAD_INIT(NULL)
5048  0, /* ob_size */
5049 #endif
5050  "swigvarlink", /* tp_name */
5051  sizeof(swig_varlinkobject), /* tp_basicsize */
5052  0, /* tp_itemsize */
5053  (destructor) swig_varlink_dealloc, /* tp_dealloc */
5054  0, /* tp_print */
5055  (getattrfunc) swig_varlink_getattr, /* tp_getattr */
5056  (setattrfunc) swig_varlink_setattr, /* tp_setattr */
5057  0, /* tp_compare */
5058  (reprfunc) swig_varlink_repr, /* tp_repr */
5059  0, /* tp_as_number */
5060  0, /* tp_as_sequence */
5061  0, /* tp_as_mapping */
5062  0, /* tp_hash */
5063  0, /* tp_call */
5064  (reprfunc) swig_varlink_str, /* tp_str */
5065  0, /* tp_getattro */
5066  0, /* tp_setattro */
5067  0, /* tp_as_buffer */
5068  0, /* tp_flags */
5069  varlink__doc__, /* tp_doc */
5070  0, /* tp_traverse */
5071  0, /* tp_clear */
5072  0, /* tp_richcompare */
5073  0, /* tp_weaklistoffset */
5074  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
5075  0, /* tp_del */
5076  0, /* tp_version_tag */
5077 #if PY_VERSION_HEX >= 0x03040000
5078  0, /* tp_finalize */
5079 #endif
5080 #if PY_VERSION_HEX >= 0x03080000
5081  0, /* tp_vectorcall */
5082 #endif
5083 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
5084  0, /* tp_print */
5085 #endif
5086 #ifdef COUNT_ALLOCS
5087  0, /* tp_allocs */
5088  0, /* tp_frees */
5089  0, /* tp_maxalloc */
5090  0, /* tp_prev */
5091  0 /* tp_next */
5092 #endif
5093  };
5094  varlink_type = tmp;
5095  type_init = 1;
5096  if (PyType_Ready(&varlink_type) < 0)
5097  return NULL;
5098  }
5099  return &varlink_type;
5100  }
5101 
5102  /* Create a variable linking object for use later */
5103  SWIGINTERN PyObject *
5105  swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
5106  if (result) {
5107  result->vars = 0;
5108  }
5109  return ((PyObject*) result);
5110  }
5111 
5112  SWIGINTERN void
5113  SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
5116  if (gv) {
5117  size_t size = strlen(name)+1;
5118  gv->name = (char *)malloc(size);
5119  if (gv->name) {
5120  memcpy(gv->name, name, size);
5121  gv->get_attr = get_attr;
5122  gv->set_attr = set_attr;
5123  gv->next = v->vars;
5124  }
5125  }
5126  v->vars = gv;
5127  }
5128 
5129  SWIGINTERN PyObject *
5131  static PyObject *globals = 0;
5132  if (!globals) {
5133  globals = SWIG_newvarlink();
5134  }
5135  return globals;
5136  }
5137 
5138  /* -----------------------------------------------------------------------------
5139  * constants/methods manipulation
5140  * ----------------------------------------------------------------------------- */
5141 
5142  /* Install Constants */
5143  SWIGINTERN void
5144  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
5145  PyObject *obj = 0;
5146  size_t i;
5147  for (i = 0; constants[i].type; ++i) {
5148  switch(constants[i].type) {
5149  case SWIG_PY_POINTER:
5150  obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
5151  break;
5152  case SWIG_PY_BINARY:
5153  obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
5154  break;
5155  default:
5156  obj = 0;
5157  break;
5158  }
5159  if (obj) {
5160  PyDict_SetItemString(d, constants[i].name, obj);
5161  Py_DECREF(obj);
5162  }
5163  }
5164  }
5165 
5166  /* -----------------------------------------------------------------------------*/
5167  /* Fix SwigMethods to carry the callback ptrs when needed */
5168  /* -----------------------------------------------------------------------------*/
5169 
5170  SWIGINTERN void
5171  SWIG_Python_FixMethods(PyMethodDef *methods,
5172  swig_const_info *const_table,
5173  swig_type_info **types,
5174  swig_type_info **types_initial) {
5175  size_t i;
5176  for (i = 0; methods[i].ml_name; ++i) {
5177  const char *c = methods[i].ml_doc;
5178  if (!c) continue;
5179  c = strstr(c, "swig_ptr: ");
5180  if (c) {
5181  int j;
5182  swig_const_info *ci = 0;
5183  const char *name = c + 10;
5184  for (j = 0; const_table[j].type; ++j) {
5185  if (strncmp(const_table[j].name, name,
5186  strlen(const_table[j].name)) == 0) {
5187  ci = &(const_table[j]);
5188  break;
5189  }
5190  }
5191  if (ci) {
5192  void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
5193  if (ptr) {
5194  size_t shift = (ci->ptype) - types;
5195  swig_type_info *ty = types_initial[shift];
5196  size_t ldoc = (c - methods[i].ml_doc);
5197  size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
5198  char *ndoc = (char*)malloc(ldoc + lptr + 10);
5199  if (ndoc) {
5200  char *buff = ndoc;
5201  memcpy(buff, methods[i].ml_doc, ldoc);
5202  buff += ldoc;
5203  memcpy(buff, "swig_ptr: ", 10);
5204  buff += 10;
5205  SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
5206  methods[i].ml_doc = ndoc;
5207  }
5208  }
5209  }
5210  }
5211  }
5212  }
5213 
5214  /* -----------------------------------------------------------------------------
5215  * Method creation and docstring support functions
5216  * ----------------------------------------------------------------------------- */
5217 
5218  /* -----------------------------------------------------------------------------
5219  * Function to find the method definition with the correct docstring for the
5220  * proxy module as opposed to the low-level API
5221  * ----------------------------------------------------------------------------- */
5222 
5223  SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
5224  /* Find the function in the modified method table */
5225  size_t offset = 0;
5226  int found = 0;
5227  while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
5228  if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
5229  found = 1;
5230  break;
5231  }
5232  offset++;
5233  }
5234  /* Use the copy with the modified docstring if available */
5235  return found ? &SwigMethods_proxydocs[offset] : NULL;
5236  }
5237 
5238  /* -----------------------------------------------------------------------------
5239  * Wrapper of PyInstanceMethod_New() used in Python 3
5240  * It is exported to the generated module, used for -fastproxy
5241  * ----------------------------------------------------------------------------- */
5242 
5243  SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5244  if (PyCFunction_Check(func)) {
5245  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5246  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5247  if (ml)
5248  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5249  }
5250 #if PY_VERSION_HEX >= 0x03000000
5251  return PyInstanceMethod_New(func);
5252 #else
5253  return PyMethod_New(func, NULL, NULL);
5254 #endif
5255  }
5256 
5257  /* -----------------------------------------------------------------------------
5258  * Wrapper of PyStaticMethod_New()
5259  * It is exported to the generated module, used for -fastproxy
5260  * ----------------------------------------------------------------------------- */
5261 
5262  SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
5263  if (PyCFunction_Check(func)) {
5264  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5265  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
5266  if (ml)
5267  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5268  }
5269  return PyStaticMethod_New(func);
5270  }
5271 
5272 #ifdef __cplusplus
5273 }
5274 #endif
5275 
5276 /* -----------------------------------------------------------------------------*
5277  * Partial Init method
5278  * -----------------------------------------------------------------------------*/
5279 
5280 #ifdef __cplusplus
5281 extern "C"
5282 #endif
5283 
5284 SWIGEXPORT
5285 #if PY_VERSION_HEX >= 0x03000000
5286 PyObject*
5287 #else
5288 void
5289 #endif
5290 SWIG_init(void) {
5291  PyObject *m, *d, *md, *globals;
5292 
5293 #if PY_VERSION_HEX >= 0x03000000
5294  static struct PyModuleDef SWIG_module = {
5295  PyModuleDef_HEAD_INIT,
5296  SWIG_name,
5297  NULL,
5298  -1,
5299  SwigMethods,
5300  NULL,
5301  NULL,
5302  NULL,
5303  NULL
5304  };
5305 #endif
5306 
5307 #if defined(SWIGPYTHON_BUILTIN)
5308  static SwigPyClientData SwigPyObject_clientdata = {
5309  0, 0, 0, 0, 0, 0, 0
5310  };
5311  static PyGetSetDef this_getset_def = {
5312  (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
5313  };
5314  static SwigPyGetSet thisown_getset_closure = {
5317  };
5318  static PyGetSetDef thisown_getset_def = {
5319  (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
5320  };
5321  PyTypeObject *builtin_pytype;
5322  int builtin_base_count;
5323  swig_type_info *builtin_basetype;
5324  PyObject *tuple;
5325  PyGetSetDescrObject *static_getset;
5326  PyTypeObject *metatype;
5327  PyTypeObject *swigpyobject;
5328  SwigPyClientData *cd;
5329  PyObject *public_interface, *public_symbol;
5330  PyObject *this_descr;
5331  PyObject *thisown_descr;
5332  PyObject *self = 0;
5333  int i;
5334 
5335  (void)builtin_pytype;
5336  (void)builtin_base_count;
5337  (void)builtin_basetype;
5338  (void)tuple;
5339  (void)static_getset;
5340  (void)self;
5341 
5342  /* Metaclass is used to implement static member variables */
5343  metatype = SwigPyObjectType();
5344  assert(metatype);
5345 #endif
5346 
5347  (void)globals;
5348 
5349  /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
5350  SWIG_This();
5353 #ifndef SWIGPYTHON_BUILTIN
5355 #endif
5356 
5357  /* Fix SwigMethods to carry the callback ptrs when needed */
5359 
5360 #if PY_VERSION_HEX >= 0x03000000
5361  m = PyModule_Create(&SWIG_module);
5362 #else
5363  m = Py_InitModule(SWIG_name, SwigMethods);
5364 #endif
5365 
5366  md = d = PyModule_GetDict(m);
5367  (void)md;
5368 
5370 
5371 #ifdef SWIGPYTHON_BUILTIN
5372  swigpyobject = SwigPyObject_TypeOnce();
5373 
5374  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
5375  assert(SwigPyObject_stype);
5376  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
5377  if (!cd) {
5378  SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
5379  SwigPyObject_clientdata.pytype = swigpyobject;
5380  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
5381  PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
5382 # if PY_VERSION_HEX >= 0x03000000
5383  return NULL;
5384 # else
5385  return;
5386 # endif
5387  }
5388 
5389  /* All objects have a 'this' attribute */
5390  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
5391  (void)this_descr;
5392 
5393  /* All objects have a 'thisown' attribute */
5394  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
5395  (void)thisown_descr;
5396 
5397  public_interface = PyList_New(0);
5398  public_symbol = 0;
5399  (void)public_symbol;
5400 
5401  PyDict_SetItemString(md, "__all__", public_interface);
5402  Py_DECREF(public_interface);
5403  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
5404  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
5405  for (i = 0; swig_const_table[i].name != 0; ++i)
5406  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
5407 #endif
5408 
5410 
5411 
5412  /* Initialize threading */
5414 #if PY_VERSION_HEX >= 0x03000000
5415  return m;
5416 #else
5417  return;
5418 #endif
5419 }
5420 
SwigPyObject_repr
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
Definition: sat_python_wrap.cc:1459
SWIG_TypeQuery
#define SWIG_TypeQuery(name)
Definition: sat_python_wrap.cc:3124
swig_varlink_setattr
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
Definition: sat_python_wrap.cc:5021
SwigDirector_SolutionCallback
Definition: sat_csharp_wrap.h:14
operations_research::sat::CpSolverResponse
SwigPyPacked::pack
PyObject_HEAD void * pack
Definition: knapsack_solver_python_wrap.cc:1817
var
IntVar * var
Definition: expr_array.cc:1858
SWIG_POINTER_NOSHADOW
#define SWIG_POINTER_NOSHADOW
Definition: sat_python_wrap.cc:1283
SWIG_Python_newvarlink
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
Definition: sat_python_wrap.cc:5104
swig_cast_info
struct swig_cast_info swig_cast_info
SwigPyClientData::newraw
PyObject * newraw
Definition: knapsack_solver_python_wrap.cc:1307
SWIG_Python_GetModule
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
Definition: sat_python_wrap.cc:2419
tail
int64 tail
Definition: routing_flow.cc:127
swig_cast_info::next
struct swig_cast_info * next
Definition: knapsack_solver_python_wrap.cc:380
swig_module_info::size
size_t size
Definition: knapsack_solver_python_wrap.cc:389
_swigc__p_unsigned_char
static swig_cast_info _swigc__p_unsigned_char[]
Definition: sat_python_wrap.cc:4657
_wrap_SolutionCallback_NumConflicts
SWIGINTERN PyObject * _wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3690
SWIG_From_std_string
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
Definition: sat_python_wrap.cc:3523
SWIG_pchar_descriptor
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
Definition: sat_python_wrap.cc:3485
SWIG_Python_str_DelForPy3
#define SWIG_Python_str_DelForPy3(x)
Definition: sat_python_wrap.cc:835
SWIG_exception_fail
#define SWIG_exception_fail(code, msg)
Definition: sat_python_wrap.cc:2671
SWIGTYPE_p_operations_research__sat__SatHelper
#define SWIGTYPE_p_operations_research__sat__SatHelper
Definition: sat_python_wrap.cc:3106
SwigPyClientData::klass
PyObject * klass
Definition: knapsack_solver_python_wrap.cc:1306
swig::SwigVar_PyObject::operator=
SwigVar_PyObject & operator=(PyObject *obj)
Definition: knapsack_solver_python_wrap.cc:2800
swig::SwigVar_PyObject::SwigVar_PyObject
SwigVar_PyObject(PyObject *obj=0)
Definition: sat_python_wrap.cc:3207
swig_module_info::next
struct swig_module_info * next
Definition: knapsack_solver_python_wrap.cc:390
_wrap_SatHelper_SolveWithParametersAndSolutionCallback
SWIGINTERN PyObject * _wrap_SatHelper_SolveWithParametersAndSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4274
if
if(!yyg->yy_init)
Definition: parser.yy.cc:965
min
int64 min
Definition: alldiff_cst.cc:138
SwigDirector_SolutionCallback::OnSolutionCallback
virtual void OnSolutionCallback() const
Definition: sat_csharp_wrap.cc:415
swig_cast_info::type
swig_type_info * type
Definition: knapsack_solver_python_wrap.cc:378
SWIG_TypeCmp
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
Definition: sat_python_wrap.cc:421
SWIG_From_long
#define SWIG_From_long
Definition: sat_python_wrap.cc:3320
SWIG_NewPointerObj
#define SWIG_NewPointerObj(ptr, type, flags)
Definition: sat_python_wrap.cc:1094
SWIG_Python_TypeErrorOccurred
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
Definition: sat_python_wrap.cc:941
cp_model.pb.h
swig_const_info::dvalue
double dvalue
Definition: knapsack_solver_python_wrap.cc:1055
SWIG_BUILTIN_TP_INIT
#define SWIG_BUILTIN_TP_INIT
Definition: sat_python_wrap.cc:1288
HandleResult
static ReturnT HandleResult(PyObject *pyresult)
Definition: sat_python_wrap.cc:3266
SWIG_Python_AddErrorMsg
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
Definition: sat_python_wrap.cc:915
max
int64 max
Definition: alldiff_cst.cc:139
SWIG_Python_CallFunctor
#define SWIG_Python_CallFunctor(functor, obj)
Definition: sat_python_wrap.cc:1266
SWIG_PyInstanceMethod_New
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
Definition: sat_python_wrap.cc:5243
SwigPyObject_Check
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
Definition: sat_python_wrap.cc:1529
_swigc__p_operations_research__sat__SatHelper
static swig_cast_info _swigc__p_operations_research__sat__SatHelper[]
Definition: sat_python_wrap.cc:4653
SWIG_CAST_NEW_MEMORY
#define SWIG_CAST_NEW_MEMORY
Definition: sat_python_wrap.cc:227
Swig
Definition: constraint_solver_csharp_wrap.cc:347
SWIG_Python_FixMethods
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
Definition: sat_python_wrap.cc:5171
Swig::DirectorPureVirtualException::DirectorPureVirtualException
DirectorPureVirtualException(const char *msg)
Definition: constraint_solver_csharp_wrap.cc:375
SWIG_Python_SetErrorObj
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
Definition: sat_python_wrap.cc:1138
SWIG_GUARD
#define SWIG_GUARD(mutex)
Definition: sat_python_wrap.cc:2976
SwigDirector_SolutionCallback::SwigDirector_SolutionCallback
SwigDirector_SolutionCallback()
Definition: sat_csharp_wrap.cc:406
swig_varlink_repr
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
Definition: sat_python_wrap.cc:4946
SwigPyClientData::pytype
PyTypeObject * pytype
Definition: knapsack_solver_python_wrap.cc:1312
SWIG_Python_TypeError
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
Definition: sat_python_wrap.cc:2556
swig_const_table
static swig_const_info swig_const_table[]
Definition: sat_python_wrap.cc:4681
SWIG_PackDataName
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
Definition: sat_python_wrap.cc:726
SharedPyPtr
Definition: constraint_solver_python_wrap.cc:3344
SWIG_ConvertPtr
#define SWIG_ConvertPtr(obj, pptr, type, flags)
Definition: sat_python_wrap.cc:1088
SWIG_Python_SetErrorMsg
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
Definition: sat_python_wrap.cc:1146
_wrap_new_SolutionCallback
SWIGINTERN PyObject * _wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4053
_swigc__p_char
static swig_cast_info _swigc__p_char[]
Definition: sat_python_wrap.cc:4648
_wrap_SatHelper_ValidateModel
SWIGINTERN PyObject * _wrap_SatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4451
SWIG_PythonGetProxyDoc
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
Definition: sat_python_wrap.cc:5223
SWIG_Python_addvarlink
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
Definition: sat_python_wrap.cc:5113
SWIG_TypeDynamicCast
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
Definition: sat_python_wrap.cc:510
_wrap_SolutionCallback_Response
SWIGINTERN PyObject * _wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3973
Swig::GCItem_Object::GCItem_Object
GCItem_Object(int own)
Definition: sat_python_wrap.cc:2832
swig_module_info
Definition: knapsack_solver_python_wrap.cc:387
SWIG_Python_NewPointerObj
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
Definition: sat_python_wrap.cc:2352
swig::SwigPtr_PyObject::operator->
PyObject * operator->() const
Definition: sat_python_wrap.cc:3197
message
std::string message
Definition: trace.cc:396
_wrap_SolutionCallback_NumBooleans
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3636
SWIG_NewClientData
#define SWIG_NewClientData(obj)
Definition: sat_python_wrap.cc:1124
SWIG_TypePrettyName
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
Definition: sat_python_wrap.cc:533
SwigPyPacked_UnpackData
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
Definition: sat_python_wrap.cc:1987
Swig::DirectorPureVirtualException::raise
static void raise(const char *msg)
Definition: constraint_solver_csharp_wrap.cc:378
Swig::GCArray_T::GCArray_T
GCArray_T(Type *ptr)
Definition: sat_python_wrap.cc:2861
swig_module
static swig_module_info swig_module
Definition: sat_python_wrap.cc:3115
swig_const_info::lvalue
long lvalue
Definition: knapsack_solver_python_wrap.cc:1054
SwigMethods
static PyMethodDef SwigMethods[]
Definition: sat_python_wrap.cc:4575
SwigPyObject_next
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
Definition: sat_python_wrap.cc:1609
SWIG_RuntimeError
#define SWIG_RuntimeError
Definition: sat_python_wrap.cc:760
_wrap_SolutionCallback_UserTime
SWIGINTERN PyObject * _wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3798
SWIG_Python_TypeCache
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
Definition: sat_python_wrap.cc:2472
_swigc__p_int
static swig_cast_info _swigc__p_int[]
Definition: sat_python_wrap.cc:4649
SWIGTYPE_p_operations_research__sat__IntegerVariableProto
#define SWIGTYPE_p_operations_research__sat__IntegerVariableProto
Definition: sat_python_wrap.cc:3105
SWIG_OK
#define SWIG_OK
Definition: sat_python_wrap.cc:313
swig_globalvar
Definition: knapsack_solver_python_wrap.cc:3825
Swig::GCItem_T::~GCItem_T
virtual ~GCItem_T()
Definition: sat_python_wrap.cc:2851
Swig::DirectorException::swig_msg
std::string swig_msg
Definition: constraint_solver_csharp_wrap.cc:355
swig_type_info::clientdata
void * clientdata
Definition: knapsack_solver_python_wrap.cc:372
SWIG_DIRECTOR_RGTR
#define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
Definition: sat_python_wrap.cc:2789
SWIG_TypeCheck
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
Definition: sat_python_wrap.cc:448
SWIG_TYPE_TABLE_NAME
#define SWIG_TYPE_TABLE_NAME
Definition: sat_python_wrap.cc:200
SWIGRUNTIMEINLINE
#define SWIGRUNTIMEINLINE
Definition: sat_python_wrap.cc:217
SWIG_Python_TypeQuery
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
Definition: sat_python_wrap.cc:2478
value
int64 value
Definition: demon_profiler.cc:43
_wrap_SolutionCallback_HasResponse
SWIGINTERN PyObject * _wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4026
SWIG_PY_POINTER
#define SWIG_PY_POINTER
Definition: sat_python_wrap.cc:1049
SwigPyPacked_str
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
Definition: sat_python_wrap.cc:1836
_swigt__p_unsigned_short
static swig_type_info _swigt__p_unsigned_short
Definition: sat_python_wrap.cc:4630
_wrap_SolutionCallback_NumBinaryPropagations
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3717
Swig::Director::swig_acquire_ownership_obj
void swig_acquire_ownership_obj(void *vptr, int own) const
Definition: sat_python_wrap.cc:3061
SWIG_AttributeError
#define SWIG_AttributeError
Definition: sat_python_wrap.cc:768
SwigPyClientData_New
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
Definition: sat_python_wrap.cc:1336
_wrap_delete_SatHelper
SWIGINTERN PyObject * _wrap_delete_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4538
swig_varlink_type
SWIGINTERN PyTypeObject * swig_varlink_type(void)
Definition: sat_python_wrap.cc:5038
SWIG_AsVal_double
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
Definition: sat_python_wrap.cc:3337
operations_research
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
Definition: dense_doubly_linked_list.h:21
SwigPyObject_format
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
Definition: sat_python_wrap.cc:1425
swig_varlinkobject
Definition: knapsack_solver_python_wrap.cc:3832
SWIG_Python_InitShadowInstance
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
Definition: sat_python_wrap.cc:2333
SWIG_fail
#define SWIG_fail
Definition: sat_python_wrap.cc:1130
SWIG_Python_CheckImplicit
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
Definition: sat_python_wrap.cc:1318
_swigt__p_unsigned_long
static swig_type_info _swigt__p_unsigned_long
Definition: sat_python_wrap.cc:4629
Swig::GCItem_var
Definition: constraint_solver_python_wrap.cc:2807
SWIG_Python_str_FromChar
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
Definition: sat_python_wrap.cc:842
Swig::GCItem::get_own
virtual int get_own() const
Definition: sat_python_wrap.cc:2803
SWIG_TypeError
#define SWIG_TypeError
Definition: sat_python_wrap.cc:762
SWIGRUNTIME
#define SWIGRUNTIME
Definition: sat_python_wrap.cc:213
_wrap_SolutionCallback_NumBranches
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3663
SWIGTYPE_p_operations_research__sat__SolutionCallback
#define SWIGTYPE_p_operations_research__sat__SolutionCallback
Definition: sat_python_wrap.cc:3107
swig::SwigPtr_PyObject::~SwigPtr_PyObject
~SwigPtr_PyObject()
Definition: sat_python_wrap.cc:3185
SwigPyObject_repr2
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
Definition: sat_python_wrap.cc:1480
SWIG_From_double
#define SWIG_From_double
Definition: sat_python_wrap.cc:3323
SWIG_AddCast
#define SWIG_AddCast(r)
Definition: sat_python_wrap.cc:354
swig_module_info::cast_initial
swig_cast_info ** cast_initial
Definition: knapsack_solver_python_wrap.cc:392
SWIG_PyStaticMethod_New
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
Definition: sat_python_wrap.cc:5262
malloc
void * malloc(YYSIZE_T)
_swigt__p_unsigned_char
static swig_type_info _swigt__p_unsigned_char
Definition: sat_python_wrap.cc:4627
_wrap_SatHelper_VariableDomain
SWIGINTERN PyObject * _wrap_SatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4491
SWIG_globals
SWIGINTERN PyObject * SWIG_globals(void)
Definition: sat_python_wrap.cc:5130
HandleResult< void >
void HandleResult< void >(PyObject *pyresult)
Definition: sat_python_wrap.cc:3288
swig_varlink_str
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
Definition: sat_python_wrap.cc:4955
int64
int64_t int64
Definition: integral_types.h:34
SWIG_CheckState
#define SWIG_CheckState(r)
Definition: sat_python_wrap.cc:355
swig_module_info::type_initial
swig_type_info ** type_initial
Definition: knapsack_solver_python_wrap.cc:391
SWIG_PYTHON_THREAD_END_ALLOW
#define SWIG_PYTHON_THREAD_END_ALLOW
Definition: sat_python_wrap.cc:1009
SWIG_Python_RaiseOrModifyTypeError
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
Definition: sat_python_wrap.cc:951
_swigc__p_unsigned_int
static swig_cast_info _swigc__p_unsigned_int[]
Definition: sat_python_wrap.cc:4658
operations_research::Domain
We call domain any subset of Int64 = [kint64min, kint64max].
Definition: sorted_interval_list.h:81
sat_python_wrap.h
SwigPyClientData::delargs
int delargs
Definition: knapsack_solver_python_wrap.cc:1310
SWIG_BUFFER_SIZE
#define SWIG_BUFFER_SIZE
Definition: sat_python_wrap.cc:222
SharedPyPtr::SharedPyPtr
SharedPyPtr(PyObject *obj)
Definition: sat_python_wrap.cc:3251
SWIG_Python_ConvertFunctionPtr
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
Definition: sat_python_wrap.cc:2207
SWIG_Python_MustGetPtr
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
Definition: sat_python_wrap.cc:2595
SWIG_TypeCast
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
Definition: sat_python_wrap.cc:502
SWIG_IndexError
#define SWIG_IndexError
Definition: sat_python_wrap.cc:761
SWIG_TypeCheckStruct
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
Definition: sat_python_wrap.cc:475
Swig::GCItem
Definition: constraint_solver_python_wrap.cc:2799
swig_cast_info
Definition: knapsack_solver_python_wrap.cc:377
swig_globalvar::name
char * name
Definition: knapsack_solver_python_wrap.cc:3826
SWIG_SetErrorMsg
#define SWIG_SetErrorMsg
Definition: sat_python_wrap.cc:1127
SWIG_Python_str_AsChar
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
Definition: sat_python_wrap.cc:811
SWIG_Python_CheckNoKeywords
SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name)
Definition: sat_python_wrap.cc:1253
swig_cast_info::prev
struct swig_cast_info * prev
Definition: knapsack_solver_python_wrap.cc:381
swig_const_info
struct swig_const_info swig_const_info
Swig::GCItem_Object::~GCItem_Object
virtual ~GCItem_Object()
Definition: sat_python_wrap.cc:2835
SWIG_DivisionByZero
#define SWIG_DivisionByZero
Definition: sat_python_wrap.cc:763
SWIG_TypeClientData
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
Definition: sat_python_wrap.cc:554
SWIG_PYTHON_THREAD_END_BLOCK
#define SWIG_PYTHON_THREAD_END_BLOCK
Definition: sat_python_wrap.cc:1007
SWIG_as_voidptr
#define SWIG_as_voidptr(a)
Definition: sat_python_wrap.cc:3142
SWIG_POINTER_IMPLICIT_CONV
#define SWIG_POINTER_IMPLICIT_CONV
Definition: sat_python_wrap.cc:1286
swig_const_info::ptype
swig_type_info ** ptype
Definition: knapsack_solver_python_wrap.cc:1057
Swig::DirectorException::DirectorException
DirectorException(const char *msg)
Definition: constraint_solver_csharp_wrap.cc:358
SWIG_UnpackDataName
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
Definition: sat_python_wrap.cc:741
InvokePythonCallableReturning
static ReturnT InvokePythonCallableReturning(PyObject *pyfunc, const char *format, Args... args)
Definition: sat_python_wrap.cc:3300
Swig::GCItem::~GCItem
virtual ~GCItem()
Definition: sat_python_wrap.cc:2801
SwigPyObject_compare
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
Definition: sat_python_wrap.cc:1486
SWIG_ValueError
#define SWIG_ValueError
Definition: sat_python_wrap.cc:766
SwigPyPacked_repr
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
Definition: sat_python_wrap.cc:1825
_swigt__p_operations_research__Domain
static swig_type_info _swigt__p_operations_research__Domain
Definition: sat_python_wrap.cc:4621
SWIG_SyntaxError
#define SWIG_SyntaxError
Definition: sat_python_wrap.cc:765
Swig::DirectorException::raise
static void raise(JNIEnv *jenv, jthrowable throwable)
Definition: constraint_solver_java_wrap.cc:701
SWIG_From_bool
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
Definition: sat_python_wrap.cc:3478
swig_const_info
Definition: knapsack_solver_python_wrap.cc:1051
SWIG_newvarlink
#define SWIG_newvarlink()
Definition: sat_python_wrap.cc:4925
SwigPyObject_long
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
Definition: sat_python_wrap.cc:1419
SWIG_TypeEquiv
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
Definition: sat_python_wrap.cc:440
SWIG_PYTHON_THREAD_BEGIN_BLOCK
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
Definition: sat_python_wrap.cc:1006
SwigPyObject::next
PyObject * next
Definition: knapsack_solver_python_wrap.cc:1393
SwigPyPacked::size
size_t size
Definition: knapsack_solver_python_wrap.cc:1819
swig::SwigPtr_PyObject::SwigPtr_PyObject
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
Definition: sat_python_wrap.cc:3166
SWIG_PackData
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
Definition: sat_python_wrap.cc:658
_swigc__p_long
static swig_cast_info _swigc__p_long[]
Definition: sat_python_wrap.cc:4650
Swig::GCArray_T
Definition: constraint_solver_python_wrap.cc:2859
SWIG_UnpackVoidPtr
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
Definition: sat_python_wrap.cc:713
SWIG_Python_AppendOutput
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
Definition: sat_python_wrap.cc:1186
SwigPyObject::own
int own
Definition: knapsack_solver_python_wrap.cc:1392
SatHelper_swigregister
SWIGINTERN PyObject * SatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4564
Swig_This_global
static PyObject * Swig_This_global
Definition: sat_python_wrap.cc:2003
SWIG_Python_ConvertPacked
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
Definition: sat_python_wrap.cc:2236
sat_parameters.pb.h
SwigPyClientData_Del
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
Definition: sat_python_wrap.cc:1382
SWIG_InternalNewPointerObj
#define SWIG_InternalNewPointerObj(ptr, type, flags)
Definition: sat_python_wrap.cc:1097
SWIG_POINTER_OWN
#define SWIG_POINTER_OWN
Definition: sat_python_wrap.cc:231
swig_const_info::pvalue
void * pvalue
Definition: knapsack_solver_python_wrap.cc:1056
_swigt__p_int
static swig_type_info _swigt__p_int
Definition: sat_python_wrap.cc:4619
Swig::GCItem_Object::get_own
int get_own() const
Definition: sat_python_wrap.cc:2838
SWIGEXPORT
#define SWIGEXPORT
Definition: sat_python_wrap.cc:130
SWIG_Python_ArgFail
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
Definition: sat_python_wrap.cc:2535
SatHelper_swiginit
SWIGINTERN PyObject * SatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4571
SwigPyObject::ty
swig_type_info * ty
Definition: knapsack_solver_python_wrap.cc:1391
_swigt__p_long
static swig_type_info _swigt__p_long
Definition: sat_python_wrap.cc:4620
Swig::DirectorTypeMismatchException::DirectorTypeMismatchException
DirectorTypeMismatchException(PyObject *error, const char *msg="")
Definition: sat_python_wrap.cc:2913
SwigDirector_SolutionCallback::~SwigDirector_SolutionCallback
virtual ~SwigDirector_SolutionCallback()
Definition: sat_csharp_wrap.cc:410
SWIG_AsVal_int
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
Definition: sat_python_wrap.cc:3462
SWIG_Python_GetSwigThis
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
Definition: sat_python_wrap.cc:2021
SWIG_InstallConstants
#define SWIG_InstallConstants(d, constants)
Definition: sat_python_wrap.cc:4927
free
void free(void *)
Swig::Director::swig_get_self
jobject swig_get_self(JNIEnv *jenv) const
Definition: constraint_solver_java_wrap.cc:523
Swig::GCItem_T::GCItem_T
GCItem_T(Type *ptr)
Definition: sat_python_wrap.cc:2848
Swig::Director
Definition: constraint_solver_csharp_wrap.cc:349
swig_const_info::name
const char * name
Definition: knapsack_solver_python_wrap.cc:1053
SwigPyObject_disown
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
Definition: sat_python_wrap.cc:1621
SWIG_PY_BINARY
#define SWIG_PY_BINARY
Definition: sat_python_wrap.cc:1050
Swig::Director::Director
Director(PyObject *self)
Definition: sat_python_wrap.cc:3000
SWIG_This
SWIGRUNTIME PyObject * SWIG_This(void)
Definition: sat_python_wrap.cc:2006
SWIG_MangledTypeQuery
#define SWIG_MangledTypeQuery(name)
Definition: sat_python_wrap.cc:3117
swig_converter_func
void *(* swig_converter_func)(void *, int *)
Definition: sat_python_wrap.cc:365
_swigt__p_short
static swig_type_info _swigt__p_short
Definition: sat_python_wrap.cc:4625
SWIG_Python_ConvertPtrAndOwn
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
Definition: sat_python_wrap.cc:2102
SWIG_TypeQueryModule
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
Definition: sat_python_wrap.cc:629
SWIG_ArgError
#define SWIG_ArgError(r)
Definition: sat_python_wrap.cc:316
operations_research::sat::IntegerVariableProto
SolutionCallback_swiginit
SWIGINTERN PyObject * SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4118
SWIG_init
#define SWIG_init
Definition: sat_python_wrap.cc:3133
_wrap_SolutionCallback_StopSearch
SWIGINTERN PyObject * _wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3947
swig::SwigVar_PyObject
Definition: knapsack_solver_python_wrap.cc:2797
swig_module_info::types
swig_type_info ** types
Definition: knapsack_solver_python_wrap.cc:388
_swigc__p_operations_research__sat__IntegerVariableProto
static swig_cast_info _swigc__p_operations_research__sat__IntegerVariableProto[]
Definition: sat_python_wrap.cc:4652
SwigPyObject_New
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
Definition: sat_python_wrap.cc:1801
Swig::DirectorPureVirtualException::DirectorPureVirtualException
DirectorPureVirtualException(const char *msg="")
Definition: sat_python_wrap.cc:2945
swig_type_info::name
const char * name
Definition: knapsack_solver_python_wrap.cc:368
_swigc__p_unsigned_short
static swig_cast_info _swigc__p_unsigned_short[]
Definition: sat_python_wrap.cc:4660
_wrap_SatHelper_SolverResponseStats
SWIGINTERN PyObject * _wrap_SatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4411
SwigPyObject_richcompare
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
Definition: sat_python_wrap.cc:1495
swig_varlinkobject
struct swig_varlinkobject swig_varlinkobject
basictypes.h
SWIG_TypeName
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
Definition: sat_python_wrap.cc:524
swig_varlink_dealloc
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
Definition: sat_python_wrap.cc:4993
SWIG_FromCharPtrAndSize
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
Definition: sat_python_wrap.cc:3498
_swigc__p_operations_research__Domain
static swig_cast_info _swigc__p_operations_research__Domain[]
Definition: sat_python_wrap.cc:4651
SWIG_Python_DestroyModule
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
Definition: sat_python_wrap.cc:2437
_wrap_SatHelper_SolveWithParameters
SWIGINTERN PyObject * _wrap_SatHelper_SolveWithParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4188
Swig::DirectorException
Definition: constraint_solver_csharp_wrap.cc:353
Swig::GCItem_T
Definition: constraint_solver_python_wrap.cc:2846
SWIG_Python_SetSwigThis
SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
Definition: sat_python_wrap.cc:2315
SWIG_Py_Void
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
Definition: sat_python_wrap.cc:1298
swig_type_info::dcast
swig_dycast_func dcast
Definition: knapsack_solver_python_wrap.cc:370
SWIG_NullReferenceError
#define SWIG_NullReferenceError
Definition: sat_python_wrap.cc:770
SwigPyObject_append
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
Definition: sat_python_wrap.cc:1596
Swig::Director::swig_get_self
PyObject * swig_get_self() const
Definition: sat_python_wrap.cc:3009
Swig::Director::swig_acquire_ownership_array
void swig_acquire_ownership_array(Type *vptr) const
Definition: sat_python_wrap.cc:3046
_swigt__p_unsigned_int
static swig_type_info _swigt__p_unsigned_int
Definition: sat_python_wrap.cc:4628
SWIG_POINTER_NEW
#define SWIG_POINTER_NEW
Definition: sat_python_wrap.cc:1284
_swigc__p_signed_char
static swig_cast_info _swigc__p_signed_char[]
Definition: sat_python_wrap.cc:4656
swig_module_info::clientdata
void * clientdata
Definition: knapsack_solver_python_wrap.cc:393
_wrap_SatHelper_Solve
SWIGINTERN PyObject * _wrap_SatHelper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4122
swig
Definition: knapsack_solver_python_wrap.cc:2740
Py_TYPE
#define Py_TYPE(op)
Definition: sat_python_wrap.cc:795
SWIG_MangledTypeQueryModule
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
Definition: sat_python_wrap.cc:584
SWIG_IOError
#define SWIG_IOError
Definition: sat_python_wrap.cc:759
SWIG_PackVoidPtr
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
Definition: sat_python_wrap.cc:702
swig_type_info
struct swig_type_info swig_type_info
_swigt__p_operations_research__sat__SatHelper
static swig_type_info _swigt__p_operations_research__sat__SatHelper
Definition: sat_python_wrap.cc:4623
Swig::Director::swig_disown
void swig_disown() const
Definition: sat_python_wrap.cc:3014
Swig::DirectorException::DirectorException
DirectorException(PyObject *error, const char *hdr="", const char *msg="")
Definition: sat_python_wrap.cc:2877
Swig::DirectorException::getMessage
const char * getMessage() const
Definition: sat_python_wrap.cc:2893
swig_type_info::owndata
int owndata
Definition: knapsack_solver_python_wrap.cc:373
Swig::Director::swig_get_inner
virtual bool swig_get_inner(const char *) const
Definition: sat_python_wrap.cc:3029
SwigPyPacked_compare
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
Definition: sat_python_wrap.cc:1847
SWIGTYPE_p_operations_research__Domain
#define SWIGTYPE_p_operations_research__Domain
Definition: sat_python_wrap.cc:3104
SwigPyObject_type
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
Definition: sat_python_wrap.cc:1522
Swig::GCItem_var::GCItem_var
GCItem_var(GCItem *item=0)
Definition: sat_python_wrap.cc:2809
SWIG_Python_UnpackTuple
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
Definition: sat_python_wrap.cc:1207
SWIG_SystemError
#define SWIG_SystemError
Definition: sat_python_wrap.cc:767
_wrap_SatHelper_ModelStats
SWIGINTERN PyObject * _wrap_SatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4371
SWIG_Python_InstallConstants
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
Definition: sat_python_wrap.cc:5144
_wrap_SolutionCallback_OnSolutionCallback
SWIGINTERN PyObject * _wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3602
_wrap_new_SatHelper
SWIGINTERN PyObject * _wrap_new_SatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4521
swig::SwigPtr_PyObject::SwigPtr_PyObject
SwigPtr_PyObject(const SwigPtr_PyObject &item)
Definition: sat_python_wrap.cc:3159
Swig::GCArray_T::~GCArray_T
virtual ~GCArray_T()
Definition: sat_python_wrap.cc:2864
swig::SwigPtr_PyObject::SwigPtr_PyObject
SwigPtr_PyObject()
Definition: sat_python_wrap.cc:3155
SWIG_STATIC_POINTER
#define SWIG_STATIC_POINTER(var)
Definition: sat_python_wrap.cc:1275
SWIG_ERROR
#define SWIG_ERROR
Definition: sat_python_wrap.cc:314
swig::SwigPtr_PyObject::_obj
PyObject * _obj
Definition: knapsack_solver_python_wrap.cc:2743
Swig::Guard::~Guard
~Guard()
Definition: sat_python_wrap.cc:2972
_swigt__p_signed_char
static swig_type_info _swigt__p_signed_char
Definition: sat_python_wrap.cc:4626
Swig::Director::~Director
virtual ~Director()
Definition: sat_python_wrap.cc:3004
SWIG_AsVal_long
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
Definition: sat_python_wrap.cc:3419
_wrap_SolutionCallback_ObjectiveValue
SWIGINTERN PyObject * _wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3825
Swig::Director::swig_release_ownership
int swig_release_ownership(void *vptr) const
Definition: sat_python_wrap.cc:3068
_wrap_SolutionCallback_SolutionBooleanValue
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3913
SWIG_RUNTIME_VERSION
#define SWIG_RUNTIME_VERSION
Definition: sat_python_wrap.cc:192
Swig::Guard::Guard
Guard(PyThread_type_lock &mutex)
Definition: sat_python_wrap.cc:2968
SWIGINTERN
#define SWIGINTERN
Definition: sat_python_wrap.cc:102
swig_type_info::str
const char * str
Definition: knapsack_solver_python_wrap.cc:369
operations_research::sat::SatParameters
SwigPyClientData::implicitconv
int implicitconv
Definition: knapsack_solver_python_wrap.cc:1311
SwigPyObject_TypeOnce
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
Definition: sat_python_wrap.cc:1668
swig_const_info::type
int type
Definition: knapsack_solver_python_wrap.cc:1052
Swig::GCItem_var::operator=
GCItem_var & operator=(GCItem *item)
Definition: sat_python_wrap.cc:2812
SwigPyPacked
Definition: knapsack_solver_python_wrap.cc:1815
Swig::Director::swig_incref
void swig_incref() const
Definition: constraint_solver_python_wrap.cc:3021
Swig::Director::swig_acquire_ownership
void swig_acquire_ownership(Type *vptr) const
Definition: sat_python_wrap.cc:3054
SWIGPY_CAPSULE_NAME
#define SWIGPY_CAPSULE_NAME
Definition: sat_python_wrap.cc:858
SWIG_InitializeModule
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
Definition: sat_python_wrap.cc:4741
SWIGINTERNINLINE
#define SWIGINTERNINLINE
Definition: sat_python_wrap.cc:107
SwigPyObject_acquire
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
Definition: sat_python_wrap.cc:1629
Swig::DirectorException::~DirectorException
virtual ~DirectorException()
Definition: sat_python_wrap.cc:2889
SWIG_IsOK
#define SWIG_IsOK(r)
Definition: sat_python_wrap.cc:315
PyObject_DEL
#define PyObject_DEL
Definition: sat_python_wrap.cc:852
SWIG_UnpackData
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
Definition: sat_python_wrap.cc:674
swig_globalvar::get_attr
PyObject *(* get_attr)(void)
Definition: knapsack_solver_python_wrap.cc:3827
SwigPyClientData::destroy
PyObject * destroy
Definition: knapsack_solver_python_wrap.cc:1309
SWIG_PropagateClientData
SWIGRUNTIME void SWIG_PropagateClientData(void)
Definition: sat_python_wrap.cc:4888
SWIG_SetModule
#define SWIG_SetModule(clientdata, pointer)
Definition: sat_python_wrap.cc:1123
SWIG_Python_AddErrMesg
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
Definition: sat_python_wrap.cc:2507
SWIG_Python_NewShadowInstance
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
Definition: sat_python_wrap.cc:2259
SwigPyObject_GetDesc
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
Definition: sat_python_wrap.cc:2548
swig::SwigPtr_PyObject
Definition: knapsack_solver_python_wrap.cc:2741
SwigPyPacked_Check
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
Definition: sat_python_wrap.cc:1864
swig_dycast_func
struct swig_type_info *(* swig_dycast_func)(void **)
Definition: sat_python_wrap.cc:366
_swigc__p_short
static swig_cast_info _swigc__p_short[]
Definition: sat_python_wrap.cc:4655
SWIG_OverflowError
#define SWIG_OverflowError
Definition: sat_python_wrap.cc:764
Swig::DirectorMethodException::DirectorMethodException
DirectorMethodException(const char *msg="")
Definition: sat_python_wrap.cc:2933
swig_type_initial
static swig_type_info * swig_type_initial[]
Definition: sat_python_wrap.cc:4632
swig_globalvar::set_attr
int(* set_attr)(PyObject *)
Definition: knapsack_solver_python_wrap.cc:3828
swig_types
static swig_type_info * swig_types[14]
Definition: sat_python_wrap.cc:3114
SWIG_PYTHON_THREAD_BEGIN_ALLOW
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
Definition: sat_python_wrap.cc:1008
operations_research::sat::Solve
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
Definition: cp_model_solver.cc:3150
SwigPyPacked::ty
swig_type_info * ty
Definition: knapsack_solver_python_wrap.cc:1818
SWIG_Python_AcquirePtr
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
Definition: sat_python_wrap.cc:2087
SharedPyPtr::SharedPyPtr
SharedPyPtr(const SharedPyPtr &other)
Definition: sat_python_wrap.cc:3252
Swig::DirectorException::what
const char * what() const
Definition: constraint_solver_csharp_wrap.cc:367
_wrap_SolutionCallback_BestObjectiveBound
SWIGINTERN PyObject * _wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3852
SwigPyObject
Definition: knapsack_solver_python_wrap.cc:1388
swig_varlink_getattr
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
Definition: sat_python_wrap.cc:5004
Swig::Director::swig_pyobj_disown
static PyObject * swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
Definition: sat_python_wrap.cc:3082
_wrap_delete_SolutionCallback
SWIGINTERN PyObject * _wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3576
SwigPyPacked_New
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
Definition: sat_python_wrap.cc:1968
SwigPyPacked_type
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
Definition: sat_python_wrap.cc:1858
SWIG_Python_str_FromFormat
#define SWIG_Python_str_FromFormat
Definition: sat_python_wrap.cc:803
Swig::GCItem_var::~GCItem_var
~GCItem_var()
Definition: sat_python_wrap.cc:2819
next
Block * next
Definition: constraint_solver.cc:667
SWIG_POINTER_NO_NULL
#define SWIG_POINTER_NO_NULL
Definition: sat_python_wrap.cc:228
SWIG_Python_ErrorType
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
Definition: sat_python_wrap.cc:871
SwigPyObject_own
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
Definition: sat_python_wrap.cc:1637
SwigPyPacked_TypeOnce
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
Definition: sat_python_wrap.cc:1880
SWIG_Python_ExceptionType
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
Definition: sat_python_wrap.cc:1328
Swig::GCItem_var::operator->
GCItem * operator->() const
Definition: sat_python_wrap.cc:2823
_wrap_SolutionCallback_NumIntegerPropagations
SWIGINTERN PyObject * _wrap_SolutionCallback_NumIntegerPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3744
SWIG_CanCastAsInteger
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
Definition: sat_python_wrap.cc:3389
swig_varlinkobject::vars
PyObject_HEAD swig_globalvar * vars
Definition: knapsack_solver_python_wrap.cc:3834
_swigt__p_operations_research__sat__SolutionCallback
static swig_type_info _swigt__p_operations_research__sat__SolutionCallback
Definition: sat_python_wrap.cc:4624
SWIG_POINTER_DISOWN
#define SWIG_POINTER_DISOWN
Definition: sat_python_wrap.cc:226
SolutionCallback_swigregister
SWIGINTERN PyObject * SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4111
SWIG_Python_SetConstant
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
Definition: sat_python_wrap.cc:1176
Swig::GCItem_Object
Definition: constraint_solver_python_wrap.cc:2830
SharedPyPtr::~SharedPyPtr
~SharedPyPtr()
Definition: sat_python_wrap.cc:3254
SWIG_MemoryError
#define SWIG_MemoryError
Definition: sat_python_wrap.cc:769
_wrap_disown_SolutionCallback
SWIGINTERN PyObject * _wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:4081
SWIG_AddNewMask
#define SWIG_AddNewMask(r)
Definition: sat_python_wrap.cc:330
swig_globalvar
struct swig_globalvar swig_globalvar
SwigPyClientData
Definition: knapsack_solver_python_wrap.cc:1305
SWIG_TypeNameComp
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
Definition: sat_python_wrap.cc:406
SwigMethods_proxydocs
static PyMethodDef SwigMethods_proxydocs[]
Definition: sat_python_wrap.cc:4611
swig_module_info
struct swig_module_info swig_module_info
SWIG_NewPackedObj
#define SWIG_NewPackedObj(ptr, sz, type)
Definition: sat_python_wrap.cc:1105
Swig::Guard
Definition: sat_python_wrap.cc:2964
SWIG_name
#define SWIG_name
Definition: sat_python_wrap.cc:3136
_swigc__p_unsigned_long
static swig_cast_info _swigc__p_unsigned_long[]
Definition: sat_python_wrap.cc:4659
SWIG_Python_NewPackedObj
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
Definition: sat_python_wrap.cc:2406
SWIG_PYTHON_INITIALIZE_THREADS
#define SWIG_PYTHON_INITIALIZE_THREADS
Definition: sat_python_wrap.cc:982
swig_globalvar::next
struct swig_globalvar * next
Definition: knapsack_solver_python_wrap.cc:3829
swig_cast_info::converter
swig_converter_func converter
Definition: knapsack_solver_python_wrap.cc:379
Swig::Director::swig_set_inner
virtual void swig_set_inner(const char *, bool) const
Definition: sat_python_wrap.cc:3033
SWIG_TypeNewClientData
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
Definition: sat_python_wrap.cc:570
SWIG_GetModule
#define SWIG_GetModule(clientdata)
Definition: sat_python_wrap.cc:1122
SwigPyClientData::newargs
PyObject * newargs
Definition: knapsack_solver_python_wrap.cc:1308
swigobject_methods
static PyMethodDef swigobject_methods[]
Definition: sat_python_wrap.cc:1657
swig::SwigPtr_PyObject::operator=
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
Definition: sat_python_wrap.cc:3175
operations_research::sat::SolveWithParameters
CpSolverResponse SolveWithParameters(const CpModelProto &model_proto, const SatParameters &params)
Solves the given CpModelProto with the given parameters.
Definition: cp_model_solver.cc:3155
SharedPyPtr::get
PyObject * get() const
Definition: sat_python_wrap.cc:3256
SwigPyObject_oct
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
Definition: sat_python_wrap.cc:1447
_wrap_SolutionCallback_WallTime
SWIGINTERN PyObject * _wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3771
name
const std::string name
Definition: default_search.cc:807
swig_cast_initial
static swig_cast_info * swig_cast_initial[]
Definition: sat_python_wrap.cc:4662
_swigt__p_char
static swig_type_info _swigt__p_char
Definition: sat_python_wrap.cc:4618
Swig::DirectorTypeMismatchException::DirectorTypeMismatchException
DirectorTypeMismatchException(const char *msg="")
Definition: sat_python_wrap.cc:2917
swig_type_info
Definition: knapsack_solver_python_wrap.cc:367
Swig::DirectorMethodException::raise
static void raise(const char *msg)
Definition: constraint_solver_python_wrap.cc:2936
_swigt__p_operations_research__sat__IntegerVariableProto
static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto
Definition: sat_python_wrap.cc:4622
SwigPyObject_dealloc
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
Definition: sat_python_wrap.cc:1545
SWIGUNUSEDPARM
#define SWIGUNUSEDPARM(p)
Definition: sat_python_wrap.cc:96
SwigPyPacked_dealloc
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
Definition: sat_python_wrap.cc:1870
_wrap_SolutionCallback_SolutionIntegerValue
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
Definition: sat_python_wrap.cc:3879
SwigPyObject_hex
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
Definition: sat_python_wrap.cc:1453
SWIG_Python_ConvertPtr
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
Definition: sat_python_wrap.cc:1087
operations_research::sat::CpModelProto
SWIG_DIRECTOR_CAST
#define SWIG_DIRECTOR_CAST(ARG)
Definition: sat_python_wrap.cc:2788
SWIG_Python_SetModule
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
Definition: sat_python_wrap.cc:2454
SwigPyObject::ptr
PyObject_HEAD void * ptr
Definition: knapsack_solver_python_wrap.cc:1390
_swigc__p_operations_research__sat__SolutionCallback
static swig_cast_info _swigc__p_operations_research__sat__SolutionCallback[]
Definition: sat_python_wrap.cc:4654
swig_type_info::cast
struct swig_cast_info * cast
Definition: knapsack_solver_python_wrap.cc:371