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