OR-Tools  9.2
linear_solver_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*/
583 swig_module_info *end,
584 const char *name) {
585 swig_module_info *iter = start;
586 do {
587 if (iter->size) {
588 size_t l = 0;
589 size_t r = iter->size - 1;
590 do {
591 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
592 size_t i = (l + r) >> 1;
593 const char *iname = iter->types[i]->name;
594 if (iname) {
595 int compare = strcmp(name, iname);
596 if (compare == 0) {
597 return iter->types[i];
598 } else if (compare < 0) {
599 if (i) {
600 r = i - 1;
601 } else {
602 break;
603 }
604 } else if (compare > 0) {
605 l = i + 1;
606 }
607 } else {
608 break; /* should never happen */
609 }
610 } while (l <= r);
611 }
612 iter = iter->next;
613 } while (iter != end);
614 return 0;
615}
616
617/*
618 Search for a swig_type_info structure for either a mangled name or a human readable name.
619 It first searches the mangled names of the types, which is a O(log #types)
620 If a type is not found it then searches the human readable names, which is O(#types).
621
622 We start searching at module start, and finish searching when start == end.
623 Note: if start == end at the beginning of the function, we go all the way around
624 the circular list.
625*/
628 swig_module_info *end,
629 const char *name) {
630 /* STEP 1: Search the name field using binary search */
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_char swig_types[0]
2696#define SWIGTYPE_p_int swig_types[1]
2697#define SWIGTYPE_p_long swig_types[2]
2698#define SWIGTYPE_p_operations_research__MPConstraint swig_types[3]
2699#define SWIGTYPE_p_operations_research__MPModelExportOptions swig_types[4]
2700#define SWIGTYPE_p_operations_research__MPModelRequest swig_types[5]
2701#define SWIGTYPE_p_operations_research__MPObjective swig_types[6]
2702#define SWIGTYPE_p_operations_research__MPSolver swig_types[7]
2703#define SWIGTYPE_p_operations_research__MPSolverParameters swig_types[8]
2704#define SWIGTYPE_p_operations_research__MPVariable swig_types[9]
2705#define SWIGTYPE_p_short swig_types[10]
2706#define SWIGTYPE_p_signed_char swig_types[11]
2707#define SWIGTYPE_p_std__atomicT_bool_t swig_types[12]
2708#define SWIGTYPE_p_std__ostream swig_types[13]
2709#define SWIGTYPE_p_unsigned_char swig_types[14]
2710#define SWIGTYPE_p_unsigned_int swig_types[15]
2711#define SWIGTYPE_p_unsigned_long swig_types[16]
2712#define SWIGTYPE_p_unsigned_short swig_types[17]
2714static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
2715#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2716#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2717
2718/* -------- TYPES TABLE (END) -------- */
2719
2720#ifdef SWIG_TypeQuery
2721# undef SWIG_TypeQuery
2722#endif
2723#define SWIG_TypeQuery SWIG_Python_TypeQuery
2724
2725/*-----------------------------------------------
2726 @(target):= _pywraplp.so
2727 ------------------------------------------------*/
2728#if PY_VERSION_HEX >= 0x03000000
2729# define SWIG_init PyInit__pywraplp
2730
2731#else
2732# define SWIG_init init_pywraplp
2733
2734#endif
2735#define SWIG_name "_pywraplp"
2736
2737#define SWIGVERSION 0x040002
2738#define SWIG_VERSION SWIGVERSION
2739
2740
2741#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2742#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2743
2744
2745#include <stdexcept>
2746
2747
2748namespace swig {
2749 class SwigPtr_PyObject {
2750 protected:
2751 PyObject *_obj;
2752
2753 public:
2755 {
2756 }
2757
2759 {
2761 Py_XINCREF(_obj);
2763 }
2764
2765 SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
2766 {
2767 if (initial_ref) {
2769 Py_XINCREF(_obj);
2771 }
2772 }
2773
2775 {
2777 Py_XINCREF(item._obj);
2778 Py_XDECREF(_obj);
2779 _obj = item._obj;
2781 return *this;
2782 }
2783
2785 {
2787 Py_XDECREF(_obj);
2789 }
2790
2791 operator PyObject *() const
2792 {
2793 return _obj;
2794 }
2795
2796 PyObject *operator->() const
2797 {
2798 return _obj;
2799 }
2800 };
2801}
2802
2803
2804namespace swig {
2805 struct SwigVar_PyObject : SwigPtr_PyObject {
2806 SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
2807
2809 {
2810 Py_XDECREF(_obj);
2811 _obj = obj;
2812 return *this;
2813 }
2814 };
2815}
2816
2817
2818#include <cstdint>
2819#include <string>
2820#include <vector>
2821
2823
2824
2825#include <stdint.h> // Use the C99 official header
2826
2827
2828#define SWIGWORDSIZE64
2829#ifndef LONG_MAX
2830#include <limits.h>
2831#endif
2832#if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
2833# error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
2834#endif
2835
2836
2837#include <string>
2838
2839
2840#include "ortools/base/python-swig.h"
2841
2842
2845#include "ortools/linear_solver/model_exporter_swig_helper.h"
2847
2848
2849template<>
2851 return SWIG_ConvertPtr(py_obj, reinterpret_cast<void**>(b),
2854}
2855
2856
2860 0 | 0);
2861}
2862
2863bool CanConvertToMPConstraint(PyObject *py_obj) {
2865 return PyObjAs(py_obj, &tmp);
2866}
2867
2868
2869template<>
2870bool PyObjAs(PyObject *py_obj, operations_research::MPVariable** b) {
2871 return SWIG_ConvertPtr(py_obj, reinterpret_cast<void**>(b),
2874}
2875
2876
2880 0 | 0);
2881}
2882
2883bool CanConvertToMPVariable(PyObject *py_obj) {
2885 return PyObjAs(py_obj, &tmp);
2886}
2887
2888
2889SWIGINTERNINLINE PyObject*
2891{
2892 return PyInt_FromLong((long) value);
2893}
2894
2895
2898{
2899 static int init = 0;
2900 static swig_type_info* info = 0;
2901 if (!init) {
2902 info = SWIG_TypeQuery("_p_char");
2903 init = 1;
2904 }
2905 return info;
2906}
2907
2908
2909SWIGINTERN int
2910SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2911{
2912#if PY_VERSION_HEX>=0x03000000
2913#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2914 if (PyBytes_Check(obj))
2915#else
2916 if (PyUnicode_Check(obj))
2917#endif
2918#else
2919 if (PyString_Check(obj))
2920#endif
2921 {
2922 char *cstr; Py_ssize_t len;
2923 int ret = SWIG_OK;
2924#if PY_VERSION_HEX>=0x03000000
2925#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2926 if (!alloc && cptr) {
2927 /* We can't allow converting without allocation, since the internal
2928 representation of string in Python 3 is UCS-2/UCS-4 but we require
2929 a UTF-8 representation.
2930 TODO(bhy) More detailed explanation */
2931 return SWIG_RuntimeError;
2932 }
2933 obj = PyUnicode_AsUTF8String(obj);
2934 if (!obj)
2935 return SWIG_TypeError;
2936 if (alloc)
2937 *alloc = SWIG_NEWOBJ;
2938#endif
2939 if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
2940 return SWIG_TypeError;
2941#else
2942 if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
2943 return SWIG_TypeError;
2944#endif
2945 if (cptr) {
2946 if (alloc) {
2947 if (*alloc == SWIG_NEWOBJ) {
2948 *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2949 *alloc = SWIG_NEWOBJ;
2950 } else {
2951 *cptr = cstr;
2952 *alloc = SWIG_OLDOBJ;
2953 }
2954 } else {
2955#if PY_VERSION_HEX>=0x03000000
2956#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2957 *cptr = PyBytes_AsString(obj);
2958#else
2959 assert(0); /* Should never reach here with Unicode strings in Python 3 */
2960#endif
2961#else
2962 *cptr = SWIG_Python_str_AsChar(obj);
2963 if (!*cptr)
2964 ret = SWIG_TypeError;
2965#endif
2966 }
2967 }
2968 if (psize) *psize = len + 1;
2969#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2970 Py_XDECREF(obj);
2971#endif
2972 return ret;
2973 } else {
2974#if defined(SWIG_PYTHON_2_UNICODE)
2975#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2976#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
2977#endif
2978#if PY_VERSION_HEX<0x03000000
2979 if (PyUnicode_Check(obj)) {
2980 char *cstr; Py_ssize_t len;
2981 if (!alloc && cptr) {
2982 return SWIG_RuntimeError;
2983 }
2984 obj = PyUnicode_AsUTF8String(obj);
2985 if (!obj)
2986 return SWIG_TypeError;
2987 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
2988 if (cptr) {
2989 if (alloc) *alloc = SWIG_NEWOBJ;
2990 *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2991 }
2992 if (psize) *psize = len + 1;
2993
2994 Py_XDECREF(obj);
2995 return SWIG_OK;
2996 } else {
2997 Py_XDECREF(obj);
2998 }
2999 }
3000#endif
3001#endif
3002
3003 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3004 if (pchar_descriptor) {
3005 void* vptr = 0;
3006 if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3007 if (cptr) *cptr = (char *) vptr;
3008 if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3009 if (alloc) *alloc = SWIG_OLDOBJ;
3010 return SWIG_OK;
3011 }
3012 }
3013 }
3014 return SWIG_TypeError;
3015}
3016
3017
3018SWIGINTERN int
3019SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
3020{
3021 char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
3022 if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
3023 if (buf) {
3024 if (val) *val = new std::string(buf, size - 1);
3025 if (alloc == SWIG_NEWOBJ) delete[] buf;
3026 return SWIG_NEWOBJ;
3027 } else {
3028 if (val) *val = 0;
3029 return SWIG_OLDOBJ;
3030 }
3031 } else {
3032 static int init = 0;
3033 static swig_type_info* descriptor = 0;
3034 if (!init) {
3035 descriptor = SWIG_TypeQuery("std::string" " *");
3036 init = 1;
3037 }
3038 if (descriptor) {
3039 std::string *vptr;
3040 int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
3041 if (SWIG_IsOK(res) && val) *val = vptr;
3042 return res;
3043 }
3044 }
3045 return SWIG_ERROR;
3046}
3047
3048
3049#include <limits.h>
3050#if !defined(SWIG_NO_LLONG_MAX)
3051# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3052# define LLONG_MAX __LONG_LONG_MAX__
3053# define LLONG_MIN (-LLONG_MAX - 1LL)
3054# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3055# endif
3056#endif
3057
3058
3059SWIGINTERN int
3060SWIG_AsVal_double (PyObject *obj, double *val)
3061{
3062 int res = SWIG_TypeError;
3063 if (PyFloat_Check(obj)) {
3064 if (val) *val = PyFloat_AsDouble(obj);
3065 return SWIG_OK;
3066#if PY_VERSION_HEX < 0x03000000
3067 } else if (PyInt_Check(obj)) {
3068 if (val) *val = (double) PyInt_AsLong(obj);
3069 return SWIG_OK;
3070#endif
3071 } else if (PyLong_Check(obj)) {
3072 double v = PyLong_AsDouble(obj);
3073 if (!PyErr_Occurred()) {
3074 if (val) *val = v;
3075 return SWIG_OK;
3076 } else {
3077 PyErr_Clear();
3078 }
3079 }
3080#ifdef SWIG_PYTHON_CAST_MODE
3081 {
3082 int dispatch = 0;
3083 double d = PyFloat_AsDouble(obj);
3084 if (!PyErr_Occurred()) {
3085 if (val) *val = d;
3086 return SWIG_AddCast(SWIG_OK);
3087 } else {
3088 PyErr_Clear();
3089 }
3090 if (!dispatch) {
3091 long v = PyLong_AsLong(obj);
3092 if (!PyErr_Occurred()) {
3093 if (val) *val = v;
3095 } else {
3096 PyErr_Clear();
3097 }
3098 }
3099 }
3100#endif
3101 return res;
3102}
3103
3104
3105#include <float.h>
3106
3107
3108#include <math.h>
3109
3110
3112SWIG_CanCastAsInteger(double *d, double min, double max) {
3113 double x = *d;
3114 if ((min <= x && x <= max)) {
3115 double fx = floor(x);
3116 double cx = ceil(x);
3117 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3118 if ((errno == EDOM) || (errno == ERANGE)) {
3119 errno = 0;
3120 } else {
3121 double summ, reps, diff;
3122 if (rd < x) {
3123 diff = x - rd;
3124 } else if (rd > x) {
3125 diff = rd - x;
3126 } else {
3127 return 1;
3128 }
3129 summ = rd + x;
3130 reps = diff/summ;
3131 if (reps < 8*DBL_EPSILON) {
3132 *d = rd;
3133 return 1;
3134 }
3135 }
3136 }
3137 return 0;
3138}
3139
3140
3141SWIGINTERN int
3142SWIG_AsVal_long (PyObject *obj, long* val)
3143{
3144#if PY_VERSION_HEX < 0x03000000
3145 if (PyInt_Check(obj)) {
3146 if (val) *val = PyInt_AsLong(obj);
3147 return SWIG_OK;
3148 } else
3149#endif
3150 if (PyLong_Check(obj)) {
3151 long v = PyLong_AsLong(obj);
3152 if (!PyErr_Occurred()) {
3153 if (val) *val = v;
3154 return SWIG_OK;
3155 } else {
3156 PyErr_Clear();
3157 return SWIG_OverflowError;
3158 }
3159 }
3160#ifdef SWIG_PYTHON_CAST_MODE
3161 {
3162 int dispatch = 0;
3163 long v = PyInt_AsLong(obj);
3164 if (!PyErr_Occurred()) {
3165 if (val) *val = v;
3166 return SWIG_AddCast(SWIG_OK);
3167 } else {
3168 PyErr_Clear();
3169 }
3170 if (!dispatch) {
3171 double d;
3172 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3173 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3174 if (val) *val = (long)(d);
3175 return res;
3176 }
3177 }
3178 }
3179#endif
3180 return SWIG_TypeError;
3181}
3182
3183
3184SWIGINTERN int
3185SWIG_AsVal_int (PyObject * obj, int *val)
3186{
3187 long v;
3188 int res = SWIG_AsVal_long (obj, &v);
3189 if (SWIG_IsOK(res)) {
3190 if ((v < INT_MIN || v > INT_MAX)) {
3191 return SWIG_OverflowError;
3192 } else {
3193 if (val) *val = static_cast< int >(v);
3194 }
3195 }
3196 return res;
3197}
3198
3199
3200SWIGINTERNINLINE PyObject*
3202{
3203 return PyBool_FromLong(value ? 1 : 0);
3204}
3205
3206
3207SWIGINTERN int
3208SWIG_AsVal_bool (PyObject *obj, bool *val)
3209{
3210 int r;
3211 if (!PyBool_Check(obj))
3212 return SWIG_ERROR;
3213 r = PyObject_IsTrue(obj);
3214 if (r == -1)
3215 return SWIG_ERROR;
3216 if (val) *val = r ? true : false;
3217 return SWIG_OK;
3218}
3219
3220
3221 #define SWIG_From_double PyFloat_FromDouble
3222
3223
3224 #define SWIG_From_long PyInt_FromLong
3225
3227 std::string error_message;
3228 self->LoadModelFromProto(input_model, &error_message);
3229 return error_message;
3230 }
3231
3232SWIGINTERNINLINE PyObject *
3233SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3234{
3235 if (carray) {
3236 if (size > INT_MAX) {
3237 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3238 return pchar_descriptor ?
3239 SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3240 } else {
3241#if PY_VERSION_HEX >= 0x03000000
3242#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3243 return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3244#else
3245 return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3246#endif
3247#else
3248 return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3249#endif
3250 }
3251 } else {
3252 return SWIG_Py_Void();
3253 }
3254}
3255
3256
3257SWIGINTERNINLINE PyObject *
3258SWIG_From_std_string (const std::string& s)
3259{
3260 return SWIG_FromCharPtrAndSize(s.data(), s.size());
3261}
3262
3264 std::string error_message;
3265 self->LoadModelFromProtoWithUniqueNamesOrDie(input_model, &error_message);
3266 return error_message;
3267 }
3269 const absl::Status status =
3270 self->LoadSolutionFromProto(response, tolerance);
3271 LOG_IF(ERROR, !status.ok()) << "LoadSolutionFromProto() failed: " << status;
3272 return status.ok();
3273 }
3276 options.obfuscate = obfuscated;
3278 self->ExportModelToProto(&model);
3279 return ExportModelAsLpFormat(model, options).value_or("");
3280 }
3283 options.obfuscate = obfuscated;
3285 self->ExportModelToProto(&model);
3286 return ExportModelAsMpsFormat(model, options).value_or("");
3287 }
3288SWIGINTERN void operations_research_MPSolver_SetHint(operations_research::MPSolver *self,std::vector< operations_research::MPVariable * > const &variables,std::vector< double > const &values){
3289 if (variables.size() != values.size()) {
3290 LOG(FATAL) << "Different number of variables and values when setting "
3291 << "hint.";
3292 }
3293 std::vector<std::pair<const operations_research::MPVariable*, double> >
3294 hint(variables.size());
3295 for (int i = 0; i < variables.size(); ++i) {
3296 hint[i] = std::make_pair(variables[i], values[i]);
3297 }
3298 self->SetHint(hint);
3299 }
3301 return self->SetNumThreads(num_theads).ok();
3302 }
3309 return self->name();
3310 }
3312 return self->name();
3313 }
3326#ifdef __cplusplus
3327extern "C" {
3328#endif
3329SWIGINTERN PyObject *_wrap_new_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3330 PyObject *resultobj = 0;
3331 std::string *arg1 = 0 ;
3333 int res1 = SWIG_OLDOBJ ;
3334 int val2 ;
3335 int ecode2 = 0 ;
3336 PyObject *swig_obj[2] ;
3337 operations_research::MPSolver *result = 0 ;
3338
3339 if (!SWIG_Python_UnpackTuple(args, "new_Solver", 2, 2, swig_obj)) SWIG_fail;
3340 {
3341 std::string *ptr = (std::string *)0;
3342 res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3343 if (!SWIG_IsOK(res1)) {
3344 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Solver" "', argument " "1"" of type '" "std::string const &""'");
3345 }
3346 if (!ptr) {
3347 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Solver" "', argument " "1"" of type '" "std::string const &""'");
3348 }
3349 arg1 = ptr;
3350 }
3351 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3352 if (!SWIG_IsOK(ecode2)) {
3353 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Solver" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3354 }
3356 result = (operations_research::MPSolver *)new operations_research::MPSolver((std::string const &)*arg1,arg2);
3358 if (SWIG_IsNewObj(res1)) delete arg1;
3359 return resultobj;
3360fail:
3361 if (SWIG_IsNewObj(res1)) delete arg1;
3362 return NULL;
3363}
3364
3365
3366SWIGINTERN PyObject *_wrap_delete_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3367 PyObject *resultobj = 0;
3369 void *argp1 = 0 ;
3370 int res1 = 0 ;
3371 PyObject *swig_obj[1] ;
3372
3373 if (!args) SWIG_fail;
3374 swig_obj[0] = args;
3376 if (!SWIG_IsOK(res1)) {
3377 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Solver" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3378 }
3379 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3380 delete arg1;
3381 resultobj = SWIG_Py_Void();
3382 return resultobj;
3383fail:
3384 return NULL;
3385}
3386
3387
3388SWIGINTERN PyObject *_wrap_Solver_CreateSolver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3389 PyObject *resultobj = 0;
3390 std::string *arg1 = 0 ;
3391 int res1 = SWIG_OLDOBJ ;
3392 PyObject *swig_obj[1] ;
3393 operations_research::MPSolver *result = 0 ;
3394
3395 if (!args) SWIG_fail;
3396 swig_obj[0] = args;
3397 {
3398 std::string *ptr = (std::string *)0;
3399 res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3400 if (!SWIG_IsOK(res1)) {
3401 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_CreateSolver" "', argument " "1"" of type '" "std::string const &""'");
3402 }
3403 if (!ptr) {
3404 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_CreateSolver" "', argument " "1"" of type '" "std::string const &""'");
3405 }
3406 arg1 = ptr;
3407 }
3408 result = (operations_research::MPSolver *)operations_research::MPSolver::CreateSolver((std::string const &)*arg1);
3410 if (SWIG_IsNewObj(res1)) delete arg1;
3411 return resultobj;
3412fail:
3413 if (SWIG_IsNewObj(res1)) delete arg1;
3414 return NULL;
3415}
3416
3417
3418SWIGINTERN PyObject *_wrap_Solver_SupportsProblemType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3419 PyObject *resultobj = 0;
3421 int val1 ;
3422 int ecode1 = 0 ;
3423 PyObject *swig_obj[1] ;
3424 bool result;
3425
3426 if (!args) SWIG_fail;
3427 swig_obj[0] = args;
3428 ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
3429 if (!SWIG_IsOK(ecode1)) {
3430 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Solver_SupportsProblemType" "', argument " "1"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3431 }
3434 resultobj = SWIG_From_bool(static_cast< bool >(result));
3435 return resultobj;
3436fail:
3437 return NULL;
3438}
3439
3440
3441SWIGINTERN PyObject *_wrap_Solver_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3442 PyObject *resultobj = 0;
3444 void *argp1 = 0 ;
3445 int res1 = 0 ;
3446 PyObject *swig_obj[1] ;
3447
3448 if (!args) SWIG_fail;
3449 swig_obj[0] = args;
3450 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3451 if (!SWIG_IsOK(res1)) {
3452 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Clear" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3453 }
3454 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3455 (arg1)->Clear();
3456 resultobj = SWIG_Py_Void();
3457 return resultobj;
3458fail:
3459 return NULL;
3460}
3461
3462
3463SWIGINTERN PyObject *_wrap_Solver_NumVariables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3464 PyObject *resultobj = 0;
3466 void *argp1 = 0 ;
3467 int res1 = 0 ;
3468 PyObject *swig_obj[1] ;
3469 int result;
3470
3471 if (!args) SWIG_fail;
3472 swig_obj[0] = args;
3473 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3474 if (!SWIG_IsOK(res1)) {
3475 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumVariables" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3476 }
3477 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3478 result = (int)((operations_research::MPSolver const *)arg1)->NumVariables();
3479 resultobj = SWIG_From_int(static_cast< int >(result));
3480 return resultobj;
3481fail:
3482 return NULL;
3483}
3484
3485
3486SWIGINTERN PyObject *_wrap_Solver_variables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3487 PyObject *resultobj = 0;
3489 void *argp1 = 0 ;
3490 int res1 = 0 ;
3491 PyObject *swig_obj[1] ;
3492 std::vector< operations_research::MPVariable * > *result = 0 ;
3493
3494 if (!args) SWIG_fail;
3495 swig_obj[0] = args;
3496 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3497 if (!SWIG_IsOK(res1)) {
3498 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_variables" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3499 }
3500 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3501 result = (std::vector< operations_research::MPVariable * > *) &((operations_research::MPSolver const *)arg1)->variables();
3502 {
3503 resultobj = vector_output_helper(result, &FromObjectMPVariable);
3504 }
3505 return resultobj;
3506fail:
3507 return NULL;
3508}
3509
3510
3511SWIGINTERN PyObject *_wrap_Solver_variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3512 PyObject *resultobj = 0;
3514 int arg2 ;
3515 void *argp1 = 0 ;
3516 int res1 = 0 ;
3517 int val2 ;
3518 int ecode2 = 0 ;
3519 PyObject *swig_obj[2] ;
3521
3522 if (!SWIG_Python_UnpackTuple(args, "Solver_variable", 2, 2, swig_obj)) SWIG_fail;
3523 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3524 if (!SWIG_IsOK(res1)) {
3525 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_variable" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3526 }
3527 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3528 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3529 if (!SWIG_IsOK(ecode2)) {
3530 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_variable" "', argument " "2"" of type '" "int""'");
3531 }
3532 arg2 = static_cast< int >(val2);
3533 result = (operations_research::MPVariable *)((operations_research::MPSolver const *)arg1)->variable(arg2);
3535 return resultobj;
3536fail:
3537 return NULL;
3538}
3539
3540
3541SWIGINTERN PyObject *_wrap_Solver_LookupVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3542 PyObject *resultobj = 0;
3544 std::string *arg2 = 0 ;
3545 void *argp1 = 0 ;
3546 int res1 = 0 ;
3547 int res2 = SWIG_OLDOBJ ;
3548 PyObject *swig_obj[2] ;
3550
3551 if (!SWIG_Python_UnpackTuple(args, "Solver_LookupVariable", 2, 2, swig_obj)) SWIG_fail;
3552 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3553 if (!SWIG_IsOK(res1)) {
3554 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LookupVariable" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3555 }
3556 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3557 {
3558 std::string *ptr = (std::string *)0;
3559 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3560 if (!SWIG_IsOK(res2)) {
3561 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_LookupVariable" "', argument " "2"" of type '" "std::string const &""'");
3562 }
3563 if (!ptr) {
3564 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_LookupVariable" "', argument " "2"" of type '" "std::string const &""'");
3565 }
3566 arg2 = ptr;
3567 }
3568 result = (operations_research::MPVariable *)((operations_research::MPSolver const *)arg1)->LookupVariableOrNull((std::string const &)*arg2);
3570 if (SWIG_IsNewObj(res2)) delete arg2;
3571 return resultobj;
3572fail:
3573 if (SWIG_IsNewObj(res2)) delete arg2;
3574 return NULL;
3575}
3576
3577
3578SWIGINTERN PyObject *_wrap_Solver_Var(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3579 PyObject *resultobj = 0;
3581 double arg2 ;
3582 double arg3 ;
3583 bool arg4 ;
3584 std::string *arg5 = 0 ;
3585 void *argp1 = 0 ;
3586 int res1 = 0 ;
3587 double val2 ;
3588 int ecode2 = 0 ;
3589 double val3 ;
3590 int ecode3 = 0 ;
3591 bool val4 ;
3592 int ecode4 = 0 ;
3593 int res5 = SWIG_OLDOBJ ;
3594 PyObject *swig_obj[5] ;
3596
3597 if (!SWIG_Python_UnpackTuple(args, "Solver_Var", 5, 5, swig_obj)) SWIG_fail;
3598 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3599 if (!SWIG_IsOK(res1)) {
3600 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Var" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3601 }
3602 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3603 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3604 if (!SWIG_IsOK(ecode2)) {
3605 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Var" "', argument " "2"" of type '" "double""'");
3606 }
3607 arg2 = static_cast< double >(val2);
3608 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3609 if (!SWIG_IsOK(ecode3)) {
3610 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Var" "', argument " "3"" of type '" "double""'");
3611 }
3612 arg3 = static_cast< double >(val3);
3613 ecode4 = SWIG_AsVal_bool(swig_obj[3], &val4);
3614 if (!SWIG_IsOK(ecode4)) {
3615 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Solver_Var" "', argument " "4"" of type '" "bool""'");
3616 }
3617 arg4 = static_cast< bool >(val4);
3618 {
3619 std::string *ptr = (std::string *)0;
3620 res5 = SWIG_AsPtr_std_string(swig_obj[4], &ptr);
3621 if (!SWIG_IsOK(res5)) {
3622 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Solver_Var" "', argument " "5"" of type '" "std::string const &""'");
3623 }
3624 if (!ptr) {
3625 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Var" "', argument " "5"" of type '" "std::string const &""'");
3626 }
3627 arg5 = ptr;
3628 }
3629 result = (operations_research::MPVariable *)(arg1)->MakeVar(arg2,arg3,arg4,(std::string const &)*arg5);
3631 if (SWIG_IsNewObj(res5)) delete arg5;
3632 return resultobj;
3633fail:
3634 if (SWIG_IsNewObj(res5)) delete arg5;
3635 return NULL;
3636}
3637
3638
3639SWIGINTERN PyObject *_wrap_Solver_NumVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3640 PyObject *resultobj = 0;
3642 double arg2 ;
3643 double arg3 ;
3644 std::string *arg4 = 0 ;
3645 void *argp1 = 0 ;
3646 int res1 = 0 ;
3647 double val2 ;
3648 int ecode2 = 0 ;
3649 double val3 ;
3650 int ecode3 = 0 ;
3651 int res4 = SWIG_OLDOBJ ;
3652 PyObject *swig_obj[4] ;
3654
3655 if (!SWIG_Python_UnpackTuple(args, "Solver_NumVar", 4, 4, swig_obj)) SWIG_fail;
3656 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3657 if (!SWIG_IsOK(res1)) {
3658 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3659 }
3660 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3661 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3662 if (!SWIG_IsOK(ecode2)) {
3663 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_NumVar" "', argument " "2"" of type '" "double""'");
3664 }
3665 arg2 = static_cast< double >(val2);
3666 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3667 if (!SWIG_IsOK(ecode3)) {
3668 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_NumVar" "', argument " "3"" of type '" "double""'");
3669 }
3670 arg3 = static_cast< double >(val3);
3671 {
3672 std::string *ptr = (std::string *)0;
3673 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
3674 if (!SWIG_IsOK(res4)) {
3675 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_NumVar" "', argument " "4"" of type '" "std::string const &""'");
3676 }
3677 if (!ptr) {
3678 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_NumVar" "', argument " "4"" of type '" "std::string const &""'");
3679 }
3680 arg4 = ptr;
3681 }
3682 result = (operations_research::MPVariable *)(arg1)->MakeNumVar(arg2,arg3,(std::string const &)*arg4);
3684 if (SWIG_IsNewObj(res4)) delete arg4;
3685 return resultobj;
3686fail:
3687 if (SWIG_IsNewObj(res4)) delete arg4;
3688 return NULL;
3689}
3690
3691
3692SWIGINTERN PyObject *_wrap_Solver_IntVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3693 PyObject *resultobj = 0;
3695 double arg2 ;
3696 double arg3 ;
3697 std::string *arg4 = 0 ;
3698 void *argp1 = 0 ;
3699 int res1 = 0 ;
3700 double val2 ;
3701 int ecode2 = 0 ;
3702 double val3 ;
3703 int ecode3 = 0 ;
3704 int res4 = SWIG_OLDOBJ ;
3705 PyObject *swig_obj[4] ;
3707
3708 if (!SWIG_Python_UnpackTuple(args, "Solver_IntVar", 4, 4, swig_obj)) SWIG_fail;
3709 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3710 if (!SWIG_IsOK(res1)) {
3711 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_IntVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3712 }
3713 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3714 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3715 if (!SWIG_IsOK(ecode2)) {
3716 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_IntVar" "', argument " "2"" of type '" "double""'");
3717 }
3718 arg2 = static_cast< double >(val2);
3719 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3720 if (!SWIG_IsOK(ecode3)) {
3721 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_IntVar" "', argument " "3"" of type '" "double""'");
3722 }
3723 arg3 = static_cast< double >(val3);
3724 {
3725 std::string *ptr = (std::string *)0;
3726 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
3727 if (!SWIG_IsOK(res4)) {
3728 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_IntVar" "', argument " "4"" of type '" "std::string const &""'");
3729 }
3730 if (!ptr) {
3731 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_IntVar" "', argument " "4"" of type '" "std::string const &""'");
3732 }
3733 arg4 = ptr;
3734 }
3735 result = (operations_research::MPVariable *)(arg1)->MakeIntVar(arg2,arg3,(std::string const &)*arg4);
3737 if (SWIG_IsNewObj(res4)) delete arg4;
3738 return resultobj;
3739fail:
3740 if (SWIG_IsNewObj(res4)) delete arg4;
3741 return NULL;
3742}
3743
3744
3745SWIGINTERN PyObject *_wrap_Solver_BoolVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3746 PyObject *resultobj = 0;
3748 std::string *arg2 = 0 ;
3749 void *argp1 = 0 ;
3750 int res1 = 0 ;
3751 int res2 = SWIG_OLDOBJ ;
3752 PyObject *swig_obj[2] ;
3754
3755 if (!SWIG_Python_UnpackTuple(args, "Solver_BoolVar", 2, 2, swig_obj)) SWIG_fail;
3756 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3757 if (!SWIG_IsOK(res1)) {
3758 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_BoolVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3759 }
3760 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3761 {
3762 std::string *ptr = (std::string *)0;
3763 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3764 if (!SWIG_IsOK(res2)) {
3765 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_BoolVar" "', argument " "2"" of type '" "std::string const &""'");
3766 }
3767 if (!ptr) {
3768 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_BoolVar" "', argument " "2"" of type '" "std::string const &""'");
3769 }
3770 arg2 = ptr;
3771 }
3772 result = (operations_research::MPVariable *)(arg1)->MakeBoolVar((std::string const &)*arg2);
3774 if (SWIG_IsNewObj(res2)) delete arg2;
3775 return resultobj;
3776fail:
3777 if (SWIG_IsNewObj(res2)) delete arg2;
3778 return NULL;
3779}
3780
3781
3782SWIGINTERN PyObject *_wrap_Solver_NumConstraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3783 PyObject *resultobj = 0;
3785 void *argp1 = 0 ;
3786 int res1 = 0 ;
3787 PyObject *swig_obj[1] ;
3788 int result;
3789
3790 if (!args) SWIG_fail;
3791 swig_obj[0] = args;
3792 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3793 if (!SWIG_IsOK(res1)) {
3794 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumConstraints" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3795 }
3796 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3797 result = (int)((operations_research::MPSolver const *)arg1)->NumConstraints();
3798 resultobj = SWIG_From_int(static_cast< int >(result));
3799 return resultobj;
3800fail:
3801 return NULL;
3802}
3803
3804
3805SWIGINTERN PyObject *_wrap_Solver_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3806 PyObject *resultobj = 0;
3808 void *argp1 = 0 ;
3809 int res1 = 0 ;
3810 PyObject *swig_obj[1] ;
3811 std::vector< operations_research::MPConstraint * > *result = 0 ;
3812
3813 if (!args) SWIG_fail;
3814 swig_obj[0] = args;
3815 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3816 if (!SWIG_IsOK(res1)) {
3817 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_constraints" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3818 }
3819 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3820 result = (std::vector< operations_research::MPConstraint * > *) &((operations_research::MPSolver const *)arg1)->constraints();
3821 {
3822 resultobj = vector_output_helper(result, &FromObjectMPConstraint);
3823 }
3824 return resultobj;
3825fail:
3826 return NULL;
3827}
3828
3829
3830SWIGINTERN PyObject *_wrap_Solver_constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3831 PyObject *resultobj = 0;
3833 int arg2 ;
3834 void *argp1 = 0 ;
3835 int res1 = 0 ;
3836 int val2 ;
3837 int ecode2 = 0 ;
3838 PyObject *swig_obj[2] ;
3840
3841 if (!SWIG_Python_UnpackTuple(args, "Solver_constraint", 2, 2, swig_obj)) SWIG_fail;
3842 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3843 if (!SWIG_IsOK(res1)) {
3844 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_constraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3845 }
3846 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3847 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3848 if (!SWIG_IsOK(ecode2)) {
3849 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_constraint" "', argument " "2"" of type '" "int""'");
3850 }
3851 arg2 = static_cast< int >(val2);
3852 result = (operations_research::MPConstraint *)((operations_research::MPSolver const *)arg1)->constraint(arg2);
3854 return resultobj;
3855fail:
3856 return NULL;
3857}
3858
3859
3860SWIGINTERN PyObject *_wrap_Solver_LookupConstraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3861 PyObject *resultobj = 0;
3863 std::string *arg2 = 0 ;
3864 void *argp1 = 0 ;
3865 int res1 = 0 ;
3866 int res2 = SWIG_OLDOBJ ;
3867 PyObject *swig_obj[2] ;
3869
3870 if (!SWIG_Python_UnpackTuple(args, "Solver_LookupConstraint", 2, 2, swig_obj)) SWIG_fail;
3871 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3872 if (!SWIG_IsOK(res1)) {
3873 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LookupConstraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3874 }
3875 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3876 {
3877 std::string *ptr = (std::string *)0;
3878 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3879 if (!SWIG_IsOK(res2)) {
3880 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_LookupConstraint" "', argument " "2"" of type '" "std::string const &""'");
3881 }
3882 if (!ptr) {
3883 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_LookupConstraint" "', argument " "2"" of type '" "std::string const &""'");
3884 }
3885 arg2 = ptr;
3886 }
3887 result = (operations_research::MPConstraint *)((operations_research::MPSolver const *)arg1)->LookupConstraintOrNull((std::string const &)*arg2);
3889 if (SWIG_IsNewObj(res2)) delete arg2;
3890 return resultobj;
3891fail:
3892 if (SWIG_IsNewObj(res2)) delete arg2;
3893 return NULL;
3894}
3895
3896
3897SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
3898 PyObject *resultobj = 0;
3900 double arg2 ;
3901 double arg3 ;
3902 void *argp1 = 0 ;
3903 int res1 = 0 ;
3904 double val2 ;
3905 int ecode2 = 0 ;
3906 double val3 ;
3907 int ecode3 = 0 ;
3909
3910 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
3911 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3912 if (!SWIG_IsOK(res1)) {
3913 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3914 }
3915 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3916 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3917 if (!SWIG_IsOK(ecode2)) {
3918 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "double""'");
3919 }
3920 arg2 = static_cast< double >(val2);
3921 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3922 if (!SWIG_IsOK(ecode3)) {
3923 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Constraint" "', argument " "3"" of type '" "double""'");
3924 }
3925 arg3 = static_cast< double >(val3);
3926 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint(arg2,arg3);
3928 return resultobj;
3929fail:
3930 return NULL;
3931}
3932
3933
3934SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
3935 PyObject *resultobj = 0;
3937 void *argp1 = 0 ;
3938 int res1 = 0 ;
3940
3941 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
3942 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3943 if (!SWIG_IsOK(res1)) {
3944 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3945 }
3946 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3947 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint();
3949 return resultobj;
3950fail:
3951 return NULL;
3952}
3953
3954
3955SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
3956 PyObject *resultobj = 0;
3958 double arg2 ;
3959 double arg3 ;
3960 std::string *arg4 = 0 ;
3961 void *argp1 = 0 ;
3962 int res1 = 0 ;
3963 double val2 ;
3964 int ecode2 = 0 ;
3965 double val3 ;
3966 int ecode3 = 0 ;
3967 int res4 = SWIG_OLDOBJ ;
3969
3970 if ((nobjs < 4) || (nobjs > 4)) SWIG_fail;
3971 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3972 if (!SWIG_IsOK(res1)) {
3973 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3974 }
3975 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3976 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3977 if (!SWIG_IsOK(ecode2)) {
3978 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "double""'");
3979 }
3980 arg2 = static_cast< double >(val2);
3981 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3982 if (!SWIG_IsOK(ecode3)) {
3983 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Constraint" "', argument " "3"" of type '" "double""'");
3984 }
3985 arg3 = static_cast< double >(val3);
3986 {
3987 std::string *ptr = (std::string *)0;
3988 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
3989 if (!SWIG_IsOK(res4)) {
3990 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_Constraint" "', argument " "4"" of type '" "std::string const &""'");
3991 }
3992 if (!ptr) {
3993 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Constraint" "', argument " "4"" of type '" "std::string const &""'");
3994 }
3995 arg4 = ptr;
3996 }
3997 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint(arg2,arg3,(std::string const &)*arg4);
3999 if (SWIG_IsNewObj(res4)) delete arg4;
4000 return resultobj;
4001fail:
4002 if (SWIG_IsNewObj(res4)) delete arg4;
4003 return NULL;
4004}
4005
4006
4007SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4008 PyObject *resultobj = 0;
4010 std::string *arg2 = 0 ;
4011 void *argp1 = 0 ;
4012 int res1 = 0 ;
4013 int res2 = SWIG_OLDOBJ ;
4015
4016 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4017 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4018 if (!SWIG_IsOK(res1)) {
4019 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4020 }
4021 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4022 {
4023 std::string *ptr = (std::string *)0;
4024 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4025 if (!SWIG_IsOK(res2)) {
4026 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "std::string const &""'");
4027 }
4028 if (!ptr) {
4029 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Constraint" "', argument " "2"" of type '" "std::string const &""'");
4030 }
4031 arg2 = ptr;
4032 }
4033 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint((std::string const &)*arg2);
4035 if (SWIG_IsNewObj(res2)) delete arg2;
4036 return resultobj;
4037fail:
4038 if (SWIG_IsNewObj(res2)) delete arg2;
4039 return NULL;
4040}
4041
4042
4043SWIGINTERN PyObject *_wrap_Solver_Constraint(PyObject *self, PyObject *args) {
4044 Py_ssize_t argc;
4045 PyObject *argv[5] = {
4046 0
4047 };
4048
4049 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_Constraint", 0, 4, argv))) SWIG_fail;
4050 --argc;
4051 if (argc == 1) {
4052 int _v;
4053 void *vptr = 0;
4054 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4055 _v = SWIG_CheckState(res);
4056 if (_v) {
4057 return _wrap_Solver_Constraint__SWIG_1(self, argc, argv);
4058 }
4059 }
4060 if (argc == 2) {
4061 int _v;
4062 void *vptr = 0;
4063 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4064 _v = SWIG_CheckState(res);
4065 if (_v) {
4066 int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
4067 _v = SWIG_CheckState(res);
4068 if (_v) {
4069 return _wrap_Solver_Constraint__SWIG_3(self, argc, argv);
4070 }
4071 }
4072 }
4073 if (argc == 3) {
4074 int _v;
4075 void *vptr = 0;
4076 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4077 _v = SWIG_CheckState(res);
4078 if (_v) {
4079 {
4080 int res = SWIG_AsVal_double(argv[1], NULL);
4081 _v = SWIG_CheckState(res);
4082 }
4083 if (_v) {
4084 {
4085 int res = SWIG_AsVal_double(argv[2], NULL);
4086 _v = SWIG_CheckState(res);
4087 }
4088 if (_v) {
4089 return _wrap_Solver_Constraint__SWIG_0(self, argc, argv);
4090 }
4091 }
4092 }
4093 }
4094 if (argc == 4) {
4095 int _v;
4096 void *vptr = 0;
4097 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4098 _v = SWIG_CheckState(res);
4099 if (_v) {
4100 {
4101 int res = SWIG_AsVal_double(argv[1], NULL);
4102 _v = SWIG_CheckState(res);
4103 }
4104 if (_v) {
4105 {
4106 int res = SWIG_AsVal_double(argv[2], NULL);
4107 _v = SWIG_CheckState(res);
4108 }
4109 if (_v) {
4110 int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
4111 _v = SWIG_CheckState(res);
4112 if (_v) {
4113 return _wrap_Solver_Constraint__SWIG_2(self, argc, argv);
4114 }
4115 }
4116 }
4117 }
4118 }
4119
4120fail:
4121 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_Constraint'.\n"
4122 " Possible C/C++ prototypes are:\n"
4123 " operations_research::MPSolver::MakeRowConstraint(double,double)\n"
4124 " operations_research::MPSolver::MakeRowConstraint()\n"
4125 " operations_research::MPSolver::MakeRowConstraint(double,double,std::string const &)\n"
4126 " operations_research::MPSolver::MakeRowConstraint(std::string const &)\n");
4127 return 0;
4128}
4129
4130
4131SWIGINTERN PyObject *_wrap_Solver_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4132 PyObject *resultobj = 0;
4134 void *argp1 = 0 ;
4135 int res1 = 0 ;
4136 PyObject *swig_obj[1] ;
4138
4139 if (!args) SWIG_fail;
4140 swig_obj[0] = args;
4141 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4142 if (!SWIG_IsOK(res1)) {
4143 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Objective" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4144 }
4145 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4146 result = (operations_research::MPObjective *)(arg1)->MutableObjective();
4148 return resultobj;
4149fail:
4150 return NULL;
4151}
4152
4153
4154SWIGINTERN PyObject *_wrap_Solver_Solve__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4155 PyObject *resultobj = 0;
4157 void *argp1 = 0 ;
4158 int res1 = 0 ;
4160
4161 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
4162 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4163 if (!SWIG_IsOK(res1)) {
4164 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Solve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4165 }
4166 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4168 resultobj = SWIG_From_int(static_cast< int >(result));
4169 return resultobj;
4170fail:
4171 return NULL;
4172}
4173
4174
4175SWIGINTERN PyObject *_wrap_Solver_Solve__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4176 PyObject *resultobj = 0;
4179 void *argp1 = 0 ;
4180 int res1 = 0 ;
4181 void *argp2 = 0 ;
4182 int res2 = 0 ;
4184
4185 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4186 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4187 if (!SWIG_IsOK(res1)) {
4188 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Solve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4189 }
4190 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4191 res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0);
4192 if (!SWIG_IsOK(res2)) {
4193 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4194 }
4195 if (!argp2) {
4196 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4197 }
4198 arg2 = reinterpret_cast< operations_research::MPSolverParameters * >(argp2);
4200 resultobj = SWIG_From_int(static_cast< int >(result));
4201 return resultobj;
4202fail:
4203 return NULL;
4204}
4205
4206
4207SWIGINTERN PyObject *_wrap_Solver_Solve(PyObject *self, PyObject *args) {
4208 Py_ssize_t argc;
4209 PyObject *argv[3] = {
4210 0
4211 };
4212
4213 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_Solve", 0, 2, argv))) SWIG_fail;
4214 --argc;
4215 if (argc == 1) {
4216 int _v;
4217 void *vptr = 0;
4218 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4219 _v = SWIG_CheckState(res);
4220 if (_v) {
4221 return _wrap_Solver_Solve__SWIG_0(self, argc, argv);
4222 }
4223 }
4224 if (argc == 2) {
4225 int _v;
4226 void *vptr = 0;
4227 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4228 _v = SWIG_CheckState(res);
4229 if (_v) {
4231 _v = SWIG_CheckState(res);
4232 if (_v) {
4233 return _wrap_Solver_Solve__SWIG_1(self, argc, argv);
4234 }
4235 }
4236 }
4237
4238fail:
4239 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_Solve'.\n"
4240 " Possible C/C++ prototypes are:\n"
4241 " operations_research::MPSolver::Solve()\n"
4242 " operations_research::MPSolver::Solve(operations_research::MPSolverParameters const &)\n");
4243 return 0;
4244}
4245
4246
4247SWIGINTERN PyObject *_wrap_Solver_ComputeConstraintActivities(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4248 PyObject *resultobj = 0;
4250 void *argp1 = 0 ;
4251 int res1 = 0 ;
4252 PyObject *swig_obj[1] ;
4253 std::vector< double > result;
4254
4255 if (!args) SWIG_fail;
4256 swig_obj[0] = args;
4257 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4258 if (!SWIG_IsOK(res1)) {
4259 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ComputeConstraintActivities" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4260 }
4261 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4263 {
4264 resultobj = vector_output_helper(&result, &PyFloat_FromDouble);
4265 }
4266 return resultobj;
4267fail:
4268 return NULL;
4269}
4270
4271
4272SWIGINTERN PyObject *_wrap_Solver_VerifySolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4273 PyObject *resultobj = 0;
4275 double arg2 ;
4276 bool arg3 ;
4277 void *argp1 = 0 ;
4278 int res1 = 0 ;
4279 double val2 ;
4280 int ecode2 = 0 ;
4281 bool val3 ;
4282 int ecode3 = 0 ;
4283 PyObject *swig_obj[3] ;
4284 bool result;
4285
4286 if (!SWIG_Python_UnpackTuple(args, "Solver_VerifySolution", 3, 3, swig_obj)) SWIG_fail;
4287 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4288 if (!SWIG_IsOK(res1)) {
4289 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_VerifySolution" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4290 }
4291 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4292 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
4293 if (!SWIG_IsOK(ecode2)) {
4294 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_VerifySolution" "', argument " "2"" of type '" "double""'");
4295 }
4296 arg2 = static_cast< double >(val2);
4297 ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
4298 if (!SWIG_IsOK(ecode3)) {
4299 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_VerifySolution" "', argument " "3"" of type '" "bool""'");
4300 }
4301 arg3 = static_cast< bool >(val3);
4302 result = (bool)((operations_research::MPSolver const *)arg1)->VerifySolution(arg2,arg3);
4303 resultobj = SWIG_From_bool(static_cast< bool >(result));
4304 return resultobj;
4305fail:
4306 return NULL;
4307}
4308
4309
4310SWIGINTERN PyObject *_wrap_Solver_InterruptSolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4311 PyObject *resultobj = 0;
4313 void *argp1 = 0 ;
4314 int res1 = 0 ;
4315 PyObject *swig_obj[1] ;
4316 bool result;
4317
4318 if (!args) SWIG_fail;
4319 swig_obj[0] = args;
4320 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4321 if (!SWIG_IsOK(res1)) {
4322 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_InterruptSolve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4323 }
4324 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4325 result = (bool)(arg1)->InterruptSolve();
4326 resultobj = SWIG_From_bool(static_cast< bool >(result));
4327 return resultobj;
4328fail:
4329 return NULL;
4330}
4331
4332
4333SWIGINTERN PyObject *_wrap_Solver_FillSolutionResponseProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4334 PyObject *resultobj = 0;
4337 void *argp1 = 0 ;
4338 int res1 = 0 ;
4339 PyObject *swig_obj[2] ;
4340
4341 if (!SWIG_Python_UnpackTuple(args, "Solver_FillSolutionResponseProto", 2, 2, swig_obj)) SWIG_fail;
4342 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4343 if (!SWIG_IsOK(res1)) {
4344 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_FillSolutionResponseProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4345 }
4346 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4347 {
4349 PyObject* const pyresult = PyObject_CallMethod(
4350 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4351 if (pyresult != nullptr) {
4352 char* buffer = nullptr;
4353 Py_ssize_t length = 0;
4354 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4355 if (buffer != nullptr) {
4356 arg2->ParseFromArray(buffer, length);
4357 }
4358 Py_DECREF(pyresult);
4359 }
4360 }
4361 ((operations_research::MPSolver const *)arg1)->FillSolutionResponseProto(arg2);
4362 resultobj = SWIG_Py_Void();
4363 {
4364 std::string encoded_protobuf;
4365 arg2->SerializeToString(&encoded_protobuf);
4366
4367 PyObject* const python_encoded_protobuf =
4368 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4369 encoded_protobuf.size());
4370
4371
4372
4373
4374
4375 if (python_encoded_protobuf != nullptr) {
4376 PyObject* const result = PyObject_CallMethod(
4377 swig_obj[1], const_cast<char*>("ParseFromString"),
4378 const_cast<char*>("(O)"), python_encoded_protobuf);
4379 Py_DECREF(python_encoded_protobuf);
4380 if (result != nullptr) {
4381 Py_DECREF(result);
4382 }
4383 }
4384 }
4385 {
4386 delete arg2;
4387 }
4388 return resultobj;
4389fail:
4390 {
4391 delete arg2;
4392 }
4393 return NULL;
4394}
4395
4396
4397SWIGINTERN PyObject *_wrap_Solver_SolveWithProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4398 PyObject *resultobj = 0;
4401 std::atomic< bool > *arg3 = (std::atomic< bool > *) 0 ;
4402 void *argp1 = 0 ;
4403 int res1 = 0 ;
4404 void *argp3 = 0 ;
4405 int res3 = 0 ;
4406
4407 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
4408 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_operations_research__MPModelRequest, 0 | 0);
4409 if (!SWIG_IsOK(res1)) {
4410 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SolveWithProto" "', argument " "1"" of type '" "operations_research::MPModelRequest const &""'");
4411 }
4412 if (!argp1) {
4413 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_SolveWithProto" "', argument " "1"" of type '" "operations_research::MPModelRequest const &""'");
4414 }
4415 arg1 = reinterpret_cast< operations_research::MPModelRequest * >(argp1);
4416 {
4418 PyObject* const pyresult = PyObject_CallMethod(
4419 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4420 if (pyresult != nullptr) {
4421 char* buffer = nullptr;
4422 Py_ssize_t length = 0;
4423 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4424 if (buffer != nullptr) {
4425 arg2->ParseFromArray(buffer, length);
4426 }
4427 Py_DECREF(pyresult);
4428 }
4429 }
4430 res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_std__atomicT_bool_t, 0 | 0 );
4431 if (!SWIG_IsOK(res3)) {
4432 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Solver_SolveWithProto" "', argument " "3"" of type '" "std::atomic< bool > *""'");
4433 }
4434 arg3 = reinterpret_cast< std::atomic< bool > * >(argp3);
4436 resultobj = SWIG_Py_Void();
4437 {
4438 std::string encoded_protobuf;
4439 arg2->SerializeToString(&encoded_protobuf);
4440
4441 PyObject* const python_encoded_protobuf =
4442 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4443 encoded_protobuf.size());
4444
4445
4446
4447
4448
4449 if (python_encoded_protobuf != nullptr) {
4450 PyObject* const result = PyObject_CallMethod(
4451 swig_obj[1], const_cast<char*>("ParseFromString"),
4452 const_cast<char*>("(O)"), python_encoded_protobuf);
4453 Py_DECREF(python_encoded_protobuf);
4454 if (result != nullptr) {
4455 Py_DECREF(result);
4456 }
4457 }
4458 }
4459 {
4460 delete arg2;
4461 }
4462 return resultobj;
4463fail:
4464 {
4465 delete arg2;
4466 }
4467 return NULL;
4468}
4469
4470
4471SWIGINTERN PyObject *_wrap_Solver_SolveWithProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4472 PyObject *resultobj = 0;
4475 void *argp1 = 0 ;
4476 int res1 = 0 ;
4477
4478 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4479 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_operations_research__MPModelRequest, 0 | 0);
4480 if (!SWIG_IsOK(res1)) {
4481 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SolveWithProto" "', argument " "1"" of type '" "operations_research::MPModelRequest const &""'");
4482 }
4483 if (!argp1) {
4484 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_SolveWithProto" "', argument " "1"" of type '" "operations_research::MPModelRequest const &""'");
4485 }
4486 arg1 = reinterpret_cast< operations_research::MPModelRequest * >(argp1);
4487 {
4489 PyObject* const pyresult = PyObject_CallMethod(
4490 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4491 if (pyresult != nullptr) {
4492 char* buffer = nullptr;
4493 Py_ssize_t length = 0;
4494 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4495 if (buffer != nullptr) {
4496 arg2->ParseFromArray(buffer, length);
4497 }
4498 Py_DECREF(pyresult);
4499 }
4500 }
4502 resultobj = SWIG_Py_Void();
4503 {
4504 std::string encoded_protobuf;
4505 arg2->SerializeToString(&encoded_protobuf);
4506
4507 PyObject* const python_encoded_protobuf =
4508 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4509 encoded_protobuf.size());
4510
4511
4512
4513
4514
4515 if (python_encoded_protobuf != nullptr) {
4516 PyObject* const result = PyObject_CallMethod(
4517 swig_obj[1], const_cast<char*>("ParseFromString"),
4518 const_cast<char*>("(O)"), python_encoded_protobuf);
4519 Py_DECREF(python_encoded_protobuf);
4520 if (result != nullptr) {
4521 Py_DECREF(result);
4522 }
4523 }
4524 }
4525 {
4526 delete arg2;
4527 }
4528 return resultobj;
4529fail:
4530 {
4531 delete arg2;
4532 }
4533 return NULL;
4534}
4535
4536
4537SWIGINTERN PyObject *_wrap_Solver_SolveWithProto(PyObject *self, PyObject *args) {
4538 Py_ssize_t argc;
4539 PyObject *argv[4] = {
4540 0
4541 };
4542
4543 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_SolveWithProto", 0, 3, argv))) SWIG_fail;
4544 --argc;
4545 if (argc == 2) {
4546 int _v;
4548 _v = SWIG_CheckState(res);
4549 if (_v) {
4550 {
4551 bool ok = false;
4552 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4553 if (module != nullptr) {
4554 PyObject* const dict = PyModule_GetDict(module);
4555 if (dict != nullptr) {
4556 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
4557 if (clss != nullptr) {
4558 if (PyObject_IsInstance(argv[1], clss)) {
4559 ok = true;
4560 }
4561 }
4562 }
4563 Py_DECREF(module);
4564 }
4565 _v = ok ? 1 : 0;
4566 }
4567 if (_v) {
4568 return _wrap_Solver_SolveWithProto__SWIG_1(self, argc, argv);
4569 }
4570 }
4571 }
4572 if (argc == 3) {
4573 int _v;
4575 _v = SWIG_CheckState(res);
4576 if (_v) {
4577 {
4578 bool ok = false;
4579 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4580 if (module != nullptr) {
4581 PyObject* const dict = PyModule_GetDict(module);
4582 if (dict != nullptr) {
4583 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
4584 if (clss != nullptr) {
4585 if (PyObject_IsInstance(argv[1], clss)) {
4586 ok = true;
4587 }
4588 }
4589 }
4590 Py_DECREF(module);
4591 }
4592 _v = ok ? 1 : 0;
4593 }
4594 if (_v) {
4595 void *vptr = 0;
4596 int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__atomicT_bool_t, 0);
4597 _v = SWIG_CheckState(res);
4598 if (_v) {
4599 return _wrap_Solver_SolveWithProto__SWIG_0(self, argc, argv);
4600 }
4601 }
4602 }
4603 }
4604
4605fail:
4606 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_SolveWithProto'.\n"
4607 " Possible C/C++ prototypes are:\n"
4608 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *,std::atomic< bool > *)\n"
4609 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *)\n");
4610 return 0;
4611}
4612
4613
4614SWIGINTERN PyObject *_wrap_Solver_ExportModelToProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4615 PyObject *resultobj = 0;
4618 void *argp1 = 0 ;
4619 int res1 = 0 ;
4620 PyObject *swig_obj[2] ;
4621
4622 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelToProto", 2, 2, swig_obj)) SWIG_fail;
4623 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4624 if (!SWIG_IsOK(res1)) {
4625 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelToProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4626 }
4627 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4628 {
4630 PyObject* const pyresult = PyObject_CallMethod(
4631 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4632 if (pyresult != nullptr) {
4633 char* buffer = nullptr;
4634 Py_ssize_t length = 0;
4635 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4636 if (buffer != nullptr) {
4637 arg2->ParseFromArray(buffer, length);
4638 }
4639 Py_DECREF(pyresult);
4640 }
4641 }
4642 ((operations_research::MPSolver const *)arg1)->ExportModelToProto(arg2);
4643 resultobj = SWIG_Py_Void();
4644 {
4645 std::string encoded_protobuf;
4646 arg2->SerializeToString(&encoded_protobuf);
4647
4648 PyObject* const python_encoded_protobuf =
4649 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4650 encoded_protobuf.size());
4651
4652
4653
4654
4655
4656 if (python_encoded_protobuf != nullptr) {
4657 PyObject* const result = PyObject_CallMethod(
4658 swig_obj[1], const_cast<char*>("ParseFromString"),
4659 const_cast<char*>("(O)"), python_encoded_protobuf);
4660 Py_DECREF(python_encoded_protobuf);
4661 if (result != nullptr) {
4662 Py_DECREF(result);
4663 }
4664 }
4665 }
4666 {
4667 delete arg2;
4668 }
4669 return resultobj;
4670fail:
4671 {
4672 delete arg2;
4673 }
4674 return NULL;
4675}
4676
4677
4679 PyObject *resultobj = 0;
4681 std::string *arg2 = 0 ;
4682 void *argp1 = 0 ;
4683 int res1 = 0 ;
4684 int res2 = SWIG_OLDOBJ ;
4685 PyObject *swig_obj[2] ;
4686 bool result;
4687
4688 if (!SWIG_Python_UnpackTuple(args, "Solver_SetSolverSpecificParametersAsString", 2, 2, swig_obj)) SWIG_fail;
4689 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4690 if (!SWIG_IsOK(res1)) {
4691 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4692 }
4693 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4694 {
4695 std::string *ptr = (std::string *)0;
4696 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4697 if (!SWIG_IsOK(res2)) {
4698 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4699 }
4700 if (!ptr) {
4701 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4702 }
4703 arg2 = ptr;
4704 }
4705 result = (bool)(arg1)->SetSolverSpecificParametersAsString((std::string const &)*arg2);
4706 resultobj = SWIG_From_bool(static_cast< bool >(result));
4707 if (SWIG_IsNewObj(res2)) delete arg2;
4708 return resultobj;
4709fail:
4710 if (SWIG_IsNewObj(res2)) delete arg2;
4711 return NULL;
4712}
4713
4714
4715SWIGINTERN PyObject *_wrap_Solver_infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4716 PyObject *resultobj = 0;
4717 double result;
4718
4719 if (!SWIG_Python_UnpackTuple(args, "Solver_infinity", 0, 0, 0)) SWIG_fail;
4720 result = (double)operations_research::MPSolver::infinity();
4721 resultobj = SWIG_From_double(static_cast< double >(result));
4722 return resultobj;
4723fail:
4724 return NULL;
4725}
4726
4727
4728SWIGINTERN PyObject *_wrap_Solver_EnableOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4729 PyObject *resultobj = 0;
4731 void *argp1 = 0 ;
4732 int res1 = 0 ;
4733 PyObject *swig_obj[1] ;
4734
4735 if (!args) SWIG_fail;
4736 swig_obj[0] = args;
4737 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4738 if (!SWIG_IsOK(res1)) {
4739 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_EnableOutput" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4740 }
4741 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4742 (arg1)->EnableOutput();
4743 resultobj = SWIG_Py_Void();
4744 return resultobj;
4745fail:
4746 return NULL;
4747}
4748
4749
4750SWIGINTERN PyObject *_wrap_Solver_SuppressOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4751 PyObject *resultobj = 0;
4753 void *argp1 = 0 ;
4754 int res1 = 0 ;
4755 PyObject *swig_obj[1] ;
4756
4757 if (!args) SWIG_fail;
4758 swig_obj[0] = args;
4759 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4760 if (!SWIG_IsOK(res1)) {
4761 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SuppressOutput" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4762 }
4763 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4764 (arg1)->SuppressOutput();
4765 resultobj = SWIG_Py_Void();
4766 return resultobj;
4767fail:
4768 return NULL;
4769}
4770
4771
4772SWIGINTERN PyObject *_wrap_Solver_iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4773 PyObject *resultobj = 0;
4775 void *argp1 = 0 ;
4776 int res1 = 0 ;
4777 PyObject *swig_obj[1] ;
4778 int64_t result;
4779
4780 if (!args) SWIG_fail;
4781 swig_obj[0] = args;
4782 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4783 if (!SWIG_IsOK(res1)) {
4784 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_iterations" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4785 }
4786 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4787 result = (int64_t)((operations_research::MPSolver const *)arg1)->iterations();
4788 resultobj = SWIG_From_long(static_cast< long >(result));
4789 return resultobj;
4790fail:
4791 return NULL;
4792}
4793
4794
4795SWIGINTERN PyObject *_wrap_Solver_nodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4796 PyObject *resultobj = 0;
4798 void *argp1 = 0 ;
4799 int res1 = 0 ;
4800 PyObject *swig_obj[1] ;
4801 int64_t result;
4802
4803 if (!args) SWIG_fail;
4804 swig_obj[0] = args;
4805 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4806 if (!SWIG_IsOK(res1)) {
4807 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_nodes" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4808 }
4809 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4810 result = (int64_t)((operations_research::MPSolver const *)arg1)->nodes();
4811 resultobj = SWIG_From_long(static_cast< long >(result));
4812 return resultobj;
4813fail:
4814 return NULL;
4815}
4816
4817
4818SWIGINTERN PyObject *_wrap_Solver_ComputeExactConditionNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4819 PyObject *resultobj = 0;
4821 void *argp1 = 0 ;
4822 int res1 = 0 ;
4823 PyObject *swig_obj[1] ;
4824 double result;
4825
4826 if (!args) SWIG_fail;
4827 swig_obj[0] = args;
4828 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4829 if (!SWIG_IsOK(res1)) {
4830 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ComputeExactConditionNumber" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4831 }
4832 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4833 result = (double)((operations_research::MPSolver const *)arg1)->ComputeExactConditionNumber();
4834 resultobj = SWIG_From_double(static_cast< double >(result));
4835 return resultobj;
4836fail:
4837 return NULL;
4838}
4839
4840
4841SWIGINTERN PyObject *_wrap_Solver_NextSolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4842 PyObject *resultobj = 0;
4844 void *argp1 = 0 ;
4845 int res1 = 0 ;
4846 PyObject *swig_obj[1] ;
4847 bool result;
4848
4849 if (!args) SWIG_fail;
4850 swig_obj[0] = args;
4851 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4852 if (!SWIG_IsOK(res1)) {
4853 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NextSolution" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4854 }
4855 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4856 result = (bool)(arg1)->NextSolution();
4857 resultobj = SWIG_From_bool(static_cast< bool >(result));
4858 return resultobj;
4859fail:
4860 return NULL;
4861}
4862
4863
4864SWIGINTERN PyObject *_wrap_Solver_set_time_limit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4865 PyObject *resultobj = 0;
4867 int64_t arg2 ;
4868 void *argp1 = 0 ;
4869 int res1 = 0 ;
4870 long val2 ;
4871 int ecode2 = 0 ;
4872 PyObject *swig_obj[2] ;
4873
4874 if (!SWIG_Python_UnpackTuple(args, "Solver_set_time_limit", 2, 2, swig_obj)) SWIG_fail;
4875 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4876 if (!SWIG_IsOK(res1)) {
4877 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_set_time_limit" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4878 }
4879 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4880 ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
4881 if (!SWIG_IsOK(ecode2)) {
4882 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_set_time_limit" "', argument " "2"" of type '" "int64_t""'");
4883 }
4884 arg2 = static_cast< int64_t >(val2);
4885 (arg1)->set_time_limit(arg2);
4886 resultobj = SWIG_Py_Void();
4887 return resultobj;
4888fail:
4889 return NULL;
4890}
4891
4892
4893SWIGINTERN PyObject *_wrap_Solver_wall_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4894 PyObject *resultobj = 0;
4896 void *argp1 = 0 ;
4897 int res1 = 0 ;
4898 PyObject *swig_obj[1] ;
4899 int64_t result;
4900
4901 if (!args) SWIG_fail;
4902 swig_obj[0] = args;
4903 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4904 if (!SWIG_IsOK(res1)) {
4905 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_wall_time" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4906 }
4907 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4908 result = (int64_t)((operations_research::MPSolver const *)arg1)->wall_time();
4909 resultobj = SWIG_From_long(static_cast< long >(result));
4910 return resultobj;
4911fail:
4912 return NULL;
4913}
4914
4915
4916SWIGINTERN PyObject *_wrap_Solver_LoadModelFromProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4917 PyObject *resultobj = 0;
4920 void *argp1 = 0 ;
4921 int res1 = 0 ;
4922 PyObject *swig_obj[2] ;
4923 std::string result;
4924
4925 if (!SWIG_Python_UnpackTuple(args, "Solver_LoadModelFromProto", 2, 2, swig_obj)) SWIG_fail;
4926 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4927 if (!SWIG_IsOK(res1)) {
4928 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadModelFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4929 }
4930 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4931 {
4933 PyObject* const pyresult = PyObject_CallMethod(
4934 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4935 if (pyresult != nullptr) {
4936 char* buffer = nullptr;
4937 Py_ssize_t length = 0;
4938 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4939 if (buffer != nullptr) {
4940 arg2->ParseFromArray(buffer, length);
4941 }
4942 Py_DECREF(pyresult);
4943 }
4944 }
4946 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4947 {
4948 delete arg2;
4949 }
4950 return resultobj;
4951fail:
4952 {
4953 delete arg2;
4954 }
4955 return NULL;
4956}
4957
4958
4960 PyObject *resultobj = 0;
4963 void *argp1 = 0 ;
4964 int res1 = 0 ;
4965 PyObject *swig_obj[2] ;
4966 std::string result;
4967
4968 if (!SWIG_Python_UnpackTuple(args, "Solver_LoadModelFromProtoWithUniqueNamesOrDie", 2, 2, swig_obj)) SWIG_fail;
4969 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4970 if (!SWIG_IsOK(res1)) {
4971 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadModelFromProtoWithUniqueNamesOrDie" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4972 }
4973 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4974 {
4976 PyObject* const pyresult = PyObject_CallMethod(
4977 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4978 if (pyresult != nullptr) {
4979 char* buffer = nullptr;
4980 Py_ssize_t length = 0;
4981 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4982 if (buffer != nullptr) {
4983 arg2->ParseFromArray(buffer, length);
4984 }
4985 Py_DECREF(pyresult);
4986 }
4987 }
4989 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4990 {
4991 delete arg2;
4992 }
4993 return resultobj;
4994fail:
4995 {
4996 delete arg2;
4997 }
4998 return NULL;
4999}
5000
5001
5002SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5003 PyObject *resultobj = 0;
5006 double arg3 ;
5007 void *argp1 = 0 ;
5008 int res1 = 0 ;
5009 double val3 ;
5010 int ecode3 = 0 ;
5011 bool result;
5012
5013 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
5014 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5015 if (!SWIG_IsOK(res1)) {
5016 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5017 }
5018 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5019 {
5021 PyObject* const pyresult = PyObject_CallMethod(
5022 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5023 if (pyresult != nullptr) {
5024 char* buffer = nullptr;
5025 Py_ssize_t length = 0;
5026 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5027 if (buffer != nullptr) {
5028 arg2->ParseFromArray(buffer, length);
5029 }
5030 Py_DECREF(pyresult);
5031 }
5032 }
5033 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
5034 if (!SWIG_IsOK(ecode3)) {
5035 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_LoadSolutionFromProto" "', argument " "3"" of type '" "double""'");
5036 }
5037 arg3 = static_cast< double >(val3);
5039 resultobj = SWIG_From_bool(static_cast< bool >(result));
5040 {
5041 delete arg2;
5042 }
5043 return resultobj;
5044fail:
5045 {
5046 delete arg2;
5047 }
5048 return NULL;
5049}
5050
5051
5052SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5053 PyObject *resultobj = 0;
5056 void *argp1 = 0 ;
5057 int res1 = 0 ;
5058 bool result;
5059
5060 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5061 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5062 if (!SWIG_IsOK(res1)) {
5063 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5064 }
5065 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5066 {
5068 PyObject* const pyresult = PyObject_CallMethod(
5069 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5070 if (pyresult != nullptr) {
5071 char* buffer = nullptr;
5072 Py_ssize_t length = 0;
5073 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5074 if (buffer != nullptr) {
5075 arg2->ParseFromArray(buffer, length);
5076 }
5077 Py_DECREF(pyresult);
5078 }
5079 }
5081 resultobj = SWIG_From_bool(static_cast< bool >(result));
5082 {
5083 delete arg2;
5084 }
5085 return resultobj;
5086fail:
5087 {
5088 delete arg2;
5089 }
5090 return NULL;
5091}
5092
5093
5094SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto(PyObject *self, PyObject *args) {
5095 Py_ssize_t argc;
5096 PyObject *argv[4] = {
5097 0
5098 };
5099
5100 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_LoadSolutionFromProto", 0, 3, argv))) SWIG_fail;
5101 --argc;
5102 if (argc == 2) {
5103 int _v;
5104 void *vptr = 0;
5105 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
5106 _v = SWIG_CheckState(res);
5107 if (_v) {
5108 {
5109 bool ok = false;
5110 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
5111 if (module != nullptr) {
5112 PyObject* const dict = PyModule_GetDict(module);
5113 if (dict != nullptr) {
5114 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
5115 if (clss != nullptr) {
5116 if (PyObject_IsInstance(argv[1], clss)) {
5117 ok = true;
5118 }
5119 }
5120 }
5121 Py_DECREF(module);
5122 }
5123 _v = ok ? 1 : 0;
5124 }
5125 if (_v) {
5126 return _wrap_Solver_LoadSolutionFromProto__SWIG_1(self, argc, argv);
5127 }
5128 }
5129 }
5130 if (argc == 3) {
5131 int _v;
5132 void *vptr = 0;
5133 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
5134 _v = SWIG_CheckState(res);
5135 if (_v) {
5136 {
5137 bool ok = false;
5138 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
5139 if (module != nullptr) {
5140 PyObject* const dict = PyModule_GetDict(module);
5141 if (dict != nullptr) {
5142 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
5143 if (clss != nullptr) {
5144 if (PyObject_IsInstance(argv[1], clss)) {
5145 ok = true;
5146 }
5147 }
5148 }
5149 Py_DECREF(module);
5150 }
5151 _v = ok ? 1 : 0;
5152 }
5153 if (_v) {
5154 {
5155 int res = SWIG_AsVal_double(argv[2], NULL);
5156 _v = SWIG_CheckState(res);
5157 }
5158 if (_v) {
5159 return _wrap_Solver_LoadSolutionFromProto__SWIG_0(self, argc, argv);
5160 }
5161 }
5162 }
5163 }
5164
5165fail:
5166 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_LoadSolutionFromProto'.\n"
5167 " Possible C/C++ prototypes are:\n"
5168 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &,double)\n"
5169 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &)\n");
5170 return 0;
5171}
5172
5173
5174SWIGINTERN PyObject *_wrap_Solver_ExportModelAsLpFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5175 PyObject *resultobj = 0;
5177 bool arg2 ;
5178 void *argp1 = 0 ;
5179 int res1 = 0 ;
5180 bool val2 ;
5181 int ecode2 = 0 ;
5182 PyObject *swig_obj[2] ;
5183 std::string result;
5184
5185 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelAsLpFormat", 2, 2, swig_obj)) SWIG_fail;
5186 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5187 if (!SWIG_IsOK(res1)) {
5188 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelAsLpFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5189 }
5190 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5191 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5192 if (!SWIG_IsOK(ecode2)) {
5193 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_ExportModelAsLpFormat" "', argument " "2"" of type '" "bool""'");
5194 }
5195 arg2 = static_cast< bool >(val2);
5197 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5198 return resultobj;
5199fail:
5200 return NULL;
5201}
5202
5203
5204SWIGINTERN PyObject *_wrap_Solver_ExportModelAsMpsFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5205 PyObject *resultobj = 0;
5207 bool arg2 ;
5208 bool arg3 ;
5209 void *argp1 = 0 ;
5210 int res1 = 0 ;
5211 bool val2 ;
5212 int ecode2 = 0 ;
5213 bool val3 ;
5214 int ecode3 = 0 ;
5215 PyObject *swig_obj[3] ;
5216 std::string result;
5217
5218 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelAsMpsFormat", 3, 3, swig_obj)) SWIG_fail;
5219 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5220 if (!SWIG_IsOK(res1)) {
5221 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5222 }
5223 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5224 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5225 if (!SWIG_IsOK(ecode2)) {
5226 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "2"" of type '" "bool""'");
5227 }
5228 arg2 = static_cast< bool >(val2);
5229 ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
5230 if (!SWIG_IsOK(ecode3)) {
5231 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "3"" of type '" "bool""'");
5232 }
5233 arg3 = static_cast< bool >(val3);
5235 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5236 return resultobj;
5237fail:
5238 return NULL;
5239}
5240
5241
5242SWIGINTERN PyObject *_wrap_Solver_SetHint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5243 PyObject *resultobj = 0;
5245 std::vector< operations_research::MPVariable * > *arg2 = 0 ;
5246 std::vector< double > *arg3 = 0 ;
5247 void *argp1 = 0 ;
5248 int res1 = 0 ;
5249 std::vector< operations_research::MPVariable * > temp2 ;
5250 std::vector< double > temp3 ;
5251 PyObject *swig_obj[3] ;
5252
5253 if (!SWIG_Python_UnpackTuple(args, "Solver_SetHint", 3, 3, swig_obj)) SWIG_fail;
5254 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5255 if (!SWIG_IsOK(res1)) {
5256 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetHint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5257 }
5258 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5259 {
5260 if (!vector_input_helper(swig_obj[1], &temp2, PyObjAs<operations_research::MPVariable*>)) {
5261 if (!PyErr_Occurred())
5262 SWIG_Error(SWIG_TypeError, "sequence(operations_research::MPVariable*) expected");
5263 return NULL;
5264 }
5265 arg2 = &temp2;
5266 }
5267 {
5268 if (!vector_input_helper(swig_obj[2], &temp3, PyObjAs<double>)) {
5269 if (!PyErr_Occurred())
5270 SWIG_Error(SWIG_TypeError, "sequence(double) expected");
5271 return NULL;
5272 }
5273 arg3 = &temp3;
5274 }
5275 operations_research_MPSolver_SetHint(arg1,(std::vector< operations_research::MPVariable * > const &)*arg2,(std::vector< double > const &)*arg3);
5276 resultobj = SWIG_Py_Void();
5277 return resultobj;
5278fail:
5279 return NULL;
5280}
5281
5282
5283SWIGINTERN PyObject *_wrap_Solver_SetNumThreads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5284 PyObject *resultobj = 0;
5286 int arg2 ;
5287 void *argp1 = 0 ;
5288 int res1 = 0 ;
5289 int val2 ;
5290 int ecode2 = 0 ;
5291 PyObject *swig_obj[2] ;
5292 bool result;
5293
5294 if (!SWIG_Python_UnpackTuple(args, "Solver_SetNumThreads", 2, 2, swig_obj)) SWIG_fail;
5295 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5296 if (!SWIG_IsOK(res1)) {
5297 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetNumThreads" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5298 }
5299 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5300 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5301 if (!SWIG_IsOK(ecode2)) {
5302 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_SetNumThreads" "', argument " "2"" of type '" "int""'");
5303 }
5304 arg2 = static_cast< int >(val2);
5305 result = (bool)operations_research_MPSolver_SetNumThreads(arg1,arg2);
5306 resultobj = SWIG_From_bool(static_cast< bool >(result));
5307 return resultobj;
5308fail:
5309 return NULL;
5310}
5311
5312
5313SWIGINTERN PyObject *_wrap_Solver_Infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5314 PyObject *resultobj = 0;
5315 double result;
5316
5317 if (!SWIG_Python_UnpackTuple(args, "Solver_Infinity", 0, 0, 0)) SWIG_fail;
5318 result = (double)operations_research_MPSolver_Infinity();
5319 resultobj = SWIG_From_double(static_cast< double >(result));
5320 return resultobj;
5321fail:
5322 return NULL;
5323}
5324
5325
5326SWIGINTERN PyObject *_wrap_Solver_SetTimeLimit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5327 PyObject *resultobj = 0;
5329 int64_t arg2 ;
5330 void *argp1 = 0 ;
5331 int res1 = 0 ;
5332 long val2 ;
5333 int ecode2 = 0 ;
5334 PyObject *swig_obj[2] ;
5335
5336 if (!SWIG_Python_UnpackTuple(args, "Solver_SetTimeLimit", 2, 2, swig_obj)) SWIG_fail;
5337 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5338 if (!SWIG_IsOK(res1)) {
5339 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetTimeLimit" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5340 }
5341 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5342 ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
5343 if (!SWIG_IsOK(ecode2)) {
5344 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_SetTimeLimit" "', argument " "2"" of type '" "int64_t""'");
5345 }
5346 arg2 = static_cast< int64_t >(val2);
5348 resultobj = SWIG_Py_Void();
5349 return resultobj;
5350fail:
5351 return NULL;
5352}
5353
5354
5355SWIGINTERN PyObject *_wrap_Solver_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5356 PyObject *resultobj = 0;
5358 void *argp1 = 0 ;
5359 int res1 = 0 ;
5360 PyObject *swig_obj[1] ;
5361 int64_t result;
5362
5363 if (!args) SWIG_fail;
5364 swig_obj[0] = args;
5365 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5366 if (!SWIG_IsOK(res1)) {
5367 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_WallTime" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
5368 }
5369 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5371 resultobj = SWIG_From_long(static_cast< long >(result));
5372 return resultobj;
5373fail:
5374 return NULL;
5375}
5376
5377
5378SWIGINTERN PyObject *_wrap_Solver_Iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5379 PyObject *resultobj = 0;
5381 void *argp1 = 0 ;
5382 int res1 = 0 ;
5383 PyObject *swig_obj[1] ;
5384 int64_t result;
5385
5386 if (!args) SWIG_fail;
5387 swig_obj[0] = args;
5388 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5389 if (!SWIG_IsOK(res1)) {
5390 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Iterations" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
5391 }
5392 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5394 resultobj = SWIG_From_long(static_cast< long >(result));
5395 return resultobj;
5396fail:
5397 return NULL;
5398}
5399
5400
5401SWIGINTERN PyObject *Solver_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5402 PyObject *obj;
5403 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
5405 return SWIG_Py_Void();
5406}
5407
5408SWIGINTERN PyObject *Solver_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5409 return SWIG_Python_InitShadowInstance(args);
5410}
5411
5412SWIGINTERN PyObject *_wrap___lshift____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5413 PyObject *resultobj = 0;
5414 std::ostream *arg1 = 0 ;
5416 void *argp1 = 0 ;
5417 int res1 = 0 ;
5418 int val2 ;
5419 int ecode2 = 0 ;
5420 std::ostream *result = 0 ;
5421
5422 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5423 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_std__ostream, 0 );
5424 if (!SWIG_IsOK(res1)) {
5425 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5426 }
5427 if (!argp1) {
5428 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5429 }
5430 arg1 = reinterpret_cast< std::ostream * >(argp1);
5431 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5432 if (!SWIG_IsOK(ecode2)) {
5433 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
5434 }
5436 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5437 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
5438 return resultobj;
5439fail:
5440 PyErr_Clear();
5441 Py_INCREF(Py_NotImplemented);
5442 return Py_NotImplemented;
5443}
5444
5445
5446SWIGINTERN PyObject *_wrap___lshift____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5447 PyObject *resultobj = 0;
5448 std::ostream *arg1 = 0 ;
5450 void *argp1 = 0 ;
5451 int res1 = 0 ;
5452 int val2 ;
5453 int ecode2 = 0 ;
5454 std::ostream *result = 0 ;
5455
5456 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5457 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_std__ostream, 0 );
5458 if (!SWIG_IsOK(res1)) {
5459 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5460 }
5461 if (!argp1) {
5462 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5463 }
5464 arg1 = reinterpret_cast< std::ostream * >(argp1);
5465 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5466 if (!SWIG_IsOK(ecode2)) {
5467 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::ResultStatus""'");
5468 }
5469 arg2 = static_cast< operations_research::MPSolver::ResultStatus >(val2);
5470 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5471 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
5472 return resultobj;
5473fail:
5474 PyErr_Clear();
5475 Py_INCREF(Py_NotImplemented);
5476 return Py_NotImplemented;
5477}
5478
5479
5480SWIGINTERN PyObject *_wrap___lshift__(PyObject *self, PyObject *args) {
5481 Py_ssize_t argc;
5482 PyObject *argv[3] = {
5483 0
5484 };
5485
5486 if (!(argc = SWIG_Python_UnpackTuple(args, "__lshift__", 0, 2, argv))) SWIG_fail;
5487 --argc;
5488 if (argc == 2) {
5489 int _v;
5490 void *vptr = 0;
5492 _v = SWIG_CheckState(res);
5493 if (_v) {
5494 {
5495 int res = SWIG_AsVal_int(argv[1], NULL);
5496 _v = SWIG_CheckState(res);
5497 }
5498 if (_v) {
5499 return _wrap___lshift____SWIG_0(self, argc, argv);
5500 }
5501 }
5502 }
5503 if (argc == 2) {
5504 int _v;
5505 void *vptr = 0;
5507 _v = SWIG_CheckState(res);
5508 if (_v) {
5509 {
5510 int res = SWIG_AsVal_int(argv[1], NULL);
5511 _v = SWIG_CheckState(res);
5512 }
5513 if (_v) {
5514 return _wrap___lshift____SWIG_1(self, argc, argv);
5515 }
5516 }
5517 }
5518
5519fail:
5520 Py_INCREF(Py_NotImplemented);
5521 return Py_NotImplemented;
5522}
5523
5524
5525SWIGINTERN PyObject *_wrap_Objective_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5526 PyObject *resultobj = 0;
5528 void *argp1 = 0 ;
5529 int res1 = 0 ;
5530 PyObject *swig_obj[1] ;
5531
5532 if (!args) SWIG_fail;
5533 swig_obj[0] = args;
5534 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5535 if (!SWIG_IsOK(res1)) {
5536 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Clear" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5537 }
5538 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5539 (arg1)->Clear();
5540 resultobj = SWIG_Py_Void();
5541 return resultobj;
5542fail:
5543 return NULL;
5544}
5545
5546
5547SWIGINTERN PyObject *_wrap_Objective_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5548 PyObject *resultobj = 0;
5551 double arg3 ;
5552 void *argp1 = 0 ;
5553 int res1 = 0 ;
5554 double val3 ;
5555 int ecode3 = 0 ;
5556 PyObject *swig_obj[3] ;
5557
5558 if (!SWIG_Python_UnpackTuple(args, "Objective_SetCoefficient", 3, 3, swig_obj)) SWIG_fail;
5559 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5560 if (!SWIG_IsOK(res1)) {
5561 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5562 }
5563 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5564 {
5565 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
5566 }
5567 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
5568 if (!SWIG_IsOK(ecode3)) {
5569 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Objective_SetCoefficient" "', argument " "3"" of type '" "double""'");
5570 }
5571 arg3 = static_cast< double >(val3);
5572 (arg1)->SetCoefficient((operations_research::MPVariable const *)arg2,arg3);
5573 resultobj = SWIG_Py_Void();
5574 return resultobj;
5575fail:
5576 return NULL;
5577}
5578
5579
5580SWIGINTERN PyObject *_wrap_Objective_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5581 PyObject *resultobj = 0;
5584 void *argp1 = 0 ;
5585 int res1 = 0 ;
5586 PyObject *swig_obj[2] ;
5587 double result;
5588
5589 if (!SWIG_Python_UnpackTuple(args, "Objective_GetCoefficient", 2, 2, swig_obj)) SWIG_fail;
5590 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5591 if (!SWIG_IsOK(res1)) {
5592 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5593 }
5594 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5595 {
5596 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
5597 }
5598 result = (double)((operations_research::MPObjective const *)arg1)->GetCoefficient((operations_research::MPVariable const *)arg2);
5599 resultobj = SWIG_From_double(static_cast< double >(result));
5600 return resultobj;
5601fail:
5602 return NULL;
5603}
5604
5605
5606SWIGINTERN PyObject *_wrap_Objective_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5607 PyObject *resultobj = 0;
5609 double arg2 ;
5610 void *argp1 = 0 ;
5611 int res1 = 0 ;
5612 double val2 ;
5613 int ecode2 = 0 ;
5614 PyObject *swig_obj[2] ;
5615
5616 if (!SWIG_Python_UnpackTuple(args, "Objective_SetOffset", 2, 2, swig_obj)) SWIG_fail;
5617 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5618 if (!SWIG_IsOK(res1)) {
5619 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetOffset" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5620 }
5621 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5622 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
5623 if (!SWIG_IsOK(ecode2)) {
5624 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Objective_SetOffset" "', argument " "2"" of type '" "double""'");
5625 }
5626 arg2 = static_cast< double >(val2);
5627 (arg1)->SetOffset(arg2);
5628 resultobj = SWIG_Py_Void();
5629 return resultobj;
5630fail:
5631 return NULL;
5632}
5633
5634
5635SWIGINTERN PyObject *_wrap_Objective_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5636 PyObject *resultobj = 0;
5638 void *argp1 = 0 ;
5639 int res1 = 0 ;
5640 PyObject *swig_obj[1] ;
5641 double result;
5642
5643 if (!args) SWIG_fail;
5644 swig_obj[0] = args;
5645 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5646 if (!SWIG_IsOK(res1)) {
5647 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_offset" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5648 }
5649 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5650 result = (double)((operations_research::MPObjective const *)arg1)->offset();
5651 resultobj = SWIG_From_double(static_cast< double >(result));
5652 return resultobj;
5653fail:
5654 return NULL;
5655}
5656
5657
5658SWIGINTERN PyObject *_wrap_Objective_SetOptimizationDirection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5659 PyObject *resultobj = 0;
5661 bool arg2 ;
5662 void *argp1 = 0 ;
5663 int res1 = 0 ;
5664 bool val2 ;
5665 int ecode2 = 0 ;
5666 PyObject *swig_obj[2] ;
5667
5668 if (!SWIG_Python_UnpackTuple(args, "Objective_SetOptimizationDirection", 2, 2, swig_obj)) SWIG_fail;
5669 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5670 if (!SWIG_IsOK(res1)) {
5671 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetOptimizationDirection" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5672 }
5673 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5674 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5675 if (!SWIG_IsOK(ecode2)) {
5676 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Objective_SetOptimizationDirection" "', argument " "2"" of type '" "bool""'");
5677 }
5678 arg2 = static_cast< bool >(val2);
5679 (arg1)->SetOptimizationDirection(arg2);
5680 resultobj = SWIG_Py_Void();
5681 return resultobj;
5682fail:
5683 return NULL;
5684}
5685
5686
5687SWIGINTERN PyObject *_wrap_Objective_SetMinimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5688 PyObject *resultobj = 0;
5690 void *argp1 = 0 ;
5691 int res1 = 0 ;
5692 PyObject *swig_obj[1] ;
5693
5694 if (!args) SWIG_fail;
5695 swig_obj[0] = args;
5696 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5697 if (!SWIG_IsOK(res1)) {
5698 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetMinimization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5699 }
5700 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5701 (arg1)->SetMinimization();
5702 resultobj = SWIG_Py_Void();
5703 return resultobj;
5704fail:
5705 return NULL;
5706}
5707
5708
5709SWIGINTERN PyObject *_wrap_Objective_SetMaximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5710 PyObject *resultobj = 0;
5712 void *argp1 = 0 ;
5713 int res1 = 0 ;
5714 PyObject *swig_obj[1] ;
5715
5716 if (!args) SWIG_fail;
5717 swig_obj[0] = args;
5718 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5719 if (!SWIG_IsOK(res1)) {
5720 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetMaximization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5721 }
5722 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5723 (arg1)->SetMaximization();
5724 resultobj = SWIG_Py_Void();
5725 return resultobj;
5726fail:
5727 return NULL;
5728}
5729
5730
5731SWIGINTERN PyObject *_wrap_Objective_maximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5732 PyObject *resultobj = 0;
5734 void *argp1 = 0 ;
5735 int res1 = 0 ;
5736 PyObject *swig_obj[1] ;
5737 bool result;
5738
5739 if (!args) SWIG_fail;
5740 swig_obj[0] = args;
5741 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5742 if (!SWIG_IsOK(res1)) {
5743 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_maximization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5744 }
5745 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5746 result = (bool)((operations_research::MPObjective const *)arg1)->maximization();
5747 resultobj = SWIG_From_bool(static_cast< bool >(result));
5748 return resultobj;
5749fail:
5750 return NULL;
5751}
5752
5753
5754SWIGINTERN PyObject *_wrap_Objective_minimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5755 PyObject *resultobj = 0;
5757 void *argp1 = 0 ;
5758 int res1 = 0 ;
5759 PyObject *swig_obj[1] ;
5760 bool result;
5761
5762 if (!args) SWIG_fail;
5763 swig_obj[0] = args;
5764 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5765 if (!SWIG_IsOK(res1)) {
5766 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_minimization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5767 }
5768 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5769 result = (bool)((operations_research::MPObjective const *)arg1)->minimization();
5770 resultobj = SWIG_From_bool(static_cast< bool >(result));
5771 return resultobj;
5772fail:
5773 return NULL;
5774}
5775
5776
5777SWIGINTERN PyObject *_wrap_Objective_Value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5778 PyObject *resultobj = 0;
5780 void *argp1 = 0 ;
5781 int res1 = 0 ;
5782 PyObject *swig_obj[1] ;
5783 double result;
5784
5785 if (!args) SWIG_fail;
5786 swig_obj[0] = args;
5787 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5788 if (!SWIG_IsOK(res1)) {
5789 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Value" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5790 }
5791 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5792 result = (double)((operations_research::MPObjective const *)arg1)->Value();
5793 resultobj = SWIG_From_double(static_cast< double >(result));
5794 return resultobj;
5795fail:
5796 return NULL;
5797}
5798
5799
5800SWIGINTERN PyObject *_wrap_Objective_BestBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5801 PyObject *resultobj = 0;
5803 void *argp1 = 0 ;
5804 int res1 = 0 ;
5805 PyObject *swig_obj[1] ;
5806 double result;
5807
5808 if (!args) SWIG_fail;
5809 swig_obj[0] = args;
5810 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5811 if (!SWIG_IsOK(res1)) {
5812 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_BestBound" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5813 }
5814 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5815 result = (double)((operations_research::MPObjective const *)arg1)->BestBound();
5816 resultobj = SWIG_From_double(static_cast< double >(result));
5817 return resultobj;
5818fail:
5819 return NULL;
5820}
5821
5822
5823SWIGINTERN PyObject *_wrap_Objective_Offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5824 PyObject *resultobj = 0;
5826 void *argp1 = 0 ;
5827 int res1 = 0 ;
5828 PyObject *swig_obj[1] ;
5829 double result;
5830
5831 if (!args) SWIG_fail;
5832 swig_obj[0] = args;
5833 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5834 if (!SWIG_IsOK(res1)) {
5835 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Offset" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5836 }
5837 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5839 resultobj = SWIG_From_double(static_cast< double >(result));
5840 return resultobj;
5841fail:
5842 return NULL;
5843}
5844
5845
5846SWIGINTERN PyObject *_wrap_delete_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5847 PyObject *resultobj = 0;
5849 void *argp1 = 0 ;
5850 int res1 = 0 ;
5851 PyObject *swig_obj[1] ;
5852
5853 if (!args) SWIG_fail;
5854 swig_obj[0] = args;
5856 if (!SWIG_IsOK(res1)) {
5857 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Objective" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5858 }
5859 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5860 delete arg1;
5861 resultobj = SWIG_Py_Void();
5862 return resultobj;
5863fail:
5864 return NULL;
5865}
5866
5867
5868SWIGINTERN PyObject *Objective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5869 PyObject *obj;
5870 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
5872 return SWIG_Py_Void();
5873}
5874
5875SWIGINTERN PyObject *_wrap_Variable_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5876 PyObject *resultobj = 0;
5878 void *argp1 = 0 ;
5879 int res1 = 0 ;
5880 PyObject *swig_obj[1] ;
5881 std::string *result = 0 ;
5882
5883 if (!args) SWIG_fail;
5884 swig_obj[0] = args;
5885 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5886 if (!SWIG_IsOK(res1)) {
5887 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_name" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5888 }
5889 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5890 result = (std::string *) &((operations_research::MPVariable const *)arg1)->name();
5891 resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
5892 return resultobj;
5893fail:
5894 return NULL;
5895}
5896
5897
5898SWIGINTERN PyObject *_wrap_Variable_SetInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5899 PyObject *resultobj = 0;
5901 bool arg2 ;
5902 void *argp1 = 0 ;
5903 int res1 = 0 ;
5904 bool val2 ;
5905 int ecode2 = 0 ;
5906 PyObject *swig_obj[2] ;
5907
5908 if (!SWIG_Python_UnpackTuple(args, "Variable_SetInteger", 2, 2, swig_obj)) SWIG_fail;
5909 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5910 if (!SWIG_IsOK(res1)) {
5911 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetInteger" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
5912 }
5913 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5914 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5915 if (!SWIG_IsOK(ecode2)) {
5916 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetInteger" "', argument " "2"" of type '" "bool""'");
5917 }
5918 arg2 = static_cast< bool >(val2);
5919 (arg1)->SetInteger(arg2);
5920 resultobj = SWIG_Py_Void();
5921 return resultobj;
5922fail:
5923 return NULL;
5924}
5925
5926
5927SWIGINTERN PyObject *_wrap_Variable_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5928 PyObject *resultobj = 0;
5930 void *argp1 = 0 ;
5931 int res1 = 0 ;
5932 PyObject *swig_obj[1] ;
5933 bool result;
5934
5935 if (!args) SWIG_fail;
5936 swig_obj[0] = args;
5937 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5938 if (!SWIG_IsOK(res1)) {
5939 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_integer" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5940 }
5941 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5942 result = (bool)((operations_research::MPVariable const *)arg1)->integer();
5943 resultobj = SWIG_From_bool(static_cast< bool >(result));
5944 return resultobj;
5945fail:
5946 return NULL;
5947}
5948
5949
5950SWIGINTERN PyObject *_wrap_Variable_solution_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5951 PyObject *resultobj = 0;
5953 void *argp1 = 0 ;
5954 int res1 = 0 ;
5955 PyObject *swig_obj[1] ;
5956 double result;
5957
5958 if (!args) SWIG_fail;
5959 swig_obj[0] = args;
5960 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5961 if (!SWIG_IsOK(res1)) {
5962 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_solution_value" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5963 }
5964 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5965 result = (double)((operations_research::MPVariable const *)arg1)->solution_value();
5966 resultobj = SWIG_From_double(static_cast< double >(result));
5967 return resultobj;
5968fail:
5969 return NULL;
5970}
5971
5972
5973SWIGINTERN PyObject *_wrap_Variable_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5974 PyObject *resultobj = 0;
5976 void *argp1 = 0 ;
5977 int res1 = 0 ;
5978 PyObject *swig_obj[1] ;
5979 int result;
5980
5981 if (!args) SWIG_fail;
5982 swig_obj[0] = args;
5983 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5984 if (!SWIG_IsOK(res1)) {
5985 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_index" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5986 }
5987 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5988 result = (int)((operations_research::MPVariable const *)arg1)->index();
5989 resultobj = SWIG_From_int(static_cast< int >(result));
5990 return resultobj;
5991fail:
5992 return NULL;
5993}
5994
5995
5996SWIGINTERN PyObject *_wrap_Variable_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5997 PyObject *resultobj = 0;
5999 void *argp1 = 0 ;
6000 int res1 = 0 ;
6001 PyObject *swig_obj[1] ;
6002 double result;
6003
6004 if (!args) SWIG_fail;
6005 swig_obj[0] = args;
6006 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6007 if (!SWIG_IsOK(res1)) {
6008 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_lb" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6009 }
6010 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6011 result = (double)((operations_research::MPVariable const *)arg1)->lb();
6012 resultobj = SWIG_From_double(static_cast< double >(result));
6013 return resultobj;
6014fail:
6015 return NULL;
6016}
6017
6018
6019SWIGINTERN PyObject *_wrap_Variable_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6020 PyObject *resultobj = 0;
6022 void *argp1 = 0 ;
6023 int res1 = 0 ;
6024 PyObject *swig_obj[1] ;
6025 double result;
6026
6027 if (!args) SWIG_fail;
6028 swig_obj[0] = args;
6029 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6030 if (!SWIG_IsOK(res1)) {
6031 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_ub" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6032 }
6033 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6034 result = (double)((operations_research::MPVariable const *)arg1)->ub();
6035 resultobj = SWIG_From_double(static_cast< double >(result));
6036 return resultobj;
6037fail:
6038 return NULL;
6039}
6040
6041
6042SWIGINTERN PyObject *_wrap_Variable_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6043 PyObject *resultobj = 0;
6045 double arg2 ;
6046 double arg3 ;
6047 void *argp1 = 0 ;
6048 int res1 = 0 ;
6049 double val2 ;
6050 int ecode2 = 0 ;
6051 double val3 ;
6052 int ecode3 = 0 ;
6053 PyObject *swig_obj[3] ;
6054
6055 if (!SWIG_Python_UnpackTuple(args, "Variable_SetBounds", 3, 3, swig_obj)) SWIG_fail;
6056 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6057 if (!SWIG_IsOK(res1)) {
6058 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetBounds" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6059 }
6060 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6061 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6062 if (!SWIG_IsOK(ecode2)) {
6063 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetBounds" "', argument " "2"" of type '" "double""'");
6064 }
6065 arg2 = static_cast< double >(val2);
6066 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6067 if (!SWIG_IsOK(ecode3)) {
6068 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Variable_SetBounds" "', argument " "3"" of type '" "double""'");
6069 }
6070 arg3 = static_cast< double >(val3);
6071 (arg1)->SetBounds(arg2,arg3);
6072 resultobj = SWIG_Py_Void();
6073 return resultobj;
6074fail:
6075 return NULL;
6076}
6077
6078
6079SWIGINTERN PyObject *_wrap_Variable_reduced_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6080 PyObject *resultobj = 0;
6082 void *argp1 = 0 ;
6083 int res1 = 0 ;
6084 PyObject *swig_obj[1] ;
6085 double result;
6086
6087 if (!args) SWIG_fail;
6088 swig_obj[0] = args;
6089 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6090 if (!SWIG_IsOK(res1)) {
6091 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_reduced_cost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6092 }
6093 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6094 result = (double)((operations_research::MPVariable const *)arg1)->reduced_cost();
6095 resultobj = SWIG_From_double(static_cast< double >(result));
6096 return resultobj;
6097fail:
6098 return NULL;
6099}
6100
6101
6102SWIGINTERN PyObject *_wrap_Variable_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6103 PyObject *resultobj = 0;
6105 void *argp1 = 0 ;
6106 int res1 = 0 ;
6107 PyObject *swig_obj[1] ;
6109
6110 if (!args) SWIG_fail;
6111 swig_obj[0] = args;
6112 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6113 if (!SWIG_IsOK(res1)) {
6114 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_basis_status" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6115 }
6116 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6117 result = (operations_research::MPSolver::BasisStatus)((operations_research::MPVariable const *)arg1)->basis_status();
6118 resultobj = SWIG_From_int(static_cast< int >(result));
6119 return resultobj;
6120fail:
6121 return NULL;
6122}
6123
6124
6125SWIGINTERN PyObject *_wrap_Variable_branching_priority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6126 PyObject *resultobj = 0;
6128 void *argp1 = 0 ;
6129 int res1 = 0 ;
6130 PyObject *swig_obj[1] ;
6131 int result;
6132
6133 if (!args) SWIG_fail;
6134 swig_obj[0] = args;
6135 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6136 if (!SWIG_IsOK(res1)) {
6137 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_branching_priority" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6138 }
6139 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6140 result = (int)((operations_research::MPVariable const *)arg1)->branching_priority();
6141 resultobj = SWIG_From_int(static_cast< int >(result));
6142 return resultobj;
6143fail:
6144 return NULL;
6145}
6146
6147
6148SWIGINTERN PyObject *_wrap_Variable_SetBranchingPriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6149 PyObject *resultobj = 0;
6151 int arg2 ;
6152 void *argp1 = 0 ;
6153 int res1 = 0 ;
6154 int val2 ;
6155 int ecode2 = 0 ;
6156 PyObject *swig_obj[2] ;
6157
6158 if (!SWIG_Python_UnpackTuple(args, "Variable_SetBranchingPriority", 2, 2, swig_obj)) SWIG_fail;
6159 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6160 if (!SWIG_IsOK(res1)) {
6161 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetBranchingPriority" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6162 }
6163 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6164 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
6165 if (!SWIG_IsOK(ecode2)) {
6166 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetBranchingPriority" "', argument " "2"" of type '" "int""'");
6167 }
6168 arg2 = static_cast< int >(val2);
6169 (arg1)->SetBranchingPriority(arg2);
6170 resultobj = SWIG_Py_Void();
6171 return resultobj;
6172fail:
6173 return NULL;
6174}
6175
6176
6177SWIGINTERN PyObject *_wrap_Variable___str__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6178 PyObject *resultobj = 0;
6180 void *argp1 = 0 ;
6181 int res1 = 0 ;
6182 PyObject *swig_obj[1] ;
6183 std::string result;
6184
6185 if (!args) SWIG_fail;
6186 swig_obj[0] = args;
6187 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6188 if (!SWIG_IsOK(res1)) {
6189 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable___str__" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6190 }
6191 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6193 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
6194 return resultobj;
6195fail:
6196 return NULL;
6197}
6198
6199
6200SWIGINTERN PyObject *_wrap_Variable___repr__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6201 PyObject *resultobj = 0;
6203 void *argp1 = 0 ;
6204 int res1 = 0 ;
6205 PyObject *swig_obj[1] ;
6206 std::string result;
6207
6208 if (!args) SWIG_fail;
6209 swig_obj[0] = args;
6210 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6211 if (!SWIG_IsOK(res1)) {
6212 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable___repr__" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6213 }
6214 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6216 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
6217 return resultobj;
6218fail:
6219 return NULL;
6220}
6221
6222
6223SWIGINTERN PyObject *_wrap_Variable_SolutionValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6224 PyObject *resultobj = 0;
6226 void *argp1 = 0 ;
6227 int res1 = 0 ;
6228 PyObject *swig_obj[1] ;
6229 double result;
6230
6231 if (!args) SWIG_fail;
6232 swig_obj[0] = args;
6233 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6234 if (!SWIG_IsOK(res1)) {
6235 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SolutionValue" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6236 }
6237 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6239 resultobj = SWIG_From_double(static_cast< double >(result));
6240 return resultobj;
6241fail:
6242 return NULL;
6243}
6244
6245
6246SWIGINTERN PyObject *_wrap_Variable_Integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6247 PyObject *resultobj = 0;
6249 void *argp1 = 0 ;
6250 int res1 = 0 ;
6251 PyObject *swig_obj[1] ;
6252 bool result;
6253
6254 if (!args) SWIG_fail;
6255 swig_obj[0] = args;
6256 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6257 if (!SWIG_IsOK(res1)) {
6258 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Integer" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6259 }
6260 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6262 resultobj = SWIG_From_bool(static_cast< bool >(result));
6263 return resultobj;
6264fail:
6265 return NULL;
6266}
6267
6268
6269SWIGINTERN PyObject *_wrap_Variable_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6270 PyObject *resultobj = 0;
6272 void *argp1 = 0 ;
6273 int res1 = 0 ;
6274 PyObject *swig_obj[1] ;
6275 double result;
6276
6277 if (!args) SWIG_fail;
6278 swig_obj[0] = args;
6279 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6280 if (!SWIG_IsOK(res1)) {
6281 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Lb" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6282 }
6283 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6285 resultobj = SWIG_From_double(static_cast< double >(result));
6286 return resultobj;
6287fail:
6288 return NULL;
6289}
6290
6291
6292SWIGINTERN PyObject *_wrap_Variable_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6293 PyObject *resultobj = 0;
6295 void *argp1 = 0 ;
6296 int res1 = 0 ;
6297 PyObject *swig_obj[1] ;
6298 double result;
6299
6300 if (!args) SWIG_fail;
6301 swig_obj[0] = args;
6302 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6303 if (!SWIG_IsOK(res1)) {
6304 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Ub" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6305 }
6306 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6308 resultobj = SWIG_From_double(static_cast< double >(result));
6309 return resultobj;
6310fail:
6311 return NULL;
6312}
6313
6314
6315SWIGINTERN PyObject *_wrap_Variable_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6316 PyObject *resultobj = 0;
6318 double arg2 ;
6319 void *argp1 = 0 ;
6320 int res1 = 0 ;
6321 double val2 ;
6322 int ecode2 = 0 ;
6323 PyObject *swig_obj[2] ;
6324
6325 if (!SWIG_Python_UnpackTuple(args, "Variable_SetLb", 2, 2, swig_obj)) SWIG_fail;
6326 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6327 if (!SWIG_IsOK(res1)) {
6328 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetLb" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6329 }
6330 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6331 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6332 if (!SWIG_IsOK(ecode2)) {
6333 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetLb" "', argument " "2"" of type '" "double""'");
6334 }
6335 arg2 = static_cast< double >(val2);
6337 resultobj = SWIG_Py_Void();
6338 return resultobj;
6339fail:
6340 return NULL;
6341}
6342
6343
6344SWIGINTERN PyObject *_wrap_Variable_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6345 PyObject *resultobj = 0;
6347 double arg2 ;
6348 void *argp1 = 0 ;
6349 int res1 = 0 ;
6350 double val2 ;
6351 int ecode2 = 0 ;
6352 PyObject *swig_obj[2] ;
6353
6354 if (!SWIG_Python_UnpackTuple(args, "Variable_SetUb", 2, 2, swig_obj)) SWIG_fail;
6355 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6356 if (!SWIG_IsOK(res1)) {
6357 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetUb" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6358 }
6359 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6360 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6361 if (!SWIG_IsOK(ecode2)) {
6362 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetUb" "', argument " "2"" of type '" "double""'");
6363 }
6364 arg2 = static_cast< double >(val2);
6366 resultobj = SWIG_Py_Void();
6367 return resultobj;
6368fail:
6369 return NULL;
6370}
6371
6372
6373SWIGINTERN PyObject *_wrap_Variable_ReducedCost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6374 PyObject *resultobj = 0;
6376 void *argp1 = 0 ;
6377 int res1 = 0 ;
6378 PyObject *swig_obj[1] ;
6379 double result;
6380
6381 if (!args) SWIG_fail;
6382 swig_obj[0] = args;
6383 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6384 if (!SWIG_IsOK(res1)) {
6385 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_ReducedCost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6386 }
6387 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6389 resultobj = SWIG_From_double(static_cast< double >(result));
6390 return resultobj;
6391fail:
6392 return NULL;
6393}
6394
6395
6396SWIGINTERN PyObject *_wrap_delete_Variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6397 PyObject *resultobj = 0;
6399 void *argp1 = 0 ;
6400 int res1 = 0 ;
6401 PyObject *swig_obj[1] ;
6402
6403 if (!args) SWIG_fail;
6404 swig_obj[0] = args;
6406 if (!SWIG_IsOK(res1)) {
6407 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Variable" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6408 }
6409 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6410 delete arg1;
6411 resultobj = SWIG_Py_Void();
6412 return resultobj;
6413fail:
6414 return NULL;
6415}
6416
6417
6418SWIGINTERN PyObject *Variable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6419 PyObject *obj;
6420 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
6422 return SWIG_Py_Void();
6423}
6424
6425SWIGINTERN PyObject *_wrap_Constraint_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6426 PyObject *resultobj = 0;
6428 void *argp1 = 0 ;
6429 int res1 = 0 ;
6430 PyObject *swig_obj[1] ;
6431 std::string *result = 0 ;
6432
6433 if (!args) SWIG_fail;
6434 swig_obj[0] = args;
6435 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6436 if (!SWIG_IsOK(res1)) {
6437 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_name" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6438 }
6439 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6440 result = (std::string *) &((operations_research::MPConstraint const *)arg1)->name();
6441 resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
6442 return resultobj;
6443fail:
6444 return NULL;
6445}
6446
6447
6448SWIGINTERN PyObject *_wrap_Constraint_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6449 PyObject *resultobj = 0;
6451 void *argp1 = 0 ;
6452 int res1 = 0 ;
6453 PyObject *swig_obj[1] ;
6454
6455 if (!args) SWIG_fail;
6456 swig_obj[0] = args;
6457 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6458 if (!SWIG_IsOK(res1)) {
6459 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Clear" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6460 }
6461 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6462 (arg1)->Clear();
6463 resultobj = SWIG_Py_Void();
6464 return resultobj;
6465fail:
6466 return NULL;
6467}
6468
6469
6470SWIGINTERN PyObject *_wrap_Constraint_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6471 PyObject *resultobj = 0;
6474 double arg3 ;
6475 void *argp1 = 0 ;
6476 int res1 = 0 ;
6477 double val3 ;
6478 int ecode3 = 0 ;
6479 PyObject *swig_obj[3] ;
6480
6481 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetCoefficient", 3, 3, swig_obj)) SWIG_fail;
6482 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6483 if (!SWIG_IsOK(res1)) {
6484 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6485 }
6486 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6487 {
6488 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
6489 }
6490 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6491 if (!SWIG_IsOK(ecode3)) {
6492 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Constraint_SetCoefficient" "', argument " "3"" of type '" "double""'");
6493 }
6494 arg3 = static_cast< double >(val3);
6495 (arg1)->SetCoefficient((operations_research::MPVariable const *)arg2,arg3);
6496 resultobj = SWIG_Py_Void();
6497 return resultobj;
6498fail:
6499 return NULL;
6500}
6501
6502
6503SWIGINTERN PyObject *_wrap_Constraint_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6504 PyObject *resultobj = 0;
6507 void *argp1 = 0 ;
6508 int res1 = 0 ;
6509 PyObject *swig_obj[2] ;
6510 double result;
6511
6512 if (!SWIG_Python_UnpackTuple(args, "Constraint_GetCoefficient", 2, 2, swig_obj)) SWIG_fail;
6513 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6514 if (!SWIG_IsOK(res1)) {
6515 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6516 }
6517 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6518 {
6519 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
6520 }
6521 result = (double)((operations_research::MPConstraint const *)arg1)->GetCoefficient((operations_research::MPVariable const *)arg2);
6522 resultobj = SWIG_From_double(static_cast< double >(result));
6523 return resultobj;
6524fail:
6525 return NULL;
6526}
6527
6528
6529SWIGINTERN PyObject *_wrap_Constraint_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6530 PyObject *resultobj = 0;
6532 void *argp1 = 0 ;
6533 int res1 = 0 ;
6534 PyObject *swig_obj[1] ;
6535 double result;
6536
6537 if (!args) SWIG_fail;
6538 swig_obj[0] = args;
6539 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6540 if (!SWIG_IsOK(res1)) {
6541 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_lb" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6542 }
6543 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6544 result = (double)((operations_research::MPConstraint const *)arg1)->lb();
6545 resultobj = SWIG_From_double(static_cast< double >(result));
6546 return resultobj;
6547fail:
6548 return NULL;
6549}
6550
6551
6552SWIGINTERN PyObject *_wrap_Constraint_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6553 PyObject *resultobj = 0;
6555 void *argp1 = 0 ;
6556 int res1 = 0 ;
6557 PyObject *swig_obj[1] ;
6558 double result;
6559
6560 if (!args) SWIG_fail;
6561 swig_obj[0] = args;
6562 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6563 if (!SWIG_IsOK(res1)) {
6564 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_ub" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6565 }
6566 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6567 result = (double)((operations_research::MPConstraint const *)arg1)->ub();
6568 resultobj = SWIG_From_double(static_cast< double >(result));
6569 return resultobj;
6570fail:
6571 return NULL;
6572}
6573
6574
6575SWIGINTERN PyObject *_wrap_Constraint_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6576 PyObject *resultobj = 0;
6578 double arg2 ;
6579 double arg3 ;
6580 void *argp1 = 0 ;
6581 int res1 = 0 ;
6582 double val2 ;
6583 int ecode2 = 0 ;
6584 double val3 ;
6585 int ecode3 = 0 ;
6586 PyObject *swig_obj[3] ;
6587
6588 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetBounds", 3, 3, swig_obj)) SWIG_fail;
6589 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6590 if (!SWIG_IsOK(res1)) {
6591 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetBounds" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6592 }
6593 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6594 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6595 if (!SWIG_IsOK(ecode2)) {
6596 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetBounds" "', argument " "2"" of type '" "double""'");
6597 }
6598 arg2 = static_cast< double >(val2);
6599 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6600 if (!SWIG_IsOK(ecode3)) {
6601 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Constraint_SetBounds" "', argument " "3"" of type '" "double""'");
6602 }
6603 arg3 = static_cast< double >(val3);
6604 (arg1)->SetBounds(arg2,arg3);
6605 resultobj = SWIG_Py_Void();
6606 return resultobj;
6607fail:
6608 return NULL;
6609}
6610
6611
6612SWIGINTERN PyObject *_wrap_Constraint_set_is_lazy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6613 PyObject *resultobj = 0;
6615 bool arg2 ;
6616 void *argp1 = 0 ;
6617 int res1 = 0 ;
6618 bool val2 ;
6619 int ecode2 = 0 ;
6620 PyObject *swig_obj[2] ;
6621
6622 if (!SWIG_Python_UnpackTuple(args, "Constraint_set_is_lazy", 2, 2, swig_obj)) SWIG_fail;
6623 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6624 if (!SWIG_IsOK(res1)) {
6625 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_set_is_lazy" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6626 }
6627 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6628 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
6629 if (!SWIG_IsOK(ecode2)) {
6630 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_set_is_lazy" "', argument " "2"" of type '" "bool""'");
6631 }
6632 arg2 = static_cast< bool >(val2);
6633 (arg1)->set_is_lazy(arg2);
6634 resultobj = SWIG_Py_Void();
6635 return resultobj;
6636fail:
6637 return NULL;
6638}
6639
6640
6641SWIGINTERN PyObject *_wrap_Constraint_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6642 PyObject *resultobj = 0;
6644 void *argp1 = 0 ;
6645 int res1 = 0 ;
6646 PyObject *swig_obj[1] ;
6647 int result;
6648
6649 if (!args) SWIG_fail;
6650 swig_obj[0] = args;
6651 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6652 if (!SWIG_IsOK(res1)) {
6653 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_index" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6654 }
6655 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6656 result = (int)((operations_research::MPConstraint const *)arg1)->index();
6657 resultobj = SWIG_From_int(static_cast< int >(result));
6658 return resultobj;
6659fail:
6660 return NULL;
6661}
6662
6663
6664SWIGINTERN PyObject *_wrap_Constraint_dual_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6665 PyObject *resultobj = 0;
6667 void *argp1 = 0 ;
6668 int res1 = 0 ;
6669 PyObject *swig_obj[1] ;
6670 double result;
6671
6672 if (!args) SWIG_fail;
6673 swig_obj[0] = args;
6674 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6675 if (!SWIG_IsOK(res1)) {
6676 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_dual_value" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6677 }
6678 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6679 result = (double)((operations_research::MPConstraint const *)arg1)->dual_value();
6680 resultobj = SWIG_From_double(static_cast< double >(result));
6681 return resultobj;
6682fail:
6683 return NULL;
6684}
6685
6686
6687SWIGINTERN PyObject *_wrap_Constraint_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6688 PyObject *resultobj = 0;
6690 void *argp1 = 0 ;
6691 int res1 = 0 ;
6692 PyObject *swig_obj[1] ;
6694
6695 if (!args) SWIG_fail;
6696 swig_obj[0] = args;
6697 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6698 if (!SWIG_IsOK(res1)) {
6699 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_basis_status" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6700 }
6701 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6702 result = (operations_research::MPSolver::BasisStatus)((operations_research::MPConstraint const *)arg1)->basis_status();
6703 resultobj = SWIG_From_int(static_cast< int >(result));
6704 return resultobj;
6705fail:
6706 return NULL;
6707}
6708
6709
6710SWIGINTERN PyObject *_wrap_Constraint_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6711 PyObject *resultobj = 0;
6713 void *argp1 = 0 ;
6714 int res1 = 0 ;
6715 PyObject *swig_obj[1] ;
6716 double result;
6717
6718 if (!args) SWIG_fail;
6719 swig_obj[0] = args;
6720 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6721 if (!SWIG_IsOK(res1)) {
6722 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Lb" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6723 }
6724 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6726 resultobj = SWIG_From_double(static_cast< double >(result));
6727 return resultobj;
6728fail:
6729 return NULL;
6730}
6731
6732
6733SWIGINTERN PyObject *_wrap_Constraint_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6734 PyObject *resultobj = 0;
6736 void *argp1 = 0 ;
6737 int res1 = 0 ;
6738 PyObject *swig_obj[1] ;
6739 double result;
6740
6741 if (!args) SWIG_fail;
6742 swig_obj[0] = args;
6743 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6744 if (!SWIG_IsOK(res1)) {
6745 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Ub" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6746 }
6747 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6749 resultobj = SWIG_From_double(static_cast< double >(result));
6750 return resultobj;
6751fail:
6752 return NULL;
6753}
6754
6755
6756SWIGINTERN PyObject *_wrap_Constraint_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6757 PyObject *resultobj = 0;
6759 double arg2 ;
6760 void *argp1 = 0 ;
6761 int res1 = 0 ;
6762 double val2 ;
6763 int ecode2 = 0 ;
6764 PyObject *swig_obj[2] ;
6765
6766 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetLb", 2, 2, swig_obj)) SWIG_fail;
6767 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6768 if (!SWIG_IsOK(res1)) {
6769 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetLb" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6770 }
6771 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6772 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6773 if (!SWIG_IsOK(ecode2)) {
6774 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetLb" "', argument " "2"" of type '" "double""'");
6775 }
6776 arg2 = static_cast< double >(val2);
6778 resultobj = SWIG_Py_Void();
6779 return resultobj;
6780fail:
6781 return NULL;
6782}
6783
6784
6785SWIGINTERN PyObject *_wrap_Constraint_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6786 PyObject *resultobj = 0;
6788 double arg2 ;
6789 void *argp1 = 0 ;
6790 int res1 = 0 ;
6791 double val2 ;
6792 int ecode2 = 0 ;
6793 PyObject *swig_obj[2] ;
6794
6795 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetUb", 2, 2, swig_obj)) SWIG_fail;
6796 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6797 if (!SWIG_IsOK(res1)) {
6798 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetUb" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6799 }
6800 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6801 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6802 if (!SWIG_IsOK(ecode2)) {
6803 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetUb" "', argument " "2"" of type '" "double""'");
6804 }
6805 arg2 = static_cast< double >(val2);
6807 resultobj = SWIG_Py_Void();
6808 return resultobj;
6809fail:
6810 return NULL;
6811}
6812
6813
6814SWIGINTERN PyObject *_wrap_Constraint_DualValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6815 PyObject *resultobj = 0;
6817 void *argp1 = 0 ;
6818 int res1 = 0 ;
6819 PyObject *swig_obj[1] ;
6820 double result;
6821
6822 if (!args) SWIG_fail;
6823 swig_obj[0] = args;
6824 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6825 if (!SWIG_IsOK(res1)) {
6826 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_DualValue" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6827 }
6828 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6830 resultobj = SWIG_From_double(static_cast< double >(result));
6831 return resultobj;
6832fail:
6833 return NULL;
6834}
6835
6836
6837SWIGINTERN PyObject *_wrap_delete_Constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6838 PyObject *resultobj = 0;
6840 void *argp1 = 0 ;
6841 int res1 = 0 ;
6842 PyObject *swig_obj[1] ;
6843
6844 if (!args) SWIG_fail;
6845 swig_obj[0] = args;
6847 if (!SWIG_IsOK(res1)) {
6848 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Constraint" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6849 }
6850 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6851 delete arg1;
6852 resultobj = SWIG_Py_Void();
6853 return resultobj;
6854fail:
6855 return NULL;
6856}
6857
6858
6859SWIGINTERN PyObject *Constraint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6860 PyObject *obj;
6861 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
6863 return SWIG_Py_Void();
6864}
6865
6867 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultRelativeMipGap is read-only.");
6868 return 1;
6869}
6870
6871
6873 PyObject *pyobj = 0;
6874
6876 return pyobj;
6877}
6878
6879
6881 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultPrimalTolerance is read-only.");
6882 return 1;
6883}
6884
6885
6887 PyObject *pyobj = 0;
6888
6890 return pyobj;
6891}
6892
6893
6895 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultDualTolerance is read-only.");
6896 return 1;
6897}
6898
6899
6901 PyObject *pyobj = 0;
6902
6904 return pyobj;
6905}
6906
6907
6909 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultPresolve is read-only.");
6910 return 1;
6911}
6912
6913
6915 PyObject *pyobj = 0;
6916
6918 return pyobj;
6919}
6920
6921
6923 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultIncrementality is read-only.");
6924 return 1;
6925}
6926
6927
6929 PyObject *pyobj = 0;
6930
6932 return pyobj;
6933}
6934
6935
6936SWIGINTERN PyObject *_wrap_new_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6937 PyObject *resultobj = 0;
6939
6940 if (!SWIG_Python_UnpackTuple(args, "new_MPSolverParameters", 0, 0, 0)) SWIG_fail;
6943 return resultobj;
6944fail:
6945 return NULL;
6946}
6947
6948
6949SWIGINTERN PyObject *_wrap_MPSolverParameters_SetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6950 PyObject *resultobj = 0;
6953 double arg3 ;
6954 void *argp1 = 0 ;
6955 int res1 = 0 ;
6956 int val2 ;
6957 int ecode2 = 0 ;
6958 double val3 ;
6959 int ecode3 = 0 ;
6960 PyObject *swig_obj[3] ;
6961
6962 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_SetDoubleParam", 3, 3, swig_obj)) SWIG_fail;
6963 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
6964 if (!SWIG_IsOK(res1)) {
6965 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
6966 }
6967 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
6968 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
6969 if (!SWIG_IsOK(ecode2)) {
6970 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
6971 }
6972 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
6973 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6974 if (!SWIG_IsOK(ecode3)) {
6975 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "3"" of type '" "double""'");
6976 }
6977 arg3 = static_cast< double >(val3);
6978 (arg1)->SetDoubleParam(arg2,arg3);
6979 resultobj = SWIG_Py_Void();
6980 return resultobj;
6981fail:
6982 return NULL;
6983}
6984
6985
6986SWIGINTERN PyObject *_wrap_MPSolverParameters_SetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6987 PyObject *resultobj = 0;
6990 int arg3 ;
6991 void *argp1 = 0 ;
6992 int res1 = 0 ;
6993 int val2 ;
6994 int ecode2 = 0 ;
6995 int val3 ;
6996 int ecode3 = 0 ;
6997 PyObject *swig_obj[3] ;
6998
6999 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_SetIntegerParam", 3, 3, swig_obj)) SWIG_fail;
7000 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7001 if (!SWIG_IsOK(res1)) {
7002 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7003 }
7004 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7005 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7006 if (!SWIG_IsOK(ecode2)) {
7007 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7008 }
7010 ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
7011 if (!SWIG_IsOK(ecode3)) {
7012 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "3"" of type '" "int""'");
7013 }
7014 arg3 = static_cast< int >(val3);
7015 (arg1)->SetIntegerParam(arg2,arg3);
7016 resultobj = SWIG_Py_Void();
7017 return resultobj;
7018fail:
7019 return NULL;
7020}
7021
7022
7023SWIGINTERN PyObject *_wrap_MPSolverParameters_GetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7024 PyObject *resultobj = 0;
7027 void *argp1 = 0 ;
7028 int res1 = 0 ;
7029 int val2 ;
7030 int ecode2 = 0 ;
7031 PyObject *swig_obj[2] ;
7032 double result;
7033
7034 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_GetDoubleParam", 2, 2, swig_obj)) SWIG_fail;
7035 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7036 if (!SWIG_IsOK(res1)) {
7037 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_GetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7038 }
7039 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7040 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7041 if (!SWIG_IsOK(ecode2)) {
7042 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_GetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7043 }
7044 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
7045 result = (double)((operations_research::MPSolverParameters const *)arg1)->GetDoubleParam(arg2);
7046 resultobj = SWIG_From_double(static_cast< double >(result));
7047 return resultobj;
7048fail:
7049 return NULL;
7050}
7051
7052
7053SWIGINTERN PyObject *_wrap_MPSolverParameters_GetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7054 PyObject *resultobj = 0;
7057 void *argp1 = 0 ;
7058 int res1 = 0 ;
7059 int val2 ;
7060 int ecode2 = 0 ;
7061 PyObject *swig_obj[2] ;
7062 int result;
7063
7064 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_GetIntegerParam", 2, 2, swig_obj)) SWIG_fail;
7065 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7066 if (!SWIG_IsOK(res1)) {
7067 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_GetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7068 }
7069 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7070 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7071 if (!SWIG_IsOK(ecode2)) {
7072 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_GetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7073 }
7075 result = (int)((operations_research::MPSolverParameters const *)arg1)->GetIntegerParam(arg2);
7076 resultobj = SWIG_From_int(static_cast< int >(result));
7077 return resultobj;
7078fail:
7079 return NULL;
7080}
7081
7082
7083SWIGINTERN PyObject *_wrap_delete_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7084 PyObject *resultobj = 0;
7086 void *argp1 = 0 ;
7087 int res1 = 0 ;
7088 PyObject *swig_obj[1] ;
7089
7090 if (!args) SWIG_fail;
7091 swig_obj[0] = args;
7093 if (!SWIG_IsOK(res1)) {
7094 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MPSolverParameters" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7095 }
7096 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7097 delete arg1;
7098 resultobj = SWIG_Py_Void();
7099 return resultobj;
7100fail:
7101 return NULL;
7102}
7103
7104
7105SWIGINTERN PyObject *MPSolverParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7106 PyObject *obj;
7107 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
7109 return SWIG_Py_Void();
7110}
7111
7112SWIGINTERN PyObject *MPSolverParameters_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7113 return SWIG_Python_InitShadowInstance(args);
7114}
7115
7116SWIGINTERN PyObject *_wrap_new_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7117 PyObject *resultobj = 0;
7119
7120 if (!SWIG_Python_UnpackTuple(args, "new_ModelExportOptions", 0, 0, 0)) SWIG_fail;
7123 return resultobj;
7124fail:
7125 return NULL;
7126}
7127
7128
7129SWIGINTERN PyObject *_wrap_delete_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7130 PyObject *resultobj = 0;
7132 void *argp1 = 0 ;
7133 int res1 = 0 ;
7134 PyObject *swig_obj[1] ;
7135
7136 if (!args) SWIG_fail;
7137 swig_obj[0] = args;
7139 if (!SWIG_IsOK(res1)) {
7140 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ModelExportOptions" "', argument " "1"" of type '" "operations_research::MPModelExportOptions *""'");
7141 }
7142 arg1 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp1);
7143 delete arg1;
7144 resultobj = SWIG_Py_Void();
7145 return resultobj;
7146fail:
7147 return NULL;
7148}
7149
7150
7151SWIGINTERN PyObject *ModelExportOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7152 PyObject *obj;
7153 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
7155 return SWIG_Py_Void();
7156}
7157
7158SWIGINTERN PyObject *ModelExportOptions_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7159 return SWIG_Python_InitShadowInstance(args);
7160}
7161
7162SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7163 PyObject *resultobj = 0;
7166 void *argp2 = 0 ;
7167 int res2 = 0 ;
7168 std::string result;
7169
7170 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
7171 {
7173 PyObject* const pyresult = PyObject_CallMethod(
7174 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7175 if (pyresult != nullptr) {
7176 char* buffer = nullptr;
7177 Py_ssize_t length = 0;
7178 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7179 if (buffer != nullptr) {
7180 arg1->ParseFromArray(buffer, length);
7181 }
7182 Py_DECREF(pyresult);
7183 }
7184 }
7186 if (!SWIG_IsOK(res2)) {
7187 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7188 }
7189 if (!argp2) {
7190 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7191 }
7192 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7193 result = operations_research::ExportModelAsLpFormatReturnString((operations_research::MPModelProto const &)*arg1,(operations_research::MPModelExportOptions const &)*arg2);
7194 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7195 {
7196 delete arg1;
7197 }
7198 return resultobj;
7199fail:
7200 {
7201 delete arg1;
7202 }
7203 return NULL;
7204}
7205
7206
7207SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7208 PyObject *resultobj = 0;
7210 std::string result;
7211
7212 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
7213 {
7215 PyObject* const pyresult = PyObject_CallMethod(
7216 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7217 if (pyresult != nullptr) {
7218 char* buffer = nullptr;
7219 Py_ssize_t length = 0;
7220 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7221 if (buffer != nullptr) {
7222 arg1->ParseFromArray(buffer, length);
7223 }
7224 Py_DECREF(pyresult);
7225 }
7226 }
7227 result = operations_research::ExportModelAsLpFormatReturnString((operations_research::MPModelProto const &)*arg1);
7228 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7229 {
7230 delete arg1;
7231 }
7232 return resultobj;
7233fail:
7234 {
7235 delete arg1;
7236 }
7237 return NULL;
7238}
7239
7240
7241SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat(PyObject *self, PyObject *args) {
7242 Py_ssize_t argc;
7243 PyObject *argv[3] = {
7244 0
7245 };
7246
7247 if (!(argc = SWIG_Python_UnpackTuple(args, "ExportModelAsLpFormat", 0, 2, argv))) SWIG_fail;
7248 --argc;
7249 if (argc == 1) {
7250 int _v;
7251 {
7252 bool ok = false;
7253 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7254 if (module != nullptr) {
7255 PyObject* const dict = PyModule_GetDict(module);
7256 if (dict != nullptr) {
7257 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7258 if (clss != nullptr) {
7259 if (PyObject_IsInstance(argv[0], clss)) {
7260 ok = true;
7261 }
7262 }
7263 }
7264 Py_DECREF(module);
7265 }
7266 _v = ok ? 1 : 0;
7267 }
7268 if (_v) {
7269 return _wrap_ExportModelAsLpFormat__SWIG_1(self, argc, argv);
7270 }
7271 }
7272 if (argc == 2) {
7273 int _v;
7274 {
7275 bool ok = false;
7276 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7277 if (module != nullptr) {
7278 PyObject* const dict = PyModule_GetDict(module);
7279 if (dict != nullptr) {
7280 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7281 if (clss != nullptr) {
7282 if (PyObject_IsInstance(argv[0], clss)) {
7283 ok = true;
7284 }
7285 }
7286 }
7287 Py_DECREF(module);
7288 }
7289 _v = ok ? 1 : 0;
7290 }
7291 if (_v) {
7293 _v = SWIG_CheckState(res);
7294 if (_v) {
7295 return _wrap_ExportModelAsLpFormat__SWIG_0(self, argc, argv);
7296 }
7297 }
7298 }
7299
7300fail:
7301 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ExportModelAsLpFormat'.\n"
7302 " Possible C/C++ prototypes are:\n"
7303 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7304 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &)\n");
7305 return 0;
7306}
7307
7308
7309SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7310 PyObject *resultobj = 0;
7313 void *argp2 = 0 ;
7314 int res2 = 0 ;
7315 std::string result;
7316
7317 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
7318 {
7320 PyObject* const pyresult = PyObject_CallMethod(
7321 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7322 if (pyresult != nullptr) {
7323 char* buffer = nullptr;
7324 Py_ssize_t length = 0;
7325 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7326 if (buffer != nullptr) {
7327 arg1->ParseFromArray(buffer, length);
7328 }
7329 Py_DECREF(pyresult);
7330 }
7331 }
7333 if (!SWIG_IsOK(res2)) {
7334 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7335 }
7336 if (!argp2) {
7337 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7338 }
7339 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7340 result = operations_research::ExportModelAsMpsFormatReturnString((operations_research::MPModelProto const &)*arg1,(operations_research::MPModelExportOptions const &)*arg2);
7341 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7342 {
7343 delete arg1;
7344 }
7345 return resultobj;
7346fail:
7347 {
7348 delete arg1;
7349 }
7350 return NULL;
7351}
7352
7353
7354SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7355 PyObject *resultobj = 0;
7357 std::string result;
7358
7359 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
7360 {
7362 PyObject* const pyresult = PyObject_CallMethod(
7363 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7364 if (pyresult != nullptr) {
7365 char* buffer = nullptr;
7366 Py_ssize_t length = 0;
7367 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7368 if (buffer != nullptr) {
7369 arg1->ParseFromArray(buffer, length);
7370 }
7371 Py_DECREF(pyresult);
7372 }
7373 }
7374 result = operations_research::ExportModelAsMpsFormatReturnString((operations_research::MPModelProto const &)*arg1);
7375 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7376 {
7377 delete arg1;
7378 }
7379 return resultobj;
7380fail:
7381 {
7382 delete arg1;
7383 }
7384 return NULL;
7385}
7386
7387
7388SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat(PyObject *self, PyObject *args) {
7389 Py_ssize_t argc;
7390 PyObject *argv[3] = {
7391 0
7392 };
7393
7394 if (!(argc = SWIG_Python_UnpackTuple(args, "ExportModelAsMpsFormat", 0, 2, argv))) SWIG_fail;
7395 --argc;
7396 if (argc == 1) {
7397 int _v;
7398 {
7399 bool ok = false;
7400 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7401 if (module != nullptr) {
7402 PyObject* const dict = PyModule_GetDict(module);
7403 if (dict != nullptr) {
7404 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7405 if (clss != nullptr) {
7406 if (PyObject_IsInstance(argv[0], clss)) {
7407 ok = true;
7408 }
7409 }
7410 }
7411 Py_DECREF(module);
7412 }
7413 _v = ok ? 1 : 0;
7414 }
7415 if (_v) {
7416 return _wrap_ExportModelAsMpsFormat__SWIG_1(self, argc, argv);
7417 }
7418 }
7419 if (argc == 2) {
7420 int _v;
7421 {
7422 bool ok = false;
7423 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7424 if (module != nullptr) {
7425 PyObject* const dict = PyModule_GetDict(module);
7426 if (dict != nullptr) {
7427 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7428 if (clss != nullptr) {
7429 if (PyObject_IsInstance(argv[0], clss)) {
7430 ok = true;
7431 }
7432 }
7433 }
7434 Py_DECREF(module);
7435 }
7436 _v = ok ? 1 : 0;
7437 }
7438 if (_v) {
7440 _v = SWIG_CheckState(res);
7441 if (_v) {
7442 return _wrap_ExportModelAsMpsFormat__SWIG_0(self, argc, argv);
7443 }
7444 }
7445 }
7446
7447fail:
7448 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ExportModelAsMpsFormat'.\n"
7449 " Possible C/C++ prototypes are:\n"
7450 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7451 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &)\n");
7452 return 0;
7453}
7454
7455
7456SWIGINTERN PyObject *_wrap_FindErrorInModelProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7457 PyObject *resultobj = 0;
7459 PyObject *swig_obj[1] ;
7460 std::string result;
7461
7462 if (!args) SWIG_fail;
7463 swig_obj[0] = args;
7464 {
7466 PyObject* const pyresult = PyObject_CallMethod(
7467 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7468 if (pyresult != nullptr) {
7469 char* buffer = nullptr;
7470 Py_ssize_t length = 0;
7471 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7472 if (buffer != nullptr) {
7473 arg1->ParseFromArray(buffer, length);
7474 }
7475 Py_DECREF(pyresult);
7476 }
7477 }
7479 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7480 {
7481 delete arg1;
7482 }
7483 return resultobj;
7484fail:
7485 {
7486 delete arg1;
7487 }
7488 return NULL;
7489}
7490
7491
7492static PyMethodDef SwigMethods[] = {
7493 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
7494 { "new_Solver", _wrap_new_Solver, METH_VARARGS, " Create a solver with the given name and underlying solver backend."},
7495 { "delete_Solver", _wrap_delete_Solver, METH_O, NULL},
7496 { "Solver_CreateSolver", _wrap_Solver_CreateSolver, METH_O, "\n"
7497 "Recommended factory method to create a MPSolver instance, especially in\n"
7498 "non C++ languages.\n"
7499 "\n"
7500 "It returns a newly created solver instance if successful, or a nullptr\n"
7501 "otherwise. This can occur if the relevant interface is not linked in, or if\n"
7502 "a needed license is not accessible for commercial solvers.\n"
7503 "\n"
7504 "Ownership of the solver is passed on to the caller of this method.\n"
7505 "It will accept both string names of the OptimizationProblemType enum, as\n"
7506 "well as a short version (i.e. \"SCIP_MIXED_INTEGER_PROGRAMMING\" or \"SCIP\").\n"
7507 "\n"
7508 "solver_id is case insensitive, and the following names are supported:\n"
7509 " - CLP_LINEAR_PROGRAMMING or CLP\n"
7510 " - CBC_MIXED_INTEGER_PROGRAMMING or CBC\n"
7511 " - GLOP_LINEAR_PROGRAMMING or GLOP\n"
7512 " - BOP_INTEGER_PROGRAMMING or BOP\n"
7513 " - SAT_INTEGER_PROGRAMMING or SAT or CP_SAT\n"
7514 " - SCIP_MIXED_INTEGER_PROGRAMMING or SCIP\n"
7515 " - GUROBI_LINEAR_PROGRAMMING or GUROBI_LP\n"
7516 " - GUROBI_MIXED_INTEGER_PROGRAMMING or GUROBI or GUROBI_MIP\n"
7517 " - CPLEX_LINEAR_PROGRAMMING or CPLEX_LP\n"
7518 " - CPLEX_MIXED_INTEGER_PROGRAMMING or CPLEX or CPLEX_MIP\n"
7519 " - XPRESS_LINEAR_PROGRAMMING or XPRESS_LP\n"
7520 " - XPRESS_MIXED_INTEGER_PROGRAMMING or XPRESS or XPRESS_MIP\n"
7521 " - GLPK_LINEAR_PROGRAMMING or GLPK_LP\n"
7522 " - GLPK_MIXED_INTEGER_PROGRAMMING or GLPK or GLPK_MIP\n"
7523 ""},
7524 { "Solver_SupportsProblemType", _wrap_Solver_SupportsProblemType, METH_O, "\n"
7525 "Whether the given problem type is supported (this will depend on the\n"
7526 "targets that you linked).\n"
7527 ""},
7528 { "Solver_Clear", _wrap_Solver_Clear, METH_O, "\n"
7529 "Clears the objective (including the optimization direction), all variables\n"
7530 "and constraints. All the other properties of the MPSolver (like the time\n"
7531 "limit) are kept untouched.\n"
7532 ""},
7533 { "Solver_NumVariables", _wrap_Solver_NumVariables, METH_O, " Returns the number of variables."},
7534 { "Solver_variables", _wrap_Solver_variables, METH_O, "\n"
7535 "Returns the array of variables handled by the MPSolver. (They are listed in\n"
7536 "the order in which they were created.)\n"
7537 ""},
7538 { "Solver_variable", _wrap_Solver_variable, METH_VARARGS, "Returns the variable at position index."},
7539 { "Solver_LookupVariable", _wrap_Solver_LookupVariable, METH_VARARGS, "\n"
7540 "Looks up a variable by name, and returns nullptr if it does not exist. The\n"
7541 "first call has a O(n) complexity, as the variable name index is lazily\n"
7542 "created upon first use. Will crash if variable names are not unique.\n"
7543 ""},
7544 { "Solver_Var", _wrap_Solver_Var, METH_VARARGS, "\n"
7545 "Creates a variable with the given bounds, integrality requirement and\n"
7546 "name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns\n"
7547 "the variable (i.e. the returned pointer is borrowed). Variable names are\n"
7548 "optional. If you give an empty name, name() will auto-generate one for you\n"
7549 "upon request.\n"
7550 ""},
7551 { "Solver_NumVar", _wrap_Solver_NumVar, METH_VARARGS, " Creates a continuous variable."},
7552 { "Solver_IntVar", _wrap_Solver_IntVar, METH_VARARGS, " Creates an integer variable."},
7553 { "Solver_BoolVar", _wrap_Solver_BoolVar, METH_VARARGS, " Creates a boolean variable."},
7554 { "Solver_NumConstraints", _wrap_Solver_NumConstraints, METH_O, " Returns the number of constraints."},
7555 { "Solver_constraints", _wrap_Solver_constraints, METH_O, "\n"
7556 "Returns the array of constraints handled by the MPSolver.\n"
7557 "\n"
7558 "They are listed in the order in which they were created.\n"
7559 ""},
7560 { "Solver_constraint", _wrap_Solver_constraint, METH_VARARGS, " Returns the constraint at the given index."},
7561 { "Solver_LookupConstraint", _wrap_Solver_LookupConstraint, METH_VARARGS, "\n"
7562 " Looks up a constraint by name, and returns nullptr if it does not exist.\n"
7563 "\n"
7564 "The first call has a O(n) complexity, as the constraint name index is\n"
7565 "lazily created upon first use. Will crash if constraint names are not\n"
7566 "unique.\n"
7567 ""},
7568 { "Solver_Constraint", _wrap_Solver_Constraint, METH_VARARGS, "\n"
7569 "*Overload 1:*\n"
7570 "\n"
7571 "Creates a linear constraint with given bounds.\n"
7572 "\n"
7573 "Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class\n"
7574 "assumes ownership of the constraint.\n"
7575 "\n"
7576 ":rtype: :py:class:`MPConstraint`\n"
7577 ":return: a pointer to the newly created constraint.\n"
7578 "\n"
7579 "|\n"
7580 "\n"
7581 "*Overload 2:*\n"
7582 " Creates a constraint with -infinity and +infinity bounds.\n"
7583 "\n"
7584 "|\n"
7585 "\n"
7586 "*Overload 3:*\n"
7587 " Creates a named constraint with given bounds.\n"
7588 "\n"
7589 "|\n"
7590 "\n"
7591 "*Overload 4:*\n"
7592 " Creates a named constraint with -infinity and +infinity bounds.\n"
7593 ""},
7594 { "Solver_Objective", _wrap_Solver_Objective, METH_O, " Returns the mutable objective object."},
7595 { "Solver_Solve", _wrap_Solver_Solve, METH_VARARGS, "\n"
7596 "*Overload 1:*\n"
7597 "Solves the problem using the default parameter values.\n"
7598 "\n"
7599 "|\n"
7600 "\n"
7601 "*Overload 2:*\n"
7602 "Solves the problem using the specified parameter values.\n"
7603 ""},
7604 { "Solver_ComputeConstraintActivities", _wrap_Solver_ComputeConstraintActivities, METH_O, "\n"
7605 "Advanced usage: compute the \"activities\" of all constraints, which are the\n"
7606 "sums of their linear terms. The activities are returned in the same order\n"
7607 "as constraints(), which is the order in which constraints were added; but\n"
7608 "you can also use MPConstraint::index() to get a constraint's index.\n"
7609 ""},
7610 { "Solver_VerifySolution", _wrap_Solver_VerifySolution, METH_VARARGS, "\n"
7611 "Advanced usage: Verifies the *correctness* of the solution.\n"
7612 "\n"
7613 "It verifies that all variables must be within their domains, all\n"
7614 "constraints must be satisfied, and the reported objective value must be\n"
7615 "accurate.\n"
7616 "\n"
7617 "Usage:\n"
7618 "- This can only be called after Solve() was called.\n"
7619 "- \"tolerance\" is interpreted as an absolute error threshold.\n"
7620 "- For the objective value only, if the absolute error is too large,\n"
7621 " the tolerance is interpreted as a relative error threshold instead.\n"
7622 "- If \"log_errors\" is true, every single violation will be logged.\n"
7623 "- If \"tolerance\" is negative, it will be set to infinity().\n"
7624 "\n"
7625 "Most users should just set the --verify_solution flag and not bother using\n"
7626 "this method directly.\n"
7627 ""},
7628 { "Solver_InterruptSolve", _wrap_Solver_InterruptSolve, METH_O, "\n"
7629 " Interrupts the Solve() execution to terminate processing if possible.\n"
7630 "\n"
7631 "If the underlying interface supports interruption; it does that and returns\n"
7632 "true regardless of whether there's an ongoing Solve() or not. The Solve()\n"
7633 "call may still linger for a while depending on the conditions. If\n"
7634 "interruption is not supported; returns false and does nothing.\n"
7635 "MPSolver::SolverTypeSupportsInterruption can be used to check if\n"
7636 "interruption is supported for a given solver type.\n"
7637 ""},
7638 { "Solver_FillSolutionResponseProto", _wrap_Solver_FillSolutionResponseProto, METH_VARARGS, " Encodes the current solution in a solution response protocol buffer."},
7639 { "Solver_SolveWithProto", _wrap_Solver_SolveWithProto, METH_VARARGS, "\n"
7640 "Solves the model encoded by a MPModelRequest protocol buffer and fills the\n"
7641 "solution encoded as a MPSolutionResponse. The solve is stopped prematurely\n"
7642 "if interrupt is non-null at set to true during (or before) solving.\n"
7643 "Interruption is only supported if SolverTypeSupportsInterruption() returns\n"
7644 "true for the requested solver. Passing a non-null interruption with any\n"
7645 "other solver type immediately returns an MPSOLVER_INCOMPATIBLE_OPTIONS\n"
7646 "error.\n"
7647 "\n"
7648 "Note(user): This attempts to first use `DirectlySolveProto()` (if\n"
7649 "implemented). Consequently, this most likely does *not* override any of\n"
7650 "the default parameters of the underlying solver. This behavior *differs*\n"
7651 "from `MPSolver::Solve()` which by default sets the feasibility tolerance\n"
7652 "and the gap limit (as of 2020/02/11, to 1e-7 and 0.0001, respectively).\n"
7653 ""},
7654 { "Solver_ExportModelToProto", _wrap_Solver_ExportModelToProto, METH_VARARGS, " Exports model to protocol buffer."},
7655 { "Solver_SetSolverSpecificParametersAsString", _wrap_Solver_SetSolverSpecificParametersAsString, METH_VARARGS, "\n"
7656 "Advanced usage: pass solver specific parameters in text format.\n"
7657 "\n"
7658 "The format is solver-specific and is the same as the corresponding solver\n"
7659 "configuration file format. Returns true if the operation was successful.\n"
7660 ""},
7661 { "Solver_infinity", _wrap_Solver_infinity, METH_NOARGS, "\n"
7662 "Infinity.\n"
7663 "\n"
7664 "You can use -MPSolver::infinity() for negative infinity.\n"
7665 ""},
7666 { "Solver_EnableOutput", _wrap_Solver_EnableOutput, METH_O, " Enables solver logging."},
7667 { "Solver_SuppressOutput", _wrap_Solver_SuppressOutput, METH_O, " Suppresses solver logging."},
7668 { "Solver_iterations", _wrap_Solver_iterations, METH_O, " Returns the number of simplex iterations."},
7669 { "Solver_nodes", _wrap_Solver_nodes, METH_O, "\n"
7670 "Returns the number of branch-and-bound nodes evaluated during the solve.\n"
7671 "\n"
7672 "Only available for discrete problems.\n"
7673 ""},
7674 { "Solver_ComputeExactConditionNumber", _wrap_Solver_ComputeExactConditionNumber, METH_O, "\n"
7675 " Advanced usage: computes the exact condition number of the current scaled\n"
7676 "basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.\n"
7677 "\n"
7678 "This method requires that a basis exists: it should be called after Solve.\n"
7679 "It is only available for continuous problems. It is implemented for GLPK\n"
7680 "but not CLP because CLP does not provide the API for doing it.\n"
7681 "\n"
7682 "The condition number measures how well the constraint matrix is conditioned\n"
7683 "and can be used to predict whether numerical issues will arise during the\n"
7684 "solve: the model is declared infeasible whereas it is feasible (or\n"
7685 "vice-versa), the solution obtained is not optimal or violates some\n"
7686 "constraints, the resolution is slow because of repeated singularities.\n"
7687 "\n"
7688 "The rule of thumb to interpret the condition number kappa is:\n"
7689 " - o kappa <= 1e7: virtually no chance of numerical issues\n"
7690 " - o 1e7 < kappa <= 1e10: small chance of numerical issues\n"
7691 " - o 1e10 < kappa <= 1e13: medium chance of numerical issues\n"
7692 " - o kappa > 1e13: high chance of numerical issues\n"
7693 "\n"
7694 "The computation of the condition number depends on the quality of the LU\n"
7695 "decomposition, so it is not very accurate when the matrix is ill\n"
7696 "conditioned.\n"
7697 ""},
7698 { "Solver_NextSolution", _wrap_Solver_NextSolution, METH_O, "\n"
7699 "Some solvers (MIP only, not LP) can produce multiple solutions to the\n"
7700 "problem. Returns true when another solution is available, and updates the\n"
7701 "MPVariable* objects to make the new solution queryable. Call only after\n"
7702 "calling solve.\n"
7703 "\n"
7704 "The optimality properties of the additional solutions found, and whether or\n"
7705 "not the solver computes them ahead of time or when NextSolution() is called\n"
7706 "is solver specific.\n"
7707 "\n"
7708 "As of 2020-02-10, only Gurobi and SCIP support NextSolution(), see\n"
7709 "linear_solver_interfaces_test for an example of how to configure these\n"
7710 "solvers for multiple solutions. Other solvers return false unconditionally.\n"
7711 ""},
7712 { "Solver_set_time_limit", _wrap_Solver_set_time_limit, METH_VARARGS, NULL},
7713 { "Solver_wall_time", _wrap_Solver_wall_time, METH_O, NULL},
7714 { "Solver_LoadModelFromProto", _wrap_Solver_LoadModelFromProto, METH_VARARGS, NULL},
7715 { "Solver_LoadModelFromProtoWithUniqueNamesOrDie", _wrap_Solver_LoadModelFromProtoWithUniqueNamesOrDie, METH_VARARGS, NULL},
7716 { "Solver_LoadSolutionFromProto", _wrap_Solver_LoadSolutionFromProto, METH_VARARGS, NULL},
7717 { "Solver_ExportModelAsLpFormat", _wrap_Solver_ExportModelAsLpFormat, METH_VARARGS, NULL},
7718 { "Solver_ExportModelAsMpsFormat", _wrap_Solver_ExportModelAsMpsFormat, METH_VARARGS, NULL},
7719 { "Solver_SetHint", _wrap_Solver_SetHint, METH_VARARGS, "\n"
7720 "Set a hint for solution.\n"
7721 "\n"
7722 "If a feasible or almost-feasible solution to the problem is already known,\n"
7723 "it may be helpful to pass it to the solver so that it can be used. A\n"
7724 "solver that supports this feature will try to use this information to\n"
7725 "create its initial feasible solution.\n"
7726 "\n"
7727 "Note that it may not always be faster to give a hint like this to the\n"
7728 "solver. There is also no guarantee that the solver will use this hint or\n"
7729 "try to return a solution \"close\" to this assignment in case of multiple\n"
7730 "optimal solutions.\n"
7731 ""},
7732 { "Solver_SetNumThreads", _wrap_Solver_SetNumThreads, METH_VARARGS, " Sets the number of threads to be used by the solver."},
7733 { "Solver_Infinity", _wrap_Solver_Infinity, METH_NOARGS, NULL},
7734 { "Solver_SetTimeLimit", _wrap_Solver_SetTimeLimit, METH_VARARGS, NULL},
7735 { "Solver_WallTime", _wrap_Solver_WallTime, METH_O, NULL},
7736 { "Solver_Iterations", _wrap_Solver_Iterations, METH_O, NULL},
7737 { "Solver_swigregister", Solver_swigregister, METH_O, NULL},
7738 { "Solver_swiginit", Solver_swiginit, METH_VARARGS, NULL},
7739 { "__lshift__", _wrap___lshift__, METH_VARARGS, NULL},
7740 { "Objective_Clear", _wrap_Objective_Clear, METH_O, "\n"
7741 " Clears the offset, all variables and coefficients, and the optimization\n"
7742 "direction.\n"
7743 ""},
7744 { "Objective_SetCoefficient", _wrap_Objective_SetCoefficient, METH_VARARGS, "\n"
7745 "Sets the coefficient of the variable in the objective.\n"
7746 "\n"
7747 "If the variable does not belong to the solver, the function just returns,\n"
7748 "or crashes in non-opt mode.\n"
7749 ""},
7750 { "Objective_GetCoefficient", _wrap_Objective_GetCoefficient, METH_VARARGS, "\n"
7751 " Gets the coefficient of a given variable in the objective\n"
7752 "\n"
7753 "It returns 0 if the variable does not appear in the objective).\n"
7754 ""},
7755 { "Objective_SetOffset", _wrap_Objective_SetOffset, METH_VARARGS, " Sets the constant term in the objective."},
7756 { "Objective_offset", _wrap_Objective_offset, METH_O, " Gets the constant term in the objective."},
7757 { "Objective_SetOptimizationDirection", _wrap_Objective_SetOptimizationDirection, METH_VARARGS, " Sets the optimization direction (maximize: true or minimize: false)."},
7758 { "Objective_SetMinimization", _wrap_Objective_SetMinimization, METH_O, " Sets the optimization direction to minimize."},
7759 { "Objective_SetMaximization", _wrap_Objective_SetMaximization, METH_O, " Sets the optimization direction to maximize."},
7760 { "Objective_maximization", _wrap_Objective_maximization, METH_O, " Is the optimization direction set to maximize?"},
7761 { "Objective_minimization", _wrap_Objective_minimization, METH_O, " Is the optimization direction set to minimize?"},
7762 { "Objective_Value", _wrap_Objective_Value, METH_O, "\n"
7763 "Returns the objective value of the best solution found so far.\n"
7764 "\n"
7765 "It is the optimal objective value if the problem has been solved to\n"
7766 "optimality.\n"
7767 "\n"
7768 "Note: the objective value may be slightly different than what you could\n"
7769 "compute yourself using ``MPVariable::solution_value();`` please use the\n"
7770 "--verify_solution flag to gain confidence about the numerical stability of\n"
7771 "your solution.\n"
7772 ""},
7773 { "Objective_BestBound", _wrap_Objective_BestBound, METH_O, "\n"
7774 "Returns the best objective bound.\n"
7775 "\n"
7776 "In case of minimization, it is a lower bound on the objective value of the\n"
7777 "optimal integer solution. Only available for discrete problems.\n"
7778 ""},
7779 { "Objective_Offset", _wrap_Objective_Offset, METH_O, NULL},
7780 { "delete_Objective", _wrap_delete_Objective, METH_O, NULL},
7781 { "Objective_swigregister", Objective_swigregister, METH_O, NULL},
7782 { "Variable_name", _wrap_Variable_name, METH_O, " Returns the name of the variable."},
7783 { "Variable_SetInteger", _wrap_Variable_SetInteger, METH_VARARGS, " Sets the integrality requirement of the variable."},
7784 { "Variable_integer", _wrap_Variable_integer, METH_O, " Returns the integrality requirement of the variable."},
7785 { "Variable_solution_value", _wrap_Variable_solution_value, METH_O, "\n"
7786 "Returns the value of the variable in the current solution.\n"
7787 "\n"
7788 "If the variable is integer, then the value will always be an integer (the\n"
7789 "underlying solver handles floating-point values only, but this function\n"
7790 "automatically rounds it to the nearest integer; see: man 3 round).\n"
7791 ""},
7792 { "Variable_index", _wrap_Variable_index, METH_O, " Returns the index of the variable in the MPSolver::variables_."},
7793 { "Variable_lb", _wrap_Variable_lb, METH_O, " Returns the lower bound."},
7794 { "Variable_ub", _wrap_Variable_ub, METH_O, " Returns the upper bound."},
7795 { "Variable_SetBounds", _wrap_Variable_SetBounds, METH_VARARGS, " Sets both the lower and upper bounds."},
7796 { "Variable_reduced_cost", _wrap_Variable_reduced_cost, METH_O, "\n"
7797 "Advanced usage: returns the reduced cost of the variable in the current\n"
7798 "solution (only available for continuous problems).\n"
7799 ""},
7800 { "Variable_basis_status", _wrap_Variable_basis_status, METH_O, "\n"
7801 "Advanced usage: returns the basis status of the variable in the current\n"
7802 "solution (only available for continuous problems).\n"
7803 "\n"
7804 "See also: MPSolver::BasisStatus.\n"
7805 ""},
7806 { "Variable_branching_priority", _wrap_Variable_branching_priority, METH_O, "\n"
7807 "Advanced usage: Certain MIP solvers (e.g. Gurobi or SCIP) allow you to set\n"
7808 "a per-variable priority for determining which variable to branch on.\n"
7809 "\n"
7810 "A value of 0 is treated as default, and is equivalent to not setting the\n"
7811 "branching priority. The solver looks first to branch on fractional\n"
7812 "variables in higher priority levels. As of 2019-05, only Gurobi and SCIP\n"
7813 "support setting branching priority; all other solvers will simply ignore\n"
7814 "this annotation.\n"
7815 ""},
7816 { "Variable_SetBranchingPriority", _wrap_Variable_SetBranchingPriority, METH_VARARGS, NULL},
7817 { "Variable___str__", _wrap_Variable___str__, METH_O, NULL},
7818 { "Variable___repr__", _wrap_Variable___repr__, METH_O, NULL},
7819 { "Variable_SolutionValue", _wrap_Variable_SolutionValue, METH_O, NULL},
7820 { "Variable_Integer", _wrap_Variable_Integer, METH_O, NULL},
7821 { "Variable_Lb", _wrap_Variable_Lb, METH_O, NULL},
7822 { "Variable_Ub", _wrap_Variable_Ub, METH_O, NULL},
7823 { "Variable_SetLb", _wrap_Variable_SetLb, METH_VARARGS, NULL},
7824 { "Variable_SetUb", _wrap_Variable_SetUb, METH_VARARGS, NULL},
7825 { "Variable_ReducedCost", _wrap_Variable_ReducedCost, METH_O, NULL},
7826 { "delete_Variable", _wrap_delete_Variable, METH_O, NULL},
7827 { "Variable_swigregister", Variable_swigregister, METH_O, NULL},
7828 { "Constraint_name", _wrap_Constraint_name, METH_O, " Returns the name of the constraint."},
7829 { "Constraint_Clear", _wrap_Constraint_Clear, METH_O, " Clears all variables and coefficients. Does not clear the bounds."},
7830 { "Constraint_SetCoefficient", _wrap_Constraint_SetCoefficient, METH_VARARGS, "\n"
7831 "Sets the coefficient of the variable on the constraint.\n"
7832 "\n"
7833 "If the variable does not belong to the solver, the function just returns,\n"
7834 "or crashes in non-opt mode.\n"
7835 ""},
7836 { "Constraint_GetCoefficient", _wrap_Constraint_GetCoefficient, METH_VARARGS, "\n"
7837 "Gets the coefficient of a given variable on the constraint (which is 0 if\n"
7838 "the variable does not appear in the constraint).\n"
7839 ""},
7840 { "Constraint_lb", _wrap_Constraint_lb, METH_O, " Returns the lower bound."},
7841 { "Constraint_ub", _wrap_Constraint_ub, METH_O, " Returns the upper bound."},
7842 { "Constraint_SetBounds", _wrap_Constraint_SetBounds, METH_VARARGS, " Sets both the lower and upper bounds."},
7843 { "Constraint_set_is_lazy", _wrap_Constraint_set_is_lazy, METH_VARARGS, "\n"
7844 "Advanced usage: sets the constraint \"laziness\".\n"
7845 "\n"
7846 "**This is only supported for SCIP and has no effect on other\n"
7847 "solvers.**\n"
7848 "\n"
7849 "When **laziness** is true, the constraint is only considered by the Linear\n"
7850 "Programming solver if its current solution violates the constraint. In this\n"
7851 "case, the constraint is definitively added to the problem. This may be\n"
7852 "useful in some MIP problems, and may have a dramatic impact on performance.\n"
7853 "\n"
7854 "For more info see: http://tinyurl.com/lazy-constraints.\n"
7855 ""},
7856 { "Constraint_index", _wrap_Constraint_index, METH_O, " Returns the index of the constraint in the MPSolver::constraints_."},
7857 { "Constraint_dual_value", _wrap_Constraint_dual_value, METH_O, "\n"
7858 "Advanced usage: returns the dual value of the constraint in the current\n"
7859 "solution (only available for continuous problems).\n"
7860 ""},
7861 { "Constraint_basis_status", _wrap_Constraint_basis_status, METH_O, "\n"
7862 "Advanced usage: returns the basis status of the constraint.\n"
7863 "\n"
7864 "It is only available for continuous problems).\n"
7865 "\n"
7866 "Note that if a constraint \"linear_expression in [lb, ub]\" is transformed\n"
7867 "into \"linear_expression + slack = 0\" with slack in [-ub, -lb], then this\n"
7868 "status is the same as the status of the slack variable with AT_UPPER_BOUND\n"
7869 "and AT_LOWER_BOUND swapped.\n"
7870 "\n"
7871 "See also: MPSolver::BasisStatus.\n"
7872 ""},
7873 { "Constraint_Lb", _wrap_Constraint_Lb, METH_O, NULL},
7874 { "Constraint_Ub", _wrap_Constraint_Ub, METH_O, NULL},
7875 { "Constraint_SetLb", _wrap_Constraint_SetLb, METH_VARARGS, NULL},
7876 { "Constraint_SetUb", _wrap_Constraint_SetUb, METH_VARARGS, NULL},
7877 { "Constraint_DualValue", _wrap_Constraint_DualValue, METH_O, NULL},
7878 { "delete_Constraint", _wrap_delete_Constraint, METH_O, NULL},
7879 { "Constraint_swigregister", Constraint_swigregister, METH_O, NULL},
7880 { "new_MPSolverParameters", _wrap_new_MPSolverParameters, METH_NOARGS, " The constructor sets all parameters to their default value."},
7881 { "MPSolverParameters_SetDoubleParam", _wrap_MPSolverParameters_SetDoubleParam, METH_VARARGS, " Sets a double parameter to a specific value."},
7882 { "MPSolverParameters_SetIntegerParam", _wrap_MPSolverParameters_SetIntegerParam, METH_VARARGS, " Sets a integer parameter to a specific value."},
7883 { "MPSolverParameters_GetDoubleParam", _wrap_MPSolverParameters_GetDoubleParam, METH_VARARGS, " Returns the value of a double parameter."},
7884 { "MPSolverParameters_GetIntegerParam", _wrap_MPSolverParameters_GetIntegerParam, METH_VARARGS, " Returns the value of an integer parameter."},
7885 { "delete_MPSolverParameters", _wrap_delete_MPSolverParameters, METH_O, NULL},
7886 { "MPSolverParameters_swigregister", MPSolverParameters_swigregister, METH_O, NULL},
7887 { "MPSolverParameters_swiginit", MPSolverParameters_swiginit, METH_VARARGS, NULL},
7888 { "new_ModelExportOptions", _wrap_new_ModelExportOptions, METH_NOARGS, NULL},
7889 { "delete_ModelExportOptions", _wrap_delete_ModelExportOptions, METH_O, NULL},
7890 { "ModelExportOptions_swigregister", ModelExportOptions_swigregister, METH_O, NULL},
7891 { "ModelExportOptions_swiginit", ModelExportOptions_swiginit, METH_VARARGS, NULL},
7892 { "ExportModelAsLpFormat", _wrap_ExportModelAsLpFormat, METH_VARARGS, NULL},
7893 { "ExportModelAsMpsFormat", _wrap_ExportModelAsMpsFormat, METH_VARARGS, NULL},
7894 { "FindErrorInModelProto", _wrap_FindErrorInModelProto, METH_O, NULL},
7895 { NULL, NULL, 0, NULL }
7896};
7897
7898static PyMethodDef SwigMethods_proxydocs[] = {
7899 { NULL, NULL, 0, NULL }
7900};
7901
7902
7903/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
7904
7905static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
7906static swig_type_info _swigt__p_int = {"_p_int", "int *|int_least32_t *|int32_t *", 0, 0, (void*)0, 0};
7907static swig_type_info _swigt__p_long = {"_p_long", "intptr_t *|int_least64_t *|int_fast32_t *|int_fast64_t *|int64_t *|long *|int_fast16_t *|intmax_t *", 0, 0, (void*)0, 0};
7908static swig_type_info _swigt__p_operations_research__MPConstraint = {"_p_operations_research__MPConstraint", "operations_research::MPConstraint *", 0, 0, (void*)0, 0};
7909static swig_type_info _swigt__p_operations_research__MPModelExportOptions = {"_p_operations_research__MPModelExportOptions", "operations_research::MPModelExportOptions *", 0, 0, (void*)0, 0};
7910static swig_type_info _swigt__p_operations_research__MPModelRequest = {"_p_operations_research__MPModelRequest", "operations_research::MPModelRequest *", 0, 0, (void*)0, 0};
7911static swig_type_info _swigt__p_operations_research__MPObjective = {"_p_operations_research__MPObjective", "operations_research::MPObjective *", 0, 0, (void*)0, 0};
7912static swig_type_info _swigt__p_operations_research__MPSolver = {"_p_operations_research__MPSolver", "operations_research::MPSolver *", 0, 0, (void*)0, 0};
7913static swig_type_info _swigt__p_operations_research__MPSolverParameters = {"_p_operations_research__MPSolverParameters", "operations_research::MPSolverParameters *", 0, 0, (void*)0, 0};
7914static swig_type_info _swigt__p_operations_research__MPVariable = {"_p_operations_research__MPVariable", "operations_research::MPVariable *", 0, 0, (void*)0, 0};
7915static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
7916static 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};
7917static swig_type_info _swigt__p_std__atomicT_bool_t = {"_p_std__atomicT_bool_t", "std::atomic< bool > *", 0, 0, (void*)0, 0};
7918static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0};
7919static 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};
7920static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint_least32_t *|uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
7921static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uintptr_t *|uint_least64_t *|uint_fast32_t *|uint_fast64_t *|uint64_t *|unsigned long *|uint_fast16_t *|uintmax_t *", 0, 0, (void*)0, 0};
7922static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
7923
7943};
7944
7945static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
7946static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
7947static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
7955static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
7956static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
7958static swig_cast_info _swigc__p_std__ostream[] = { {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}};
7960static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
7963
7983};
7984
7985
7986/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
7987
7989{0, 0, 0, 0.0, 0, 0}};
7990
7991#ifdef __cplusplus
7992}
7993#endif
7994/* -----------------------------------------------------------------------------
7995 * Type initialization:
7996 * This problem is tough by the requirement that no dynamic
7997 * memory is used. Also, since swig_type_info structures store pointers to
7998 * swig_cast_info structures and swig_cast_info structures store pointers back
7999 * to swig_type_info structures, we need some lookup code at initialization.
8000 * The idea is that swig generates all the structures that are needed.
8001 * The runtime then collects these partially filled structures.
8002 * The SWIG_InitializeModule function takes these initial arrays out of
8003 * swig_module, and does all the lookup, filling in the swig_module.types
8004 * array with the correct data and linking the correct swig_cast_info
8005 * structures together.
8006 *
8007 * The generated swig_type_info structures are assigned statically to an initial
8008 * array. We just loop through that array, and handle each type individually.
8009 * First we lookup if this type has been already loaded, and if so, use the
8010 * loaded structure instead of the generated one. Then we have to fill in the
8011 * cast linked list. The cast data is initially stored in something like a
8012 * two-dimensional array. Each row corresponds to a type (there are the same
8013 * number of rows as there are in the swig_type_initial array). Each entry in
8014 * a column is one of the swig_cast_info structures for that type.
8015 * The cast_initial array is actually an array of arrays, because each row has
8016 * a variable number of columns. So to actually build the cast linked list,
8017 * we find the array of casts associated with the type, and loop through it
8018 * adding the casts to the list. The one last trick we need to do is making
8019 * sure the type pointer in the swig_cast_info struct is correct.
8020 *
8021 * First off, we lookup the cast->type name to see if it is already loaded.
8022 * There are three cases to handle:
8023 * 1) If the cast->type has already been loaded AND the type we are adding
8024 * casting info to has not been loaded (it is in this module), THEN we
8025 * replace the cast->type pointer with the type pointer that has already
8026 * been loaded.
8027 * 2) If BOTH types (the one we are adding casting info to, and the
8028 * cast->type) are loaded, THEN the cast info has already been loaded by
8029 * the previous module so we just ignore it.
8030 * 3) Finally, if cast->type has not already been loaded, then we add that
8031 * swig_cast_info to the linked list (because the cast->type) pointer will
8032 * be correct.
8033 * ----------------------------------------------------------------------------- */
8034
8035#ifdef __cplusplus
8036extern "C" {
8037#if 0
8038} /* c-mode */
8039#endif
8040#endif
8041
8042#if 0
8043#define SWIGRUNTIME_DEBUG
8044#endif
8045
8046
8047SWIGRUNTIME void
8048SWIG_InitializeModule(void *clientdata) {
8049 size_t i;
8050 swig_module_info *module_head, *iter;
8051 int init;
8052
8053 /* check to see if the circular list has been setup, if not, set it up */
8054 if (swig_module.next==0) {
8055 /* Initialize the swig_module */
8059 init = 1;
8060 } else {
8061 init = 0;
8062 }
8063
8064 /* Try and load any already created modules */
8065 module_head = SWIG_GetModule(clientdata);
8066 if (!module_head) {
8067 /* This is the first module loaded for this interpreter */
8068 /* so set the swig module into the interpreter */
8069 SWIG_SetModule(clientdata, &swig_module);
8070 } else {
8071 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
8072 iter=module_head;
8073 do {
8074 if (iter==&swig_module) {
8075 /* Our module is already in the list, so there's nothing more to do. */
8076 return;
8077 }
8078 iter=iter->next;
8079 } while (iter!= module_head);
8080
8081 /* otherwise we must add our module into the list */
8082 swig_module.next = module_head->next;
8083 module_head->next = &swig_module;
8084 }
8085
8086 /* When multiple interpreters are used, a module could have already been initialized in
8087 a different interpreter, but not yet have a pointer in this interpreter.
8088 In this case, we do not want to continue adding types... everything should be
8089 set up already */
8090 if (init == 0) return;
8091
8092 /* Now work on filling in swig_module.types */
8093#ifdef SWIGRUNTIME_DEBUG
8094 printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
8095#endif
8096 for (i = 0; i < swig_module.size; ++i) {
8097 swig_type_info *type = 0;
8098 swig_type_info *ret;
8099 swig_cast_info *cast;
8100
8101#ifdef SWIGRUNTIME_DEBUG
8102 printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
8103#endif
8104
8105 /* if there is another module already loaded */
8106 if (swig_module.next != &swig_module) {
8108 }
8109 if (type) {
8110 /* Overwrite clientdata field */
8111#ifdef SWIGRUNTIME_DEBUG
8112 printf("SWIG_InitializeModule: found type %s\n", type->name);
8113#endif
8116#ifdef SWIGRUNTIME_DEBUG
8117 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
8118#endif
8119 }
8120 } else {
8121 type = swig_module.type_initial[i];
8122 }
8123
8124 /* Insert casting types */
8125 cast = swig_module.cast_initial[i];
8126 while (cast->type) {
8127 /* Don't need to add information already in the list */
8128 ret = 0;
8129#ifdef SWIGRUNTIME_DEBUG
8130 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
8131#endif
8132 if (swig_module.next != &swig_module) {
8134#ifdef SWIGRUNTIME_DEBUG
8135 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
8136#endif
8137 }
8138 if (ret) {
8139 if (type == swig_module.type_initial[i]) {
8140#ifdef SWIGRUNTIME_DEBUG
8141 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
8142#endif
8143 cast->type = ret;
8144 ret = 0;
8145 } else {
8146 /* Check for casting already in the list */
8147 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
8148#ifdef SWIGRUNTIME_DEBUG
8149 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
8150#endif
8151 if (!ocast) ret = 0;
8152 }
8153 }
8154
8155 if (!ret) {
8156#ifdef SWIGRUNTIME_DEBUG
8157 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
8158#endif
8159 if (type->cast) {
8160 type->cast->prev = cast;
8161 cast->next = type->cast;
8162 }
8163 type->cast = cast;
8164 }
8165 cast++;
8166 }
8167 /* Set entry in modules->types array equal to the type */
8168 swig_module.types[i] = type;
8169 }
8170 swig_module.types[i] = 0;
8171
8172#ifdef SWIGRUNTIME_DEBUG
8173 printf("**** SWIG_InitializeModule: Cast List ******\n");
8174 for (i = 0; i < swig_module.size; ++i) {
8175 int j = 0;
8177 printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
8178 while (cast->type) {
8179 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
8180 cast++;
8181 ++j;
8182 }
8183 printf("---- Total casts: %d\n",j);
8184 }
8185 printf("**** SWIG_InitializeModule: Cast List ******\n");
8186#endif
8187}
8188
8189/* This function will propagate the clientdata field of type to
8190* any new swig_type_info structures that have been added into the list
8191* of equivalent types. It is like calling
8192* SWIG_TypeClientData(type, clientdata) a second time.
8193*/
8194SWIGRUNTIME void
8196 size_t i;
8197 swig_cast_info *equiv;
8198 static int init_run = 0;
8199
8200 if (init_run) return;
8201 init_run = 1;
8202
8203 for (i = 0; i < swig_module.size; i++) {
8204 if (swig_module.types[i]->clientdata) {
8205 equiv = swig_module.types[i]->cast;
8206 while (equiv) {
8207 if (!equiv->converter) {
8208 if (equiv->type && !equiv->type->clientdata)
8210 }
8211 equiv = equiv->next;
8212 }
8213 }
8214 }
8215}
8216
8217#ifdef __cplusplus
8218#if 0
8219{
8220 /* c-mode */
8221#endif
8222}
8223#endif
8224
8225
8226
8227#ifdef __cplusplus
8228extern "C" {
8229#endif
8230
8231 /* Python-specific SWIG API */
8232#define SWIG_newvarlink() SWIG_Python_newvarlink()
8233#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
8234#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
8235
8236 /* -----------------------------------------------------------------------------
8237 * global variable support code.
8238 * ----------------------------------------------------------------------------- */
8239
8240 typedef struct swig_globalvar {
8241 char *name; /* Name of global variable */
8242 PyObject *(*get_attr)(void); /* Return the current value */
8243 int (*set_attr)(PyObject *); /* Set the value */
8244 struct swig_globalvar *next;
8246
8247 typedef struct swig_varlinkobject {
8248 PyObject_HEAD
8251
8252 SWIGINTERN PyObject *
8254#if PY_VERSION_HEX >= 0x03000000
8255 return PyUnicode_InternFromString("<Swig global variables>");
8256#else
8257 return PyString_FromString("<Swig global variables>");
8258#endif
8259 }
8260
8261 SWIGINTERN PyObject *
8263#if PY_VERSION_HEX >= 0x03000000
8264 PyObject *str = PyUnicode_InternFromString("(");
8265 PyObject *tail;
8266 PyObject *joined;
8268 for (var = v->vars; var; var=var->next) {
8269 tail = PyUnicode_FromString(var->name);
8270 joined = PyUnicode_Concat(str, tail);
8271 Py_DecRef(str);
8272 Py_DecRef(tail);
8273 str = joined;
8274 if (var->next) {
8275 tail = PyUnicode_InternFromString(", ");
8276 joined = PyUnicode_Concat(str, tail);
8277 Py_DecRef(str);
8278 Py_DecRef(tail);
8279 str = joined;
8280 }
8281 }
8282 tail = PyUnicode_InternFromString(")");
8283 joined = PyUnicode_Concat(str, tail);
8284 Py_DecRef(str);
8285 Py_DecRef(tail);
8286 str = joined;
8287#else
8288 PyObject *str = PyString_FromString("(");
8290 for (var = v->vars; var; var=var->next) {
8291 PyString_ConcatAndDel(&str,PyString_FromString(var->name));
8292 if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
8293 }
8294 PyString_ConcatAndDel(&str,PyString_FromString(")"));
8295#endif
8296 return str;
8297 }
8298
8299 SWIGINTERN void
8301 swig_globalvar *var = v->vars;
8302 while (var) {
8303 swig_globalvar *n = var->next;
8304 free(var->name);
8305 free(var);
8306 var = n;
8307 }
8308 }
8309
8310 SWIGINTERN PyObject *
8312 PyObject *res = NULL;
8313 swig_globalvar *var = v->vars;
8314 while (var) {
8315 if (strcmp(var->name,n) == 0) {
8316 res = (*var->get_attr)();
8317 break;
8318 }
8319 var = var->next;
8320 }
8321 if (res == NULL && !PyErr_Occurred()) {
8322 PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
8323 }
8324 return res;
8325 }
8326
8327 SWIGINTERN int
8328 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
8329 int res = 1;
8330 swig_globalvar *var = v->vars;
8331 while (var) {
8332 if (strcmp(var->name,n) == 0) {
8333 res = (*var->set_attr)(p);
8334 break;
8335 }
8336 var = var->next;
8337 }
8338 if (res == 1 && !PyErr_Occurred()) {
8339 PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
8340 }
8341 return res;
8342 }
8343
8344 SWIGINTERN PyTypeObject*
8346 static char varlink__doc__[] = "Swig var link object";
8347 static PyTypeObject varlink_type;
8348 static int type_init = 0;
8349 if (!type_init) {
8350 const PyTypeObject tmp = {
8351#if PY_VERSION_HEX >= 0x03000000
8352 PyVarObject_HEAD_INIT(NULL, 0)
8353#else
8354 PyObject_HEAD_INIT(NULL)
8355 0, /* ob_size */
8356#endif
8357 "swigvarlink", /* tp_name */
8358 sizeof(swig_varlinkobject), /* tp_basicsize */
8359 0, /* tp_itemsize */
8360 (destructor) swig_varlink_dealloc, /* tp_dealloc */
8361 0, /* tp_print */
8362 (getattrfunc) swig_varlink_getattr, /* tp_getattr */
8363 (setattrfunc) swig_varlink_setattr, /* tp_setattr */
8364 0, /* tp_compare */
8365 (reprfunc) swig_varlink_repr, /* tp_repr */
8366 0, /* tp_as_number */
8367 0, /* tp_as_sequence */
8368 0, /* tp_as_mapping */
8369 0, /* tp_hash */
8370 0, /* tp_call */
8371 (reprfunc) swig_varlink_str, /* tp_str */
8372 0, /* tp_getattro */
8373 0, /* tp_setattro */
8374 0, /* tp_as_buffer */
8375 0, /* tp_flags */
8376 varlink__doc__, /* tp_doc */
8377 0, /* tp_traverse */
8378 0, /* tp_clear */
8379 0, /* tp_richcompare */
8380 0, /* tp_weaklistoffset */
8381 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
8382 0, /* tp_del */
8383 0, /* tp_version_tag */
8384#if PY_VERSION_HEX >= 0x03040000
8385 0, /* tp_finalize */
8386#endif
8387#if PY_VERSION_HEX >= 0x03080000
8388 0, /* tp_vectorcall */
8389#endif
8390#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
8391 0, /* tp_print */
8392#endif
8393#ifdef COUNT_ALLOCS
8394 0, /* tp_allocs */
8395 0, /* tp_frees */
8396 0, /* tp_maxalloc */
8397 0, /* tp_prev */
8398 0 /* tp_next */
8399#endif
8400 };
8401 varlink_type = tmp;
8402 type_init = 1;
8403 if (PyType_Ready(&varlink_type) < 0)
8404 return NULL;
8405 }
8406 return &varlink_type;
8407 }
8408
8409 /* Create a variable linking object for use later */
8410 SWIGINTERN PyObject *
8412 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
8413 if (result) {
8414 result->vars = 0;
8415 }
8416 return ((PyObject*) result);
8417 }
8418
8419 SWIGINTERN void
8420 SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
8423 if (gv) {
8424 size_t size = strlen(name)+1;
8425 gv->name = (char *)malloc(size);
8426 if (gv->name) {
8427 memcpy(gv->name, name, size);
8428 gv->get_attr = get_attr;
8429 gv->set_attr = set_attr;
8430 gv->next = v->vars;
8431 }
8432 }
8433 v->vars = gv;
8434 }
8435
8436 SWIGINTERN PyObject *
8438 static PyObject *globals = 0;
8439 if (!globals) {
8440 globals = SWIG_newvarlink();
8441 }
8442 return globals;
8443 }
8444
8445 /* -----------------------------------------------------------------------------
8446 * constants/methods manipulation
8447 * ----------------------------------------------------------------------------- */
8448
8449 /* Install Constants */
8450 SWIGINTERN void
8452 PyObject *obj = 0;
8453 size_t i;
8454 for (i = 0; constants[i].type; ++i) {
8455 switch(constants[i].type) {
8456 case SWIG_PY_POINTER:
8457 obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
8458 break;
8459 case SWIG_PY_BINARY:
8460 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
8461 break;
8462 default:
8463 obj = 0;
8464 break;
8465 }
8466 if (obj) {
8467 PyDict_SetItemString(d, constants[i].name, obj);
8468 Py_DECREF(obj);
8469 }
8470 }
8471 }
8472
8473 /* -----------------------------------------------------------------------------*/
8474 /* Fix SwigMethods to carry the callback ptrs when needed */
8475 /* -----------------------------------------------------------------------------*/
8476
8477 SWIGINTERN void
8478 SWIG_Python_FixMethods(PyMethodDef *methods,
8479 swig_const_info *const_table,
8480 swig_type_info **types,
8481 swig_type_info **types_initial) {
8482 size_t i;
8483 for (i = 0; methods[i].ml_name; ++i) {
8484 const char *c = methods[i].ml_doc;
8485 if (!c) continue;
8486 c = strstr(c, "swig_ptr: ");
8487 if (c) {
8488 int j;
8489 swig_const_info *ci = 0;
8490 const char *name = c + 10;
8491 for (j = 0; const_table[j].type; ++j) {
8492 if (strncmp(const_table[j].name, name,
8493 strlen(const_table[j].name)) == 0) {
8494 ci = &(const_table[j]);
8495 break;
8496 }
8497 }
8498 if (ci) {
8499 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
8500 if (ptr) {
8501 size_t shift = (ci->ptype) - types;
8502 swig_type_info *ty = types_initial[shift];
8503 size_t ldoc = (c - methods[i].ml_doc);
8504 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
8505 char *ndoc = (char*)malloc(ldoc + lptr + 10);
8506 if (ndoc) {
8507 char *buff = ndoc;
8508 memcpy(buff, methods[i].ml_doc, ldoc);
8509 buff += ldoc;
8510 memcpy(buff, "swig_ptr: ", 10);
8511 buff += 10;
8512 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
8513 methods[i].ml_doc = ndoc;
8514 }
8515 }
8516 }
8517 }
8518 }
8519 }
8520
8521 /* -----------------------------------------------------------------------------
8522 * Method creation and docstring support functions
8523 * ----------------------------------------------------------------------------- */
8524
8525 /* -----------------------------------------------------------------------------
8526 * Function to find the method definition with the correct docstring for the
8527 * proxy module as opposed to the low-level API
8528 * ----------------------------------------------------------------------------- */
8529
8530 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
8531 /* Find the function in the modified method table */
8532 size_t offset = 0;
8533 int found = 0;
8534 while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
8535 if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
8536 found = 1;
8537 break;
8538 }
8539 offset++;
8540 }
8541 /* Use the copy with the modified docstring if available */
8542 return found ? &SwigMethods_proxydocs[offset] : NULL;
8543 }
8544
8545 /* -----------------------------------------------------------------------------
8546 * Wrapper of PyInstanceMethod_New() used in Python 3
8547 * It is exported to the generated module, used for -fastproxy
8548 * ----------------------------------------------------------------------------- */
8549
8550 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
8551 if (PyCFunction_Check(func)) {
8552 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8553 PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
8554 if (ml)
8555 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8556 }
8557#if PY_VERSION_HEX >= 0x03000000
8558 return PyInstanceMethod_New(func);
8559#else
8560 return PyMethod_New(func, NULL, NULL);
8561#endif
8562 }
8563
8564 /* -----------------------------------------------------------------------------
8565 * Wrapper of PyStaticMethod_New()
8566 * It is exported to the generated module, used for -fastproxy
8567 * ----------------------------------------------------------------------------- */
8568
8569 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
8570 if (PyCFunction_Check(func)) {
8571 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8572 PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
8573 if (ml)
8574 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8575 }
8576 return PyStaticMethod_New(func);
8577 }
8578
8579#ifdef __cplusplus
8580}
8581#endif
8582
8583/* -----------------------------------------------------------------------------*
8584 * Partial Init method
8585 * -----------------------------------------------------------------------------*/
8586
8587#ifdef __cplusplus
8588extern "C"
8589#endif
8590
8592#if PY_VERSION_HEX >= 0x03000000
8593PyObject*
8594#else
8595void
8596#endif
8597SWIG_init(void) {
8598 PyObject *m, *d, *md, *globals;
8599
8600#if PY_VERSION_HEX >= 0x03000000
8601 static struct PyModuleDef SWIG_module = {
8602 PyModuleDef_HEAD_INIT,
8603 SWIG_name,
8604 NULL,
8605 -1,
8607 NULL,
8608 NULL,
8609 NULL,
8610 NULL
8611 };
8612#endif
8613
8614#if defined(SWIGPYTHON_BUILTIN)
8615 static SwigPyClientData SwigPyObject_clientdata = {
8616 0, 0, 0, 0, 0, 0, 0
8617 };
8618 static PyGetSetDef this_getset_def = {
8619 (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
8620 };
8621 static SwigPyGetSet thisown_getset_closure = {
8624 };
8625 static PyGetSetDef thisown_getset_def = {
8626 (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
8627 };
8628 PyTypeObject *builtin_pytype;
8629 int builtin_base_count;
8630 swig_type_info *builtin_basetype;
8631 PyObject *tuple;
8632 PyGetSetDescrObject *static_getset;
8633 PyTypeObject *metatype;
8634 PyTypeObject *swigpyobject;
8635 SwigPyClientData *cd;
8636 PyObject *public_interface, *public_symbol;
8637 PyObject *this_descr;
8638 PyObject *thisown_descr;
8639 PyObject *self = 0;
8640 int i;
8641
8642 (void)builtin_pytype;
8643 (void)builtin_base_count;
8644 (void)builtin_basetype;
8645 (void)tuple;
8646 (void)static_getset;
8647 (void)self;
8648
8649 /* Metaclass is used to implement static member variables */
8650 metatype = SwigPyObjectType();
8651 assert(metatype);
8652#endif
8653
8654 (void)globals;
8655
8656 /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
8657 SWIG_This();
8660#ifndef SWIGPYTHON_BUILTIN
8662#endif
8663
8664 /* Fix SwigMethods to carry the callback ptrs when needed */
8666
8667#if PY_VERSION_HEX >= 0x03000000
8668 m = PyModule_Create(&SWIG_module);
8669#else
8670 m = Py_InitModule(SWIG_name, SwigMethods);
8671#endif
8672
8673 md = d = PyModule_GetDict(m);
8674 (void)md;
8675
8677
8678#ifdef SWIGPYTHON_BUILTIN
8679 swigpyobject = SwigPyObject_TypeOnce();
8680
8681 SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
8682 assert(SwigPyObject_stype);
8683 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
8684 if (!cd) {
8685 SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
8686 SwigPyObject_clientdata.pytype = swigpyobject;
8687 } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
8688 PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
8689# if PY_VERSION_HEX >= 0x03000000
8690 return NULL;
8691# else
8692 return;
8693# endif
8694 }
8695
8696 /* All objects have a 'this' attribute */
8697 this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
8698 (void)this_descr;
8699
8700 /* All objects have a 'thisown' attribute */
8701 thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
8702 (void)thisown_descr;
8703
8704 public_interface = PyList_New(0);
8705 public_symbol = 0;
8706 (void)public_symbol;
8707
8708 PyDict_SetItemString(md, "__all__", public_interface);
8709 Py_DECREF(public_interface);
8710 for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
8711 SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
8712 for (i = 0; swig_const_table[i].name != 0; ++i)
8713 SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
8714#endif
8715
8717
8718 SWIG_Python_SetConstant(d, "Solver_CLP_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CLP_LINEAR_PROGRAMMING)));
8719 SWIG_Python_SetConstant(d, "Solver_GLPK_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLPK_LINEAR_PROGRAMMING)));
8720 SWIG_Python_SetConstant(d, "Solver_GLOP_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLOP_LINEAR_PROGRAMMING)));
8721 SWIG_Python_SetConstant(d, "Solver_SCIP_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING)));
8722 SWIG_Python_SetConstant(d, "Solver_GLPK_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING)));
8723 SWIG_Python_SetConstant(d, "Solver_CBC_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CBC_MIXED_INTEGER_PROGRAMMING)));
8724 SWIG_Python_SetConstant(d, "Solver_GUROBI_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GUROBI_LINEAR_PROGRAMMING)));
8725 SWIG_Python_SetConstant(d, "Solver_GUROBI_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GUROBI_MIXED_INTEGER_PROGRAMMING)));
8726 SWIG_Python_SetConstant(d, "Solver_CPLEX_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CPLEX_LINEAR_PROGRAMMING)));
8727 SWIG_Python_SetConstant(d, "Solver_CPLEX_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CPLEX_MIXED_INTEGER_PROGRAMMING)));
8728 SWIG_Python_SetConstant(d, "Solver_XPRESS_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::XPRESS_LINEAR_PROGRAMMING)));
8729 SWIG_Python_SetConstant(d, "Solver_XPRESS_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::XPRESS_MIXED_INTEGER_PROGRAMMING)));
8730 SWIG_Python_SetConstant(d, "Solver_BOP_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::BOP_INTEGER_PROGRAMMING)));
8731 SWIG_Python_SetConstant(d, "Solver_SAT_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::SAT_INTEGER_PROGRAMMING)));
8732 SWIG_Python_SetConstant(d, "Solver_OPTIMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolver::OPTIMAL)));
8733 SWIG_Python_SetConstant(d, "Solver_FEASIBLE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FEASIBLE)));
8734 SWIG_Python_SetConstant(d, "Solver_INFEASIBLE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::INFEASIBLE)));
8735 SWIG_Python_SetConstant(d, "Solver_UNBOUNDED",SWIG_From_int(static_cast< int >(operations_research::MPSolver::UNBOUNDED)));
8736 SWIG_Python_SetConstant(d, "Solver_ABNORMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolver::ABNORMAL)));
8737 SWIG_Python_SetConstant(d, "Solver_NOT_SOLVED",SWIG_From_int(static_cast< int >(operations_research::MPSolver::NOT_SOLVED)));
8738 SWIG_Python_SetConstant(d, "Solver_FREE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FREE)));
8739 SWIG_Python_SetConstant(d, "Solver_AT_LOWER_BOUND",SWIG_From_int(static_cast< int >(operations_research::MPSolver::AT_LOWER_BOUND)));
8740 SWIG_Python_SetConstant(d, "Solver_AT_UPPER_BOUND",SWIG_From_int(static_cast< int >(operations_research::MPSolver::AT_UPPER_BOUND)));
8741 SWIG_Python_SetConstant(d, "Solver_FIXED_VALUE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FIXED_VALUE)));
8742 SWIG_Python_SetConstant(d, "Solver_BASIC",SWIG_From_int(static_cast< int >(operations_research::MPSolver::BASIC)));
8743 SWIG_Python_SetConstant(d, "MPSolverParameters_RELATIVE_MIP_GAP",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::RELATIVE_MIP_GAP)));
8744 SWIG_Python_SetConstant(d, "MPSolverParameters_PRIMAL_TOLERANCE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRIMAL_TOLERANCE)));
8745 SWIG_Python_SetConstant(d, "MPSolverParameters_DUAL_TOLERANCE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::DUAL_TOLERANCE)));
8746 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE)));
8747 SWIG_Python_SetConstant(d, "MPSolverParameters_LP_ALGORITHM",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::LP_ALGORITHM)));
8748 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY)));
8749 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING)));
8750 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE_OFF)));
8751 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE_ON)));
8752 SWIG_Python_SetConstant(d, "MPSolverParameters_DUAL",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::DUAL)));
8753 SWIG_Python_SetConstant(d, "MPSolverParameters_PRIMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRIMAL)));
8754 SWIG_Python_SetConstant(d, "MPSolverParameters_BARRIER",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::BARRIER)));
8755 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY_OFF)));
8756 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY_ON)));
8757 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING_OFF)));
8758 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING_ON)));
8759 globals = SWIG_globals();
8760 if (!globals) {
8761 PyErr_SetString(PyExc_TypeError, "Failure to create SWIG globals.");
8762#if PY_VERSION_HEX >= 0x03000000
8763 return NULL;
8764#else
8765 return;
8766#endif
8767 }
8768 PyDict_SetItemString(md, "cvar", globals);
8769 Py_DECREF(globals);
8775#if PY_VERSION_HEX >= 0x03000000
8776 return m;
8777#else
8778 return;
8779#endif
8780}
8781
int64_t max
Definition: alldiff_cst.cc:140
int64_t min
Definition: alldiff_cst.cc:139
#define LOG_IF(severity, condition)
Definition: base/logging.h:476
#define LOG(severity)
Definition: base/logging.h:417
The class for constraints of a Mathematical Programming (MP) model.
A class to express a linear objective.
This mathematical programming (MP) solver class is the main class though which users build and solve ...
static bool SupportsProblemType(OptimizationProblemType problem_type)
Whether the given problem type is supported (this will depend on the targets that you linked).
static MPSolver * CreateSolver(const std::string &solver_id)
Recommended factory method to create a MPSolver instance, especially in non C++ languages.
ResultStatus
The status of solving the problem.
@ FEASIBLE
feasible, or stopped by limit.
@ NOT_SOLVED
not been solved yet.
@ INFEASIBLE
proven infeasible.
@ UNBOUNDED
proven unbounded.
@ ABNORMAL
abnormal, i.e., error of some kind.
OptimizationProblemType
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
std::vector< double > ComputeConstraintActivities() const
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms...
static double infinity()
Infinity.
static void SolveWithProto(const MPModelRequest &model_request, MPSolutionResponse *response, std::atomic< bool > *interrupt=nullptr)
Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSo...
ABSL_MUST_USE_RESULT bool NextSolution()
Some solvers (MIP only, not LP) can produce multiple solutions to the problem.
bool InterruptSolve()
Interrupts the Solve() execution to terminate processing if possible.
ResultStatus Solve()
Solves the problem using the default parameter values.
BasisStatus
Advanced usage: possible basis status values for a variable and the slack variable of a linear constr...
This class stores parameter settings for LP and MIP solvers.
@ INCREMENTALITY_OFF
Start solve from scratch.
@ INCREMENTALITY_ON
Reuse results from previous solve as much as the underlying solver allows.
static const IncrementalityValues kDefaultIncrementality
DoubleParam
Enumeration of parameters that take continuous values.
@ DUAL_TOLERANCE
Advanced usage: tolerance for dual feasibility of basic solutions.
@ PRIMAL_TOLERANCE
Advanced usage: tolerance for primal feasibility of basic solutions.
@ RELATIVE_MIP_GAP
Limit for relative MIP gap.
static const PresolveValues kDefaultPresolve
IntegerParam
Enumeration of parameters that take integer or categorical values.
@ LP_ALGORITHM
Algorithm to solve linear programs.
@ SCALING
Advanced usage: enable or disable matrix scaling.
@ PRESOLVE
Advanced usage: presolve mode.
@ INCREMENTALITY
Advanced usage: incrementality from one solve to the next.
The class for variables of a Mathematical Programming (MP) model.
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
SwigPtr_PyObject(const SwigPtr_PyObject &item)
int64_t b
Block * next
SharedResponseManager * response
const std::string name
int64_t value
IntVar * var
Definition: expr_array.cc:1874
GRBmodel * model
A C++ wrapper that provides a simple and unified interface to several linear programming and mixed in...
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
static swig_cast_info _swigc__p_operations_research__MPObjective[]
#define SWIG_Error(code, msg)
SWIGINTERN PyObject * _wrap_Solver_LookupConstraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_From_int(int value)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
PyObject * FromObjectMPConstraint(operations_research::MPConstraint *obj)
SWIGINTERN PyObject * _wrap_Objective_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_ExportModelToProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * _wrap_Variable_solution_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__MPSolverParameters
SWIGINTERN PyObject * _wrap_Variable_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultPrimalTolerance_set(PyObject *)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat(PyObject *self, PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_SetInteger(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_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
static swig_type_info _swigt__p_operations_research__MPSolverParameters
SWIGINTERN PyObject * _wrap___lshift____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * Variable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
bool CanConvertToMPConstraint(PyObject *py_obj)
SWIGINTERN PyObject * _wrap_Constraint_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Constraint_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_reduced_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_SupportsProblemType(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NumConstraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyObject * Swig_This_global
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGINTERN PyObject * Solver_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
#define SWIG_TypeQuery(name)
static swig_cast_info _swigc__p_operations_research__MPVariable[]
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_OWN
#define SWIG_POINTER_EXCEPTION
#define SWIG_SyntaxError
SWIGINTERN PyObject * _wrap_Solver_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_NEW
SWIGINTERN PyObject * _wrap_Objective_SetMinimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_CheckState(r)
SWIGINTERN PyObject * _wrap_Solver_nodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__MPConstraint[]
static swig_cast_info _swigc__p_int[]
static swig_cast_info _swigc__p_operations_research__MPModelRequest[]
SWIGINTERN std::string operations_research_MPVariable___repr__(operations_research::MPVariable *self)
static swig_cast_info _swigc__p_std__atomicT_bool_t[]
SWIGINTERN PyObject * _wrap_Variable_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
SWIGINTERN PyObject * _wrap_Solver_SetSolverSpecificParametersAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_VerifySolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN double operations_research_MPSolver_Infinity()
#define SWIG_BUFFER_SIZE
#define SWIG_TypeError
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
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[])
SWIGINTERN PyObject * _wrap_Solver_BoolVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * Objective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_LoadModelFromProtoWithUniqueNamesOrDie(operations_research::MPSolver *self, operations_research::MPModelProto const &input_model)
#define SWIGTYPE_p_operations_research__MPSolver
static swig_type_info * swig_types[19]
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
#define SWIG_POINTER_IMPLICIT_CONV
SWIGINTERN PyObject * _wrap_Constraint_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_FindErrorInModelProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
#define SWIG_PY_POINTER
struct swig_cast_info swig_cast_info
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_init
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)
SWIGINTERN PyObject * _wrap_Solver_constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__MPConstraint
#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
SWIGINTERN std::string operations_research_MPSolver_LoadModelFromProto(operations_research::MPSolver *self, operations_research::MPModelProto const &input_model)
SWIGINTERN PyObject * _wrap_Constraint_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPVariable
SWIGINTERN PyObject * _wrap_Solver_LookupVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_RuntimeError
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
SWIGINTERN PyObject * _wrap_delete_Constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_varlinkobject swig_varlinkobject
#define SWIG_NewClientData(obj)
SWIGINTERN bool operations_research_MPSolver_LoadSolutionFromProto__SWIG_0(operations_research::MPSolver *self, operations_research::MPSolutionResponse const &response, double tolerance=std::numeric_limits< double >::infinity())
SWIGINTERN PyObject * _wrap_Constraint_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultRelativeMipGap_get(void)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Solver_SuppressOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define PyObject_DEL
bool CanConvertToMPVariable(PyObject *py_obj)
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
static swig_type_info _swigt__p_unsigned_char
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
SWIGINTERN PyObject * _wrap_Objective_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGRUNTIME
SWIGINTERN PyObject * _wrap___lshift____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Objective_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN double operations_research_MPVariable_Lb(operations_research::MPVariable const *self)
#define SWIG_PY_BINARY
static swig_type_info _swigt__p_operations_research__MPModelExportOptions
#define SWIG_RUNTIME_VERSION
SWIGINTERN void operations_research_MPVariable_SetLb(operations_research::MPVariable *self, double x)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
SWIGINTERN PyObject * _wrap_Solver_EnableOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_addvarlink(p, name, get_attr, set_attr)
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_POINTER_NOSHADOW
#define SWIG_OLDOBJ
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 PyObject * _wrap_Variable_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * _wrap_Constraint_set_is_lazy(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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)
#define SWIG_AddCast(r)
static swig_cast_info _swigc__p_std__ostream[]
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
#define SWIG_IsNewObj(r)
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN PyObject * _wrap_Variable_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_IntVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_exception_fail(code, msg)
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultIncrementality_get(void)
SWIGINTERN PyObject * _wrap_Solver_NumVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int64_t operations_research_MPSolver_WallTime(operations_research::MPSolver const *self)
SWIGINTERN PyObject * _wrap_Solver_ComputeConstraintActivities(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN bool operations_research_MPVariable_Integer(operations_research::MPVariable const *self)
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
#define SWIG_AttributeError
SWIGINTERN PyObject * _wrap_Variable_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static swig_type_info _swigt__p_operations_research__MPModelRequest
SWIGINTERN PyObject * _wrap_Solver_SetTimeLimit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_module_info swig_module
static swig_cast_info _swigc__p_unsigned_char[]
SWIGINTERN PyObject * _wrap_Solver_wall_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_short[]
#define SWIG_From_long
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGINTERN PyObject * _wrap_Variable_branching_priority(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
#define SWIG_SetModule(clientdata, pointer)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
#define SWIGUNUSEDPARM(p)
SWIGINTERN PyObject * _wrap_Variable_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_ExportModelAsLpFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * ModelExportOptions_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPSolver
SWIGINTERN int64_t operations_research_MPSolver_Iterations(operations_research::MPSolver const *self)
SWIGINTERN PyObject * _wrap_Solver_SetHint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
#define SWIG_as_voidptr(a)
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
static swig_const_info swig_const_table[]
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * _wrap_Solver_ComputeExactConditionNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Constraint_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
SWIGINTERN PyObject * _wrap_Constraint_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NextSolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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_Solver_infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_const_info swig_const_info
#define SWIGTYPE_p_operations_research__MPModelExportOptions
SWIGINTERN PyObject * _wrap_new_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Objective_SetMaximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Solve(PyObject *self, PyObject *args)
SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name)
SWIGINTERN PyObject * _wrap_Objective_minimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NumVariables(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_InterruptSolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__MPSolver[]
void *(* swig_converter_func)(void *, int *)
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Solver_Var(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_new_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPObjective
SWIGINTERN PyObject * _wrap_Constraint_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
SWIGINTERN PyObject * _wrap_Variable_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
SWIGINTERN PyObject * _wrap_Solver_Solve__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Objective_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
SWIGINTERN PyObject * _wrap_Constraint_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_newvarlink()
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto(PyObject *self, PyObject *args)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
SWIGINTERN PyObject * _wrap_Variable___repr__(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
bool PyObjAs(PyObject *py_obj, operations_research::MPConstraint **b)
static swig_type_info _swigt__p_unsigned_long
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_char[]
SWIGINTERN PyObject * _wrap_delete_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void operations_research_MPSolver_SetHint(operations_research::MPSolver *self, std::vector< operations_research::MPVariable * > const &variables, std::vector< double > const &values)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat(PyObject *self, PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_Integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGINTERN
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
#define SWIG_From_double
SWIGINTERN PyObject * _wrap_Solver_CreateSolver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
#define SWIGTYPE_p_operations_research__MPObjective
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGINTERN PyObject * _wrap_Constraint_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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)
SWIGINTERN PyObject * _wrap_Constraint_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
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 void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
#define SWIG_POINTER_NO_NULL
#define SWIG_Python_str_FromFormat
SWIGINTERN PyObject * _wrap_Solver_Constraint(PyObject *self, PyObject *args)
#define SWIG_InstallConstants(d, constants)
SWIGINTERN PyObject * _wrap_Constraint_dual_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_type_info *(* swig_dycast_func)(void **)
SWIGINTERN PyObject * ModelExportOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultDualTolerance_set(PyObject *)
static swig_type_info _swigt__p_std__ostream
static swig_type_info _swigt__p_operations_research__MPConstraint
static swig_cast_info _swigc__p_operations_research__MPModelExportOptions[]
static swig_cast_info _swigc__p_operations_research__MPSolverParameters[]
#define SWIG_IOError
static PyMethodDef SwigMethods[]
#define SWIG_NullReferenceError
SWIGINTERN std::string operations_research_MPVariable___str__(operations_research::MPVariable *self)
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGINTERN PyObject * _wrap_new_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_ExportModelAsLpFormat(operations_research::MPSolver *self, bool obfuscated)
#define SWIG_POINTER_DISOWN
#define SWIG_STATIC_POINTER(var)
struct swig_type_info swig_type_info
SWIGINTERN double operations_research_MPVariable_Ub(operations_research::MPVariable const *self)
SWIGINTERN PyObject * _wrap_Solver_Solve__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGINTERN PyObject * _wrap_delete_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_ReducedCost(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Objective_Value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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_Solver_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_set_time_limit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto(PyObject *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)
#define SWIG_NEWOBJ
SWIGINTERN PyObject * _wrap_Solver_ExportModelAsMpsFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_delete_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_signed_char
SWIGINTERN PyObject * Solver_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
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)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
SWIGINTERN PyObject * _wrap_Objective_BestBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_FillSolutionResponseProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_NewPackedObj(ptr, sz, type)
#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)
static swig_cast_info _swigc__p_unsigned_long[]
SWIGINTERN PyObject * _wrap_Solver_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultIncrementality_set(PyObject *)
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
SWIGINTERN PyObject * _wrap_Variable_SetBranchingPriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_long
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
SWIGINTERN PyObject * _wrap_Constraint_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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 int Swig_var_MPSolverParameters_kDefaultPresolve_set(PyObject *)
SWIGRUNTIME PyObject * SWIG_This(void)
SWIGINTERN PyObject * _wrap_Solver_variables(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultPrimalTolerance_get(void)
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
SWIGINTERN double operations_research_MPVariable_SolutionValue(operations_research::MPVariable const *self)
SWIGINTERN PyObject * _wrap_delete_Variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_unsigned_int
#define SWIG_CAST_NEW_MEMORY
SWIGINTERN PyObject * _wrap_Solver_LoadModelFromProtoWithUniqueNamesOrDie(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__MPModelRequest
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
SWIGINTERN PyObject * Constraint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
SWIGINTERN PyObject * _wrap_Solver_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_module_info swig_module_info
SWIGINTERN PyObject * _wrap_Solver_Iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN bool operations_research_MPSolver_SetNumThreads(operations_research::MPSolver *self, int num_theads)
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
#define SWIG_ERROR
SWIGINTERN int SWIG_AsVal_bool(PyObject *obj, bool *val)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
SWIGINTERN PyObject * _wrap_Variable_SolutionValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_name
PyObject * FromObjectMPVariable(operations_research::MPVariable *obj)
SWIGINTERN PyObject * _wrap_MPSolverParameters_SetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
SWIGINTERN double operations_research_MPConstraint_Ub(operations_research::MPConstraint const *self)
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGINTERN double operations_research_MPObjective_Offset(operations_research::MPObjective const *self)
static swig_cast_info _swigc__p_long[]
static swig_type_info * swig_type_initial[]
#define SWIGTYPE_p_std__ostream
SWIGINTERN PyObject * _wrap_Variable___str__(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
static swig_type_info _swigt__p_std__atomicT_bool_t
SWIGINTERN PyObject * _wrap_Objective_maximization(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 * _wrap_Objective_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
SWIGINTERN PyObject * _wrap_Objective_SetOptimizationDirection(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)
SWIGINTERN PyObject * MPSolverParameters_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * MPSolverParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadModelFromProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_MemoryError
#define SWIG_SystemError
#define SWIG_DivisionByZero
SWIGINTERN PyObject * _wrap_Objective_Offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_char
#define SWIGTYPE_p_operations_research__MPVariable
SWIGINTERN PyObject * _wrap___lshift__(PyObject *self, PyObject *args)
SWIGINTERN void operations_research_MPSolver_SetTimeLimit(operations_research::MPSolver *self, int64_t x)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Variable_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
#define SWIG_OverflowError
#define SWIGEXPORT
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
#define SWIG_IsOK(r)
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultPresolve_get(void)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultDualTolerance_get(void)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultRelativeMipGap_set(PyObject *)
#define SWIGTYPE_p_std__atomicT_bool_t
#define SWIG_IndexError
SWIGINTERN PyObject * _wrap_Constraint_DualValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
SWIGINTERN double operations_research_MPVariable_ReducedCost(operations_research::MPVariable const *self)
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN double operations_research_MPConstraint_Lb(operations_research::MPConstraint const *self)
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
#define SWIG_AddNewMask(r)
SWIGINTERN PyObject * SWIG_globals(void)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGINTERN void operations_research_MPConstraint_SetLb(operations_research::MPConstraint *self, double x)
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
#define SWIG_OK
SWIGINTERN PyObject * _wrap_Solver_SetNumThreads(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_ExportModelAsMpsFormat(operations_research::MPSolver *self, bool fixed_format, bool obfuscated)
SWIGINTERN void operations_research_MPConstraint_SetUb(operations_research::MPConstraint *self, double x)
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
#define SWIGINTERNINLINE
SWIGINTERN PyObject * _wrap_MPSolverParameters_SetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_signed_char[]
SWIGINTERN PyObject * _wrap_Constraint_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define Py_TYPE(op)
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGINTERN void operations_research_MPVariable_SetUb(operations_research::MPVariable *self, double x)
#define SWIGRUNTIMEINLINE
SWIGINTERN double operations_research_MPConstraint_DualValue(operations_research::MPConstraint const *self)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
const int ERROR
Definition: log_severity.h:32
const int FATAL
Definition: log_severity.h:32
int NumVariables(const VariablesProto &variables)
int NumConstraints(const LinearConstraintsProto &linear_constraints)
IntegerValue GetCoefficient(const IntegerVariable var, const LinearExpression &expr)
std::function< int64_t(const Model &)> Value(IntegerVariable v)
Definition: integer.h:1673
absl::StatusOr< std::string > ExportModelAsMpsFormat(const MPModelProto &model, const MPModelExportOptions &options)
Outputs the current model (variables, constraints, objective) as a string encoded in MPS file format,...
std::string FindErrorInMPModelProto(const MPModelProto &model, double abs_value_threshold, const bool accept_trivially_infeasible_bounds)
Returns an empty string iff the model is valid and not trivially infeasible.
absl::StatusOr< std::string > ExportModelAsLpFormat(const MPModelProto &model, const MPModelExportOptions &options)
Outputs the current model (variables, constraints, objective) as a string encoded in the so-called "C...
int index
Definition: pack.cc:509
void * malloc(YYSIZE_T)
void free(void *)
if(!yyg->yy_init)
Definition: parser.yy.cc:965
int64_t tail
int nodes
PyObject_HEAD void * ptr
PyObject_HEAD void * pack
bool obfuscate
Obfuscates variable and constraint names.
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