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