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*/
584 const char *name) {
585 swig_module_info *iter = start;
586 do {
587 if (iter->size) {
588 size_t l = 0;
589 size_t r = iter->size - 1;
590 do {
591 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
592 size_t i = (l + r) >> 1;
593 const char *iname = iter->types[i]->name;
594 if (iname) {
595 int compare = strcmp(name, iname);
596 if (compare == 0) {
597 return iter->types[i];
598 } else if (compare < 0) {
599 if (i) {
600 r = i - 1;
601 } else {
602 break;
603 }
604 } else if (compare > 0) {
605 l = i + 1;
606 }
607 } else {
608 break; /* should never happen */
609 }
610 } while (l <= r);
611 }
612 iter = iter->next;
613 } while (iter != end);
614 return 0;
615}
616
617/*
618 Search for a swig_type_info structure for either a mangled name or a human readable name.
619 It first searches the mangled names of the types, which is a O(log #types)
620 If a type is not found it then searches the human readable names, which is O(#types).
621
622 We start searching at module start, and finish searching when start == end.
623 Note: if start == end at the beginning of the function, we go all the way around
624 the circular list.
625*/
629 const char *name) {
630 /* STEP 1: Search the name field using binary search */
632 if (ret) {
633 return ret;
634 } else {
635 /* STEP 2: If the type hasn't been found, do a complete search
636 of the str field (the human readable name) */
637 swig_module_info *iter = start;
638 do {
639 size_t i = 0;
640 for (; i < iter->size; ++i) {
641 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
642 return iter->types[i];
643 }
644 iter = iter->next;
645 } while (iter != end);
646 }
647
648 /* neither found a match */
649 return 0;
650}
651
652/*
653 Pack binary data into a string
654*/
655SWIGRUNTIME char *
656SWIG_PackData(char *c, void *ptr, size_t sz) {
657 static const char hex[17] = "0123456789abcdef";
658 const unsigned char *u = (unsigned char *) ptr;
659 const unsigned char *eu = u + sz;
660 for (; u != eu; ++u) {
661 unsigned char uu = *u;
662 *(c++) = hex[(uu & 0xf0) >> 4];
663 *(c++) = hex[uu & 0xf];
664 }
665 return c;
666}
667
668/*
669 Unpack binary data from a string
670*/
671SWIGRUNTIME const char *
672SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
673 unsigned char *u = (unsigned char *) ptr;
674 const unsigned char *eu = u + sz;
675 for (; u != eu; ++u) {
676 char d = *(c++);
677 unsigned char uu;
678 if ((d >= '0') && (d <= '9'))
679 uu = (unsigned char)((d - '0') << 4);
680 else if ((d >= 'a') && (d <= 'f'))
681 uu = (unsigned char)((d - ('a'-10)) << 4);
682 else
683 return (char *) 0;
684 d = *(c++);
685 if ((d >= '0') && (d <= '9'))
686 uu |= (unsigned char)(d - '0');
687 else if ((d >= 'a') && (d <= 'f'))
688 uu |= (unsigned char)(d - ('a'-10));
689 else
690 return (char *) 0;
691 *u = uu;
692 }
693 return c;
694}
695
696/*
697 Pack 'void *' into a string buffer.
698*/
699SWIGRUNTIME char *
700SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
701 char *r = buff;
702 if ((2*sizeof(void *) + 2) > bsz) return 0;
703 *(r++) = '_';
704 r = SWIG_PackData(r,&ptr,sizeof(void *));
705 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
706 strcpy(r,name);
707 return buff;
708}
709
710SWIGRUNTIME const char *
711SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
712 if (*c != '_') {
713 if (strcmp(c,"NULL") == 0) {
714 *ptr = (void *) 0;
715 return name;
716 } else {
717 return 0;
718 }
719 }
720 return SWIG_UnpackData(++c,ptr,sizeof(void *));
721}
722
723SWIGRUNTIME char *
724SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
725 char *r = buff;
726 size_t lname = (name ? strlen(name) : 0);
727 if ((2*sz + 2 + lname) > bsz) return 0;
728 *(r++) = '_';
729 r = SWIG_PackData(r,ptr,sz);
730 if (lname) {
731 strncpy(r,name,lname+1);
732 } else {
733 *r = 0;
734 }
735 return buff;
736}
737
738SWIGRUNTIME const char *
739SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
740 if (*c != '_') {
741 if (strcmp(c,"NULL") == 0) {
742 memset(ptr,0,sz);
743 return name;
744 } else {
745 return 0;
746 }
747 }
748 return SWIG_UnpackData(++c,ptr,sz);
749}
750
751#ifdef __cplusplus
752}
753#endif
754
755/* Errors in SWIG */
756#define SWIG_UnknownError -1
757#define SWIG_IOError -2
758#define SWIG_RuntimeError -3
759#define SWIG_IndexError -4
760#define SWIG_TypeError -5
761#define SWIG_DivisionByZero -6
762#define SWIG_OverflowError -7
763#define SWIG_SyntaxError -8
764#define SWIG_ValueError -9
765#define SWIG_SystemError -10
766#define SWIG_AttributeError -11
767#define SWIG_MemoryError -12
768#define SWIG_NullReferenceError -13
769
770
771
772/* Compatibility macros for Python 3 */
773#if PY_VERSION_HEX >= 0x03000000
774
775#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
776#define PyInt_Check(x) PyLong_Check(x)
777#define PyInt_AsLong(x) PyLong_AsLong(x)
778#define PyInt_FromLong(x) PyLong_FromLong(x)
779#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
780#define PyString_Check(name) PyBytes_Check(name)
781#define PyString_FromString(x) PyUnicode_FromString(x)
782#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
783#define PyString_AsString(str) PyBytes_AsString(str)
784#define PyString_Size(str) PyBytes_Size(str)
785#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
786#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
787#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
788#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
789
790#endif
791
792#ifndef Py_TYPE
793# define Py_TYPE(op) ((op)->ob_type)
794#endif
795
796/* SWIG APIs for compatibility of both Python 2 & 3 */
797
798#if PY_VERSION_HEX >= 0x03000000
799# define SWIG_Python_str_FromFormat PyUnicode_FromFormat
800#else
801# define SWIG_Python_str_FromFormat PyString_FromFormat
802#endif
803
804
805/* Warning: This function will allocate a new string in Python 3,
806 * so please call SWIG_Python_str_DelForPy3(x) to free the space.
807 */
808SWIGINTERN char*
810{
811#if PY_VERSION_HEX >= 0x03030000
812 return (char *)PyUnicode_AsUTF8(str);
813#elif PY_VERSION_HEX >= 0x03000000
814 char *newstr = 0;
815 str = PyUnicode_AsUTF8String(str);
816 if (str) {
817 char *cstr;
818 Py_ssize_t len;
819 if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
820 newstr = (char *) malloc(len+1);
821 if (newstr)
822 memcpy(newstr, cstr, len+1);
823 }
824 Py_XDECREF(str);
825 }
826 return newstr;
827#else
828 return PyString_AsString(str);
829#endif
830}
831
832#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
833# define SWIG_Python_str_DelForPy3(x)
834#else
835# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
836#endif
837
838
839SWIGINTERN PyObject*
841{
842#if PY_VERSION_HEX >= 0x03000000
843 return PyUnicode_FromString(c);
844#else
845 return PyString_FromString(c);
846#endif
847}
848
849#ifndef PyObject_DEL
850# define PyObject_DEL PyObject_Del
851#endif
852
853// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
854// interface files check for it.
855# define SWIGPY_USE_CAPSULE
856# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
857
858#if PY_VERSION_HEX < 0x03020000
859#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
860#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
861#define Py_hash_t long
862#endif
863
864/* -----------------------------------------------------------------------------
865 * error manipulation
866 * ----------------------------------------------------------------------------- */
867
868SWIGRUNTIME PyObject*
870 PyObject* type = 0;
871 switch(code) {
872 case SWIG_MemoryError:
873 type = PyExc_MemoryError;
874 break;
875 case SWIG_IOError:
876 type = PyExc_IOError;
877 break;
879 type = PyExc_RuntimeError;
880 break;
881 case SWIG_IndexError:
882 type = PyExc_IndexError;
883 break;
884 case SWIG_TypeError:
885 type = PyExc_TypeError;
886 break;
888 type = PyExc_ZeroDivisionError;
889 break;
891 type = PyExc_OverflowError;
892 break;
893 case SWIG_SyntaxError:
894 type = PyExc_SyntaxError;
895 break;
896 case SWIG_ValueError:
897 type = PyExc_ValueError;
898 break;
899 case SWIG_SystemError:
900 type = PyExc_SystemError;
901 break;
903 type = PyExc_AttributeError;
904 break;
905 default:
906 type = PyExc_RuntimeError;
907 }
908 return type;
909}
910
911
912SWIGRUNTIME void
913SWIG_Python_AddErrorMsg(const char* mesg)
914{
915 PyObject *type = 0;
916 PyObject *value = 0;
917 PyObject *traceback = 0;
918
919 if (PyErr_Occurred())
920 PyErr_Fetch(&type, &value, &traceback);
921 if (value) {
922 PyObject *old_str = PyObject_Str(value);
923 const char *tmp = SWIG_Python_str_AsChar(old_str);
924 PyErr_Clear();
925 Py_XINCREF(type);
926 if (tmp)
927 PyErr_Format(type, "%s %s", tmp, mesg);
928 else
929 PyErr_Format(type, "%s", mesg);
931 Py_DECREF(old_str);
932 Py_DECREF(value);
933 } else {
934 PyErr_SetString(PyExc_RuntimeError, mesg);
935 }
936}
937
938SWIGRUNTIME int
940{
941 PyObject *error;
942 if (obj)
943 return 0;
944 error = PyErr_Occurred();
945 return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
946}
947
948SWIGRUNTIME void
950{
952 /* Use existing TypeError to preserve stacktrace and enhance with given message */
953 PyObject *newvalue;
954 PyObject *type = NULL, *value = NULL, *traceback = NULL;
955 PyErr_Fetch(&type, &value, &traceback);
956#if PY_VERSION_HEX >= 0x03000000
957 newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
958#else
959 newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
960#endif
961 Py_XDECREF(value);
962 PyErr_Restore(type, newvalue, traceback);
963 } else {
964 /* Raise TypeError using given message */
965 PyErr_SetString(PyExc_TypeError, message);
966 }
967}
968
969#if defined(SWIG_PYTHON_NO_THREADS)
970# if defined(SWIG_PYTHON_THREADS)
971# undef SWIG_PYTHON_THREADS
972# endif
973#endif
974#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
975# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
976# define SWIG_PYTHON_USE_GIL
977# endif
978# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
979# ifndef SWIG_PYTHON_INITIALIZE_THREADS
980# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
981# endif
982# ifdef __cplusplus /* C++ code */
983 class SWIG_Python_Thread_Block {
984 bool status;
985 PyGILState_STATE state;
986 public:
987 void end() { if (status) { PyGILState_Release(state); status = false;} }
988 SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
989 ~SWIG_Python_Thread_Block() { end(); }
990 };
991 class SWIG_Python_Thread_Allow {
992 bool status;
993 PyThreadState *save;
994 public:
995 void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
996 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
997 ~SWIG_Python_Thread_Allow() { end(); }
998 };
999# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1000# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1001# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1002# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1003# else /* C code */
1004# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1005# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1006# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1007# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1008# endif
1009# else /* Old thread way, not implemented, user must provide it */
1010# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1011# define SWIG_PYTHON_INITIALIZE_THREADS
1012# endif
1013# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1014# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1015# endif
1016# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1017# define SWIG_PYTHON_THREAD_END_BLOCK
1018# endif
1019# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1020# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1021# endif
1022# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1023# define SWIG_PYTHON_THREAD_END_ALLOW
1024# endif
1025# endif
1026#else /* No thread support */
1027# define SWIG_PYTHON_INITIALIZE_THREADS
1028# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1029# define SWIG_PYTHON_THREAD_END_BLOCK
1030# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1031# define SWIG_PYTHON_THREAD_END_ALLOW
1032#endif
1033
1034/* -----------------------------------------------------------------------------
1035 * Python API portion that goes into the runtime
1036 * ----------------------------------------------------------------------------- */
1037
1038#ifdef __cplusplus
1039extern "C" {
1040#endif
1041
1042/* -----------------------------------------------------------------------------
1043 * Constant declarations
1044 * ----------------------------------------------------------------------------- */
1045
1046/* Constant Types */
1047#define SWIG_PY_POINTER 4
1048#define SWIG_PY_BINARY 5
1049
1050/* Constant information structure */
1051typedef struct swig_const_info {
1052 int type;
1053 const char *name;
1054 long lvalue;
1055 double dvalue;
1056 void *pvalue;
1059
1060#ifdef __cplusplus
1061}
1062#endif
1063
1064
1065/* -----------------------------------------------------------------------------
1066 * pyrun.swg
1067 *
1068 * This file contains the runtime support for Python modules
1069 * and includes code for managing global variables and pointer
1070 * type checking.
1071 *
1072 * ----------------------------------------------------------------------------- */
1073
1074#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1075# error "This version of SWIG only supports Python >= 2.7"
1076#endif
1077
1078#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1079# error "This version of SWIG only supports Python 3 >= 3.2"
1080#endif
1081
1082/* Common SWIG API */
1083
1084/* for raw pointers */
1085#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1086#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1087#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1088
1089#ifdef SWIGPYTHON_BUILTIN
1090#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1091#else
1092#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1093#endif
1094
1095#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1096
1097#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1098#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1099#define swig_owntype int
1100
1101/* for raw packed data */
1102#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1103#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1104
1105/* for class or struct pointers */
1106#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1107#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1108
1109/* for C or C++ function pointers */
1110#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1111#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1112
1113/* for C++ member pointers, ie, member methods */
1114#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1115#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1116
1117
1118/* Runtime API */
1119
1120#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1121#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1122#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1123
1124#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1125#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1126#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1127#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1128#define SWIG_fail goto fail
1129
1130
1131/* Runtime API implementation */
1132
1133/* Error manipulation */
1134
1135SWIGINTERN void
1136SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1138 PyErr_SetObject(errtype, obj);
1139 Py_DECREF(obj);
1141}
1142
1143SWIGINTERN void
1144SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1146 PyErr_SetString(errtype, msg);
1148}
1149
1150#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1151
1152/* Set a constant value */
1153
1154#if defined(SWIGPYTHON_BUILTIN)
1155
1156SWIGINTERN void
1157SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1158 PyObject *s = PyString_InternFromString(key);
1159 PyList_Append(seq, s);
1160 Py_DECREF(s);
1161}
1162
1163SWIGINTERN void
1164SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1165 PyDict_SetItemString(d, name, obj);
1166 Py_DECREF(obj);
1167 if (public_interface)
1168 SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1169}
1170
1171#else
1172
1173SWIGINTERN void
1174SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1175 PyDict_SetItemString(d, name, obj);
1176 Py_DECREF(obj);
1177}
1178
1179#endif
1180
1181/* Append a value to the result obj */
1182
1183SWIGINTERN PyObject*
1184SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1185 if (!result) {
1186 result = obj;
1187 } else if (result == Py_None) {
1188 Py_DECREF(result);
1189 result = obj;
1190 } else {
1191 if (!PyList_Check(result)) {
1192 PyObject *o2 = result;
1193 result = PyList_New(1);
1194 PyList_SetItem(result, 0, o2);
1195 }
1196 PyList_Append(result,obj);
1197 Py_DECREF(obj);
1198 }
1199 return result;
1200}
1201
1202/* Unpack the argument tuple */
1203
1204SWIGINTERN Py_ssize_t
1205SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1206{
1207 if (!args) {
1208 if (!min && !max) {
1209 return 1;
1210 } else {
1211 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1212 name, (min == max ? "" : "at least "), (int)min);
1213 return 0;
1214 }
1215 }
1216 if (!PyTuple_Check(args)) {
1217 if (min <= 1 && max >= 1) {
1218 Py_ssize_t i;
1219 objs[0] = args;
1220 for (i = 1; i < max; ++i) {
1221 objs[i] = 0;
1222 }
1223 return 2;
1224 }
1225 PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1226 return 0;
1227 } else {
1228 Py_ssize_t l = PyTuple_GET_SIZE(args);
1229 if (l < min) {
1230 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1231 name, (min == max ? "" : "at least "), (int)min, (int)l);
1232 return 0;
1233 } else if (l > max) {
1234 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1235 name, (min == max ? "" : "at most "), (int)max, (int)l);
1236 return 0;
1237 } else {
1238 Py_ssize_t i;
1239 for (i = 0; i < l; ++i) {
1240 objs[i] = PyTuple_GET_ITEM(args, i);
1241 }
1242 for (; l < max; ++l) {
1243 objs[l] = 0;
1244 }
1245 return i + 1;
1246 }
1247 }
1248}
1249
1250SWIGINTERN int
1251SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1252 int no_kwargs = 1;
1253 if (kwargs) {
1254 assert(PyDict_Check(kwargs));
1255 if (PyDict_Size(kwargs) > 0) {
1256 PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1257 no_kwargs = 0;
1258 }
1259 }
1260 return no_kwargs;
1261}
1262
1263/* A functor is a function object with one single object argument */
1264#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1265
1266/*
1267 Helper for static pointer initialization for both C and C++ code, for example
1268 static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1269*/
1270#ifdef __cplusplus
1271#define SWIG_STATIC_POINTER(var) var
1272#else
1273#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1274#endif
1275
1276/* -----------------------------------------------------------------------------
1277 * Pointer declarations
1278 * ----------------------------------------------------------------------------- */
1279
1280/* Flags for new pointer objects */
1281#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1282#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1283
1284#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1285
1286#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1287#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1288
1289#ifdef __cplusplus
1290extern "C" {
1291#endif
1292
1293/* The python void return value */
1294
1295SWIGRUNTIMEINLINE PyObject *
1297{
1298 PyObject *none = Py_None;
1299 Py_INCREF(none);
1300 return none;
1301}
1302
1303/* SwigPyClientData */
1304
1305typedef struct {
1306 PyObject *klass;
1307 PyObject *newraw;
1308 PyObject *newargs;
1309 PyObject *destroy;
1310 int delargs;
1311 int implicitconv;
1312 PyTypeObject *pytype;
1314
1317{
1319 int fail = data ? data->implicitconv : 0;
1320 if (fail)
1321 PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1322 return fail;
1323}
1324
1325SWIGRUNTIMEINLINE PyObject *
1327 SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1328 PyObject *klass = data ? data->klass : 0;
1329 return (klass ? klass : PyExc_RuntimeError);
1330}
1331
1332
1335{
1336 if (!obj) {
1337 return 0;
1338 } else {
1340 /* the klass element */
1341 data->klass = obj;
1342 Py_INCREF(data->klass);
1343 /* the newraw method and newargs arguments used to create a new raw instance */
1344 if (PyClass_Check(obj)) {
1345 data->newraw = 0;
1346 data->newargs = obj;
1347 Py_INCREF(obj);
1348 } else {
1349 data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1350 if (data->newraw) {
1351 Py_INCREF(data->newraw);
1352 data->newargs = PyTuple_New(1);
1353 PyTuple_SetItem(data->newargs, 0, obj);
1354 } else {
1355 data->newargs = obj;
1356 }
1357 Py_INCREF(data->newargs);
1358 }
1359 /* the destroy method, aka as the C++ delete method */
1360 data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1361 if (PyErr_Occurred()) {
1362 PyErr_Clear();
1363 data->destroy = 0;
1364 }
1365 if (data->destroy) {
1366 int flags;
1367 Py_INCREF(data->destroy);
1368 flags = PyCFunction_GET_FLAGS(data->destroy);
1369 data->delargs = !(flags & (METH_O));
1370 } else {
1371 data->delargs = 0;
1372 }
1373 data->implicitconv = 0;
1374 data->pytype = 0;
1375 return data;
1376 }
1377}
1378
1379SWIGRUNTIME void
1381 Py_XDECREF(data->newraw);
1382 Py_XDECREF(data->newargs);
1383 Py_XDECREF(data->destroy);
1384}
1385
1386/* =============== SwigPyObject =====================*/
1387
1388typedef struct {
1389 PyObject_HEAD
1390 void *ptr;
1391 swig_type_info *ty;
1392 int own;
1393 PyObject *next;
1394#ifdef SWIGPYTHON_BUILTIN
1395 PyObject *dict;
1396#endif
1397} SwigPyObject;
1398
1399
1400#ifdef SWIGPYTHON_BUILTIN
1401
1402SWIGRUNTIME PyObject *
1403SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1404{
1405 SwigPyObject *sobj = (SwigPyObject *)v;
1406
1407 if (!sobj->dict)
1408 sobj->dict = PyDict_New();
1409
1410 Py_INCREF(sobj->dict);
1411 return sobj->dict;
1412}
1413
1414#endif
1415
1416SWIGRUNTIME PyObject *
1418{
1419 return PyLong_FromVoidPtr(v->ptr);
1420}
1421
1422SWIGRUNTIME PyObject *
1424{
1425 PyObject *res = NULL;
1426 PyObject *args = PyTuple_New(1);
1427 if (args) {
1428 if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1429 PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1430 if (ofmt) {
1431#if PY_VERSION_HEX >= 0x03000000
1432 res = PyUnicode_Format(ofmt,args);
1433#else
1434 res = PyString_Format(ofmt,args);
1435#endif
1436 Py_DECREF(ofmt);
1437 }
1438 Py_DECREF(args);
1439 }
1440 }
1441 return res;
1442}
1443
1444SWIGRUNTIME PyObject *
1446{
1447 return SwigPyObject_format("%o",v);
1448}
1449
1450SWIGRUNTIME PyObject *
1452{
1453 return SwigPyObject_format("%x",v);
1454}
1455
1456SWIGRUNTIME PyObject *
1458{
1459 const char *name = SWIG_TypePrettyName(v->ty);
1460 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1461 if (v->next) {
1462 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1463# if PY_VERSION_HEX >= 0x03000000
1464 PyObject *joined = PyUnicode_Concat(repr, nrep);
1465 Py_DecRef(repr);
1466 Py_DecRef(nrep);
1467 repr = joined;
1468# else
1469 PyString_ConcatAndDel(&repr,nrep);
1470# endif
1471 }
1472 return repr;
1473}
1474
1475/* We need a version taking two PyObject* parameters so it's a valid
1476 * PyCFunction to use in swigobject_methods[]. */
1477SWIGRUNTIME PyObject *
1478SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1479{
1480 return SwigPyObject_repr((SwigPyObject*)v);
1481}
1482
1483SWIGRUNTIME int
1485{
1486 void *i = v->ptr;
1487 void *j = w->ptr;
1488 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1489}
1490
1491/* Added for Python 3.x, would it also be useful for Python 2.x? */
1492SWIGRUNTIME PyObject*
1494{
1495 PyObject* res;
1496 if( op != Py_EQ && op != Py_NE ) {
1497 Py_INCREF(Py_NotImplemented);
1498 return Py_NotImplemented;
1499 }
1500 res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1501 return res;
1502}
1503
1504
1505SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1506
1507#ifdef SWIGPYTHON_BUILTIN
1508static swig_type_info *SwigPyObject_stype = 0;
1509SWIGRUNTIME PyTypeObject*
1510SwigPyObject_type(void) {
1511 SwigPyClientData *cd;
1512 assert(SwigPyObject_stype);
1513 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1514 assert(cd);
1515 assert(cd->pytype);
1516 return cd->pytype;
1517}
1518#else
1519SWIGRUNTIME PyTypeObject*
1521 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1522 return type;
1523}
1524#endif
1525
1527SwigPyObject_Check(PyObject *op) {
1528#ifdef SWIGPYTHON_BUILTIN
1529 PyTypeObject *target_tp = SwigPyObject_type();
1530 if (PyType_IsSubtype(op->ob_type, target_tp))
1531 return 1;
1532 return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1533#else
1534 return (Py_TYPE(op) == SwigPyObject_type())
1535 || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1536#endif
1537}
1538
1539SWIGRUNTIME PyObject *
1540SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1541
1542SWIGRUNTIME void
1544{
1545 SwigPyObject *sobj = (SwigPyObject *) v;
1546 PyObject *next = sobj->next;
1547 if (sobj->own == SWIG_POINTER_OWN) {
1548 swig_type_info *ty = sobj->ty;
1549 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1550 PyObject *destroy = data ? data->destroy : 0;
1551 if (destroy) {
1552 /* destroy is always a VARARGS method */
1553 PyObject *res;
1554
1555 /* PyObject_CallFunction() has the potential to silently drop
1556 the active exception. In cases of unnamed temporary
1557 variable or where we just finished iterating over a generator
1558 StopIteration will be active right now, and this needs to
1559 remain true upon return from SwigPyObject_dealloc. So save
1560 and restore. */
1561
1562 PyObject *type = NULL, *value = NULL, *traceback = NULL;
1563 PyErr_Fetch(&type, &value, &traceback);
1564
1565 if (data->delargs) {
1566 /* we need to create a temporary object to carry the destroy operation */
1567 PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1568 res = SWIG_Python_CallFunctor(destroy, tmp);
1569 Py_DECREF(tmp);
1570 } else {
1571 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1572 PyObject *mself = PyCFunction_GET_SELF(destroy);
1573 res = ((*meth)(mself, v));
1574 }
1575 if (!res)
1576 PyErr_WriteUnraisable(destroy);
1577
1578 PyErr_Restore(type, value, traceback);
1579
1580 Py_XDECREF(res);
1581 }
1582#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1583 else {
1584 const char *name = SWIG_TypePrettyName(ty);
1585 printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1586 }
1587#endif
1588 }
1589 Py_XDECREF(next);
1590 PyObject_DEL(v);
1591}
1592
1593SWIGRUNTIME PyObject*
1594SwigPyObject_append(PyObject* v, PyObject* next)
1595{
1596 SwigPyObject *sobj = (SwigPyObject *) v;
1597 if (!SwigPyObject_Check(next)) {
1598 PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1599 return NULL;
1600 }
1601 sobj->next = next;
1602 Py_INCREF(next);
1603 return SWIG_Py_Void();
1604}
1605
1606SWIGRUNTIME PyObject*
1607SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1608{
1609 SwigPyObject *sobj = (SwigPyObject *) v;
1610 if (sobj->next) {
1611 Py_INCREF(sobj->next);
1612 return sobj->next;
1613 } else {
1614 return SWIG_Py_Void();
1615 }
1616}
1617
1618SWIGINTERN PyObject*
1619SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1620{
1621 SwigPyObject *sobj = (SwigPyObject *)v;
1622 sobj->own = 0;
1623 return SWIG_Py_Void();
1624}
1625
1626SWIGINTERN PyObject*
1627SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1628{
1629 SwigPyObject *sobj = (SwigPyObject *)v;
1630 sobj->own = SWIG_POINTER_OWN;
1631 return SWIG_Py_Void();
1632}
1633
1634SWIGINTERN PyObject*
1635SwigPyObject_own(PyObject *v, PyObject *args)
1636{
1637 PyObject *val = 0;
1638 if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1639 return NULL;
1640 } else {
1641 SwigPyObject *sobj = (SwigPyObject *)v;
1642 PyObject *obj = PyBool_FromLong(sobj->own);
1643 if (val) {
1644 if (PyObject_IsTrue(val)) {
1645 SwigPyObject_acquire(v,args);
1646 } else {
1647 SwigPyObject_disown(v,args);
1648 }
1649 }
1650 return obj;
1651 }
1652}
1653
1654static PyMethodDef
1656 {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"},
1657 {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"},
1658 {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"},
1659 {"append", SwigPyObject_append, METH_O, "appends another 'this' object"},
1660 {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"},
1661 {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"},
1662 {0, 0, 0, 0}
1663};
1664
1665SWIGRUNTIME PyTypeObject*
1667 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1668
1669 static PyNumberMethods SwigPyObject_as_number = {
1670 (binaryfunc)0, /*nb_add*/
1671 (binaryfunc)0, /*nb_subtract*/
1672 (binaryfunc)0, /*nb_multiply*/
1673 /* nb_divide removed in Python 3 */
1674#if PY_VERSION_HEX < 0x03000000
1675 (binaryfunc)0, /*nb_divide*/
1676#endif
1677 (binaryfunc)0, /*nb_remainder*/
1678 (binaryfunc)0, /*nb_divmod*/
1679 (ternaryfunc)0,/*nb_power*/
1680 (unaryfunc)0, /*nb_negative*/
1681 (unaryfunc)0, /*nb_positive*/
1682 (unaryfunc)0, /*nb_absolute*/
1683 (inquiry)0, /*nb_nonzero*/
1684 0, /*nb_invert*/
1685 0, /*nb_lshift*/
1686 0, /*nb_rshift*/
1687 0, /*nb_and*/
1688 0, /*nb_xor*/
1689 0, /*nb_or*/
1690#if PY_VERSION_HEX < 0x03000000
1691 0, /*nb_coerce*/
1692#endif
1693 (unaryfunc)SwigPyObject_long, /*nb_int*/
1694#if PY_VERSION_HEX < 0x03000000
1695 (unaryfunc)SwigPyObject_long, /*nb_long*/
1696#else
1697 0, /*nb_reserved*/
1698#endif
1699 (unaryfunc)0, /*nb_float*/
1700#if PY_VERSION_HEX < 0x03000000
1701 (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1702 (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1703#endif
1704#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1705 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1706#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1707 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1708#else
1709 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1710#endif
1711 };
1712
1713 static PyTypeObject swigpyobject_type;
1714 static int type_init = 0;
1715 if (!type_init) {
1716 const PyTypeObject tmp = {
1717#if PY_VERSION_HEX >= 0x03000000
1718 PyVarObject_HEAD_INIT(NULL, 0)
1719#else
1720 PyObject_HEAD_INIT(NULL)
1721 0, /* ob_size */
1722#endif
1723 "SwigPyObject", /* tp_name */
1724 sizeof(SwigPyObject), /* tp_basicsize */
1725 0, /* tp_itemsize */
1726 (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1727 0, /* tp_print */
1728 (getattrfunc)0, /* tp_getattr */
1729 (setattrfunc)0, /* tp_setattr */
1730#if PY_VERSION_HEX >= 0x03000000
1731 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1732#else
1733 (cmpfunc)SwigPyObject_compare, /* tp_compare */
1734#endif
1735 (reprfunc)SwigPyObject_repr, /* tp_repr */
1736 &SwigPyObject_as_number, /* tp_as_number */
1737 0, /* tp_as_sequence */
1738 0, /* tp_as_mapping */
1739 (hashfunc)0, /* tp_hash */
1740 (ternaryfunc)0, /* tp_call */
1741 0, /* tp_str */
1742 PyObject_GenericGetAttr, /* tp_getattro */
1743 0, /* tp_setattro */
1744 0, /* tp_as_buffer */
1745 Py_TPFLAGS_DEFAULT, /* tp_flags */
1746 swigobject_doc, /* tp_doc */
1747 0, /* tp_traverse */
1748 0, /* tp_clear */
1749 (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1750 0, /* tp_weaklistoffset */
1751 0, /* tp_iter */
1752 0, /* tp_iternext */
1753 swigobject_methods, /* tp_methods */
1754 0, /* tp_members */
1755 0, /* tp_getset */
1756 0, /* tp_base */
1757 0, /* tp_dict */
1758 0, /* tp_descr_get */
1759 0, /* tp_descr_set */
1760 0, /* tp_dictoffset */
1761 0, /* tp_init */
1762 0, /* tp_alloc */
1763 0, /* tp_new */
1764 0, /* tp_free */
1765 0, /* tp_is_gc */
1766 0, /* tp_bases */
1767 0, /* tp_mro */
1768 0, /* tp_cache */
1769 0, /* tp_subclasses */
1770 0, /* tp_weaklist */
1771 0, /* tp_del */
1772 0, /* tp_version_tag */
1773#if PY_VERSION_HEX >= 0x03040000
1774 0, /* tp_finalize */
1775#endif
1776#if PY_VERSION_HEX >= 0x03080000
1777 0, /* tp_vectorcall */
1778#endif
1779#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1780 0, /* tp_print */
1781#endif
1782#ifdef COUNT_ALLOCS
1783 0, /* tp_allocs */
1784 0, /* tp_frees */
1785 0, /* tp_maxalloc */
1786 0, /* tp_prev */
1787 0 /* tp_next */
1788#endif
1789 };
1790 swigpyobject_type = tmp;
1791 type_init = 1;
1792 if (PyType_Ready(&swigpyobject_type) < 0)
1793 return NULL;
1794 }
1795 return &swigpyobject_type;
1796}
1797
1798SWIGRUNTIME PyObject *
1799SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1800{
1801 SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1802 if (sobj) {
1803 sobj->ptr = ptr;
1804 sobj->ty = ty;
1805 sobj->own = own;
1806 sobj->next = 0;
1807 }
1808 return (PyObject *)sobj;
1809}
1810
1811/* -----------------------------------------------------------------------------
1812 * Implements a simple Swig Packed type, and use it instead of string
1813 * ----------------------------------------------------------------------------- */
1814
1815typedef struct {
1816 PyObject_HEAD
1817 void *pack;
1818 swig_type_info *ty;
1819 size_t size;
1820} SwigPyPacked;
1821
1822SWIGRUNTIME PyObject *
1824{
1825 char result[SWIG_BUFFER_SIZE];
1826 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1827 return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1828 } else {
1829 return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1830 }
1831}
1832
1833SWIGRUNTIME PyObject *
1835{
1836 char result[SWIG_BUFFER_SIZE];
1837 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1838 return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1839 } else {
1840 return SWIG_Python_str_FromChar(v->ty->name);
1841 }
1842}
1843
1844SWIGRUNTIME int
1846{
1847 size_t i = v->size;
1848 size_t j = w->size;
1849 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1850 return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1851}
1852
1853SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1854
1855SWIGRUNTIME PyTypeObject*
1857 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1858 return type;
1859}
1860
1862SwigPyPacked_Check(PyObject *op) {
1863 return ((op)->ob_type == SwigPyPacked_TypeOnce())
1864 || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1865}
1866
1867SWIGRUNTIME void
1869{
1870 if (SwigPyPacked_Check(v)) {
1871 SwigPyPacked *sobj = (SwigPyPacked *) v;
1872 free(sobj->pack);
1873 }
1874 PyObject_DEL(v);
1875}
1876
1877SWIGRUNTIME PyTypeObject*
1879 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1880 static PyTypeObject swigpypacked_type;
1881 static int type_init = 0;
1882 if (!type_init) {
1883 const PyTypeObject tmp = {
1884#if PY_VERSION_HEX>=0x03000000
1885 PyVarObject_HEAD_INIT(NULL, 0)
1886#else
1887 PyObject_HEAD_INIT(NULL)
1888 0, /* ob_size */
1889#endif
1890 "SwigPyPacked", /* tp_name */
1891 sizeof(SwigPyPacked), /* tp_basicsize */
1892 0, /* tp_itemsize */
1893 (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1894 0, /* tp_print */
1895 (getattrfunc)0, /* tp_getattr */
1896 (setattrfunc)0, /* tp_setattr */
1897#if PY_VERSION_HEX>=0x03000000
1898 0, /* tp_reserved in 3.0.1 */
1899#else
1900 (cmpfunc)SwigPyPacked_compare, /* tp_compare */
1901#endif
1902 (reprfunc)SwigPyPacked_repr, /* tp_repr */
1903 0, /* tp_as_number */
1904 0, /* tp_as_sequence */
1905 0, /* tp_as_mapping */
1906 (hashfunc)0, /* tp_hash */
1907 (ternaryfunc)0, /* tp_call */
1908 (reprfunc)SwigPyPacked_str, /* tp_str */
1909 PyObject_GenericGetAttr, /* tp_getattro */
1910 0, /* tp_setattro */
1911 0, /* tp_as_buffer */
1912 Py_TPFLAGS_DEFAULT, /* tp_flags */
1913 swigpacked_doc, /* tp_doc */
1914 0, /* tp_traverse */
1915 0, /* tp_clear */
1916 0, /* tp_richcompare */
1917 0, /* tp_weaklistoffset */
1918 0, /* tp_iter */
1919 0, /* tp_iternext */
1920 0, /* tp_methods */
1921 0, /* tp_members */
1922 0, /* tp_getset */
1923 0, /* tp_base */
1924 0, /* tp_dict */
1925 0, /* tp_descr_get */
1926 0, /* tp_descr_set */
1927 0, /* tp_dictoffset */
1928 0, /* tp_init */
1929 0, /* tp_alloc */
1930 0, /* tp_new */
1931 0, /* tp_free */
1932 0, /* tp_is_gc */
1933 0, /* tp_bases */
1934 0, /* tp_mro */
1935 0, /* tp_cache */
1936 0, /* tp_subclasses */
1937 0, /* tp_weaklist */
1938 0, /* tp_del */
1939 0, /* tp_version_tag */
1940#if PY_VERSION_HEX >= 0x03040000
1941 0, /* tp_finalize */
1942#endif
1943#if PY_VERSION_HEX >= 0x03080000
1944 0, /* tp_vectorcall */
1945#endif
1946#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1947 0, /* tp_print */
1948#endif
1949#ifdef COUNT_ALLOCS
1950 0, /* tp_allocs */
1951 0, /* tp_frees */
1952 0, /* tp_maxalloc */
1953 0, /* tp_prev */
1954 0 /* tp_next */
1955#endif
1956 };
1957 swigpypacked_type = tmp;
1958 type_init = 1;
1959 if (PyType_Ready(&swigpypacked_type) < 0)
1960 return NULL;
1961 }
1962 return &swigpypacked_type;
1963}
1964
1965SWIGRUNTIME PyObject *
1966SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1967{
1968 SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1969 if (sobj) {
1970 void *pack = malloc(size);
1971 if (pack) {
1972 memcpy(pack, ptr, size);
1973 sobj->pack = pack;
1974 sobj->ty = ty;
1975 sobj->size = size;
1976 } else {
1977 PyObject_DEL((PyObject *) sobj);
1978 sobj = 0;
1979 }
1980 }
1981 return (PyObject *) sobj;
1982}
1983
1985SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1986{
1987 if (SwigPyPacked_Check(obj)) {
1988 SwigPyPacked *sobj = (SwigPyPacked *)obj;
1989 if (sobj->size != size) return 0;
1990 memcpy(ptr, sobj->pack, size);
1991 return sobj->ty;
1992 } else {
1993 return 0;
1994 }
1995}
1996
1997/* -----------------------------------------------------------------------------
1998 * pointers/data manipulation
1999 * ----------------------------------------------------------------------------- */
2000
2001static PyObject *Swig_This_global = NULL;
2002
2003SWIGRUNTIME PyObject *
2005{
2006 if (Swig_This_global == NULL)
2008 return Swig_This_global;
2009}
2010
2011/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2012
2013/* TODO: I don't know how to implement the fast getset in Python 3 right now */
2014#if PY_VERSION_HEX>=0x03000000
2015#define SWIG_PYTHON_SLOW_GETSET_THIS
2016#endif
2017
2020{
2021 PyObject *obj;
2022
2023 if (SwigPyObject_Check(pyobj))
2024 return (SwigPyObject *) pyobj;
2025
2026#ifdef SWIGPYTHON_BUILTIN
2027 (void)obj;
2028# ifdef PyWeakref_CheckProxy
2029 if (PyWeakref_CheckProxy(pyobj)) {
2030 pyobj = PyWeakref_GET_OBJECT(pyobj);
2031 if (pyobj && SwigPyObject_Check(pyobj))
2032 return (SwigPyObject*) pyobj;
2033 }
2034# endif
2035 return NULL;
2036#else
2037
2038 obj = 0;
2039
2040#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2041 if (PyInstance_Check(pyobj)) {
2042 obj = _PyInstance_Lookup(pyobj, SWIG_This());
2043 } else {
2044 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2045 if (dictptr != NULL) {
2046 PyObject *dict = *dictptr;
2047 obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2048 } else {
2049#ifdef PyWeakref_CheckProxy
2050 if (PyWeakref_CheckProxy(pyobj)) {
2051 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2052 return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2053 }
2054#endif
2055 obj = PyObject_GetAttr(pyobj,SWIG_This());
2056 if (obj) {
2057 Py_DECREF(obj);
2058 } else {
2059 if (PyErr_Occurred()) PyErr_Clear();
2060 return 0;
2061 }
2062 }
2063 }
2064#else
2065 obj = PyObject_GetAttr(pyobj,SWIG_This());
2066 if (obj) {
2067 Py_DECREF(obj);
2068 } else {
2069 if (PyErr_Occurred()) PyErr_Clear();
2070 return 0;
2071 }
2072#endif
2073 if (obj && !SwigPyObject_Check(obj)) {
2074 /* a PyObject is called 'this', try to get the 'real this'
2075 SwigPyObject from it */
2076 return SWIG_Python_GetSwigThis(obj);
2077 }
2078 return (SwigPyObject *)obj;
2079#endif
2080}
2081
2082/* Acquire a pointer value */
2083
2084SWIGRUNTIME int
2085SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2086 if (own == SWIG_POINTER_OWN) {
2088 if (sobj) {
2089 int oldown = sobj->own;
2090 sobj->own = own;
2091 return oldown;
2092 }
2093 }
2094 return 0;
2095}
2096
2097/* Convert a pointer value */
2098
2099SWIGRUNTIME int
2100SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2101 int res;
2102 SwigPyObject *sobj;
2103 int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2104
2105 if (!obj)
2106 return SWIG_ERROR;
2107 if (obj == Py_None && !implicit_conv) {
2108 if (ptr)
2109 *ptr = 0;
2111 }
2112
2113 res = SWIG_ERROR;
2114
2115 sobj = SWIG_Python_GetSwigThis(obj);
2116 if (own)
2117 *own = 0;
2118 while (sobj) {
2119 void *vptr = sobj->ptr;
2120 if (ty) {
2121 swig_type_info *to = sobj->ty;
2122 if (to == ty) {
2123 /* no type cast needed */
2124 if (ptr) *ptr = vptr;
2125 break;
2126 } else {
2127 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2128 if (!tc) {
2129 sobj = (SwigPyObject *)sobj->next;
2130 } else {
2131 if (ptr) {
2132 int newmemory = 0;
2133 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2134 if (newmemory == SWIG_CAST_NEW_MEMORY) {
2135 assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2136 if (own)
2137 *own = *own | SWIG_CAST_NEW_MEMORY;
2138 }
2139 }
2140 break;
2141 }
2142 }
2143 } else {
2144 if (ptr) *ptr = vptr;
2145 break;
2146 }
2147 }
2148 if (sobj) {
2149 if (own)
2150 *own = *own | sobj->own;
2151 if (flags & SWIG_POINTER_DISOWN) {
2152 sobj->own = 0;
2153 }
2154 res = SWIG_OK;
2155 } else {
2156 if (implicit_conv) {
2157 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2158 if (data && !data->implicitconv) {
2159 PyObject *klass = data->klass;
2160 if (klass) {
2161 PyObject *impconv;
2162 data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2163 impconv = SWIG_Python_CallFunctor(klass, obj);
2164 data->implicitconv = 0;
2165 if (PyErr_Occurred()) {
2166 PyErr_Clear();
2167 impconv = 0;
2168 }
2169 if (impconv) {
2170 SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2171 if (iobj) {
2172 void *vptr;
2173 res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2174 if (SWIG_IsOK(res)) {
2175 if (ptr) {
2176 *ptr = vptr;
2177 /* transfer the ownership to 'ptr' */
2178 iobj->own = 0;
2179 res = SWIG_AddCast(res);
2180 res = SWIG_AddNewMask(res);
2181 } else {
2182 res = SWIG_AddCast(res);
2183 }
2184 }
2185 }
2186 Py_DECREF(impconv);
2187 }
2188 }
2189 }
2190 if (!SWIG_IsOK(res) && obj == Py_None) {
2191 if (ptr)
2192 *ptr = 0;
2193 if (PyErr_Occurred())
2194 PyErr_Clear();
2195 res = SWIG_OK;
2196 }
2197 }
2198 }
2199 return res;
2200}
2201
2202/* Convert a function ptr value */
2203
2204SWIGRUNTIME int
2205SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2206 if (!PyCFunction_Check(obj)) {
2207 return SWIG_ConvertPtr(obj, ptr, ty, 0);
2208 } else {
2209 void *vptr = 0;
2210 swig_cast_info *tc;
2211
2212 /* here we get the method pointer for callbacks */
2213 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2214 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2215 if (desc)
2216 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2217 if (!desc)
2218 return SWIG_ERROR;
2219 tc = SWIG_TypeCheck(desc,ty);
2220 if (tc) {
2221 int newmemory = 0;
2222 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2223 assert(!newmemory); /* newmemory handling not yet implemented */
2224 } else {
2225 return SWIG_ERROR;
2226 }
2227 return SWIG_OK;
2228 }
2229}
2230
2231/* Convert a packed pointer value */
2232
2233SWIGRUNTIME int
2234SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2235 swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2236 if (!to) return SWIG_ERROR;
2237 if (ty) {
2238 if (to != ty) {
2239 /* check type cast? */
2240 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2241 if (!tc) return SWIG_ERROR;
2242 }
2243 }
2244 return SWIG_OK;
2245}
2246
2247/* -----------------------------------------------------------------------------
2248 * Create a new pointer object
2249 * ----------------------------------------------------------------------------- */
2250
2251/*
2252 Create a new instance object, without calling __init__, and set the
2253 'this' attribute.
2254*/
2255
2256SWIGRUNTIME PyObject*
2258{
2259 PyObject *inst = 0;
2260 PyObject *newraw = data->newraw;
2261 if (newraw) {
2262 inst = PyObject_Call(newraw, data->newargs, NULL);
2263 if (inst) {
2264#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2265 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2266 if (dictptr != NULL) {
2267 PyObject *dict = *dictptr;
2268 if (dict == NULL) {
2269 dict = PyDict_New();
2270 *dictptr = dict;
2271 PyDict_SetItem(dict, SWIG_This(), swig_this);
2272 }
2273 }
2274#else
2275 if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2276 Py_DECREF(inst);
2277 inst = 0;
2278 }
2279#endif
2280 }
2281 } else {
2282#if PY_VERSION_HEX >= 0x03000000
2283 PyObject *empty_args = PyTuple_New(0);
2284 if (empty_args) {
2285 PyObject *empty_kwargs = PyDict_New();
2286 if (empty_kwargs) {
2287 inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2288 Py_DECREF(empty_kwargs);
2289 if (inst) {
2290 if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2291 Py_DECREF(inst);
2292 inst = 0;
2293 } else {
2294 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2295 }
2296 }
2297 }
2298 Py_DECREF(empty_args);
2299 }
2300#else
2301 PyObject *dict = PyDict_New();
2302 if (dict) {
2303 PyDict_SetItem(dict, SWIG_This(), swig_this);
2304 inst = PyInstance_NewRaw(data->newargs, dict);
2305 Py_DECREF(dict);
2306 }
2307#endif
2308 }
2309 return inst;
2310}
2311
2312SWIGRUNTIME int
2313SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2314{
2315#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2316 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2317 if (dictptr != NULL) {
2318 PyObject *dict = *dictptr;
2319 if (dict == NULL) {
2320 dict = PyDict_New();
2321 *dictptr = dict;
2322 }
2323 return PyDict_SetItem(dict, SWIG_This(), swig_this);
2324 }
2325#endif
2326 return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2327}
2328
2329
2330SWIGINTERN PyObject *
2332 PyObject *obj[2];
2333 if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2334 return NULL;
2335 } else {
2336 SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2337 if (sthis) {
2338 SwigPyObject_append((PyObject*) sthis, obj[1]);
2339 } else {
2340 if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2341 return NULL;
2342 }
2343 return SWIG_Py_Void();
2344 }
2345}
2346
2347/* Create a new pointer object */
2348
2349SWIGRUNTIME PyObject *
2350SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2351 SwigPyClientData *clientdata;
2352 PyObject * robj;
2353 int own;
2354
2355 if (!ptr)
2356 return SWIG_Py_Void();
2357
2358 clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2359 own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2360 if (clientdata && clientdata->pytype) {
2361 SwigPyObject *newobj;
2362 if (flags & SWIG_BUILTIN_TP_INIT) {
2363 newobj = (SwigPyObject*) self;
2364 if (newobj->ptr) {
2365 PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2366 while (newobj->next)
2367 newobj = (SwigPyObject *) newobj->next;
2368 newobj->next = next_self;
2369 newobj = (SwigPyObject *)next_self;
2370#ifdef SWIGPYTHON_BUILTIN
2371 newobj->dict = 0;
2372#endif
2373 }
2374 } else {
2375 newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2376#ifdef SWIGPYTHON_BUILTIN
2377 newobj->dict = 0;
2378#endif
2379 }
2380 if (newobj) {
2381 newobj->ptr = ptr;
2382 newobj->ty = type;
2383 newobj->own = own;
2384 newobj->next = 0;
2385 return (PyObject*) newobj;
2386 }
2387 return SWIG_Py_Void();
2388 }
2389
2390 assert(!(flags & SWIG_BUILTIN_TP_INIT));
2391
2392 robj = SwigPyObject_New(ptr, type, own);
2393 if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2394 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2395 Py_DECREF(robj);
2396 robj = inst;
2397 }
2398 return robj;
2399}
2400
2401/* Create a new packed object */
2402
2403SWIGRUNTIMEINLINE PyObject *
2404SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2405 return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2406}
2407
2408/* -----------------------------------------------------------------------------*
2409 * Get type list
2410 * -----------------------------------------------------------------------------*/
2411
2412#ifdef SWIG_LINK_RUNTIME
2413void *SWIG_ReturnGlobalTypeList(void *);
2414#endif
2415
2418 static void *type_pointer = (void *)0;
2419 /* first check if module already created */
2420 if (!type_pointer) {
2421#ifdef SWIG_LINK_RUNTIME
2422 type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2423#else
2424 type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2425 if (PyErr_Occurred()) {
2426 PyErr_Clear();
2427 type_pointer = (void *)0;
2428 }
2429#endif
2430 }
2431 return (swig_module_info *) type_pointer;
2432}
2433
2434SWIGRUNTIME void
2436{
2437 swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2438 swig_type_info **types = swig_module->types;
2439 size_t i;
2440 for (i =0; i < swig_module->size; ++i) {
2441 swig_type_info *ty = types[i];
2442 if (ty->owndata) {
2444 if (data) SwigPyClientData_Del(data);
2445 }
2446 }
2447 Py_DECREF(SWIG_This());
2448 Swig_This_global = NULL;
2449}
2450
2451SWIGRUNTIME void
2453#if PY_VERSION_HEX >= 0x03000000
2454 /* Add a dummy module object into sys.modules */
2455 PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2456#else
2457 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2458 PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2459#endif
2460 PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2461 if (pointer && module) {
2462 PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2463 } else {
2464 Py_XDECREF(pointer);
2465 }
2466}
2467
2468/* The python cached type query */
2469SWIGRUNTIME PyObject *
2471 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2472 return cache;
2473}
2474
2476SWIG_Python_TypeQuery(const char *type)
2477{
2478 PyObject *cache = SWIG_Python_TypeCache();
2479 PyObject *key = SWIG_Python_str_FromChar(type);
2480 PyObject *obj = PyDict_GetItem(cache, key);
2481 swig_type_info *descriptor;
2482 if (obj) {
2483 descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2484 } else {
2486 descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2487 if (descriptor) {
2488 obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2489 PyDict_SetItem(cache, key, obj);
2490 Py_DECREF(obj);
2491 }
2492 }
2493 Py_DECREF(key);
2494 return descriptor;
2495}
2496
2497/*
2498 For backward compatibility only
2499*/
2500#define SWIG_POINTER_EXCEPTION 0
2501#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2502#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2503
2504SWIGRUNTIME int
2505SWIG_Python_AddErrMesg(const char* mesg, int infront)
2506{
2507 if (PyErr_Occurred()) {
2508 PyObject *type = 0;
2509 PyObject *value = 0;
2510 PyObject *traceback = 0;
2511 PyErr_Fetch(&type, &value, &traceback);
2512 if (value) {
2513 PyObject *old_str = PyObject_Str(value);
2514 const char *tmp = SWIG_Python_str_AsChar(old_str);
2515 const char *errmesg = tmp ? tmp : "Invalid error message";
2516 Py_XINCREF(type);
2517 PyErr_Clear();
2518 if (infront) {
2519 PyErr_Format(type, "%s %s", mesg, errmesg);
2520 } else {
2521 PyErr_Format(type, "%s %s", errmesg, mesg);
2522 }
2524 Py_DECREF(old_str);
2525 }
2526 return 1;
2527 } else {
2528 return 0;
2529 }
2530}
2531
2532SWIGRUNTIME int
2534{
2535 if (PyErr_Occurred()) {
2536 /* add information about failing argument */
2537 char mesg[256];
2538 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2539 return SWIG_Python_AddErrMesg(mesg, 1);
2540 } else {
2541 return 0;
2542 }
2543}
2544
2545SWIGRUNTIMEINLINE const char *
2547{
2548 SwigPyObject *v = (SwigPyObject *)self;
2549 swig_type_info *ty = v ? v->ty : 0;
2550 return ty ? ty->str : "";
2551}
2552
2553SWIGRUNTIME void
2554SWIG_Python_TypeError(const char *type, PyObject *obj)
2555{
2556 if (type) {
2557#if defined(SWIG_COBJECT_TYPES)
2558 if (obj && SwigPyObject_Check(obj)) {
2559 const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2560 if (otype) {
2561 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2562 type, otype);
2563 return;
2564 }
2565 } else
2566#endif
2567 {
2568 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2569 if (otype) {
2570 PyObject *str = PyObject_Str(obj);
2571 const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2572 if (cstr) {
2573 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2574 type, otype, cstr);
2576 } else {
2577 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2578 type, otype);
2579 }
2580 Py_XDECREF(str);
2581 return;
2582 }
2583 }
2584 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2585 } else {
2586 PyErr_Format(PyExc_TypeError, "unexpected type is received");
2587 }
2588}
2589
2590
2591/* Convert a pointer value, signal an exception on a type mismatch */
2592SWIGRUNTIME void *
2593SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2594 void *result;
2595 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2596 PyErr_Clear();
2597#if SWIG_POINTER_EXCEPTION
2598 if (flags) {
2600 SWIG_Python_ArgFail(argnum);
2601 }
2602#endif
2603 }
2604 return result;
2605}
2606
2607#ifdef SWIGPYTHON_BUILTIN
2608SWIGRUNTIME int
2609SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2610 PyTypeObject *tp = obj->ob_type;
2611 PyObject *descr;
2612 PyObject *encoded_name;
2613 descrsetfunc f;
2614 int res = -1;
2615
2616# ifdef Py_USING_UNICODE
2617 if (PyString_Check(name)) {
2618 name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2619 if (!name)
2620 return -1;
2621 } else if (!PyUnicode_Check(name))
2622# else
2623 if (!PyString_Check(name))
2624# endif
2625 {
2626 PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2627 return -1;
2628 } else {
2629 Py_INCREF(name);
2630 }
2631
2632 if (!tp->tp_dict) {
2633 if (PyType_Ready(tp) < 0)
2634 goto done;
2635 }
2636
2637 descr = _PyType_Lookup(tp, name);
2638 f = NULL;
2639 if (descr != NULL)
2640 f = descr->ob_type->tp_descr_set;
2641 if (!f) {
2642 if (PyString_Check(name)) {
2643 encoded_name = name;
2644 Py_INCREF(name);
2645 } else {
2646 encoded_name = PyUnicode_AsUTF8String(name);
2647 if (!encoded_name)
2648 return -1;
2649 }
2650 PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2651 Py_DECREF(encoded_name);
2652 } else {
2653 res = f(descr, obj, value);
2654 }
2655
2656 done:
2657 Py_DECREF(name);
2658 return res;
2659}
2660#endif
2661
2662
2663#ifdef __cplusplus
2664}
2665#endif
2666
2667
2668
2669#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2670
2671#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2672
2673
2674
2675#ifdef __cplusplus
2676extern "C" {
2677#endif
2678
2679/* Method creation and docstring support functions */
2680
2681SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
2682SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2683SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2684
2685#ifdef __cplusplus
2686}
2687#endif
2688
2689
2690 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2691
2692
2693/* -------- TYPES TABLE (BEGIN) -------- */
2694
2695#define SWIGTYPE_p_char swig_types[0]
2696#define SWIGTYPE_p_int swig_types[1]
2697#define SWIGTYPE_p_long_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__MPObjective swig_types[5]
2701#define SWIGTYPE_p_operations_research__MPSolver swig_types[6]
2702#define SWIGTYPE_p_operations_research__MPSolverParameters swig_types[7]
2703#define SWIGTYPE_p_operations_research__MPVariable swig_types[8]
2704#define SWIGTYPE_p_short swig_types[9]
2705#define SWIGTYPE_p_signed_char swig_types[10]
2706#define SWIGTYPE_p_std__atomicT_bool_t swig_types[11]
2707#define SWIGTYPE_p_std__ostream swig_types[12]
2708#define SWIGTYPE_p_unsigned_char swig_types[13]
2709#define SWIGTYPE_p_unsigned_int swig_types[14]
2710#define SWIGTYPE_p_unsigned_long_long swig_types[15]
2711#define SWIGTYPE_p_unsigned_short swig_types[16]
2713static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
2714#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2715#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2716
2717/* -------- TYPES TABLE (END) -------- */
2718
2719#ifdef SWIG_TypeQuery
2720# undef SWIG_TypeQuery
2721#endif
2722#define SWIG_TypeQuery SWIG_Python_TypeQuery
2723
2724/*-----------------------------------------------
2725 @(target):= _pywraplp.so
2726 ------------------------------------------------*/
2727#if PY_VERSION_HEX >= 0x03000000
2728# define SWIG_init PyInit__pywraplp
2729
2730#else
2731# define SWIG_init init_pywraplp
2732
2733#endif
2734#define SWIG_name "_pywraplp"
2735
2736#define SWIGVERSION 0x040002
2737#define SWIG_VERSION SWIGVERSION
2738
2739
2740#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2741#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2742
2743
2744#include <stdexcept>
2745
2746
2747namespace swig {
2748 class SwigPtr_PyObject {
2749 protected:
2750 PyObject *_obj;
2751
2752 public:
2754 {
2755 }
2756
2758 {
2760 Py_XINCREF(_obj);
2762 }
2763
2764 SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
2765 {
2766 if (initial_ref) {
2768 Py_XINCREF(_obj);
2770 }
2771 }
2772
2774 {
2776 Py_XINCREF(item._obj);
2777 Py_XDECREF(_obj);
2778 _obj = item._obj;
2780 return *this;
2781 }
2782
2784 {
2786 Py_XDECREF(_obj);
2788 }
2789
2790 operator PyObject *() const
2791 {
2792 return _obj;
2793 }
2794
2795 PyObject *operator->() const
2796 {
2797 return _obj;
2798 }
2799 };
2800}
2801
2802
2803namespace swig {
2804 struct SwigVar_PyObject : SwigPtr_PyObject {
2805 SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
2806
2808 {
2809 Py_XDECREF(_obj);
2810 _obj = obj;
2811 return *this;
2812 }
2813 };
2814}
2815
2816
2817#include <cstdint>
2818#include <string>
2819#include <vector>
2820
2822
2823
2824#include <stdint.h> // Use the C99 official header
2825
2826
2827#include <string>
2828
2829
2830#include "ortools/base/python-swig.h"
2831
2832
2835#include "ortools/linear_solver/model_exporter_swig_helper.h"
2837
2838
2839template<>
2841 return SWIG_ConvertPtr(py_obj, reinterpret_cast<void**>(b),
2844}
2845
2846
2850 0 | 0);
2851}
2852
2853bool CanConvertToMPConstraint(PyObject *py_obj) {
2855 return PyObjAs(py_obj, &tmp);
2856}
2857
2858
2859template<>
2860bool PyObjAs(PyObject *py_obj, operations_research::MPVariable** b) {
2861 return SWIG_ConvertPtr(py_obj, reinterpret_cast<void**>(b),
2864}
2865
2866
2870 0 | 0);
2871}
2872
2873bool CanConvertToMPVariable(PyObject *py_obj) {
2875 return PyObjAs(py_obj, &tmp);
2876}
2877
2878
2879SWIGINTERNINLINE PyObject*
2881{
2882 return PyInt_FromLong((long) value);
2883}
2884
2885
2888{
2889 static int init = 0;
2890 static swig_type_info* info = 0;
2891 if (!init) {
2892 info = SWIG_TypeQuery("_p_char");
2893 init = 1;
2894 }
2895 return info;
2896}
2897
2898
2899SWIGINTERN int
2900SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2901{
2902#if PY_VERSION_HEX>=0x03000000
2903#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2904 if (PyBytes_Check(obj))
2905#else
2906 if (PyUnicode_Check(obj))
2907#endif
2908#else
2909 if (PyString_Check(obj))
2910#endif
2911 {
2912 char *cstr; Py_ssize_t len;
2913 int ret = SWIG_OK;
2914#if PY_VERSION_HEX>=0x03000000
2915#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2916 if (!alloc && cptr) {
2917 /* We can't allow converting without allocation, since the internal
2918 representation of string in Python 3 is UCS-2/UCS-4 but we require
2919 a UTF-8 representation.
2920 TODO(bhy) More detailed explanation */
2921 return SWIG_RuntimeError;
2922 }
2923 obj = PyUnicode_AsUTF8String(obj);
2924 if (!obj)
2925 return SWIG_TypeError;
2926 if (alloc)
2927 *alloc = SWIG_NEWOBJ;
2928#endif
2929 if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
2930 return SWIG_TypeError;
2931#else
2932 if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
2933 return SWIG_TypeError;
2934#endif
2935 if (cptr) {
2936 if (alloc) {
2937 if (*alloc == SWIG_NEWOBJ) {
2938 *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2939 *alloc = SWIG_NEWOBJ;
2940 } else {
2941 *cptr = cstr;
2942 *alloc = SWIG_OLDOBJ;
2943 }
2944 } else {
2945#if PY_VERSION_HEX>=0x03000000
2946#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2947 *cptr = PyBytes_AsString(obj);
2948#else
2949 assert(0); /* Should never reach here with Unicode strings in Python 3 */
2950#endif
2951#else
2952 *cptr = SWIG_Python_str_AsChar(obj);
2953 if (!*cptr)
2954 ret = SWIG_TypeError;
2955#endif
2956 }
2957 }
2958 if (psize) *psize = len + 1;
2959#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2960 Py_XDECREF(obj);
2961#endif
2962 return ret;
2963 } else {
2964#if defined(SWIG_PYTHON_2_UNICODE)
2965#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2966#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
2967#endif
2968#if PY_VERSION_HEX<0x03000000
2969 if (PyUnicode_Check(obj)) {
2970 char *cstr; Py_ssize_t len;
2971 if (!alloc && cptr) {
2972 return SWIG_RuntimeError;
2973 }
2974 obj = PyUnicode_AsUTF8String(obj);
2975 if (!obj)
2976 return SWIG_TypeError;
2977 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
2978 if (cptr) {
2979 if (alloc) *alloc = SWIG_NEWOBJ;
2980 *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2981 }
2982 if (psize) *psize = len + 1;
2983
2984 Py_XDECREF(obj);
2985 return SWIG_OK;
2986 } else {
2987 Py_XDECREF(obj);
2988 }
2989 }
2990#endif
2991#endif
2992
2993 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2994 if (pchar_descriptor) {
2995 void* vptr = 0;
2996 if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2997 if (cptr) *cptr = (char *) vptr;
2998 if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
2999 if (alloc) *alloc = SWIG_OLDOBJ;
3000 return SWIG_OK;
3001 }
3002 }
3003 }
3004 return SWIG_TypeError;
3005}
3006
3007
3008SWIGINTERN int
3009SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
3010{
3011 char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
3012 if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
3013 if (buf) {
3014 if (val) *val = new std::string(buf, size - 1);
3015 if (alloc == SWIG_NEWOBJ) delete[] buf;
3016 return SWIG_NEWOBJ;
3017 } else {
3018 if (val) *val = 0;
3019 return SWIG_OLDOBJ;
3020 }
3021 } else {
3022 static int init = 0;
3023 static swig_type_info* descriptor = 0;
3024 if (!init) {
3025 descriptor = SWIG_TypeQuery("std::string" " *");
3026 init = 1;
3027 }
3028 if (descriptor) {
3029 std::string *vptr;
3030 int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
3031 if (SWIG_IsOK(res) && val) *val = vptr;
3032 return res;
3033 }
3034 }
3035 return SWIG_ERROR;
3036}
3037
3038
3039#include <limits.h>
3040#if !defined(SWIG_NO_LLONG_MAX)
3041# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3042# define LLONG_MAX __LONG_LONG_MAX__
3043# define LLONG_MIN (-LLONG_MAX - 1LL)
3044# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3045# endif
3046#endif
3047
3048
3049SWIGINTERN int
3050SWIG_AsVal_double (PyObject *obj, double *val)
3051{
3052 int res = SWIG_TypeError;
3053 if (PyFloat_Check(obj)) {
3054 if (val) *val = PyFloat_AsDouble(obj);
3055 return SWIG_OK;
3056#if PY_VERSION_HEX < 0x03000000
3057 } else if (PyInt_Check(obj)) {
3058 if (val) *val = (double) PyInt_AsLong(obj);
3059 return SWIG_OK;
3060#endif
3061 } else if (PyLong_Check(obj)) {
3062 double v = PyLong_AsDouble(obj);
3063 if (!PyErr_Occurred()) {
3064 if (val) *val = v;
3065 return SWIG_OK;
3066 } else {
3067 PyErr_Clear();
3068 }
3069 }
3070#ifdef SWIG_PYTHON_CAST_MODE
3071 {
3072 int dispatch = 0;
3073 double d = PyFloat_AsDouble(obj);
3074 if (!PyErr_Occurred()) {
3075 if (val) *val = d;
3076 return SWIG_AddCast(SWIG_OK);
3077 } else {
3078 PyErr_Clear();
3079 }
3080 if (!dispatch) {
3081 long v = PyLong_AsLong(obj);
3082 if (!PyErr_Occurred()) {
3083 if (val) *val = v;
3085 } else {
3086 PyErr_Clear();
3087 }
3088 }
3089 }
3090#endif
3091 return res;
3092}
3093
3094
3095#include <float.h>
3096
3097
3098#include <math.h>
3099
3100
3102SWIG_CanCastAsInteger(double *d, double min, double max) {
3103 double x = *d;
3104 if ((min <= x && x <= max)) {
3105 double fx = floor(x);
3106 double cx = ceil(x);
3107 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3108 if ((errno == EDOM) || (errno == ERANGE)) {
3109 errno = 0;
3110 } else {
3111 double summ, reps, diff;
3112 if (rd < x) {
3113 diff = x - rd;
3114 } else if (rd > x) {
3115 diff = rd - x;
3116 } else {
3117 return 1;
3118 }
3119 summ = rd + x;
3120 reps = diff/summ;
3121 if (reps < 8*DBL_EPSILON) {
3122 *d = rd;
3123 return 1;
3124 }
3125 }
3126 }
3127 return 0;
3128}
3129
3130
3131SWIGINTERN int
3132SWIG_AsVal_long (PyObject *obj, long* val)
3133{
3134#if PY_VERSION_HEX < 0x03000000
3135 if (PyInt_Check(obj)) {
3136 if (val) *val = PyInt_AsLong(obj);
3137 return SWIG_OK;
3138 } else
3139#endif
3140 if (PyLong_Check(obj)) {
3141 long v = PyLong_AsLong(obj);
3142 if (!PyErr_Occurred()) {
3143 if (val) *val = v;
3144 return SWIG_OK;
3145 } else {
3146 PyErr_Clear();
3147 return SWIG_OverflowError;
3148 }
3149 }
3150#ifdef SWIG_PYTHON_CAST_MODE
3151 {
3152 int dispatch = 0;
3153 long v = PyInt_AsLong(obj);
3154 if (!PyErr_Occurred()) {
3155 if (val) *val = v;
3156 return SWIG_AddCast(SWIG_OK);
3157 } else {
3158 PyErr_Clear();
3159 }
3160 if (!dispatch) {
3161 double d;
3162 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3163 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3164 if (val) *val = (long)(d);
3165 return res;
3166 }
3167 }
3168 }
3169#endif
3170 return SWIG_TypeError;
3171}
3172
3173
3174SWIGINTERN int
3175SWIG_AsVal_int (PyObject * obj, int *val)
3176{
3177 long v;
3178 int res = SWIG_AsVal_long (obj, &v);
3179 if (SWIG_IsOK(res)) {
3180 if ((v < INT_MIN || v > INT_MAX)) {
3181 return SWIG_OverflowError;
3182 } else {
3183 if (val) *val = static_cast< int >(v);
3184 }
3185 }
3186 return res;
3187}
3188
3189
3190SWIGINTERNINLINE PyObject*
3192{
3193 return PyBool_FromLong(value ? 1 : 0);
3194}
3195
3196
3197SWIGINTERN int
3198SWIG_AsVal_bool (PyObject *obj, bool *val)
3199{
3200 int r;
3201 if (!PyBool_Check(obj))
3202 return SWIG_ERROR;
3203 r = PyObject_IsTrue(obj);
3204 if (r == -1)
3205 return SWIG_ERROR;
3206 if (val) *val = r ? true : false;
3207 return SWIG_OK;
3208}
3209
3210
3211 #define SWIG_From_double PyFloat_FromDouble
3212
3213
3214#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
3215# define SWIG_LONG_LONG_AVAILABLE
3216#endif
3217
3218
3219#ifdef SWIG_LONG_LONG_AVAILABLE
3220SWIGINTERNINLINE PyObject*
3221SWIG_From_long_SS_long (long long value)
3222{
3223 return ((value < LONG_MIN) || (value > LONG_MAX)) ?
3224 PyLong_FromLongLong(value) : PyInt_FromLong(static_cast< long >(value));
3225}
3226#endif
3227
3228
3229#ifdef SWIG_LONG_LONG_AVAILABLE
3230SWIGINTERN int
3231SWIG_AsVal_long_SS_long (PyObject *obj, long long *val)
3232{
3233 int res = SWIG_TypeError;
3234 if (PyLong_Check(obj)) {
3235 long long v = PyLong_AsLongLong(obj);
3236 if (!PyErr_Occurred()) {
3237 if (val) *val = v;
3238 return SWIG_OK;
3239 } else {
3240 PyErr_Clear();
3241 res = SWIG_OverflowError;
3242 }
3243 } else {
3244 long v;
3245 res = SWIG_AsVal_long (obj,&v);
3246 if (SWIG_IsOK(res)) {
3247 if (val) *val = v;
3248 return res;
3249 }
3250 }
3251#ifdef SWIG_PYTHON_CAST_MODE
3252 {
3253 const double mant_max = 1LL << DBL_MANT_DIG;
3254 const double mant_min = -mant_max;
3255 double d;
3256 res = SWIG_AsVal_double (obj,&d);
3257 if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max))
3258 return SWIG_OverflowError;
3259 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) {
3260 if (val) *val = (long long)(d);
3261 return SWIG_AddCast(res);
3262 }
3263 res = SWIG_TypeError;
3264 }
3265#endif
3266 return res;
3267}
3268#endif
3269
3271 std::string error_message;
3272 self->LoadModelFromProto(input_model, &error_message);
3273 return error_message;
3274 }
3275
3276SWIGINTERNINLINE PyObject *
3277SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3278{
3279 if (carray) {
3280 if (size > INT_MAX) {
3281 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3282 return pchar_descriptor ?
3283 SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3284 } else {
3285#if PY_VERSION_HEX >= 0x03000000
3286#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3287 return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3288#else
3289 return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3290#endif
3291#else
3292 return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3293#endif
3294 }
3295 } else {
3296 return SWIG_Py_Void();
3297 }
3298}
3299
3300
3301SWIGINTERNINLINE PyObject *
3302SWIG_From_std_string (const std::string& s)
3303{
3304 return SWIG_FromCharPtrAndSize(s.data(), s.size());
3305}
3306
3308 std::string error_message;
3309 self->LoadModelFromProtoWithUniqueNamesOrDie(input_model, &error_message);
3310 return error_message;
3311 }
3313 const absl::Status status =
3314 self->LoadSolutionFromProto(response, tolerance);
3315 LOG_IF(ERROR, !status.ok()) << "LoadSolutionFromProto() failed: " << status;
3316 return status.ok();
3317 }
3320 options.obfuscate = obfuscated;
3322 self->ExportModelToProto(&model);
3323 return ExportModelAsLpFormat(model, options).value_or("");
3324 }
3327 options.obfuscate = obfuscated;
3329 self->ExportModelToProto(&model);
3330 return ExportModelAsMpsFormat(model, options).value_or("");
3331 }
3332SWIGINTERN void operations_research_MPSolver_SetHint(operations_research::MPSolver *self,std::vector< operations_research::MPVariable * > const &variables,std::vector< double > const &values){
3333 if (variables.size() != values.size()) {
3334 LOG(FATAL) << "Different number of variables and values when setting "
3335 << "hint.";
3336 }
3337 std::vector<std::pair<const operations_research::MPVariable*, double> >
3338 hint(variables.size());
3339 for (int i = 0; i < variables.size(); ++i) {
3340 hint[i] = std::make_pair(variables[i], values[i]);
3341 }
3342 self->SetHint(hint);
3343 }
3345 return self->SetNumThreads(num_theads).ok();
3346 }
3353 return self->name();
3354 }
3356 return self->name();
3357 }
3370#ifdef __cplusplus
3371extern "C" {
3372#endif
3373SWIGINTERN PyObject *_wrap_new_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3374 PyObject *resultobj = 0;
3375 std::string *arg1 = 0 ;
3377 int res1 = SWIG_OLDOBJ ;
3378 int val2 ;
3379 int ecode2 = 0 ;
3380 PyObject *swig_obj[2] ;
3381 operations_research::MPSolver *result = 0 ;
3382
3383 if (!SWIG_Python_UnpackTuple(args, "new_Solver", 2, 2, swig_obj)) SWIG_fail;
3384 {
3385 std::string *ptr = (std::string *)0;
3386 res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3387 if (!SWIG_IsOK(res1)) {
3388 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Solver" "', argument " "1"" of type '" "std::string const &""'");
3389 }
3390 if (!ptr) {
3391 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Solver" "', argument " "1"" of type '" "std::string const &""'");
3392 }
3393 arg1 = ptr;
3394 }
3395 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3396 if (!SWIG_IsOK(ecode2)) {
3397 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Solver" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3398 }
3400 result = (operations_research::MPSolver *)new operations_research::MPSolver((std::string const &)*arg1,arg2);
3402 if (SWIG_IsNewObj(res1)) delete arg1;
3403 return resultobj;
3404fail:
3405 if (SWIG_IsNewObj(res1)) delete arg1;
3406 return NULL;
3407}
3408
3409
3410SWIGINTERN PyObject *_wrap_delete_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3411 PyObject *resultobj = 0;
3413 void *argp1 = 0 ;
3414 int res1 = 0 ;
3415 PyObject *swig_obj[1] ;
3416
3417 if (!args) SWIG_fail;
3418 swig_obj[0] = args;
3420 if (!SWIG_IsOK(res1)) {
3421 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Solver" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3422 }
3423 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3424 delete arg1;
3425 resultobj = SWIG_Py_Void();
3426 return resultobj;
3427fail:
3428 return NULL;
3429}
3430
3431
3432SWIGINTERN PyObject *_wrap_Solver_CreateSolver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3433 PyObject *resultobj = 0;
3434 std::string *arg1 = 0 ;
3435 int res1 = SWIG_OLDOBJ ;
3436 PyObject *swig_obj[1] ;
3437 operations_research::MPSolver *result = 0 ;
3438
3439 if (!args) SWIG_fail;
3440 swig_obj[0] = args;
3441 {
3442 std::string *ptr = (std::string *)0;
3443 res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3444 if (!SWIG_IsOK(res1)) {
3445 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_CreateSolver" "', argument " "1"" of type '" "std::string const &""'");
3446 }
3447 if (!ptr) {
3448 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_CreateSolver" "', argument " "1"" of type '" "std::string const &""'");
3449 }
3450 arg1 = ptr;
3451 }
3452 result = (operations_research::MPSolver *)operations_research::MPSolver::CreateSolver((std::string const &)*arg1);
3454 if (SWIG_IsNewObj(res1)) delete arg1;
3455 return resultobj;
3456fail:
3457 if (SWIG_IsNewObj(res1)) delete arg1;
3458 return NULL;
3459}
3460
3461
3462SWIGINTERN PyObject *_wrap_Solver_SupportsProblemType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3463 PyObject *resultobj = 0;
3465 int val1 ;
3466 int ecode1 = 0 ;
3467 PyObject *swig_obj[1] ;
3468 bool result;
3469
3470 if (!args) SWIG_fail;
3471 swig_obj[0] = args;
3472 ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
3473 if (!SWIG_IsOK(ecode1)) {
3474 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Solver_SupportsProblemType" "', argument " "1"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3475 }
3478 resultobj = SWIG_From_bool(static_cast< bool >(result));
3479 return resultobj;
3480fail:
3481 return NULL;
3482}
3483
3484
3485SWIGINTERN PyObject *_wrap_Solver_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3486 PyObject *resultobj = 0;
3488 void *argp1 = 0 ;
3489 int res1 = 0 ;
3490 PyObject *swig_obj[1] ;
3491
3492 if (!args) SWIG_fail;
3493 swig_obj[0] = args;
3494 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3495 if (!SWIG_IsOK(res1)) {
3496 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Clear" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3497 }
3498 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3499 (arg1)->Clear();
3500 resultobj = SWIG_Py_Void();
3501 return resultobj;
3502fail:
3503 return NULL;
3504}
3505
3506
3507SWIGINTERN PyObject *_wrap_Solver_NumVariables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3508 PyObject *resultobj = 0;
3510 void *argp1 = 0 ;
3511 int res1 = 0 ;
3512 PyObject *swig_obj[1] ;
3513 int result;
3514
3515 if (!args) SWIG_fail;
3516 swig_obj[0] = args;
3517 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3518 if (!SWIG_IsOK(res1)) {
3519 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumVariables" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3520 }
3521 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3522 result = (int)((operations_research::MPSolver const *)arg1)->NumVariables();
3523 resultobj = SWIG_From_int(static_cast< int >(result));
3524 return resultobj;
3525fail:
3526 return NULL;
3527}
3528
3529
3530SWIGINTERN PyObject *_wrap_Solver_variables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3531 PyObject *resultobj = 0;
3533 void *argp1 = 0 ;
3534 int res1 = 0 ;
3535 PyObject *swig_obj[1] ;
3536 std::vector< operations_research::MPVariable * > *result = 0 ;
3537
3538 if (!args) SWIG_fail;
3539 swig_obj[0] = args;
3540 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3541 if (!SWIG_IsOK(res1)) {
3542 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_variables" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3543 }
3544 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3545 result = (std::vector< operations_research::MPVariable * > *) &((operations_research::MPSolver const *)arg1)->variables();
3546 {
3547 resultobj = vector_output_helper(result, &FromObjectMPVariable);
3548 }
3549 return resultobj;
3550fail:
3551 return NULL;
3552}
3553
3554
3555SWIGINTERN PyObject *_wrap_Solver_variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3556 PyObject *resultobj = 0;
3558 int arg2 ;
3559 void *argp1 = 0 ;
3560 int res1 = 0 ;
3561 int val2 ;
3562 int ecode2 = 0 ;
3563 PyObject *swig_obj[2] ;
3565
3566 if (!SWIG_Python_UnpackTuple(args, "Solver_variable", 2, 2, swig_obj)) SWIG_fail;
3567 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3568 if (!SWIG_IsOK(res1)) {
3569 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_variable" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3570 }
3571 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3572 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3573 if (!SWIG_IsOK(ecode2)) {
3574 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_variable" "', argument " "2"" of type '" "int""'");
3575 }
3576 arg2 = static_cast< int >(val2);
3577 result = (operations_research::MPVariable *)((operations_research::MPSolver const *)arg1)->variable(arg2);
3579 return resultobj;
3580fail:
3581 return NULL;
3582}
3583
3584
3585SWIGINTERN PyObject *_wrap_Solver_LookupVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3586 PyObject *resultobj = 0;
3588 std::string *arg2 = 0 ;
3589 void *argp1 = 0 ;
3590 int res1 = 0 ;
3591 int res2 = SWIG_OLDOBJ ;
3592 PyObject *swig_obj[2] ;
3594
3595 if (!SWIG_Python_UnpackTuple(args, "Solver_LookupVariable", 2, 2, swig_obj)) SWIG_fail;
3596 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3597 if (!SWIG_IsOK(res1)) {
3598 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LookupVariable" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3599 }
3600 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3601 {
3602 std::string *ptr = (std::string *)0;
3603 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3604 if (!SWIG_IsOK(res2)) {
3605 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_LookupVariable" "', argument " "2"" of type '" "std::string const &""'");
3606 }
3607 if (!ptr) {
3608 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_LookupVariable" "', argument " "2"" of type '" "std::string const &""'");
3609 }
3610 arg2 = ptr;
3611 }
3612 result = (operations_research::MPVariable *)((operations_research::MPSolver const *)arg1)->LookupVariableOrNull((std::string const &)*arg2);
3614 if (SWIG_IsNewObj(res2)) delete arg2;
3615 return resultobj;
3616fail:
3617 if (SWIG_IsNewObj(res2)) delete arg2;
3618 return NULL;
3619}
3620
3621
3622SWIGINTERN PyObject *_wrap_Solver_Var(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3623 PyObject *resultobj = 0;
3625 double arg2 ;
3626 double arg3 ;
3627 bool arg4 ;
3628 std::string *arg5 = 0 ;
3629 void *argp1 = 0 ;
3630 int res1 = 0 ;
3631 double val2 ;
3632 int ecode2 = 0 ;
3633 double val3 ;
3634 int ecode3 = 0 ;
3635 bool val4 ;
3636 int ecode4 = 0 ;
3637 int res5 = SWIG_OLDOBJ ;
3638 PyObject *swig_obj[5] ;
3640
3641 if (!SWIG_Python_UnpackTuple(args, "Solver_Var", 5, 5, swig_obj)) SWIG_fail;
3642 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3643 if (!SWIG_IsOK(res1)) {
3644 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Var" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3645 }
3646 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3647 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3648 if (!SWIG_IsOK(ecode2)) {
3649 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Var" "', argument " "2"" of type '" "double""'");
3650 }
3651 arg2 = static_cast< double >(val2);
3652 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3653 if (!SWIG_IsOK(ecode3)) {
3654 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Var" "', argument " "3"" of type '" "double""'");
3655 }
3656 arg3 = static_cast< double >(val3);
3657 ecode4 = SWIG_AsVal_bool(swig_obj[3], &val4);
3658 if (!SWIG_IsOK(ecode4)) {
3659 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Solver_Var" "', argument " "4"" of type '" "bool""'");
3660 }
3661 arg4 = static_cast< bool >(val4);
3662 {
3663 std::string *ptr = (std::string *)0;
3664 res5 = SWIG_AsPtr_std_string(swig_obj[4], &ptr);
3665 if (!SWIG_IsOK(res5)) {
3666 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Solver_Var" "', argument " "5"" of type '" "std::string const &""'");
3667 }
3668 if (!ptr) {
3669 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Var" "', argument " "5"" of type '" "std::string const &""'");
3670 }
3671 arg5 = ptr;
3672 }
3673 result = (operations_research::MPVariable *)(arg1)->MakeVar(arg2,arg3,arg4,(std::string const &)*arg5);
3675 if (SWIG_IsNewObj(res5)) delete arg5;
3676 return resultobj;
3677fail:
3678 if (SWIG_IsNewObj(res5)) delete arg5;
3679 return NULL;
3680}
3681
3682
3683SWIGINTERN PyObject *_wrap_Solver_NumVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3684 PyObject *resultobj = 0;
3686 double arg2 ;
3687 double arg3 ;
3688 std::string *arg4 = 0 ;
3689 void *argp1 = 0 ;
3690 int res1 = 0 ;
3691 double val2 ;
3692 int ecode2 = 0 ;
3693 double val3 ;
3694 int ecode3 = 0 ;
3695 int res4 = SWIG_OLDOBJ ;
3696 PyObject *swig_obj[4] ;
3698
3699 if (!SWIG_Python_UnpackTuple(args, "Solver_NumVar", 4, 4, swig_obj)) SWIG_fail;
3700 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3701 if (!SWIG_IsOK(res1)) {
3702 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3703 }
3704 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3705 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3706 if (!SWIG_IsOK(ecode2)) {
3707 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_NumVar" "', argument " "2"" of type '" "double""'");
3708 }
3709 arg2 = static_cast< double >(val2);
3710 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3711 if (!SWIG_IsOK(ecode3)) {
3712 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_NumVar" "', argument " "3"" of type '" "double""'");
3713 }
3714 arg3 = static_cast< double >(val3);
3715 {
3716 std::string *ptr = (std::string *)0;
3717 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
3718 if (!SWIG_IsOK(res4)) {
3719 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_NumVar" "', argument " "4"" of type '" "std::string const &""'");
3720 }
3721 if (!ptr) {
3722 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_NumVar" "', argument " "4"" of type '" "std::string const &""'");
3723 }
3724 arg4 = ptr;
3725 }
3726 result = (operations_research::MPVariable *)(arg1)->MakeNumVar(arg2,arg3,(std::string const &)*arg4);
3728 if (SWIG_IsNewObj(res4)) delete arg4;
3729 return resultobj;
3730fail:
3731 if (SWIG_IsNewObj(res4)) delete arg4;
3732 return NULL;
3733}
3734
3735
3736SWIGINTERN PyObject *_wrap_Solver_IntVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3737 PyObject *resultobj = 0;
3739 double arg2 ;
3740 double arg3 ;
3741 std::string *arg4 = 0 ;
3742 void *argp1 = 0 ;
3743 int res1 = 0 ;
3744 double val2 ;
3745 int ecode2 = 0 ;
3746 double val3 ;
3747 int ecode3 = 0 ;
3748 int res4 = SWIG_OLDOBJ ;
3749 PyObject *swig_obj[4] ;
3751
3752 if (!SWIG_Python_UnpackTuple(args, "Solver_IntVar", 4, 4, swig_obj)) SWIG_fail;
3753 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3754 if (!SWIG_IsOK(res1)) {
3755 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_IntVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3756 }
3757 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3758 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3759 if (!SWIG_IsOK(ecode2)) {
3760 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_IntVar" "', argument " "2"" of type '" "double""'");
3761 }
3762 arg2 = static_cast< double >(val2);
3763 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3764 if (!SWIG_IsOK(ecode3)) {
3765 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_IntVar" "', argument " "3"" of type '" "double""'");
3766 }
3767 arg3 = static_cast< double >(val3);
3768 {
3769 std::string *ptr = (std::string *)0;
3770 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
3771 if (!SWIG_IsOK(res4)) {
3772 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_IntVar" "', argument " "4"" of type '" "std::string const &""'");
3773 }
3774 if (!ptr) {
3775 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_IntVar" "', argument " "4"" of type '" "std::string const &""'");
3776 }
3777 arg4 = ptr;
3778 }
3779 result = (operations_research::MPVariable *)(arg1)->MakeIntVar(arg2,arg3,(std::string const &)*arg4);
3781 if (SWIG_IsNewObj(res4)) delete arg4;
3782 return resultobj;
3783fail:
3784 if (SWIG_IsNewObj(res4)) delete arg4;
3785 return NULL;
3786}
3787
3788
3789SWIGINTERN PyObject *_wrap_Solver_BoolVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3790 PyObject *resultobj = 0;
3792 std::string *arg2 = 0 ;
3793 void *argp1 = 0 ;
3794 int res1 = 0 ;
3795 int res2 = SWIG_OLDOBJ ;
3796 PyObject *swig_obj[2] ;
3798
3799 if (!SWIG_Python_UnpackTuple(args, "Solver_BoolVar", 2, 2, swig_obj)) SWIG_fail;
3800 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3801 if (!SWIG_IsOK(res1)) {
3802 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_BoolVar" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3803 }
3804 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3805 {
3806 std::string *ptr = (std::string *)0;
3807 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3808 if (!SWIG_IsOK(res2)) {
3809 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_BoolVar" "', argument " "2"" of type '" "std::string const &""'");
3810 }
3811 if (!ptr) {
3812 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_BoolVar" "', argument " "2"" of type '" "std::string const &""'");
3813 }
3814 arg2 = ptr;
3815 }
3816 result = (operations_research::MPVariable *)(arg1)->MakeBoolVar((std::string const &)*arg2);
3818 if (SWIG_IsNewObj(res2)) delete arg2;
3819 return resultobj;
3820fail:
3821 if (SWIG_IsNewObj(res2)) delete arg2;
3822 return NULL;
3823}
3824
3825
3826SWIGINTERN PyObject *_wrap_Solver_NumConstraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3827 PyObject *resultobj = 0;
3829 void *argp1 = 0 ;
3830 int res1 = 0 ;
3831 PyObject *swig_obj[1] ;
3832 int result;
3833
3834 if (!args) SWIG_fail;
3835 swig_obj[0] = args;
3836 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3837 if (!SWIG_IsOK(res1)) {
3838 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NumConstraints" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3839 }
3840 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3841 result = (int)((operations_research::MPSolver const *)arg1)->NumConstraints();
3842 resultobj = SWIG_From_int(static_cast< int >(result));
3843 return resultobj;
3844fail:
3845 return NULL;
3846}
3847
3848
3849SWIGINTERN PyObject *_wrap_Solver_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3850 PyObject *resultobj = 0;
3852 void *argp1 = 0 ;
3853 int res1 = 0 ;
3854 PyObject *swig_obj[1] ;
3855 std::vector< operations_research::MPConstraint * > *result = 0 ;
3856
3857 if (!args) SWIG_fail;
3858 swig_obj[0] = args;
3859 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3860 if (!SWIG_IsOK(res1)) {
3861 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_constraints" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3862 }
3863 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3864 result = (std::vector< operations_research::MPConstraint * > *) &((operations_research::MPSolver const *)arg1)->constraints();
3865 {
3866 resultobj = vector_output_helper(result, &FromObjectMPConstraint);
3867 }
3868 return resultobj;
3869fail:
3870 return NULL;
3871}
3872
3873
3874SWIGINTERN PyObject *_wrap_Solver_constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3875 PyObject *resultobj = 0;
3877 int arg2 ;
3878 void *argp1 = 0 ;
3879 int res1 = 0 ;
3880 int val2 ;
3881 int ecode2 = 0 ;
3882 PyObject *swig_obj[2] ;
3884
3885 if (!SWIG_Python_UnpackTuple(args, "Solver_constraint", 2, 2, swig_obj)) SWIG_fail;
3886 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3887 if (!SWIG_IsOK(res1)) {
3888 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_constraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3889 }
3890 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3891 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
3892 if (!SWIG_IsOK(ecode2)) {
3893 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_constraint" "', argument " "2"" of type '" "int""'");
3894 }
3895 arg2 = static_cast< int >(val2);
3896 result = (operations_research::MPConstraint *)((operations_research::MPSolver const *)arg1)->constraint(arg2);
3898 return resultobj;
3899fail:
3900 return NULL;
3901}
3902
3903
3904SWIGINTERN PyObject *_wrap_Solver_LookupConstraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3905 PyObject *resultobj = 0;
3907 std::string *arg2 = 0 ;
3908 void *argp1 = 0 ;
3909 int res1 = 0 ;
3910 int res2 = SWIG_OLDOBJ ;
3911 PyObject *swig_obj[2] ;
3913
3914 if (!SWIG_Python_UnpackTuple(args, "Solver_LookupConstraint", 2, 2, swig_obj)) SWIG_fail;
3915 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3916 if (!SWIG_IsOK(res1)) {
3917 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LookupConstraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3918 }
3919 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3920 {
3921 std::string *ptr = (std::string *)0;
3922 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3923 if (!SWIG_IsOK(res2)) {
3924 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_LookupConstraint" "', argument " "2"" of type '" "std::string const &""'");
3925 }
3926 if (!ptr) {
3927 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_LookupConstraint" "', argument " "2"" of type '" "std::string const &""'");
3928 }
3929 arg2 = ptr;
3930 }
3931 result = (operations_research::MPConstraint *)((operations_research::MPSolver const *)arg1)->LookupConstraintOrNull((std::string const &)*arg2);
3933 if (SWIG_IsNewObj(res2)) delete arg2;
3934 return resultobj;
3935fail:
3936 if (SWIG_IsNewObj(res2)) delete arg2;
3937 return NULL;
3938}
3939
3940
3941SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
3942 PyObject *resultobj = 0;
3944 double arg2 ;
3945 double arg3 ;
3946 void *argp1 = 0 ;
3947 int res1 = 0 ;
3948 double val2 ;
3949 int ecode2 = 0 ;
3950 double val3 ;
3951 int ecode3 = 0 ;
3953
3954 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
3955 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3956 if (!SWIG_IsOK(res1)) {
3957 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3958 }
3959 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3960 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
3961 if (!SWIG_IsOK(ecode2)) {
3962 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "double""'");
3963 }
3964 arg2 = static_cast< double >(val2);
3965 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
3966 if (!SWIG_IsOK(ecode3)) {
3967 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Constraint" "', argument " "3"" of type '" "double""'");
3968 }
3969 arg3 = static_cast< double >(val3);
3970 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint(arg2,arg3);
3972 return resultobj;
3973fail:
3974 return NULL;
3975}
3976
3977
3978SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
3979 PyObject *resultobj = 0;
3981 void *argp1 = 0 ;
3982 int res1 = 0 ;
3984
3985 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
3986 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
3987 if (!SWIG_IsOK(res1)) {
3988 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
3989 }
3990 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3991 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint();
3993 return resultobj;
3994fail:
3995 return NULL;
3996}
3997
3998
3999SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4000 PyObject *resultobj = 0;
4002 double arg2 ;
4003 double arg3 ;
4004 std::string *arg4 = 0 ;
4005 void *argp1 = 0 ;
4006 int res1 = 0 ;
4007 double val2 ;
4008 int ecode2 = 0 ;
4009 double val3 ;
4010 int ecode3 = 0 ;
4011 int res4 = SWIG_OLDOBJ ;
4013
4014 if ((nobjs < 4) || (nobjs > 4)) SWIG_fail;
4015 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4016 if (!SWIG_IsOK(res1)) {
4017 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4018 }
4019 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4020 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
4021 if (!SWIG_IsOK(ecode2)) {
4022 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "double""'");
4023 }
4024 arg2 = static_cast< double >(val2);
4025 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
4026 if (!SWIG_IsOK(ecode3)) {
4027 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_Constraint" "', argument " "3"" of type '" "double""'");
4028 }
4029 arg3 = static_cast< double >(val3);
4030 {
4031 std::string *ptr = (std::string *)0;
4032 res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr);
4033 if (!SWIG_IsOK(res4)) {
4034 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Solver_Constraint" "', argument " "4"" of type '" "std::string const &""'");
4035 }
4036 if (!ptr) {
4037 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Constraint" "', argument " "4"" of type '" "std::string const &""'");
4038 }
4039 arg4 = ptr;
4040 }
4041 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint(arg2,arg3,(std::string const &)*arg4);
4043 if (SWIG_IsNewObj(res4)) delete arg4;
4044 return resultobj;
4045fail:
4046 if (SWIG_IsNewObj(res4)) delete arg4;
4047 return NULL;
4048}
4049
4050
4051SWIGINTERN PyObject *_wrap_Solver_Constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4052 PyObject *resultobj = 0;
4054 std::string *arg2 = 0 ;
4055 void *argp1 = 0 ;
4056 int res1 = 0 ;
4057 int res2 = SWIG_OLDOBJ ;
4059
4060 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4061 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4062 if (!SWIG_IsOK(res1)) {
4063 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Constraint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4064 }
4065 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4066 {
4067 std::string *ptr = (std::string *)0;
4068 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4069 if (!SWIG_IsOK(res2)) {
4070 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_Constraint" "', argument " "2"" of type '" "std::string const &""'");
4071 }
4072 if (!ptr) {
4073 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Constraint" "', argument " "2"" of type '" "std::string const &""'");
4074 }
4075 arg2 = ptr;
4076 }
4077 result = (operations_research::MPConstraint *)(arg1)->MakeRowConstraint((std::string const &)*arg2);
4079 if (SWIG_IsNewObj(res2)) delete arg2;
4080 return resultobj;
4081fail:
4082 if (SWIG_IsNewObj(res2)) delete arg2;
4083 return NULL;
4084}
4085
4086
4087SWIGINTERN PyObject *_wrap_Solver_Constraint(PyObject *self, PyObject *args) {
4088 Py_ssize_t argc;
4089 PyObject *argv[5] = {
4090 0
4091 };
4092
4093 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_Constraint", 0, 4, argv))) SWIG_fail;
4094 --argc;
4095 if (argc == 1) {
4096 int _v;
4097 void *vptr = 0;
4098 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4099 _v = SWIG_CheckState(res);
4100 if (_v) {
4101 return _wrap_Solver_Constraint__SWIG_1(self, argc, argv);
4102 }
4103 }
4104 if (argc == 2) {
4105 int _v;
4106 void *vptr = 0;
4107 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4108 _v = SWIG_CheckState(res);
4109 if (_v) {
4110 int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
4111 _v = SWIG_CheckState(res);
4112 if (_v) {
4113 return _wrap_Solver_Constraint__SWIG_3(self, argc, argv);
4114 }
4115 }
4116 }
4117 if (argc == 3) {
4118 int _v;
4119 void *vptr = 0;
4120 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4121 _v = SWIG_CheckState(res);
4122 if (_v) {
4123 {
4124 int res = SWIG_AsVal_double(argv[1], NULL);
4125 _v = SWIG_CheckState(res);
4126 }
4127 if (_v) {
4128 {
4129 int res = SWIG_AsVal_double(argv[2], NULL);
4130 _v = SWIG_CheckState(res);
4131 }
4132 if (_v) {
4133 return _wrap_Solver_Constraint__SWIG_0(self, argc, argv);
4134 }
4135 }
4136 }
4137 }
4138 if (argc == 4) {
4139 int _v;
4140 void *vptr = 0;
4141 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4142 _v = SWIG_CheckState(res);
4143 if (_v) {
4144 {
4145 int res = SWIG_AsVal_double(argv[1], NULL);
4146 _v = SWIG_CheckState(res);
4147 }
4148 if (_v) {
4149 {
4150 int res = SWIG_AsVal_double(argv[2], NULL);
4151 _v = SWIG_CheckState(res);
4152 }
4153 if (_v) {
4154 int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
4155 _v = SWIG_CheckState(res);
4156 if (_v) {
4157 return _wrap_Solver_Constraint__SWIG_2(self, argc, argv);
4158 }
4159 }
4160 }
4161 }
4162 }
4163
4164fail:
4165 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_Constraint'.\n"
4166 " Possible C/C++ prototypes are:\n"
4167 " operations_research::MPSolver::MakeRowConstraint(double,double)\n"
4168 " operations_research::MPSolver::MakeRowConstraint()\n"
4169 " operations_research::MPSolver::MakeRowConstraint(double,double,std::string const &)\n"
4170 " operations_research::MPSolver::MakeRowConstraint(std::string const &)\n");
4171 return 0;
4172}
4173
4174
4175SWIGINTERN PyObject *_wrap_Solver_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4176 PyObject *resultobj = 0;
4178 void *argp1 = 0 ;
4179 int res1 = 0 ;
4180 PyObject *swig_obj[1] ;
4182
4183 if (!args) SWIG_fail;
4184 swig_obj[0] = args;
4185 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4186 if (!SWIG_IsOK(res1)) {
4187 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Objective" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4188 }
4189 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4190 result = (operations_research::MPObjective *)(arg1)->MutableObjective();
4192 return resultobj;
4193fail:
4194 return NULL;
4195}
4196
4197
4198SWIGINTERN PyObject *_wrap_Solver_Solve__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4199 PyObject *resultobj = 0;
4201 void *argp1 = 0 ;
4202 int res1 = 0 ;
4204
4205 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
4206 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4207 if (!SWIG_IsOK(res1)) {
4208 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Solve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4209 }
4210 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4212 resultobj = SWIG_From_int(static_cast< int >(result));
4213 return resultobj;
4214fail:
4215 return NULL;
4216}
4217
4218
4219SWIGINTERN PyObject *_wrap_Solver_Solve__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4220 PyObject *resultobj = 0;
4223 void *argp1 = 0 ;
4224 int res1 = 0 ;
4225 void *argp2 = 0 ;
4226 int res2 = 0 ;
4228
4229 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4230 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4231 if (!SWIG_IsOK(res1)) {
4232 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Solve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4233 }
4234 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4235 res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0);
4236 if (!SWIG_IsOK(res2)) {
4237 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4238 }
4239 if (!argp2) {
4240 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4241 }
4242 arg2 = reinterpret_cast< operations_research::MPSolverParameters * >(argp2);
4244 resultobj = SWIG_From_int(static_cast< int >(result));
4245 return resultobj;
4246fail:
4247 return NULL;
4248}
4249
4250
4251SWIGINTERN PyObject *_wrap_Solver_Solve(PyObject *self, PyObject *args) {
4252 Py_ssize_t argc;
4253 PyObject *argv[3] = {
4254 0
4255 };
4256
4257 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_Solve", 0, 2, argv))) SWIG_fail;
4258 --argc;
4259 if (argc == 1) {
4260 int _v;
4261 void *vptr = 0;
4262 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4263 _v = SWIG_CheckState(res);
4264 if (_v) {
4265 return _wrap_Solver_Solve__SWIG_0(self, argc, argv);
4266 }
4267 }
4268 if (argc == 2) {
4269 int _v;
4270 void *vptr = 0;
4271 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
4272 _v = SWIG_CheckState(res);
4273 if (_v) {
4275 _v = SWIG_CheckState(res);
4276 if (_v) {
4277 return _wrap_Solver_Solve__SWIG_1(self, argc, argv);
4278 }
4279 }
4280 }
4281
4282fail:
4283 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_Solve'.\n"
4284 " Possible C/C++ prototypes are:\n"
4285 " operations_research::MPSolver::Solve()\n"
4286 " operations_research::MPSolver::Solve(operations_research::MPSolverParameters const &)\n");
4287 return 0;
4288}
4289
4290
4291SWIGINTERN PyObject *_wrap_Solver_ComputeConstraintActivities(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4292 PyObject *resultobj = 0;
4294 void *argp1 = 0 ;
4295 int res1 = 0 ;
4296 PyObject *swig_obj[1] ;
4297 std::vector< double > result;
4298
4299 if (!args) SWIG_fail;
4300 swig_obj[0] = args;
4301 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4302 if (!SWIG_IsOK(res1)) {
4303 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ComputeConstraintActivities" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4304 }
4305 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4307 {
4308 resultobj = vector_output_helper(&result, &PyFloat_FromDouble);
4309 }
4310 return resultobj;
4311fail:
4312 return NULL;
4313}
4314
4315
4316SWIGINTERN PyObject *_wrap_Solver_VerifySolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4317 PyObject *resultobj = 0;
4319 double arg2 ;
4320 bool arg3 ;
4321 void *argp1 = 0 ;
4322 int res1 = 0 ;
4323 double val2 ;
4324 int ecode2 = 0 ;
4325 bool val3 ;
4326 int ecode3 = 0 ;
4327 PyObject *swig_obj[3] ;
4328 bool result;
4329
4330 if (!SWIG_Python_UnpackTuple(args, "Solver_VerifySolution", 3, 3, swig_obj)) SWIG_fail;
4331 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4332 if (!SWIG_IsOK(res1)) {
4333 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_VerifySolution" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4334 }
4335 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4336 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
4337 if (!SWIG_IsOK(ecode2)) {
4338 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_VerifySolution" "', argument " "2"" of type '" "double""'");
4339 }
4340 arg2 = static_cast< double >(val2);
4341 ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
4342 if (!SWIG_IsOK(ecode3)) {
4343 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_VerifySolution" "', argument " "3"" of type '" "bool""'");
4344 }
4345 arg3 = static_cast< bool >(val3);
4346 result = (bool)((operations_research::MPSolver const *)arg1)->VerifySolution(arg2,arg3);
4347 resultobj = SWIG_From_bool(static_cast< bool >(result));
4348 return resultobj;
4349fail:
4350 return NULL;
4351}
4352
4353
4354SWIGINTERN PyObject *_wrap_Solver_InterruptSolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4355 PyObject *resultobj = 0;
4357 void *argp1 = 0 ;
4358 int res1 = 0 ;
4359 PyObject *swig_obj[1] ;
4360 bool result;
4361
4362 if (!args) SWIG_fail;
4363 swig_obj[0] = args;
4364 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4365 if (!SWIG_IsOK(res1)) {
4366 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_InterruptSolve" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4367 }
4368 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4369 result = (bool)(arg1)->InterruptSolve();
4370 resultobj = SWIG_From_bool(static_cast< bool >(result));
4371 return resultobj;
4372fail:
4373 return NULL;
4374}
4375
4376
4377SWIGINTERN PyObject *_wrap_Solver_FillSolutionResponseProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4378 PyObject *resultobj = 0;
4381 void *argp1 = 0 ;
4382 int res1 = 0 ;
4383 PyObject *swig_obj[2] ;
4384
4385 if (!SWIG_Python_UnpackTuple(args, "Solver_FillSolutionResponseProto", 2, 2, swig_obj)) SWIG_fail;
4386 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4387 if (!SWIG_IsOK(res1)) {
4388 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_FillSolutionResponseProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4389 }
4390 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4391 {
4393 PyObject* const pyresult = PyObject_CallMethod(
4394 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4395 if (pyresult != nullptr) {
4396 char* buffer = nullptr;
4397 Py_ssize_t length = 0;
4398 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4399 if (buffer != nullptr) {
4400 arg2->ParseFromArray(buffer, length);
4401 }
4402 Py_DECREF(pyresult);
4403 }
4404 }
4405 ((operations_research::MPSolver const *)arg1)->FillSolutionResponseProto(arg2);
4406 resultobj = SWIG_Py_Void();
4407 {
4408 std::string encoded_protobuf;
4409 arg2->SerializeToString(&encoded_protobuf);
4410
4411 PyObject* const python_encoded_protobuf =
4412 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4413 encoded_protobuf.size());
4414
4415
4416
4417
4418
4419 if (python_encoded_protobuf != nullptr) {
4420 PyObject* const result = PyObject_CallMethod(
4421 swig_obj[1], const_cast<char*>("ParseFromString"),
4422 const_cast<char*>("(O)"), python_encoded_protobuf);
4423 Py_DECREF(python_encoded_protobuf);
4424 if (result != nullptr) {
4425 Py_DECREF(result);
4426 }
4427 }
4428 }
4429 {
4430 delete arg2;
4431 }
4432 return resultobj;
4433fail:
4434 {
4435 delete arg2;
4436 }
4437 return NULL;
4438}
4439
4440
4441SWIGINTERN PyObject *_wrap_Solver_SolveWithProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4442 PyObject *resultobj = 0;
4445 std::atomic< bool > *arg3 = (std::atomic< bool > *) 0 ;
4446 void *argp3 = 0 ;
4447 int res3 = 0 ;
4448
4449 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
4450 {
4452 PyObject* const pyresult = PyObject_CallMethod(
4453 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4454 if (pyresult != nullptr) {
4455 char* buffer = nullptr;
4456 Py_ssize_t length = 0;
4457 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4458 if (buffer != nullptr) {
4459 arg1->ParseFromArray(buffer, length);
4460 }
4461 Py_DECREF(pyresult);
4462 }
4463 }
4464 {
4466 PyObject* const pyresult = PyObject_CallMethod(
4467 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4468 if (pyresult != nullptr) {
4469 char* buffer = nullptr;
4470 Py_ssize_t length = 0;
4471 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4472 if (buffer != nullptr) {
4473 arg2->ParseFromArray(buffer, length);
4474 }
4475 Py_DECREF(pyresult);
4476 }
4477 }
4478 res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_std__atomicT_bool_t, 0 | 0 );
4479 if (!SWIG_IsOK(res3)) {
4480 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Solver_SolveWithProto" "', argument " "3"" of type '" "std::atomic< bool > *""'");
4481 }
4482 arg3 = reinterpret_cast< std::atomic< bool > * >(argp3);
4484 resultobj = SWIG_Py_Void();
4485 {
4486 std::string encoded_protobuf;
4487 arg2->SerializeToString(&encoded_protobuf);
4488
4489 PyObject* const python_encoded_protobuf =
4490 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4491 encoded_protobuf.size());
4492
4493
4494
4495
4496
4497 if (python_encoded_protobuf != nullptr) {
4498 PyObject* const result = PyObject_CallMethod(
4499 swig_obj[1], const_cast<char*>("ParseFromString"),
4500 const_cast<char*>("(O)"), python_encoded_protobuf);
4501 Py_DECREF(python_encoded_protobuf);
4502 if (result != nullptr) {
4503 Py_DECREF(result);
4504 }
4505 }
4506 }
4507 {
4508 delete arg1;
4509 }
4510 {
4511 delete arg2;
4512 }
4513 return resultobj;
4514fail:
4515 {
4516 delete arg1;
4517 }
4518 {
4519 delete arg2;
4520 }
4521 return NULL;
4522}
4523
4524
4525SWIGINTERN PyObject *_wrap_Solver_SolveWithProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
4526 PyObject *resultobj = 0;
4529
4530 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
4531 {
4533 PyObject* const pyresult = PyObject_CallMethod(
4534 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
4535 if (pyresult != nullptr) {
4536 char* buffer = nullptr;
4537 Py_ssize_t length = 0;
4538 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4539 if (buffer != nullptr) {
4540 arg1->ParseFromArray(buffer, length);
4541 }
4542 Py_DECREF(pyresult);
4543 }
4544 }
4545 {
4547 PyObject* const pyresult = PyObject_CallMethod(
4548 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4549 if (pyresult != nullptr) {
4550 char* buffer = nullptr;
4551 Py_ssize_t length = 0;
4552 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4553 if (buffer != nullptr) {
4554 arg2->ParseFromArray(buffer, length);
4555 }
4556 Py_DECREF(pyresult);
4557 }
4558 }
4560 resultobj = SWIG_Py_Void();
4561 {
4562 std::string encoded_protobuf;
4563 arg2->SerializeToString(&encoded_protobuf);
4564
4565 PyObject* const python_encoded_protobuf =
4566 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4567 encoded_protobuf.size());
4568
4569
4570
4571
4572
4573 if (python_encoded_protobuf != nullptr) {
4574 PyObject* const result = PyObject_CallMethod(
4575 swig_obj[1], const_cast<char*>("ParseFromString"),
4576 const_cast<char*>("(O)"), python_encoded_protobuf);
4577 Py_DECREF(python_encoded_protobuf);
4578 if (result != nullptr) {
4579 Py_DECREF(result);
4580 }
4581 }
4582 }
4583 {
4584 delete arg1;
4585 }
4586 {
4587 delete arg2;
4588 }
4589 return resultobj;
4590fail:
4591 {
4592 delete arg1;
4593 }
4594 {
4595 delete arg2;
4596 }
4597 return NULL;
4598}
4599
4600
4601SWIGINTERN PyObject *_wrap_Solver_SolveWithProto(PyObject *self, PyObject *args) {
4602 Py_ssize_t argc;
4603 PyObject *argv[4] = {
4604 0
4605 };
4606
4607 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_SolveWithProto", 0, 3, argv))) SWIG_fail;
4608 --argc;
4609 if (argc == 2) {
4610 int _v;
4611 {
4612 bool ok = false;
4613 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4614 if (module != nullptr) {
4615 PyObject* const dict = PyModule_GetDict(module);
4616 if (dict != nullptr) {
4617 PyObject* const clss = PyDict_GetItemString(dict, "MPModelRequest");
4618 if (clss != nullptr) {
4619 if (PyObject_IsInstance(argv[0], clss)) {
4620 ok = true;
4621 }
4622 }
4623 }
4624 Py_DECREF(module);
4625 }
4626 _v = ok ? 1 : 0;
4627 }
4628 if (_v) {
4629 {
4630 bool ok = false;
4631 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4632 if (module != nullptr) {
4633 PyObject* const dict = PyModule_GetDict(module);
4634 if (dict != nullptr) {
4635 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
4636 if (clss != nullptr) {
4637 if (PyObject_IsInstance(argv[1], clss)) {
4638 ok = true;
4639 }
4640 }
4641 }
4642 Py_DECREF(module);
4643 }
4644 _v = ok ? 1 : 0;
4645 }
4646 if (_v) {
4647 return _wrap_Solver_SolveWithProto__SWIG_1(self, argc, argv);
4648 }
4649 }
4650 }
4651 if (argc == 3) {
4652 int _v;
4653 {
4654 bool ok = false;
4655 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4656 if (module != nullptr) {
4657 PyObject* const dict = PyModule_GetDict(module);
4658 if (dict != nullptr) {
4659 PyObject* const clss = PyDict_GetItemString(dict, "MPModelRequest");
4660 if (clss != nullptr) {
4661 if (PyObject_IsInstance(argv[0], clss)) {
4662 ok = true;
4663 }
4664 }
4665 }
4666 Py_DECREF(module);
4667 }
4668 _v = ok ? 1 : 0;
4669 }
4670 if (_v) {
4671 {
4672 bool ok = false;
4673 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
4674 if (module != nullptr) {
4675 PyObject* const dict = PyModule_GetDict(module);
4676 if (dict != nullptr) {
4677 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
4678 if (clss != nullptr) {
4679 if (PyObject_IsInstance(argv[1], clss)) {
4680 ok = true;
4681 }
4682 }
4683 }
4684 Py_DECREF(module);
4685 }
4686 _v = ok ? 1 : 0;
4687 }
4688 if (_v) {
4689 void *vptr = 0;
4690 int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__atomicT_bool_t, 0);
4691 _v = SWIG_CheckState(res);
4692 if (_v) {
4693 return _wrap_Solver_SolveWithProto__SWIG_0(self, argc, argv);
4694 }
4695 }
4696 }
4697 }
4698
4699fail:
4700 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_SolveWithProto'.\n"
4701 " Possible C/C++ prototypes are:\n"
4702 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *,std::atomic< bool > *)\n"
4703 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *)\n");
4704 return 0;
4705}
4706
4707
4708SWIGINTERN PyObject *_wrap_Solver_ExportModelToProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4709 PyObject *resultobj = 0;
4712 void *argp1 = 0 ;
4713 int res1 = 0 ;
4714 PyObject *swig_obj[2] ;
4715
4716 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelToProto", 2, 2, swig_obj)) SWIG_fail;
4717 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4718 if (!SWIG_IsOK(res1)) {
4719 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelToProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4720 }
4721 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4722 {
4724 PyObject* const pyresult = PyObject_CallMethod(
4725 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
4726 if (pyresult != nullptr) {
4727 char* buffer = nullptr;
4728 Py_ssize_t length = 0;
4729 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4730 if (buffer != nullptr) {
4731 arg2->ParseFromArray(buffer, length);
4732 }
4733 Py_DECREF(pyresult);
4734 }
4735 }
4736 ((operations_research::MPSolver const *)arg1)->ExportModelToProto(arg2);
4737 resultobj = SWIG_Py_Void();
4738 {
4739 std::string encoded_protobuf;
4740 arg2->SerializeToString(&encoded_protobuf);
4741
4742 PyObject* const python_encoded_protobuf =
4743 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4744 encoded_protobuf.size());
4745
4746
4747
4748
4749
4750 if (python_encoded_protobuf != nullptr) {
4751 PyObject* const result = PyObject_CallMethod(
4752 swig_obj[1], const_cast<char*>("ParseFromString"),
4753 const_cast<char*>("(O)"), python_encoded_protobuf);
4754 Py_DECREF(python_encoded_protobuf);
4755 if (result != nullptr) {
4756 Py_DECREF(result);
4757 }
4758 }
4759 }
4760 {
4761 delete arg2;
4762 }
4763 return resultobj;
4764fail:
4765 {
4766 delete arg2;
4767 }
4768 return NULL;
4769}
4770
4771
4773 PyObject *resultobj = 0;
4775 std::string *arg2 = 0 ;
4776 void *argp1 = 0 ;
4777 int res1 = 0 ;
4778 int res2 = SWIG_OLDOBJ ;
4779 PyObject *swig_obj[2] ;
4780 bool result;
4781
4782 if (!SWIG_Python_UnpackTuple(args, "Solver_SetSolverSpecificParametersAsString", 2, 2, swig_obj)) SWIG_fail;
4783 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4784 if (!SWIG_IsOK(res1)) {
4785 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4786 }
4787 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4788 {
4789 std::string *ptr = (std::string *)0;
4790 res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
4791 if (!SWIG_IsOK(res2)) {
4792 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4793 }
4794 if (!ptr) {
4795 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4796 }
4797 arg2 = ptr;
4798 }
4799 result = (bool)(arg1)->SetSolverSpecificParametersAsString((std::string const &)*arg2);
4800 resultobj = SWIG_From_bool(static_cast< bool >(result));
4801 if (SWIG_IsNewObj(res2)) delete arg2;
4802 return resultobj;
4803fail:
4804 if (SWIG_IsNewObj(res2)) delete arg2;
4805 return NULL;
4806}
4807
4808
4809SWIGINTERN PyObject *_wrap_Solver_infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4810 PyObject *resultobj = 0;
4811 double result;
4812
4813 if (!SWIG_Python_UnpackTuple(args, "Solver_infinity", 0, 0, 0)) SWIG_fail;
4814 result = (double)operations_research::MPSolver::infinity();
4815 resultobj = SWIG_From_double(static_cast< double >(result));
4816 return resultobj;
4817fail:
4818 return NULL;
4819}
4820
4821
4822SWIGINTERN PyObject *_wrap_Solver_EnableOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4823 PyObject *resultobj = 0;
4825 void *argp1 = 0 ;
4826 int res1 = 0 ;
4827 PyObject *swig_obj[1] ;
4828
4829 if (!args) SWIG_fail;
4830 swig_obj[0] = args;
4831 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4832 if (!SWIG_IsOK(res1)) {
4833 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_EnableOutput" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4834 }
4835 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4836 (arg1)->EnableOutput();
4837 resultobj = SWIG_Py_Void();
4838 return resultobj;
4839fail:
4840 return NULL;
4841}
4842
4843
4844SWIGINTERN PyObject *_wrap_Solver_SuppressOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4845 PyObject *resultobj = 0;
4847 void *argp1 = 0 ;
4848 int res1 = 0 ;
4849 PyObject *swig_obj[1] ;
4850
4851 if (!args) SWIG_fail;
4852 swig_obj[0] = args;
4853 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4854 if (!SWIG_IsOK(res1)) {
4855 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SuppressOutput" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4856 }
4857 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4858 (arg1)->SuppressOutput();
4859 resultobj = SWIG_Py_Void();
4860 return resultobj;
4861fail:
4862 return NULL;
4863}
4864
4865
4866SWIGINTERN PyObject *_wrap_Solver_iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4867 PyObject *resultobj = 0;
4869 void *argp1 = 0 ;
4870 int res1 = 0 ;
4871 PyObject *swig_obj[1] ;
4872 int64_t result;
4873
4874 if (!args) SWIG_fail;
4875 swig_obj[0] = args;
4876 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4877 if (!SWIG_IsOK(res1)) {
4878 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_iterations" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4879 }
4880 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4881 result = (int64_t)((operations_research::MPSolver const *)arg1)->iterations();
4882 resultobj = SWIG_From_long_SS_long(static_cast< long long >(result));
4883 return resultobj;
4884fail:
4885 return NULL;
4886}
4887
4888
4889SWIGINTERN PyObject *_wrap_Solver_nodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4890 PyObject *resultobj = 0;
4892 void *argp1 = 0 ;
4893 int res1 = 0 ;
4894 PyObject *swig_obj[1] ;
4895 int64_t result;
4896
4897 if (!args) SWIG_fail;
4898 swig_obj[0] = args;
4899 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4900 if (!SWIG_IsOK(res1)) {
4901 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_nodes" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4902 }
4903 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4904 result = (int64_t)((operations_research::MPSolver const *)arg1)->nodes();
4905 resultobj = SWIG_From_long_SS_long(static_cast< long long >(result));
4906 return resultobj;
4907fail:
4908 return NULL;
4909}
4910
4911
4912SWIGINTERN PyObject *_wrap_Solver_ComputeExactConditionNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4913 PyObject *resultobj = 0;
4915 void *argp1 = 0 ;
4916 int res1 = 0 ;
4917 PyObject *swig_obj[1] ;
4918 double result;
4919
4920 if (!args) SWIG_fail;
4921 swig_obj[0] = args;
4922 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4923 if (!SWIG_IsOK(res1)) {
4924 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ComputeExactConditionNumber" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4925 }
4926 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4927 result = (double)((operations_research::MPSolver const *)arg1)->ComputeExactConditionNumber();
4928 resultobj = SWIG_From_double(static_cast< double >(result));
4929 return resultobj;
4930fail:
4931 return NULL;
4932}
4933
4934
4935SWIGINTERN PyObject *_wrap_Solver_NextSolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4936 PyObject *resultobj = 0;
4938 void *argp1 = 0 ;
4939 int res1 = 0 ;
4940 PyObject *swig_obj[1] ;
4941 bool result;
4942
4943 if (!args) SWIG_fail;
4944 swig_obj[0] = args;
4945 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4946 if (!SWIG_IsOK(res1)) {
4947 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_NextSolution" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4948 }
4949 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4950 result = (bool)(arg1)->NextSolution();
4951 resultobj = SWIG_From_bool(static_cast< bool >(result));
4952 return resultobj;
4953fail:
4954 return NULL;
4955}
4956
4957
4958SWIGINTERN PyObject *_wrap_Solver_set_time_limit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4959 PyObject *resultobj = 0;
4961 int64_t arg2 ;
4962 void *argp1 = 0 ;
4963 int res1 = 0 ;
4964 long long val2 ;
4965 int ecode2 = 0 ;
4966 PyObject *swig_obj[2] ;
4967
4968 if (!SWIG_Python_UnpackTuple(args, "Solver_set_time_limit", 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_set_time_limit" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4972 }
4973 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4974 ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2);
4975 if (!SWIG_IsOK(ecode2)) {
4976 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_set_time_limit" "', argument " "2"" of type '" "int64_t""'");
4977 }
4978 arg2 = static_cast< int64_t >(val2);
4979 (arg1)->set_time_limit(arg2);
4980 resultobj = SWIG_Py_Void();
4981 return resultobj;
4982fail:
4983 return NULL;
4984}
4985
4986
4987SWIGINTERN PyObject *_wrap_Solver_wall_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4988 PyObject *resultobj = 0;
4990 void *argp1 = 0 ;
4991 int res1 = 0 ;
4992 PyObject *swig_obj[1] ;
4993 int64_t result;
4994
4995 if (!args) SWIG_fail;
4996 swig_obj[0] = args;
4997 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
4998 if (!SWIG_IsOK(res1)) {
4999 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_wall_time" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
5000 }
5001 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5002 result = (int64_t)((operations_research::MPSolver const *)arg1)->wall_time();
5003 resultobj = SWIG_From_long_SS_long(static_cast< long long >(result));
5004 return resultobj;
5005fail:
5006 return NULL;
5007}
5008
5009
5010SWIGINTERN PyObject *_wrap_Solver_LoadModelFromProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5011 PyObject *resultobj = 0;
5014 void *argp1 = 0 ;
5015 int res1 = 0 ;
5016 PyObject *swig_obj[2] ;
5017 std::string result;
5018
5019 if (!SWIG_Python_UnpackTuple(args, "Solver_LoadModelFromProto", 2, 2, swig_obj)) SWIG_fail;
5020 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5021 if (!SWIG_IsOK(res1)) {
5022 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadModelFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5023 }
5024 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5025 {
5027 PyObject* const pyresult = PyObject_CallMethod(
5028 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5029 if (pyresult != nullptr) {
5030 char* buffer = nullptr;
5031 Py_ssize_t length = 0;
5032 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5033 if (buffer != nullptr) {
5034 arg2->ParseFromArray(buffer, length);
5035 }
5036 Py_DECREF(pyresult);
5037 }
5038 }
5040 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5041 {
5042 delete arg2;
5043 }
5044 return resultobj;
5045fail:
5046 {
5047 delete arg2;
5048 }
5049 return NULL;
5050}
5051
5052
5054 PyObject *resultobj = 0;
5057 void *argp1 = 0 ;
5058 int res1 = 0 ;
5059 PyObject *swig_obj[2] ;
5060 std::string result;
5061
5062 if (!SWIG_Python_UnpackTuple(args, "Solver_LoadModelFromProtoWithUniqueNamesOrDie", 2, 2, swig_obj)) SWIG_fail;
5063 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5064 if (!SWIG_IsOK(res1)) {
5065 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadModelFromProtoWithUniqueNamesOrDie" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5066 }
5067 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5068 {
5070 PyObject* const pyresult = PyObject_CallMethod(
5071 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5072 if (pyresult != nullptr) {
5073 char* buffer = nullptr;
5074 Py_ssize_t length = 0;
5075 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5076 if (buffer != nullptr) {
5077 arg2->ParseFromArray(buffer, length);
5078 }
5079 Py_DECREF(pyresult);
5080 }
5081 }
5083 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5084 {
5085 delete arg2;
5086 }
5087 return resultobj;
5088fail:
5089 {
5090 delete arg2;
5091 }
5092 return NULL;
5093}
5094
5095
5096SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5097 PyObject *resultobj = 0;
5100 double arg3 ;
5101 void *argp1 = 0 ;
5102 int res1 = 0 ;
5103 double val3 ;
5104 int ecode3 = 0 ;
5105 bool result;
5106
5107 if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
5108 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5109 if (!SWIG_IsOK(res1)) {
5110 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5111 }
5112 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5113 {
5115 PyObject* const pyresult = PyObject_CallMethod(
5116 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5117 if (pyresult != nullptr) {
5118 char* buffer = nullptr;
5119 Py_ssize_t length = 0;
5120 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5121 if (buffer != nullptr) {
5122 arg2->ParseFromArray(buffer, length);
5123 }
5124 Py_DECREF(pyresult);
5125 }
5126 }
5127 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
5128 if (!SWIG_IsOK(ecode3)) {
5129 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_LoadSolutionFromProto" "', argument " "3"" of type '" "double""'");
5130 }
5131 arg3 = static_cast< double >(val3);
5133 resultobj = SWIG_From_bool(static_cast< bool >(result));
5134 {
5135 delete arg2;
5136 }
5137 return resultobj;
5138fail:
5139 {
5140 delete arg2;
5141 }
5142 return NULL;
5143}
5144
5145
5146SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5147 PyObject *resultobj = 0;
5150 void *argp1 = 0 ;
5151 int res1 = 0 ;
5152 bool result;
5153
5154 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5155 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5156 if (!SWIG_IsOK(res1)) {
5157 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5158 }
5159 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5160 {
5162 PyObject* const pyresult = PyObject_CallMethod(
5163 swig_obj[1], const_cast<char*>("SerializeToString"), nullptr);
5164 if (pyresult != nullptr) {
5165 char* buffer = nullptr;
5166 Py_ssize_t length = 0;
5167 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5168 if (buffer != nullptr) {
5169 arg2->ParseFromArray(buffer, length);
5170 }
5171 Py_DECREF(pyresult);
5172 }
5173 }
5175 resultobj = SWIG_From_bool(static_cast< bool >(result));
5176 {
5177 delete arg2;
5178 }
5179 return resultobj;
5180fail:
5181 {
5182 delete arg2;
5183 }
5184 return NULL;
5185}
5186
5187
5188SWIGINTERN PyObject *_wrap_Solver_LoadSolutionFromProto(PyObject *self, PyObject *args) {
5189 Py_ssize_t argc;
5190 PyObject *argv[4] = {
5191 0
5192 };
5193
5194 if (!(argc = SWIG_Python_UnpackTuple(args, "Solver_LoadSolutionFromProto", 0, 3, argv))) SWIG_fail;
5195 --argc;
5196 if (argc == 2) {
5197 int _v;
5198 void *vptr = 0;
5199 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
5200 _v = SWIG_CheckState(res);
5201 if (_v) {
5202 {
5203 bool ok = false;
5204 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
5205 if (module != nullptr) {
5206 PyObject* const dict = PyModule_GetDict(module);
5207 if (dict != nullptr) {
5208 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
5209 if (clss != nullptr) {
5210 if (PyObject_IsInstance(argv[1], clss)) {
5211 ok = true;
5212 }
5213 }
5214 }
5215 Py_DECREF(module);
5216 }
5217 _v = ok ? 1 : 0;
5218 }
5219 if (_v) {
5220 return _wrap_Solver_LoadSolutionFromProto__SWIG_1(self, argc, argv);
5221 }
5222 }
5223 }
5224 if (argc == 3) {
5225 int _v;
5226 void *vptr = 0;
5227 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_operations_research__MPSolver, 0);
5228 _v = SWIG_CheckState(res);
5229 if (_v) {
5230 {
5231 bool ok = false;
5232 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
5233 if (module != nullptr) {
5234 PyObject* const dict = PyModule_GetDict(module);
5235 if (dict != nullptr) {
5236 PyObject* const clss = PyDict_GetItemString(dict, "MPSolutionResponse");
5237 if (clss != nullptr) {
5238 if (PyObject_IsInstance(argv[1], clss)) {
5239 ok = true;
5240 }
5241 }
5242 }
5243 Py_DECREF(module);
5244 }
5245 _v = ok ? 1 : 0;
5246 }
5247 if (_v) {
5248 {
5249 int res = SWIG_AsVal_double(argv[2], NULL);
5250 _v = SWIG_CheckState(res);
5251 }
5252 if (_v) {
5253 return _wrap_Solver_LoadSolutionFromProto__SWIG_0(self, argc, argv);
5254 }
5255 }
5256 }
5257 }
5258
5259fail:
5260 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Solver_LoadSolutionFromProto'.\n"
5261 " Possible C/C++ prototypes are:\n"
5262 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &,double)\n"
5263 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &)\n");
5264 return 0;
5265}
5266
5267
5268SWIGINTERN PyObject *_wrap_Solver_ExportModelAsLpFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5269 PyObject *resultobj = 0;
5271 bool arg2 ;
5272 void *argp1 = 0 ;
5273 int res1 = 0 ;
5274 bool val2 ;
5275 int ecode2 = 0 ;
5276 PyObject *swig_obj[2] ;
5277 std::string result;
5278
5279 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelAsLpFormat", 2, 2, swig_obj)) SWIG_fail;
5280 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5281 if (!SWIG_IsOK(res1)) {
5282 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelAsLpFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5283 }
5284 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5285 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5286 if (!SWIG_IsOK(ecode2)) {
5287 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_ExportModelAsLpFormat" "', argument " "2"" of type '" "bool""'");
5288 }
5289 arg2 = static_cast< bool >(val2);
5291 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5292 return resultobj;
5293fail:
5294 return NULL;
5295}
5296
5297
5298SWIGINTERN PyObject *_wrap_Solver_ExportModelAsMpsFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5299 PyObject *resultobj = 0;
5301 bool arg2 ;
5302 bool arg3 ;
5303 void *argp1 = 0 ;
5304 int res1 = 0 ;
5305 bool val2 ;
5306 int ecode2 = 0 ;
5307 bool val3 ;
5308 int ecode3 = 0 ;
5309 PyObject *swig_obj[3] ;
5310 std::string result;
5311
5312 if (!SWIG_Python_UnpackTuple(args, "Solver_ExportModelAsMpsFormat", 3, 3, swig_obj)) SWIG_fail;
5313 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5314 if (!SWIG_IsOK(res1)) {
5315 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5316 }
5317 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5318 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5319 if (!SWIG_IsOK(ecode2)) {
5320 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "2"" of type '" "bool""'");
5321 }
5322 arg2 = static_cast< bool >(val2);
5323 ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
5324 if (!SWIG_IsOK(ecode3)) {
5325 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Solver_ExportModelAsMpsFormat" "', argument " "3"" of type '" "bool""'");
5326 }
5327 arg3 = static_cast< bool >(val3);
5329 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
5330 return resultobj;
5331fail:
5332 return NULL;
5333}
5334
5335
5336SWIGINTERN PyObject *_wrap_Solver_SetHint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5337 PyObject *resultobj = 0;
5339 std::vector< operations_research::MPVariable * > *arg2 = 0 ;
5340 std::vector< double > *arg3 = 0 ;
5341 void *argp1 = 0 ;
5342 int res1 = 0 ;
5343 std::vector< operations_research::MPVariable * > temp2 ;
5344 std::vector< double > temp3 ;
5345 PyObject *swig_obj[3] ;
5346
5347 if (!SWIG_Python_UnpackTuple(args, "Solver_SetHint", 3, 3, swig_obj)) SWIG_fail;
5348 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5349 if (!SWIG_IsOK(res1)) {
5350 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetHint" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5351 }
5352 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5353 {
5354 if (!vector_input_helper(swig_obj[1], &temp2, PyObjAs<operations_research::MPVariable*>)) {
5355 if (!PyErr_Occurred())
5356 SWIG_Error(SWIG_TypeError, "sequence(operations_research::MPVariable*) expected");
5357 return NULL;
5358 }
5359 arg2 = &temp2;
5360 }
5361 {
5362 if (!vector_input_helper(swig_obj[2], &temp3, PyObjAs<double>)) {
5363 if (!PyErr_Occurred())
5364 SWIG_Error(SWIG_TypeError, "sequence(double) expected");
5365 return NULL;
5366 }
5367 arg3 = &temp3;
5368 }
5369 operations_research_MPSolver_SetHint(arg1,(std::vector< operations_research::MPVariable * > const &)*arg2,(std::vector< double > const &)*arg3);
5370 resultobj = SWIG_Py_Void();
5371 return resultobj;
5372fail:
5373 return NULL;
5374}
5375
5376
5377SWIGINTERN PyObject *_wrap_Solver_SetNumThreads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5378 PyObject *resultobj = 0;
5380 int arg2 ;
5381 void *argp1 = 0 ;
5382 int res1 = 0 ;
5383 int val2 ;
5384 int ecode2 = 0 ;
5385 PyObject *swig_obj[2] ;
5386 bool result;
5387
5388 if (!SWIG_Python_UnpackTuple(args, "Solver_SetNumThreads", 2, 2, swig_obj)) SWIG_fail;
5389 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5390 if (!SWIG_IsOK(res1)) {
5391 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetNumThreads" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5392 }
5393 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5394 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5395 if (!SWIG_IsOK(ecode2)) {
5396 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_SetNumThreads" "', argument " "2"" of type '" "int""'");
5397 }
5398 arg2 = static_cast< int >(val2);
5399 result = (bool)operations_research_MPSolver_SetNumThreads(arg1,arg2);
5400 resultobj = SWIG_From_bool(static_cast< bool >(result));
5401 return resultobj;
5402fail:
5403 return NULL;
5404}
5405
5406
5407SWIGINTERN PyObject *_wrap_Solver_Infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5408 PyObject *resultobj = 0;
5409 double result;
5410
5411 if (!SWIG_Python_UnpackTuple(args, "Solver_Infinity", 0, 0, 0)) SWIG_fail;
5412 result = (double)operations_research_MPSolver_Infinity();
5413 resultobj = SWIG_From_double(static_cast< double >(result));
5414 return resultobj;
5415fail:
5416 return NULL;
5417}
5418
5419
5420SWIGINTERN PyObject *_wrap_Solver_SetTimeLimit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5421 PyObject *resultobj = 0;
5423 int64_t arg2 ;
5424 void *argp1 = 0 ;
5425 int res1 = 0 ;
5426 long long val2 ;
5427 int ecode2 = 0 ;
5428 PyObject *swig_obj[2] ;
5429
5430 if (!SWIG_Python_UnpackTuple(args, "Solver_SetTimeLimit", 2, 2, swig_obj)) SWIG_fail;
5431 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5432 if (!SWIG_IsOK(res1)) {
5433 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_SetTimeLimit" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5434 }
5435 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5436 ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2);
5437 if (!SWIG_IsOK(ecode2)) {
5438 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Solver_SetTimeLimit" "', argument " "2"" of type '" "int64_t""'");
5439 }
5440 arg2 = static_cast< int64_t >(val2);
5442 resultobj = SWIG_Py_Void();
5443 return resultobj;
5444fail:
5445 return NULL;
5446}
5447
5448
5449SWIGINTERN PyObject *_wrap_Solver_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5450 PyObject *resultobj = 0;
5452 void *argp1 = 0 ;
5453 int res1 = 0 ;
5454 PyObject *swig_obj[1] ;
5455 int64_t result;
5456
5457 if (!args) SWIG_fail;
5458 swig_obj[0] = args;
5459 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5460 if (!SWIG_IsOK(res1)) {
5461 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_WallTime" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
5462 }
5463 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5465 resultobj = SWIG_From_long_SS_long(static_cast< long long >(result));
5466 return resultobj;
5467fail:
5468 return NULL;
5469}
5470
5471
5472SWIGINTERN PyObject *_wrap_Solver_Iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5473 PyObject *resultobj = 0;
5475 void *argp1 = 0 ;
5476 int res1 = 0 ;
5477 PyObject *swig_obj[1] ;
5478 int64_t result;
5479
5480 if (!args) SWIG_fail;
5481 swig_obj[0] = args;
5482 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolver, 0 | 0 );
5483 if (!SWIG_IsOK(res1)) {
5484 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Solver_Iterations" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
5485 }
5486 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5488 resultobj = SWIG_From_long_SS_long(static_cast< long long >(result));
5489 return resultobj;
5490fail:
5491 return NULL;
5492}
5493
5494
5495SWIGINTERN PyObject *Solver_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5496 PyObject *obj;
5497 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
5499 return SWIG_Py_Void();
5500}
5501
5502SWIGINTERN PyObject *Solver_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5503 return SWIG_Python_InitShadowInstance(args);
5504}
5505
5506SWIGINTERN PyObject *_wrap___lshift____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5507 PyObject *resultobj = 0;
5508 std::ostream *arg1 = 0 ;
5510 void *argp1 = 0 ;
5511 int res1 = 0 ;
5512 int val2 ;
5513 int ecode2 = 0 ;
5514 std::ostream *result = 0 ;
5515
5516 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5517 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_std__ostream, 0 );
5518 if (!SWIG_IsOK(res1)) {
5519 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5520 }
5521 if (!argp1) {
5522 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5523 }
5524 arg1 = reinterpret_cast< std::ostream * >(argp1);
5525 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5526 if (!SWIG_IsOK(ecode2)) {
5527 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
5528 }
5530 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5531 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
5532 return resultobj;
5533fail:
5534 PyErr_Clear();
5535 Py_INCREF(Py_NotImplemented);
5536 return Py_NotImplemented;
5537}
5538
5539
5540SWIGINTERN PyObject *_wrap___lshift____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
5541 PyObject *resultobj = 0;
5542 std::ostream *arg1 = 0 ;
5544 void *argp1 = 0 ;
5545 int res1 = 0 ;
5546 int val2 ;
5547 int ecode2 = 0 ;
5548 std::ostream *result = 0 ;
5549
5550 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
5551 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_std__ostream, 0 );
5552 if (!SWIG_IsOK(res1)) {
5553 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5554 }
5555 if (!argp1) {
5556 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "std::ostream &""'");
5557 }
5558 arg1 = reinterpret_cast< std::ostream * >(argp1);
5559 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
5560 if (!SWIG_IsOK(ecode2)) {
5561 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::ResultStatus""'");
5562 }
5563 arg2 = static_cast< operations_research::MPSolver::ResultStatus >(val2);
5564 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5565 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
5566 return resultobj;
5567fail:
5568 PyErr_Clear();
5569 Py_INCREF(Py_NotImplemented);
5570 return Py_NotImplemented;
5571}
5572
5573
5574SWIGINTERN PyObject *_wrap___lshift__(PyObject *self, PyObject *args) {
5575 Py_ssize_t argc;
5576 PyObject *argv[3] = {
5577 0
5578 };
5579
5580 if (!(argc = SWIG_Python_UnpackTuple(args, "__lshift__", 0, 2, argv))) SWIG_fail;
5581 --argc;
5582 if (argc == 2) {
5583 int _v;
5584 void *vptr = 0;
5586 _v = SWIG_CheckState(res);
5587 if (_v) {
5588 {
5589 int res = SWIG_AsVal_int(argv[1], NULL);
5590 _v = SWIG_CheckState(res);
5591 }
5592 if (_v) {
5593 return _wrap___lshift____SWIG_0(self, argc, argv);
5594 }
5595 }
5596 }
5597 if (argc == 2) {
5598 int _v;
5599 void *vptr = 0;
5601 _v = SWIG_CheckState(res);
5602 if (_v) {
5603 {
5604 int res = SWIG_AsVal_int(argv[1], NULL);
5605 _v = SWIG_CheckState(res);
5606 }
5607 if (_v) {
5608 return _wrap___lshift____SWIG_1(self, argc, argv);
5609 }
5610 }
5611 }
5612
5613fail:
5614 Py_INCREF(Py_NotImplemented);
5615 return Py_NotImplemented;
5616}
5617
5618
5619SWIGINTERN PyObject *_wrap_Objective_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5620 PyObject *resultobj = 0;
5622 void *argp1 = 0 ;
5623 int res1 = 0 ;
5624 PyObject *swig_obj[1] ;
5625
5626 if (!args) SWIG_fail;
5627 swig_obj[0] = args;
5628 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5629 if (!SWIG_IsOK(res1)) {
5630 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Clear" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5631 }
5632 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5633 (arg1)->Clear();
5634 resultobj = SWIG_Py_Void();
5635 return resultobj;
5636fail:
5637 return NULL;
5638}
5639
5640
5641SWIGINTERN PyObject *_wrap_Objective_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5642 PyObject *resultobj = 0;
5645 double arg3 ;
5646 void *argp1 = 0 ;
5647 int res1 = 0 ;
5648 double val3 ;
5649 int ecode3 = 0 ;
5650 PyObject *swig_obj[3] ;
5651
5652 if (!SWIG_Python_UnpackTuple(args, "Objective_SetCoefficient", 3, 3, swig_obj)) SWIG_fail;
5653 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5654 if (!SWIG_IsOK(res1)) {
5655 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5656 }
5657 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5658 {
5659 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
5660 }
5661 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
5662 if (!SWIG_IsOK(ecode3)) {
5663 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Objective_SetCoefficient" "', argument " "3"" of type '" "double""'");
5664 }
5665 arg3 = static_cast< double >(val3);
5666 (arg1)->SetCoefficient((operations_research::MPVariable const *)arg2,arg3);
5667 resultobj = SWIG_Py_Void();
5668 return resultobj;
5669fail:
5670 return NULL;
5671}
5672
5673
5674SWIGINTERN PyObject *_wrap_Objective_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5675 PyObject *resultobj = 0;
5678 void *argp1 = 0 ;
5679 int res1 = 0 ;
5680 PyObject *swig_obj[2] ;
5681 double result;
5682
5683 if (!SWIG_Python_UnpackTuple(args, "Objective_GetCoefficient", 2, 2, swig_obj)) SWIG_fail;
5684 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5685 if (!SWIG_IsOK(res1)) {
5686 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5687 }
5688 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5689 {
5690 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
5691 }
5692 result = (double)((operations_research::MPObjective const *)arg1)->GetCoefficient((operations_research::MPVariable const *)arg2);
5693 resultobj = SWIG_From_double(static_cast< double >(result));
5694 return resultobj;
5695fail:
5696 return NULL;
5697}
5698
5699
5700SWIGINTERN PyObject *_wrap_Objective_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5701 PyObject *resultobj = 0;
5703 double arg2 ;
5704 void *argp1 = 0 ;
5705 int res1 = 0 ;
5706 double val2 ;
5707 int ecode2 = 0 ;
5708 PyObject *swig_obj[2] ;
5709
5710 if (!SWIG_Python_UnpackTuple(args, "Objective_SetOffset", 2, 2, swig_obj)) SWIG_fail;
5711 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5712 if (!SWIG_IsOK(res1)) {
5713 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetOffset" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5714 }
5715 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5716 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
5717 if (!SWIG_IsOK(ecode2)) {
5718 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Objective_SetOffset" "', argument " "2"" of type '" "double""'");
5719 }
5720 arg2 = static_cast< double >(val2);
5721 (arg1)->SetOffset(arg2);
5722 resultobj = SWIG_Py_Void();
5723 return resultobj;
5724fail:
5725 return NULL;
5726}
5727
5728
5729SWIGINTERN PyObject *_wrap_Objective_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5730 PyObject *resultobj = 0;
5732 void *argp1 = 0 ;
5733 int res1 = 0 ;
5734 PyObject *swig_obj[1] ;
5735 double result;
5736
5737 if (!args) SWIG_fail;
5738 swig_obj[0] = args;
5739 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5740 if (!SWIG_IsOK(res1)) {
5741 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_offset" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5742 }
5743 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5744 result = (double)((operations_research::MPObjective const *)arg1)->offset();
5745 resultobj = SWIG_From_double(static_cast< double >(result));
5746 return resultobj;
5747fail:
5748 return NULL;
5749}
5750
5751
5752SWIGINTERN PyObject *_wrap_Objective_SetOptimizationDirection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5753 PyObject *resultobj = 0;
5755 bool arg2 ;
5756 void *argp1 = 0 ;
5757 int res1 = 0 ;
5758 bool val2 ;
5759 int ecode2 = 0 ;
5760 PyObject *swig_obj[2] ;
5761
5762 if (!SWIG_Python_UnpackTuple(args, "Objective_SetOptimizationDirection", 2, 2, swig_obj)) SWIG_fail;
5763 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5764 if (!SWIG_IsOK(res1)) {
5765 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetOptimizationDirection" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5766 }
5767 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5768 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
5769 if (!SWIG_IsOK(ecode2)) {
5770 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Objective_SetOptimizationDirection" "', argument " "2"" of type '" "bool""'");
5771 }
5772 arg2 = static_cast< bool >(val2);
5773 (arg1)->SetOptimizationDirection(arg2);
5774 resultobj = SWIG_Py_Void();
5775 return resultobj;
5776fail:
5777 return NULL;
5778}
5779
5780
5781SWIGINTERN PyObject *_wrap_Objective_SetMinimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5782 PyObject *resultobj = 0;
5784 void *argp1 = 0 ;
5785 int res1 = 0 ;
5786 PyObject *swig_obj[1] ;
5787
5788 if (!args) SWIG_fail;
5789 swig_obj[0] = args;
5790 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5791 if (!SWIG_IsOK(res1)) {
5792 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetMinimization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5793 }
5794 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5795 (arg1)->SetMinimization();
5796 resultobj = SWIG_Py_Void();
5797 return resultobj;
5798fail:
5799 return NULL;
5800}
5801
5802
5803SWIGINTERN PyObject *_wrap_Objective_SetMaximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5804 PyObject *resultobj = 0;
5806 void *argp1 = 0 ;
5807 int res1 = 0 ;
5808 PyObject *swig_obj[1] ;
5809
5810 if (!args) SWIG_fail;
5811 swig_obj[0] = args;
5812 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5813 if (!SWIG_IsOK(res1)) {
5814 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_SetMaximization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5815 }
5816 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5817 (arg1)->SetMaximization();
5818 resultobj = SWIG_Py_Void();
5819 return resultobj;
5820fail:
5821 return NULL;
5822}
5823
5824
5825SWIGINTERN PyObject *_wrap_Objective_maximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5826 PyObject *resultobj = 0;
5828 void *argp1 = 0 ;
5829 int res1 = 0 ;
5830 PyObject *swig_obj[1] ;
5831 bool result;
5832
5833 if (!args) SWIG_fail;
5834 swig_obj[0] = args;
5835 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5836 if (!SWIG_IsOK(res1)) {
5837 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_maximization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5838 }
5839 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5840 result = (bool)((operations_research::MPObjective const *)arg1)->maximization();
5841 resultobj = SWIG_From_bool(static_cast< bool >(result));
5842 return resultobj;
5843fail:
5844 return NULL;
5845}
5846
5847
5848SWIGINTERN PyObject *_wrap_Objective_minimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5849 PyObject *resultobj = 0;
5851 void *argp1 = 0 ;
5852 int res1 = 0 ;
5853 PyObject *swig_obj[1] ;
5854 bool result;
5855
5856 if (!args) SWIG_fail;
5857 swig_obj[0] = args;
5858 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5859 if (!SWIG_IsOK(res1)) {
5860 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_minimization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5861 }
5862 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5863 result = (bool)((operations_research::MPObjective const *)arg1)->minimization();
5864 resultobj = SWIG_From_bool(static_cast< bool >(result));
5865 return resultobj;
5866fail:
5867 return NULL;
5868}
5869
5870
5871SWIGINTERN PyObject *_wrap_Objective_Value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5872 PyObject *resultobj = 0;
5874 void *argp1 = 0 ;
5875 int res1 = 0 ;
5876 PyObject *swig_obj[1] ;
5877 double result;
5878
5879 if (!args) SWIG_fail;
5880 swig_obj[0] = args;
5881 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5882 if (!SWIG_IsOK(res1)) {
5883 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Value" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5884 }
5885 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5886 result = (double)((operations_research::MPObjective const *)arg1)->Value();
5887 resultobj = SWIG_From_double(static_cast< double >(result));
5888 return resultobj;
5889fail:
5890 return NULL;
5891}
5892
5893
5894SWIGINTERN PyObject *_wrap_Objective_BestBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5895 PyObject *resultobj = 0;
5897 void *argp1 = 0 ;
5898 int res1 = 0 ;
5899 PyObject *swig_obj[1] ;
5900 double result;
5901
5902 if (!args) SWIG_fail;
5903 swig_obj[0] = args;
5904 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5905 if (!SWIG_IsOK(res1)) {
5906 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_BestBound" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5907 }
5908 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5909 result = (double)((operations_research::MPObjective const *)arg1)->BestBound();
5910 resultobj = SWIG_From_double(static_cast< double >(result));
5911 return resultobj;
5912fail:
5913 return NULL;
5914}
5915
5916
5917SWIGINTERN PyObject *_wrap_Objective_Offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5918 PyObject *resultobj = 0;
5920 void *argp1 = 0 ;
5921 int res1 = 0 ;
5922 PyObject *swig_obj[1] ;
5923 double result;
5924
5925 if (!args) SWIG_fail;
5926 swig_obj[0] = args;
5927 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPObjective, 0 | 0 );
5928 if (!SWIG_IsOK(res1)) {
5929 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Objective_Offset" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5930 }
5931 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5933 resultobj = SWIG_From_double(static_cast< double >(result));
5934 return resultobj;
5935fail:
5936 return NULL;
5937}
5938
5939
5940SWIGINTERN PyObject *_wrap_delete_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5941 PyObject *resultobj = 0;
5943 void *argp1 = 0 ;
5944 int res1 = 0 ;
5945 PyObject *swig_obj[1] ;
5946
5947 if (!args) SWIG_fail;
5948 swig_obj[0] = args;
5950 if (!SWIG_IsOK(res1)) {
5951 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Objective" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5952 }
5953 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5954 delete arg1;
5955 resultobj = SWIG_Py_Void();
5956 return resultobj;
5957fail:
5958 return NULL;
5959}
5960
5961
5962SWIGINTERN PyObject *Objective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5963 PyObject *obj;
5964 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
5966 return SWIG_Py_Void();
5967}
5968
5969SWIGINTERN PyObject *_wrap_Variable_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5970 PyObject *resultobj = 0;
5972 void *argp1 = 0 ;
5973 int res1 = 0 ;
5974 PyObject *swig_obj[1] ;
5975 std::string *result = 0 ;
5976
5977 if (!args) SWIG_fail;
5978 swig_obj[0] = args;
5979 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
5980 if (!SWIG_IsOK(res1)) {
5981 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_name" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5982 }
5983 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5984 result = (std::string *) &((operations_research::MPVariable const *)arg1)->name();
5985 resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
5986 return resultobj;
5987fail:
5988 return NULL;
5989}
5990
5991
5992SWIGINTERN PyObject *_wrap_Variable_SetInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5993 PyObject *resultobj = 0;
5995 bool arg2 ;
5996 void *argp1 = 0 ;
5997 int res1 = 0 ;
5998 bool val2 ;
5999 int ecode2 = 0 ;
6000 PyObject *swig_obj[2] ;
6001
6002 if (!SWIG_Python_UnpackTuple(args, "Variable_SetInteger", 2, 2, swig_obj)) SWIG_fail;
6003 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6004 if (!SWIG_IsOK(res1)) {
6005 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetInteger" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6006 }
6007 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6008 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
6009 if (!SWIG_IsOK(ecode2)) {
6010 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetInteger" "', argument " "2"" of type '" "bool""'");
6011 }
6012 arg2 = static_cast< bool >(val2);
6013 (arg1)->SetInteger(arg2);
6014 resultobj = SWIG_Py_Void();
6015 return resultobj;
6016fail:
6017 return NULL;
6018}
6019
6020
6021SWIGINTERN PyObject *_wrap_Variable_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6022 PyObject *resultobj = 0;
6024 void *argp1 = 0 ;
6025 int res1 = 0 ;
6026 PyObject *swig_obj[1] ;
6027 bool result;
6028
6029 if (!args) SWIG_fail;
6030 swig_obj[0] = args;
6031 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6032 if (!SWIG_IsOK(res1)) {
6033 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_integer" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6034 }
6035 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6036 result = (bool)((operations_research::MPVariable const *)arg1)->integer();
6037 resultobj = SWIG_From_bool(static_cast< bool >(result));
6038 return resultobj;
6039fail:
6040 return NULL;
6041}
6042
6043
6044SWIGINTERN PyObject *_wrap_Variable_solution_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6045 PyObject *resultobj = 0;
6047 void *argp1 = 0 ;
6048 int res1 = 0 ;
6049 PyObject *swig_obj[1] ;
6050 double result;
6051
6052 if (!args) SWIG_fail;
6053 swig_obj[0] = args;
6054 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6055 if (!SWIG_IsOK(res1)) {
6056 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_solution_value" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6057 }
6058 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6059 result = (double)((operations_research::MPVariable const *)arg1)->solution_value();
6060 resultobj = SWIG_From_double(static_cast< double >(result));
6061 return resultobj;
6062fail:
6063 return NULL;
6064}
6065
6066
6067SWIGINTERN PyObject *_wrap_Variable_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6068 PyObject *resultobj = 0;
6070 void *argp1 = 0 ;
6071 int res1 = 0 ;
6072 PyObject *swig_obj[1] ;
6073 int result;
6074
6075 if (!args) SWIG_fail;
6076 swig_obj[0] = args;
6077 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6078 if (!SWIG_IsOK(res1)) {
6079 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_index" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6080 }
6081 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6082 result = (int)((operations_research::MPVariable const *)arg1)->index();
6083 resultobj = SWIG_From_int(static_cast< int >(result));
6084 return resultobj;
6085fail:
6086 return NULL;
6087}
6088
6089
6090SWIGINTERN PyObject *_wrap_Variable_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6091 PyObject *resultobj = 0;
6093 void *argp1 = 0 ;
6094 int res1 = 0 ;
6095 PyObject *swig_obj[1] ;
6096 double result;
6097
6098 if (!args) SWIG_fail;
6099 swig_obj[0] = args;
6100 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6101 if (!SWIG_IsOK(res1)) {
6102 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_lb" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6103 }
6104 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6105 result = (double)((operations_research::MPVariable const *)arg1)->lb();
6106 resultobj = SWIG_From_double(static_cast< double >(result));
6107 return resultobj;
6108fail:
6109 return NULL;
6110}
6111
6112
6113SWIGINTERN PyObject *_wrap_Variable_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6114 PyObject *resultobj = 0;
6116 void *argp1 = 0 ;
6117 int res1 = 0 ;
6118 PyObject *swig_obj[1] ;
6119 double result;
6120
6121 if (!args) SWIG_fail;
6122 swig_obj[0] = args;
6123 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6124 if (!SWIG_IsOK(res1)) {
6125 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_ub" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6126 }
6127 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6128 result = (double)((operations_research::MPVariable const *)arg1)->ub();
6129 resultobj = SWIG_From_double(static_cast< double >(result));
6130 return resultobj;
6131fail:
6132 return NULL;
6133}
6134
6135
6136SWIGINTERN PyObject *_wrap_Variable_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6137 PyObject *resultobj = 0;
6139 double arg2 ;
6140 double arg3 ;
6141 void *argp1 = 0 ;
6142 int res1 = 0 ;
6143 double val2 ;
6144 int ecode2 = 0 ;
6145 double val3 ;
6146 int ecode3 = 0 ;
6147 PyObject *swig_obj[3] ;
6148
6149 if (!SWIG_Python_UnpackTuple(args, "Variable_SetBounds", 3, 3, swig_obj)) SWIG_fail;
6150 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6151 if (!SWIG_IsOK(res1)) {
6152 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetBounds" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6153 }
6154 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6155 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6156 if (!SWIG_IsOK(ecode2)) {
6157 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetBounds" "', argument " "2"" of type '" "double""'");
6158 }
6159 arg2 = static_cast< double >(val2);
6160 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6161 if (!SWIG_IsOK(ecode3)) {
6162 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Variable_SetBounds" "', argument " "3"" of type '" "double""'");
6163 }
6164 arg3 = static_cast< double >(val3);
6165 (arg1)->SetBounds(arg2,arg3);
6166 resultobj = SWIG_Py_Void();
6167 return resultobj;
6168fail:
6169 return NULL;
6170}
6171
6172
6173SWIGINTERN PyObject *_wrap_Variable_reduced_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6174 PyObject *resultobj = 0;
6176 void *argp1 = 0 ;
6177 int res1 = 0 ;
6178 PyObject *swig_obj[1] ;
6179 double result;
6180
6181 if (!args) SWIG_fail;
6182 swig_obj[0] = args;
6183 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6184 if (!SWIG_IsOK(res1)) {
6185 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_reduced_cost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6186 }
6187 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6188 result = (double)((operations_research::MPVariable const *)arg1)->reduced_cost();
6189 resultobj = SWIG_From_double(static_cast< double >(result));
6190 return resultobj;
6191fail:
6192 return NULL;
6193}
6194
6195
6196SWIGINTERN PyObject *_wrap_Variable_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6197 PyObject *resultobj = 0;
6199 void *argp1 = 0 ;
6200 int res1 = 0 ;
6201 PyObject *swig_obj[1] ;
6203
6204 if (!args) SWIG_fail;
6205 swig_obj[0] = args;
6206 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6207 if (!SWIG_IsOK(res1)) {
6208 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_basis_status" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6209 }
6210 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6211 result = (operations_research::MPSolver::BasisStatus)((operations_research::MPVariable const *)arg1)->basis_status();
6212 resultobj = SWIG_From_int(static_cast< int >(result));
6213 return resultobj;
6214fail:
6215 return NULL;
6216}
6217
6218
6219SWIGINTERN PyObject *_wrap_Variable_branching_priority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6220 PyObject *resultobj = 0;
6222 void *argp1 = 0 ;
6223 int res1 = 0 ;
6224 PyObject *swig_obj[1] ;
6225 int result;
6226
6227 if (!args) SWIG_fail;
6228 swig_obj[0] = args;
6229 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6230 if (!SWIG_IsOK(res1)) {
6231 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_branching_priority" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6232 }
6233 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6234 result = (int)((operations_research::MPVariable const *)arg1)->branching_priority();
6235 resultobj = SWIG_From_int(static_cast< int >(result));
6236 return resultobj;
6237fail:
6238 return NULL;
6239}
6240
6241
6242SWIGINTERN PyObject *_wrap_Variable_SetBranchingPriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6243 PyObject *resultobj = 0;
6245 int arg2 ;
6246 void *argp1 = 0 ;
6247 int res1 = 0 ;
6248 int val2 ;
6249 int ecode2 = 0 ;
6250 PyObject *swig_obj[2] ;
6251
6252 if (!SWIG_Python_UnpackTuple(args, "Variable_SetBranchingPriority", 2, 2, swig_obj)) SWIG_fail;
6253 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6254 if (!SWIG_IsOK(res1)) {
6255 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetBranchingPriority" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6256 }
6257 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6258 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
6259 if (!SWIG_IsOK(ecode2)) {
6260 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetBranchingPriority" "', argument " "2"" of type '" "int""'");
6261 }
6262 arg2 = static_cast< int >(val2);
6263 (arg1)->SetBranchingPriority(arg2);
6264 resultobj = SWIG_Py_Void();
6265 return resultobj;
6266fail:
6267 return NULL;
6268}
6269
6270
6271SWIGINTERN PyObject *_wrap_Variable___str__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6272 PyObject *resultobj = 0;
6274 void *argp1 = 0 ;
6275 int res1 = 0 ;
6276 PyObject *swig_obj[1] ;
6277 std::string result;
6278
6279 if (!args) SWIG_fail;
6280 swig_obj[0] = args;
6281 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6282 if (!SWIG_IsOK(res1)) {
6283 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable___str__" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6284 }
6285 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6287 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
6288 return resultobj;
6289fail:
6290 return NULL;
6291}
6292
6293
6294SWIGINTERN PyObject *_wrap_Variable___repr__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6295 PyObject *resultobj = 0;
6297 void *argp1 = 0 ;
6298 int res1 = 0 ;
6299 PyObject *swig_obj[1] ;
6300 std::string result;
6301
6302 if (!args) SWIG_fail;
6303 swig_obj[0] = args;
6304 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6305 if (!SWIG_IsOK(res1)) {
6306 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable___repr__" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6307 }
6308 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6310 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
6311 return resultobj;
6312fail:
6313 return NULL;
6314}
6315
6316
6317SWIGINTERN PyObject *_wrap_Variable_SolutionValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6318 PyObject *resultobj = 0;
6320 void *argp1 = 0 ;
6321 int res1 = 0 ;
6322 PyObject *swig_obj[1] ;
6323 double result;
6324
6325 if (!args) SWIG_fail;
6326 swig_obj[0] = args;
6327 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6328 if (!SWIG_IsOK(res1)) {
6329 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SolutionValue" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6330 }
6331 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6333 resultobj = SWIG_From_double(static_cast< double >(result));
6334 return resultobj;
6335fail:
6336 return NULL;
6337}
6338
6339
6340SWIGINTERN PyObject *_wrap_Variable_Integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6341 PyObject *resultobj = 0;
6343 void *argp1 = 0 ;
6344 int res1 = 0 ;
6345 PyObject *swig_obj[1] ;
6346 bool result;
6347
6348 if (!args) SWIG_fail;
6349 swig_obj[0] = args;
6350 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6351 if (!SWIG_IsOK(res1)) {
6352 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Integer" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6353 }
6354 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6356 resultobj = SWIG_From_bool(static_cast< bool >(result));
6357 return resultobj;
6358fail:
6359 return NULL;
6360}
6361
6362
6363SWIGINTERN PyObject *_wrap_Variable_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6364 PyObject *resultobj = 0;
6366 void *argp1 = 0 ;
6367 int res1 = 0 ;
6368 PyObject *swig_obj[1] ;
6369 double result;
6370
6371 if (!args) SWIG_fail;
6372 swig_obj[0] = args;
6373 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6374 if (!SWIG_IsOK(res1)) {
6375 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Lb" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6376 }
6377 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6379 resultobj = SWIG_From_double(static_cast< double >(result));
6380 return resultobj;
6381fail:
6382 return NULL;
6383}
6384
6385
6386SWIGINTERN PyObject *_wrap_Variable_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6387 PyObject *resultobj = 0;
6389 void *argp1 = 0 ;
6390 int res1 = 0 ;
6391 PyObject *swig_obj[1] ;
6392 double result;
6393
6394 if (!args) SWIG_fail;
6395 swig_obj[0] = args;
6396 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6397 if (!SWIG_IsOK(res1)) {
6398 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_Ub" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6399 }
6400 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6402 resultobj = SWIG_From_double(static_cast< double >(result));
6403 return resultobj;
6404fail:
6405 return NULL;
6406}
6407
6408
6409SWIGINTERN PyObject *_wrap_Variable_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6410 PyObject *resultobj = 0;
6412 double arg2 ;
6413 void *argp1 = 0 ;
6414 int res1 = 0 ;
6415 double val2 ;
6416 int ecode2 = 0 ;
6417 PyObject *swig_obj[2] ;
6418
6419 if (!SWIG_Python_UnpackTuple(args, "Variable_SetLb", 2, 2, swig_obj)) SWIG_fail;
6420 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6421 if (!SWIG_IsOK(res1)) {
6422 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetLb" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6423 }
6424 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6425 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6426 if (!SWIG_IsOK(ecode2)) {
6427 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetLb" "', argument " "2"" of type '" "double""'");
6428 }
6429 arg2 = static_cast< double >(val2);
6431 resultobj = SWIG_Py_Void();
6432 return resultobj;
6433fail:
6434 return NULL;
6435}
6436
6437
6438SWIGINTERN PyObject *_wrap_Variable_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6439 PyObject *resultobj = 0;
6441 double arg2 ;
6442 void *argp1 = 0 ;
6443 int res1 = 0 ;
6444 double val2 ;
6445 int ecode2 = 0 ;
6446 PyObject *swig_obj[2] ;
6447
6448 if (!SWIG_Python_UnpackTuple(args, "Variable_SetUb", 2, 2, swig_obj)) SWIG_fail;
6449 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6450 if (!SWIG_IsOK(res1)) {
6451 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_SetUb" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6452 }
6453 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6454 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6455 if (!SWIG_IsOK(ecode2)) {
6456 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Variable_SetUb" "', argument " "2"" of type '" "double""'");
6457 }
6458 arg2 = static_cast< double >(val2);
6460 resultobj = SWIG_Py_Void();
6461 return resultobj;
6462fail:
6463 return NULL;
6464}
6465
6466
6467SWIGINTERN PyObject *_wrap_Variable_ReducedCost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6468 PyObject *resultobj = 0;
6470 void *argp1 = 0 ;
6471 int res1 = 0 ;
6472 PyObject *swig_obj[1] ;
6473 double result;
6474
6475 if (!args) SWIG_fail;
6476 swig_obj[0] = args;
6477 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPVariable, 0 | 0 );
6478 if (!SWIG_IsOK(res1)) {
6479 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Variable_ReducedCost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6480 }
6481 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6483 resultobj = SWIG_From_double(static_cast< double >(result));
6484 return resultobj;
6485fail:
6486 return NULL;
6487}
6488
6489
6490SWIGINTERN PyObject *_wrap_delete_Variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6491 PyObject *resultobj = 0;
6493 void *argp1 = 0 ;
6494 int res1 = 0 ;
6495 PyObject *swig_obj[1] ;
6496
6497 if (!args) SWIG_fail;
6498 swig_obj[0] = args;
6500 if (!SWIG_IsOK(res1)) {
6501 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Variable" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6502 }
6503 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6504 delete arg1;
6505 resultobj = SWIG_Py_Void();
6506 return resultobj;
6507fail:
6508 return NULL;
6509}
6510
6511
6512SWIGINTERN PyObject *Variable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6513 PyObject *obj;
6514 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
6516 return SWIG_Py_Void();
6517}
6518
6519SWIGINTERN PyObject *_wrap_Constraint_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6520 PyObject *resultobj = 0;
6522 void *argp1 = 0 ;
6523 int res1 = 0 ;
6524 PyObject *swig_obj[1] ;
6525 std::string *result = 0 ;
6526
6527 if (!args) SWIG_fail;
6528 swig_obj[0] = args;
6529 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6530 if (!SWIG_IsOK(res1)) {
6531 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_name" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6532 }
6533 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6534 result = (std::string *) &((operations_research::MPConstraint const *)arg1)->name();
6535 resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
6536 return resultobj;
6537fail:
6538 return NULL;
6539}
6540
6541
6542SWIGINTERN PyObject *_wrap_Constraint_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6543 PyObject *resultobj = 0;
6545 void *argp1 = 0 ;
6546 int res1 = 0 ;
6547 PyObject *swig_obj[1] ;
6548
6549 if (!args) SWIG_fail;
6550 swig_obj[0] = args;
6551 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6552 if (!SWIG_IsOK(res1)) {
6553 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Clear" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6554 }
6555 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6556 (arg1)->Clear();
6557 resultobj = SWIG_Py_Void();
6558 return resultobj;
6559fail:
6560 return NULL;
6561}
6562
6563
6564SWIGINTERN PyObject *_wrap_Constraint_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6565 PyObject *resultobj = 0;
6568 double arg3 ;
6569 void *argp1 = 0 ;
6570 int res1 = 0 ;
6571 double val3 ;
6572 int ecode3 = 0 ;
6573 PyObject *swig_obj[3] ;
6574
6575 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetCoefficient", 3, 3, swig_obj)) SWIG_fail;
6576 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6577 if (!SWIG_IsOK(res1)) {
6578 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6579 }
6580 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6581 {
6582 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
6583 }
6584 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6585 if (!SWIG_IsOK(ecode3)) {
6586 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Constraint_SetCoefficient" "', argument " "3"" of type '" "double""'");
6587 }
6588 arg3 = static_cast< double >(val3);
6589 (arg1)->SetCoefficient((operations_research::MPVariable const *)arg2,arg3);
6590 resultobj = SWIG_Py_Void();
6591 return resultobj;
6592fail:
6593 return NULL;
6594}
6595
6596
6597SWIGINTERN PyObject *_wrap_Constraint_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6598 PyObject *resultobj = 0;
6601 void *argp1 = 0 ;
6602 int res1 = 0 ;
6603 PyObject *swig_obj[2] ;
6604 double result;
6605
6606 if (!SWIG_Python_UnpackTuple(args, "Constraint_GetCoefficient", 2, 2, swig_obj)) SWIG_fail;
6607 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6608 if (!SWIG_IsOK(res1)) {
6609 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6610 }
6611 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6612 {
6613 if (!PyObjAs(swig_obj[1], &arg2)) SWIG_fail;
6614 }
6615 result = (double)((operations_research::MPConstraint const *)arg1)->GetCoefficient((operations_research::MPVariable const *)arg2);
6616 resultobj = SWIG_From_double(static_cast< double >(result));
6617 return resultobj;
6618fail:
6619 return NULL;
6620}
6621
6622
6623SWIGINTERN PyObject *_wrap_Constraint_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6624 PyObject *resultobj = 0;
6626 void *argp1 = 0 ;
6627 int res1 = 0 ;
6628 PyObject *swig_obj[1] ;
6629 double result;
6630
6631 if (!args) SWIG_fail;
6632 swig_obj[0] = args;
6633 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6634 if (!SWIG_IsOK(res1)) {
6635 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_lb" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6636 }
6637 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6638 result = (double)((operations_research::MPConstraint const *)arg1)->lb();
6639 resultobj = SWIG_From_double(static_cast< double >(result));
6640 return resultobj;
6641fail:
6642 return NULL;
6643}
6644
6645
6646SWIGINTERN PyObject *_wrap_Constraint_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6647 PyObject *resultobj = 0;
6649 void *argp1 = 0 ;
6650 int res1 = 0 ;
6651 PyObject *swig_obj[1] ;
6652 double result;
6653
6654 if (!args) SWIG_fail;
6655 swig_obj[0] = args;
6656 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6657 if (!SWIG_IsOK(res1)) {
6658 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_ub" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6659 }
6660 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6661 result = (double)((operations_research::MPConstraint const *)arg1)->ub();
6662 resultobj = SWIG_From_double(static_cast< double >(result));
6663 return resultobj;
6664fail:
6665 return NULL;
6666}
6667
6668
6669SWIGINTERN PyObject *_wrap_Constraint_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6670 PyObject *resultobj = 0;
6672 double arg2 ;
6673 double arg3 ;
6674 void *argp1 = 0 ;
6675 int res1 = 0 ;
6676 double val2 ;
6677 int ecode2 = 0 ;
6678 double val3 ;
6679 int ecode3 = 0 ;
6680 PyObject *swig_obj[3] ;
6681
6682 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetBounds", 3, 3, swig_obj)) SWIG_fail;
6683 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6684 if (!SWIG_IsOK(res1)) {
6685 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetBounds" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6686 }
6687 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6688 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6689 if (!SWIG_IsOK(ecode2)) {
6690 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetBounds" "', argument " "2"" of type '" "double""'");
6691 }
6692 arg2 = static_cast< double >(val2);
6693 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
6694 if (!SWIG_IsOK(ecode3)) {
6695 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Constraint_SetBounds" "', argument " "3"" of type '" "double""'");
6696 }
6697 arg3 = static_cast< double >(val3);
6698 (arg1)->SetBounds(arg2,arg3);
6699 resultobj = SWIG_Py_Void();
6700 return resultobj;
6701fail:
6702 return NULL;
6703}
6704
6705
6706SWIGINTERN PyObject *_wrap_Constraint_set_is_lazy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6707 PyObject *resultobj = 0;
6709 bool arg2 ;
6710 void *argp1 = 0 ;
6711 int res1 = 0 ;
6712 bool val2 ;
6713 int ecode2 = 0 ;
6714 PyObject *swig_obj[2] ;
6715
6716 if (!SWIG_Python_UnpackTuple(args, "Constraint_set_is_lazy", 2, 2, swig_obj)) SWIG_fail;
6717 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6718 if (!SWIG_IsOK(res1)) {
6719 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_set_is_lazy" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6720 }
6721 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6722 ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
6723 if (!SWIG_IsOK(ecode2)) {
6724 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_set_is_lazy" "', argument " "2"" of type '" "bool""'");
6725 }
6726 arg2 = static_cast< bool >(val2);
6727 (arg1)->set_is_lazy(arg2);
6728 resultobj = SWIG_Py_Void();
6729 return resultobj;
6730fail:
6731 return NULL;
6732}
6733
6734
6735SWIGINTERN PyObject *_wrap_Constraint_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6736 PyObject *resultobj = 0;
6738 void *argp1 = 0 ;
6739 int res1 = 0 ;
6740 PyObject *swig_obj[1] ;
6741 int result;
6742
6743 if (!args) SWIG_fail;
6744 swig_obj[0] = args;
6745 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6746 if (!SWIG_IsOK(res1)) {
6747 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_index" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6748 }
6749 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6750 result = (int)((operations_research::MPConstraint const *)arg1)->index();
6751 resultobj = SWIG_From_int(static_cast< int >(result));
6752 return resultobj;
6753fail:
6754 return NULL;
6755}
6756
6757
6758SWIGINTERN PyObject *_wrap_Constraint_dual_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6759 PyObject *resultobj = 0;
6761 void *argp1 = 0 ;
6762 int res1 = 0 ;
6763 PyObject *swig_obj[1] ;
6764 double result;
6765
6766 if (!args) SWIG_fail;
6767 swig_obj[0] = args;
6768 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6769 if (!SWIG_IsOK(res1)) {
6770 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_dual_value" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6771 }
6772 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6773 result = (double)((operations_research::MPConstraint const *)arg1)->dual_value();
6774 resultobj = SWIG_From_double(static_cast< double >(result));
6775 return resultobj;
6776fail:
6777 return NULL;
6778}
6779
6780
6781SWIGINTERN PyObject *_wrap_Constraint_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6782 PyObject *resultobj = 0;
6784 void *argp1 = 0 ;
6785 int res1 = 0 ;
6786 PyObject *swig_obj[1] ;
6788
6789 if (!args) SWIG_fail;
6790 swig_obj[0] = args;
6791 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6792 if (!SWIG_IsOK(res1)) {
6793 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_basis_status" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6794 }
6795 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6796 result = (operations_research::MPSolver::BasisStatus)((operations_research::MPConstraint const *)arg1)->basis_status();
6797 resultobj = SWIG_From_int(static_cast< int >(result));
6798 return resultobj;
6799fail:
6800 return NULL;
6801}
6802
6803
6804SWIGINTERN PyObject *_wrap_Constraint_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6805 PyObject *resultobj = 0;
6807 void *argp1 = 0 ;
6808 int res1 = 0 ;
6809 PyObject *swig_obj[1] ;
6810 double result;
6811
6812 if (!args) SWIG_fail;
6813 swig_obj[0] = args;
6814 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6815 if (!SWIG_IsOK(res1)) {
6816 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Lb" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6817 }
6818 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6820 resultobj = SWIG_From_double(static_cast< double >(result));
6821 return resultobj;
6822fail:
6823 return NULL;
6824}
6825
6826
6827SWIGINTERN PyObject *_wrap_Constraint_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6828 PyObject *resultobj = 0;
6830 void *argp1 = 0 ;
6831 int res1 = 0 ;
6832 PyObject *swig_obj[1] ;
6833 double result;
6834
6835 if (!args) SWIG_fail;
6836 swig_obj[0] = args;
6837 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6838 if (!SWIG_IsOK(res1)) {
6839 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_Ub" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6840 }
6841 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6843 resultobj = SWIG_From_double(static_cast< double >(result));
6844 return resultobj;
6845fail:
6846 return NULL;
6847}
6848
6849
6850SWIGINTERN PyObject *_wrap_Constraint_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6851 PyObject *resultobj = 0;
6853 double arg2 ;
6854 void *argp1 = 0 ;
6855 int res1 = 0 ;
6856 double val2 ;
6857 int ecode2 = 0 ;
6858 PyObject *swig_obj[2] ;
6859
6860 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetLb", 2, 2, swig_obj)) SWIG_fail;
6861 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6862 if (!SWIG_IsOK(res1)) {
6863 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetLb" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6864 }
6865 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6866 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6867 if (!SWIG_IsOK(ecode2)) {
6868 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetLb" "', argument " "2"" of type '" "double""'");
6869 }
6870 arg2 = static_cast< double >(val2);
6872 resultobj = SWIG_Py_Void();
6873 return resultobj;
6874fail:
6875 return NULL;
6876}
6877
6878
6879SWIGINTERN PyObject *_wrap_Constraint_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6880 PyObject *resultobj = 0;
6882 double arg2 ;
6883 void *argp1 = 0 ;
6884 int res1 = 0 ;
6885 double val2 ;
6886 int ecode2 = 0 ;
6887 PyObject *swig_obj[2] ;
6888
6889 if (!SWIG_Python_UnpackTuple(args, "Constraint_SetUb", 2, 2, swig_obj)) SWIG_fail;
6890 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6891 if (!SWIG_IsOK(res1)) {
6892 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_SetUb" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6893 }
6894 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6895 ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
6896 if (!SWIG_IsOK(ecode2)) {
6897 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Constraint_SetUb" "', argument " "2"" of type '" "double""'");
6898 }
6899 arg2 = static_cast< double >(val2);
6901 resultobj = SWIG_Py_Void();
6902 return resultobj;
6903fail:
6904 return NULL;
6905}
6906
6907
6908SWIGINTERN PyObject *_wrap_Constraint_DualValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6909 PyObject *resultobj = 0;
6911 void *argp1 = 0 ;
6912 int res1 = 0 ;
6913 PyObject *swig_obj[1] ;
6914 double result;
6915
6916 if (!args) SWIG_fail;
6917 swig_obj[0] = args;
6918 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPConstraint, 0 | 0 );
6919 if (!SWIG_IsOK(res1)) {
6920 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Constraint_DualValue" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6921 }
6922 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6924 resultobj = SWIG_From_double(static_cast< double >(result));
6925 return resultobj;
6926fail:
6927 return NULL;
6928}
6929
6930
6931SWIGINTERN PyObject *_wrap_delete_Constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6932 PyObject *resultobj = 0;
6934 void *argp1 = 0 ;
6935 int res1 = 0 ;
6936 PyObject *swig_obj[1] ;
6937
6938 if (!args) SWIG_fail;
6939 swig_obj[0] = args;
6941 if (!SWIG_IsOK(res1)) {
6942 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Constraint" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6943 }
6944 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6945 delete arg1;
6946 resultobj = SWIG_Py_Void();
6947 return resultobj;
6948fail:
6949 return NULL;
6950}
6951
6952
6953SWIGINTERN PyObject *Constraint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6954 PyObject *obj;
6955 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
6957 return SWIG_Py_Void();
6958}
6959
6961 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultRelativeMipGap is read-only.");
6962 return 1;
6963}
6964
6965
6967 PyObject *pyobj = 0;
6968
6970 return pyobj;
6971}
6972
6973
6975 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultPrimalTolerance is read-only.");
6976 return 1;
6977}
6978
6979
6981 PyObject *pyobj = 0;
6982
6984 return pyobj;
6985}
6986
6987
6989 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultDualTolerance is read-only.");
6990 return 1;
6991}
6992
6993
6995 PyObject *pyobj = 0;
6996
6998 return pyobj;
6999}
7000
7001
7003 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultPresolve is read-only.");
7004 return 1;
7005}
7006
7007
7009 PyObject *pyobj = 0;
7010
7012 return pyobj;
7013}
7014
7015
7017 SWIG_Error(SWIG_AttributeError,"Variable MPSolverParameters_kDefaultIncrementality is read-only.");
7018 return 1;
7019}
7020
7021
7023 PyObject *pyobj = 0;
7024
7026 return pyobj;
7027}
7028
7029
7030SWIGINTERN PyObject *_wrap_new_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7031 PyObject *resultobj = 0;
7033
7034 if (!SWIG_Python_UnpackTuple(args, "new_MPSolverParameters", 0, 0, 0)) SWIG_fail;
7037 return resultobj;
7038fail:
7039 return NULL;
7040}
7041
7042
7043SWIGINTERN PyObject *_wrap_MPSolverParameters_SetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7044 PyObject *resultobj = 0;
7047 double arg3 ;
7048 void *argp1 = 0 ;
7049 int res1 = 0 ;
7050 int val2 ;
7051 int ecode2 = 0 ;
7052 double val3 ;
7053 int ecode3 = 0 ;
7054 PyObject *swig_obj[3] ;
7055
7056 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_SetDoubleParam", 3, 3, swig_obj)) SWIG_fail;
7057 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7058 if (!SWIG_IsOK(res1)) {
7059 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7060 }
7061 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7062 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7063 if (!SWIG_IsOK(ecode2)) {
7064 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7065 }
7066 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
7067 ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
7068 if (!SWIG_IsOK(ecode3)) {
7069 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MPSolverParameters_SetDoubleParam" "', argument " "3"" of type '" "double""'");
7070 }
7071 arg3 = static_cast< double >(val3);
7072 (arg1)->SetDoubleParam(arg2,arg3);
7073 resultobj = SWIG_Py_Void();
7074 return resultobj;
7075fail:
7076 return NULL;
7077}
7078
7079
7080SWIGINTERN PyObject *_wrap_MPSolverParameters_SetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7081 PyObject *resultobj = 0;
7084 int arg3 ;
7085 void *argp1 = 0 ;
7086 int res1 = 0 ;
7087 int val2 ;
7088 int ecode2 = 0 ;
7089 int val3 ;
7090 int ecode3 = 0 ;
7091 PyObject *swig_obj[3] ;
7092
7093 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_SetIntegerParam", 3, 3, swig_obj)) SWIG_fail;
7094 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7095 if (!SWIG_IsOK(res1)) {
7096 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7097 }
7098 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7099 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7100 if (!SWIG_IsOK(ecode2)) {
7101 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7102 }
7104 ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
7105 if (!SWIG_IsOK(ecode3)) {
7106 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MPSolverParameters_SetIntegerParam" "', argument " "3"" of type '" "int""'");
7107 }
7108 arg3 = static_cast< int >(val3);
7109 (arg1)->SetIntegerParam(arg2,arg3);
7110 resultobj = SWIG_Py_Void();
7111 return resultobj;
7112fail:
7113 return NULL;
7114}
7115
7116
7117SWIGINTERN PyObject *_wrap_MPSolverParameters_GetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7118 PyObject *resultobj = 0;
7121 void *argp1 = 0 ;
7122 int res1 = 0 ;
7123 int val2 ;
7124 int ecode2 = 0 ;
7125 PyObject *swig_obj[2] ;
7126 double result;
7127
7128 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_GetDoubleParam", 2, 2, swig_obj)) SWIG_fail;
7129 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7130 if (!SWIG_IsOK(res1)) {
7131 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_GetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7132 }
7133 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7134 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7135 if (!SWIG_IsOK(ecode2)) {
7136 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_GetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7137 }
7138 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
7139 result = (double)((operations_research::MPSolverParameters const *)arg1)->GetDoubleParam(arg2);
7140 resultobj = SWIG_From_double(static_cast< double >(result));
7141 return resultobj;
7142fail:
7143 return NULL;
7144}
7145
7146
7147SWIGINTERN PyObject *_wrap_MPSolverParameters_GetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7148 PyObject *resultobj = 0;
7151 void *argp1 = 0 ;
7152 int res1 = 0 ;
7153 int val2 ;
7154 int ecode2 = 0 ;
7155 PyObject *swig_obj[2] ;
7156 int result;
7157
7158 if (!SWIG_Python_UnpackTuple(args, "MPSolverParameters_GetIntegerParam", 2, 2, swig_obj)) SWIG_fail;
7159 res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_operations_research__MPSolverParameters, 0 | 0 );
7160 if (!SWIG_IsOK(res1)) {
7161 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MPSolverParameters_GetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7162 }
7163 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7164 ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
7165 if (!SWIG_IsOK(ecode2)) {
7166 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MPSolverParameters_GetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7167 }
7169 result = (int)((operations_research::MPSolverParameters const *)arg1)->GetIntegerParam(arg2);
7170 resultobj = SWIG_From_int(static_cast< int >(result));
7171 return resultobj;
7172fail:
7173 return NULL;
7174}
7175
7176
7177SWIGINTERN PyObject *_wrap_delete_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7178 PyObject *resultobj = 0;
7180 void *argp1 = 0 ;
7181 int res1 = 0 ;
7182 PyObject *swig_obj[1] ;
7183
7184 if (!args) SWIG_fail;
7185 swig_obj[0] = args;
7187 if (!SWIG_IsOK(res1)) {
7188 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MPSolverParameters" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7189 }
7190 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7191 delete arg1;
7192 resultobj = SWIG_Py_Void();
7193 return resultobj;
7194fail:
7195 return NULL;
7196}
7197
7198
7199SWIGINTERN PyObject *MPSolverParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7200 PyObject *obj;
7201 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
7203 return SWIG_Py_Void();
7204}
7205
7206SWIGINTERN PyObject *MPSolverParameters_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7207 return SWIG_Python_InitShadowInstance(args);
7208}
7209
7210SWIGINTERN PyObject *_wrap_new_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7211 PyObject *resultobj = 0;
7213
7214 if (!SWIG_Python_UnpackTuple(args, "new_ModelExportOptions", 0, 0, 0)) SWIG_fail;
7217 return resultobj;
7218fail:
7219 return NULL;
7220}
7221
7222
7223SWIGINTERN PyObject *_wrap_delete_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7224 PyObject *resultobj = 0;
7226 void *argp1 = 0 ;
7227 int res1 = 0 ;
7228 PyObject *swig_obj[1] ;
7229
7230 if (!args) SWIG_fail;
7231 swig_obj[0] = args;
7233 if (!SWIG_IsOK(res1)) {
7234 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ModelExportOptions" "', argument " "1"" of type '" "operations_research::MPModelExportOptions *""'");
7235 }
7236 arg1 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp1);
7237 delete arg1;
7238 resultobj = SWIG_Py_Void();
7239 return resultobj;
7240fail:
7241 return NULL;
7242}
7243
7244
7245SWIGINTERN PyObject *ModelExportOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7246 PyObject *obj;
7247 if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
7249 return SWIG_Py_Void();
7250}
7251
7252SWIGINTERN PyObject *ModelExportOptions_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7253 return SWIG_Python_InitShadowInstance(args);
7254}
7255
7256SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7257 PyObject *resultobj = 0;
7260 void *argp2 = 0 ;
7261 int res2 = 0 ;
7262 std::string result;
7263
7264 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
7265 {
7267 PyObject* const pyresult = PyObject_CallMethod(
7268 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7269 if (pyresult != nullptr) {
7270 char* buffer = nullptr;
7271 Py_ssize_t length = 0;
7272 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7273 if (buffer != nullptr) {
7274 arg1->ParseFromArray(buffer, length);
7275 }
7276 Py_DECREF(pyresult);
7277 }
7278 }
7280 if (!SWIG_IsOK(res2)) {
7281 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7282 }
7283 if (!argp2) {
7284 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7285 }
7286 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7287 result = operations_research::ExportModelAsLpFormatReturnString((operations_research::MPModelProto const &)*arg1,(operations_research::MPModelExportOptions const &)*arg2);
7288 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7289 {
7290 delete arg1;
7291 }
7292 return resultobj;
7293fail:
7294 {
7295 delete arg1;
7296 }
7297 return NULL;
7298}
7299
7300
7301SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7302 PyObject *resultobj = 0;
7304 std::string result;
7305
7306 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
7307 {
7309 PyObject* const pyresult = PyObject_CallMethod(
7310 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7311 if (pyresult != nullptr) {
7312 char* buffer = nullptr;
7313 Py_ssize_t length = 0;
7314 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7315 if (buffer != nullptr) {
7316 arg1->ParseFromArray(buffer, length);
7317 }
7318 Py_DECREF(pyresult);
7319 }
7320 }
7321 result = operations_research::ExportModelAsLpFormatReturnString((operations_research::MPModelProto const &)*arg1);
7322 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7323 {
7324 delete arg1;
7325 }
7326 return resultobj;
7327fail:
7328 {
7329 delete arg1;
7330 }
7331 return NULL;
7332}
7333
7334
7335SWIGINTERN PyObject *_wrap_ExportModelAsLpFormat(PyObject *self, PyObject *args) {
7336 Py_ssize_t argc;
7337 PyObject *argv[3] = {
7338 0
7339 };
7340
7341 if (!(argc = SWIG_Python_UnpackTuple(args, "ExportModelAsLpFormat", 0, 2, argv))) SWIG_fail;
7342 --argc;
7343 if (argc == 1) {
7344 int _v;
7345 {
7346 bool ok = false;
7347 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7348 if (module != nullptr) {
7349 PyObject* const dict = PyModule_GetDict(module);
7350 if (dict != nullptr) {
7351 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7352 if (clss != nullptr) {
7353 if (PyObject_IsInstance(argv[0], clss)) {
7354 ok = true;
7355 }
7356 }
7357 }
7358 Py_DECREF(module);
7359 }
7360 _v = ok ? 1 : 0;
7361 }
7362 if (_v) {
7363 return _wrap_ExportModelAsLpFormat__SWIG_1(self, argc, argv);
7364 }
7365 }
7366 if (argc == 2) {
7367 int _v;
7368 {
7369 bool ok = false;
7370 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7371 if (module != nullptr) {
7372 PyObject* const dict = PyModule_GetDict(module);
7373 if (dict != nullptr) {
7374 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7375 if (clss != nullptr) {
7376 if (PyObject_IsInstance(argv[0], clss)) {
7377 ok = true;
7378 }
7379 }
7380 }
7381 Py_DECREF(module);
7382 }
7383 _v = ok ? 1 : 0;
7384 }
7385 if (_v) {
7387 _v = SWIG_CheckState(res);
7388 if (_v) {
7389 return _wrap_ExportModelAsLpFormat__SWIG_0(self, argc, argv);
7390 }
7391 }
7392 }
7393
7394fail:
7395 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ExportModelAsLpFormat'.\n"
7396 " Possible C/C++ prototypes are:\n"
7397 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7398 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &)\n");
7399 return 0;
7400}
7401
7402
7403SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7404 PyObject *resultobj = 0;
7407 void *argp2 = 0 ;
7408 int res2 = 0 ;
7409 std::string result;
7410
7411 if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
7412 {
7414 PyObject* const pyresult = PyObject_CallMethod(
7415 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7416 if (pyresult != nullptr) {
7417 char* buffer = nullptr;
7418 Py_ssize_t length = 0;
7419 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7420 if (buffer != nullptr) {
7421 arg1->ParseFromArray(buffer, length);
7422 }
7423 Py_DECREF(pyresult);
7424 }
7425 }
7427 if (!SWIG_IsOK(res2)) {
7428 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7429 }
7430 if (!argp2) {
7431 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7432 }
7433 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7434 result = operations_research::ExportModelAsMpsFormatReturnString((operations_research::MPModelProto const &)*arg1,(operations_research::MPModelExportOptions const &)*arg2);
7435 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7436 {
7437 delete arg1;
7438 }
7439 return resultobj;
7440fail:
7441 {
7442 delete arg1;
7443 }
7444 return NULL;
7445}
7446
7447
7448SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
7449 PyObject *resultobj = 0;
7451 std::string result;
7452
7453 if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
7454 {
7456 PyObject* const pyresult = PyObject_CallMethod(
7457 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7458 if (pyresult != nullptr) {
7459 char* buffer = nullptr;
7460 Py_ssize_t length = 0;
7461 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7462 if (buffer != nullptr) {
7463 arg1->ParseFromArray(buffer, length);
7464 }
7465 Py_DECREF(pyresult);
7466 }
7467 }
7468 result = operations_research::ExportModelAsMpsFormatReturnString((operations_research::MPModelProto const &)*arg1);
7469 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7470 {
7471 delete arg1;
7472 }
7473 return resultobj;
7474fail:
7475 {
7476 delete arg1;
7477 }
7478 return NULL;
7479}
7480
7481
7482SWIGINTERN PyObject *_wrap_ExportModelAsMpsFormat(PyObject *self, PyObject *args) {
7483 Py_ssize_t argc;
7484 PyObject *argv[3] = {
7485 0
7486 };
7487
7488 if (!(argc = SWIG_Python_UnpackTuple(args, "ExportModelAsMpsFormat", 0, 2, argv))) SWIG_fail;
7489 --argc;
7490 if (argc == 1) {
7491 int _v;
7492 {
7493 bool ok = false;
7494 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7495 if (module != nullptr) {
7496 PyObject* const dict = PyModule_GetDict(module);
7497 if (dict != nullptr) {
7498 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7499 if (clss != nullptr) {
7500 if (PyObject_IsInstance(argv[0], clss)) {
7501 ok = true;
7502 }
7503 }
7504 }
7505 Py_DECREF(module);
7506 }
7507 _v = ok ? 1 : 0;
7508 }
7509 if (_v) {
7510 return _wrap_ExportModelAsMpsFormat__SWIG_1(self, argc, argv);
7511 }
7512 }
7513 if (argc == 2) {
7514 int _v;
7515 {
7516 bool ok = false;
7517 PyObject* const module = PyImport_ImportModule("ortools.linear_solver.linear_solver_pb2");
7518 if (module != nullptr) {
7519 PyObject* const dict = PyModule_GetDict(module);
7520 if (dict != nullptr) {
7521 PyObject* const clss = PyDict_GetItemString(dict, "MPModelProto");
7522 if (clss != nullptr) {
7523 if (PyObject_IsInstance(argv[0], clss)) {
7524 ok = true;
7525 }
7526 }
7527 }
7528 Py_DECREF(module);
7529 }
7530 _v = ok ? 1 : 0;
7531 }
7532 if (_v) {
7534 _v = SWIG_CheckState(res);
7535 if (_v) {
7536 return _wrap_ExportModelAsMpsFormat__SWIG_0(self, argc, argv);
7537 }
7538 }
7539 }
7540
7541fail:
7542 SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'ExportModelAsMpsFormat'.\n"
7543 " Possible C/C++ prototypes are:\n"
7544 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7545 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &)\n");
7546 return 0;
7547}
7548
7549
7550SWIGINTERN PyObject *_wrap_FindErrorInModelProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7551 PyObject *resultobj = 0;
7553 PyObject *swig_obj[1] ;
7554 std::string result;
7555
7556 if (!args) SWIG_fail;
7557 swig_obj[0] = args;
7558 {
7560 PyObject* const pyresult = PyObject_CallMethod(
7561 swig_obj[0], const_cast<char*>("SerializeToString"), nullptr);
7562 if (pyresult != nullptr) {
7563 char* buffer = nullptr;
7564 Py_ssize_t length = 0;
7565 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7566 if (buffer != nullptr) {
7567 arg1->ParseFromArray(buffer, length);
7568 }
7569 Py_DECREF(pyresult);
7570 }
7571 }
7573 resultobj = SWIG_From_std_string(static_cast< std::string >(result));
7574 {
7575 delete arg1;
7576 }
7577 return resultobj;
7578fail:
7579 {
7580 delete arg1;
7581 }
7582 return NULL;
7583}
7584
7585
7586static PyMethodDef SwigMethods[] = {
7587 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
7588 { "new_Solver", _wrap_new_Solver, METH_VARARGS, " Create a solver with the given name and underlying solver backend."},
7589 { "delete_Solver", _wrap_delete_Solver, METH_O, NULL},
7590 { "Solver_CreateSolver", _wrap_Solver_CreateSolver, METH_O, "\n"
7591 "Recommended factory method to create a MPSolver instance, especially in\n"
7592 "non C++ languages.\n"
7593 "\n"
7594 "It returns a newly created solver instance if successful, or a nullptr\n"
7595 "otherwise. This can occur if the relevant interface is not linked in, or if\n"
7596 "a needed license is not accessible for commercial solvers.\n"
7597 "\n"
7598 "Ownership of the solver is passed on to the caller of this method.\n"
7599 "It will accept both string names of the OptimizationProblemType enum, as\n"
7600 "well as a short version (i.e. \"SCIP_MIXED_INTEGER_PROGRAMMING\" or \"SCIP\").\n"
7601 "\n"
7602 "solver_id is case insensitive, and the following names are supported:\n"
7603 " - CLP_LINEAR_PROGRAMMING or CLP\n"
7604 " - CBC_MIXED_INTEGER_PROGRAMMING or CBC\n"
7605 " - GLOP_LINEAR_PROGRAMMING or GLOP\n"
7606 " - BOP_INTEGER_PROGRAMMING or BOP\n"
7607 " - SAT_INTEGER_PROGRAMMING or SAT or CP_SAT\n"
7608 " - SCIP_MIXED_INTEGER_PROGRAMMING or SCIP\n"
7609 " - GUROBI_LINEAR_PROGRAMMING or GUROBI_LP\n"
7610 " - GUROBI_MIXED_INTEGER_PROGRAMMING or GUROBI or GUROBI_MIP\n"
7611 " - CPLEX_LINEAR_PROGRAMMING or CPLEX_LP\n"
7612 " - CPLEX_MIXED_INTEGER_PROGRAMMING or CPLEX or CPLEX_MIP\n"
7613 " - XPRESS_LINEAR_PROGRAMMING or XPRESS_LP\n"
7614 " - XPRESS_MIXED_INTEGER_PROGRAMMING or XPRESS or XPRESS_MIP\n"
7615 " - GLPK_LINEAR_PROGRAMMING or GLPK_LP\n"
7616 " - GLPK_MIXED_INTEGER_PROGRAMMING or GLPK or GLPK_MIP\n"
7617 ""},
7618 { "Solver_SupportsProblemType", _wrap_Solver_SupportsProblemType, METH_O, "\n"
7619 "Whether the given problem type is supported (this will depend on the\n"
7620 "targets that you linked).\n"
7621 ""},
7622 { "Solver_Clear", _wrap_Solver_Clear, METH_O, "\n"
7623 "Clears the objective (including the optimization direction), all variables\n"
7624 "and constraints. All the other properties of the MPSolver (like the time\n"
7625 "limit) are kept untouched.\n"
7626 ""},
7627 { "Solver_NumVariables", _wrap_Solver_NumVariables, METH_O, " Returns the number of variables."},
7628 { "Solver_variables", _wrap_Solver_variables, METH_O, "\n"
7629 "Returns the array of variables handled by the MPSolver. (They are listed in\n"
7630 "the order in which they were created.)\n"
7631 ""},
7632 { "Solver_variable", _wrap_Solver_variable, METH_VARARGS, "Returns the variable at position index."},
7633 { "Solver_LookupVariable", _wrap_Solver_LookupVariable, METH_VARARGS, "\n"
7634 "Looks up a variable by name, and returns nullptr if it does not exist. The\n"
7635 "first call has a O(n) complexity, as the variable name index is lazily\n"
7636 "created upon first use. Will crash if variable names are not unique.\n"
7637 ""},
7638 { "Solver_Var", _wrap_Solver_Var, METH_VARARGS, "\n"
7639 "Creates a variable with the given bounds, integrality requirement and\n"
7640 "name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns\n"
7641 "the variable (i.e. the returned pointer is borrowed). Variable names are\n"
7642 "optional. If you give an empty name, name() will auto-generate one for you\n"
7643 "upon request.\n"
7644 ""},
7645 { "Solver_NumVar", _wrap_Solver_NumVar, METH_VARARGS, " Creates a continuous variable."},
7646 { "Solver_IntVar", _wrap_Solver_IntVar, METH_VARARGS, " Creates an integer variable."},
7647 { "Solver_BoolVar", _wrap_Solver_BoolVar, METH_VARARGS, " Creates a boolean variable."},
7648 { "Solver_NumConstraints", _wrap_Solver_NumConstraints, METH_O, " Returns the number of constraints."},
7649 { "Solver_constraints", _wrap_Solver_constraints, METH_O, "\n"
7650 "Returns the array of constraints handled by the MPSolver.\n"
7651 "\n"
7652 "They are listed in the order in which they were created.\n"
7653 ""},
7654 { "Solver_constraint", _wrap_Solver_constraint, METH_VARARGS, " Returns the constraint at the given index."},
7655 { "Solver_LookupConstraint", _wrap_Solver_LookupConstraint, METH_VARARGS, "\n"
7656 " Looks up a constraint by name, and returns nullptr if it does not exist.\n"
7657 "\n"
7658 "The first call has a O(n) complexity, as the constraint name index is\n"
7659 "lazily created upon first use. Will crash if constraint names are not\n"
7660 "unique.\n"
7661 ""},
7662 { "Solver_Constraint", _wrap_Solver_Constraint, METH_VARARGS, "\n"
7663 "*Overload 1:*\n"
7664 "\n"
7665 "Creates a linear constraint with given bounds.\n"
7666 "\n"
7667 "Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class\n"
7668 "assumes ownership of the constraint.\n"
7669 "\n"
7670 ":rtype: :py:class:`MPConstraint`\n"
7671 ":return: a pointer to the newly created constraint.\n"
7672 "\n"
7673 "|\n"
7674 "\n"
7675 "*Overload 2:*\n"
7676 " Creates a constraint with -infinity and +infinity bounds.\n"
7677 "\n"
7678 "|\n"
7679 "\n"
7680 "*Overload 3:*\n"
7681 " Creates a named constraint with given bounds.\n"
7682 "\n"
7683 "|\n"
7684 "\n"
7685 "*Overload 4:*\n"
7686 " Creates a named constraint with -infinity and +infinity bounds.\n"
7687 ""},
7688 { "Solver_Objective", _wrap_Solver_Objective, METH_O, " Returns the mutable objective object."},
7689 { "Solver_Solve", _wrap_Solver_Solve, METH_VARARGS, "\n"
7690 "*Overload 1:*\n"
7691 "Solves the problem using the default parameter values.\n"
7692 "\n"
7693 "|\n"
7694 "\n"
7695 "*Overload 2:*\n"
7696 "Solves the problem using the specified parameter values.\n"
7697 ""},
7698 { "Solver_ComputeConstraintActivities", _wrap_Solver_ComputeConstraintActivities, METH_O, "\n"
7699 "Advanced usage: compute the \"activities\" of all constraints, which are the\n"
7700 "sums of their linear terms. The activities are returned in the same order\n"
7701 "as constraints(), which is the order in which constraints were added; but\n"
7702 "you can also use MPConstraint::index() to get a constraint's index.\n"
7703 ""},
7704 { "Solver_VerifySolution", _wrap_Solver_VerifySolution, METH_VARARGS, "\n"
7705 "Advanced usage: Verifies the *correctness* of the solution.\n"
7706 "\n"
7707 "It verifies that all variables must be within their domains, all\n"
7708 "constraints must be satisfied, and the reported objective value must be\n"
7709 "accurate.\n"
7710 "\n"
7711 "Usage:\n"
7712 "- This can only be called after Solve() was called.\n"
7713 "- \"tolerance\" is interpreted as an absolute error threshold.\n"
7714 "- For the objective value only, if the absolute error is too large,\n"
7715 " the tolerance is interpreted as a relative error threshold instead.\n"
7716 "- If \"log_errors\" is true, every single violation will be logged.\n"
7717 "- If \"tolerance\" is negative, it will be set to infinity().\n"
7718 "\n"
7719 "Most users should just set the --verify_solution flag and not bother using\n"
7720 "this method directly.\n"
7721 ""},
7722 { "Solver_InterruptSolve", _wrap_Solver_InterruptSolve, METH_O, "\n"
7723 " Interrupts the Solve() execution to terminate processing if possible.\n"
7724 "\n"
7725 "If the underlying interface supports interruption; it does that and returns\n"
7726 "true regardless of whether there's an ongoing Solve() or not. The Solve()\n"
7727 "call may still linger for a while depending on the conditions. If\n"
7728 "interruption is not supported; returns false and does nothing.\n"
7729 "MPSolver::SolverTypeSupportsInterruption can be used to check if\n"
7730 "interruption is supported for a given solver type.\n"
7731 ""},
7732 { "Solver_FillSolutionResponseProto", _wrap_Solver_FillSolutionResponseProto, METH_VARARGS, " Encodes the current solution in a solution response protocol buffer."},
7733 { "Solver_SolveWithProto", _wrap_Solver_SolveWithProto, METH_VARARGS, "\n"
7734 "Solves the model encoded by a MPModelRequest protocol buffer and fills the\n"
7735 "solution encoded as a MPSolutionResponse. The solve is stopped prematurely\n"
7736 "if interrupt is non-null at set to true during (or before) solving.\n"
7737 "Interruption is only supported if SolverTypeSupportsInterruption() returns\n"
7738 "true for the requested solver. Passing a non-null interruption with any\n"
7739 "other solver type immediately returns an MPSOLVER_INCOMPATIBLE_OPTIONS\n"
7740 "error.\n"
7741 "\n"
7742 "Note(user): This attempts to first use `DirectlySolveProto()` (if\n"
7743 "implemented). Consequently, this most likely does *not* override any of\n"
7744 "the default parameters of the underlying solver. This behavior *differs*\n"
7745 "from `MPSolver::Solve()` which by default sets the feasibility tolerance\n"
7746 "and the gap limit (as of 2020/02/11, to 1e-7 and 0.0001, respectively).\n"
7747 ""},
7748 { "Solver_ExportModelToProto", _wrap_Solver_ExportModelToProto, METH_VARARGS, " Exports model to protocol buffer."},
7749 { "Solver_SetSolverSpecificParametersAsString", _wrap_Solver_SetSolverSpecificParametersAsString, METH_VARARGS, "\n"
7750 "Advanced usage: pass solver specific parameters in text format.\n"
7751 "\n"
7752 "The format is solver-specific and is the same as the corresponding solver\n"
7753 "configuration file format. Returns true if the operation was successful.\n"
7754 ""},
7755 { "Solver_infinity", _wrap_Solver_infinity, METH_NOARGS, "\n"
7756 "Infinity.\n"
7757 "\n"
7758 "You can use -MPSolver::infinity() for negative infinity.\n"
7759 ""},
7760 { "Solver_EnableOutput", _wrap_Solver_EnableOutput, METH_O, " Enables solver logging."},
7761 { "Solver_SuppressOutput", _wrap_Solver_SuppressOutput, METH_O, " Suppresses solver logging."},
7762 { "Solver_iterations", _wrap_Solver_iterations, METH_O, " Returns the number of simplex iterations."},
7763 { "Solver_nodes", _wrap_Solver_nodes, METH_O, "\n"
7764 "Returns the number of branch-and-bound nodes evaluated during the solve.\n"
7765 "\n"
7766 "Only available for discrete problems.\n"
7767 ""},
7768 { "Solver_ComputeExactConditionNumber", _wrap_Solver_ComputeExactConditionNumber, METH_O, "\n"
7769 " Advanced usage: computes the exact condition number of the current scaled\n"
7770 "basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.\n"
7771 "\n"
7772 "This method requires that a basis exists: it should be called after Solve.\n"
7773 "It is only available for continuous problems. It is implemented for GLPK\n"
7774 "but not CLP because CLP does not provide the API for doing it.\n"
7775 "\n"
7776 "The condition number measures how well the constraint matrix is conditioned\n"
7777 "and can be used to predict whether numerical issues will arise during the\n"
7778 "solve: the model is declared infeasible whereas it is feasible (or\n"
7779 "vice-versa), the solution obtained is not optimal or violates some\n"
7780 "constraints, the resolution is slow because of repeated singularities.\n"
7781 "\n"
7782 "The rule of thumb to interpret the condition number kappa is:\n"
7783 " - o kappa <= 1e7: virtually no chance of numerical issues\n"
7784 " - o 1e7 < kappa <= 1e10: small chance of numerical issues\n"
7785 " - o 1e10 < kappa <= 1e13: medium chance of numerical issues\n"
7786 " - o kappa > 1e13: high chance of numerical issues\n"
7787 "\n"
7788 "The computation of the condition number depends on the quality of the LU\n"
7789 "decomposition, so it is not very accurate when the matrix is ill\n"
7790 "conditioned.\n"
7791 ""},
7792 { "Solver_NextSolution", _wrap_Solver_NextSolution, METH_O, "\n"
7793 "Some solvers (MIP only, not LP) can produce multiple solutions to the\n"
7794 "problem. Returns true when another solution is available, and updates the\n"
7795 "MPVariable* objects to make the new solution queryable. Call only after\n"
7796 "calling solve.\n"
7797 "\n"
7798 "The optimality properties of the additional solutions found, and whether or\n"
7799 "not the solver computes them ahead of time or when NextSolution() is called\n"
7800 "is solver specific.\n"
7801 "\n"
7802 "As of 2020-02-10, only Gurobi and SCIP support NextSolution(), see\n"
7803 "linear_solver_interfaces_test for an example of how to configure these\n"
7804 "solvers for multiple solutions. Other solvers return false unconditionally.\n"
7805 ""},
7806 { "Solver_set_time_limit", _wrap_Solver_set_time_limit, METH_VARARGS, NULL},
7807 { "Solver_wall_time", _wrap_Solver_wall_time, METH_O, NULL},
7808 { "Solver_LoadModelFromProto", _wrap_Solver_LoadModelFromProto, METH_VARARGS, NULL},
7809 { "Solver_LoadModelFromProtoWithUniqueNamesOrDie", _wrap_Solver_LoadModelFromProtoWithUniqueNamesOrDie, METH_VARARGS, NULL},
7810 { "Solver_LoadSolutionFromProto", _wrap_Solver_LoadSolutionFromProto, METH_VARARGS, NULL},
7811 { "Solver_ExportModelAsLpFormat", _wrap_Solver_ExportModelAsLpFormat, METH_VARARGS, NULL},
7812 { "Solver_ExportModelAsMpsFormat", _wrap_Solver_ExportModelAsMpsFormat, METH_VARARGS, NULL},
7813 { "Solver_SetHint", _wrap_Solver_SetHint, METH_VARARGS, "\n"
7814 "Set a hint for solution.\n"
7815 "\n"
7816 "If a feasible or almost-feasible solution to the problem is already known,\n"
7817 "it may be helpful to pass it to the solver so that it can be used. A\n"
7818 "solver that supports this feature will try to use this information to\n"
7819 "create its initial feasible solution.\n"
7820 "\n"
7821 "Note that it may not always be faster to give a hint like this to the\n"
7822 "solver. There is also no guarantee that the solver will use this hint or\n"
7823 "try to return a solution \"close\" to this assignment in case of multiple\n"
7824 "optimal solutions.\n"
7825 ""},
7826 { "Solver_SetNumThreads", _wrap_Solver_SetNumThreads, METH_VARARGS, " Sets the number of threads to be used by the solver."},
7827 { "Solver_Infinity", _wrap_Solver_Infinity, METH_NOARGS, NULL},
7828 { "Solver_SetTimeLimit", _wrap_Solver_SetTimeLimit, METH_VARARGS, NULL},
7829 { "Solver_WallTime", _wrap_Solver_WallTime, METH_O, NULL},
7830 { "Solver_Iterations", _wrap_Solver_Iterations, METH_O, NULL},
7831 { "Solver_swigregister", Solver_swigregister, METH_O, NULL},
7832 { "Solver_swiginit", Solver_swiginit, METH_VARARGS, NULL},
7833 { "__lshift__", _wrap___lshift__, METH_VARARGS, NULL},
7834 { "Objective_Clear", _wrap_Objective_Clear, METH_O, "\n"
7835 " Clears the offset, all variables and coefficients, and the optimization\n"
7836 "direction.\n"
7837 ""},
7838 { "Objective_SetCoefficient", _wrap_Objective_SetCoefficient, METH_VARARGS, "\n"
7839 "Sets the coefficient of the variable in the objective.\n"
7840 "\n"
7841 "If the variable does not belong to the solver, the function just returns,\n"
7842 "or crashes in non-opt mode.\n"
7843 ""},
7844 { "Objective_GetCoefficient", _wrap_Objective_GetCoefficient, METH_VARARGS, "\n"
7845 " Gets the coefficient of a given variable in the objective\n"
7846 "\n"
7847 "It returns 0 if the variable does not appear in the objective).\n"
7848 ""},
7849 { "Objective_SetOffset", _wrap_Objective_SetOffset, METH_VARARGS, " Sets the constant term in the objective."},
7850 { "Objective_offset", _wrap_Objective_offset, METH_O, " Gets the constant term in the objective."},
7851 { "Objective_SetOptimizationDirection", _wrap_Objective_SetOptimizationDirection, METH_VARARGS, " Sets the optimization direction (maximize: true or minimize: false)."},
7852 { "Objective_SetMinimization", _wrap_Objective_SetMinimization, METH_O, " Sets the optimization direction to minimize."},
7853 { "Objective_SetMaximization", _wrap_Objective_SetMaximization, METH_O, " Sets the optimization direction to maximize."},
7854 { "Objective_maximization", _wrap_Objective_maximization, METH_O, " Is the optimization direction set to maximize?"},
7855 { "Objective_minimization", _wrap_Objective_minimization, METH_O, " Is the optimization direction set to minimize?"},
7856 { "Objective_Value", _wrap_Objective_Value, METH_O, "\n"
7857 "Returns the objective value of the best solution found so far.\n"
7858 "\n"
7859 "It is the optimal objective value if the problem has been solved to\n"
7860 "optimality.\n"
7861 "\n"
7862 "Note: the objective value may be slightly different than what you could\n"
7863 "compute yourself using ``MPVariable::solution_value();`` please use the\n"
7864 "--verify_solution flag to gain confidence about the numerical stability of\n"
7865 "your solution.\n"
7866 ""},
7867 { "Objective_BestBound", _wrap_Objective_BestBound, METH_O, "\n"
7868 "Returns the best objective bound.\n"
7869 "\n"
7870 "In case of minimization, it is a lower bound on the objective value of the\n"
7871 "optimal integer solution. Only available for discrete problems.\n"
7872 ""},
7873 { "Objective_Offset", _wrap_Objective_Offset, METH_O, NULL},
7874 { "delete_Objective", _wrap_delete_Objective, METH_O, NULL},
7875 { "Objective_swigregister", Objective_swigregister, METH_O, NULL},
7876 { "Variable_name", _wrap_Variable_name, METH_O, " Returns the name of the variable."},
7877 { "Variable_SetInteger", _wrap_Variable_SetInteger, METH_VARARGS, " Sets the integrality requirement of the variable."},
7878 { "Variable_integer", _wrap_Variable_integer, METH_O, " Returns the integrality requirement of the variable."},
7879 { "Variable_solution_value", _wrap_Variable_solution_value, METH_O, "\n"
7880 "Returns the value of the variable in the current solution.\n"
7881 "\n"
7882 "If the variable is integer, then the value will always be an integer (the\n"
7883 "underlying solver handles floating-point values only, but this function\n"
7884 "automatically rounds it to the nearest integer; see: man 3 round).\n"
7885 ""},
7886 { "Variable_index", _wrap_Variable_index, METH_O, " Returns the index of the variable in the MPSolver::variables_."},
7887 { "Variable_lb", _wrap_Variable_lb, METH_O, " Returns the lower bound."},
7888 { "Variable_ub", _wrap_Variable_ub, METH_O, " Returns the upper bound."},
7889 { "Variable_SetBounds", _wrap_Variable_SetBounds, METH_VARARGS, " Sets both the lower and upper bounds."},
7890 { "Variable_reduced_cost", _wrap_Variable_reduced_cost, METH_O, "\n"
7891 "Advanced usage: returns the reduced cost of the variable in the current\n"
7892 "solution (only available for continuous problems).\n"
7893 ""},
7894 { "Variable_basis_status", _wrap_Variable_basis_status, METH_O, "\n"
7895 "Advanced usage: returns the basis status of the variable in the current\n"
7896 "solution (only available for continuous problems).\n"
7897 "\n"
7898 "See also: MPSolver::BasisStatus.\n"
7899 ""},
7900 { "Variable_branching_priority", _wrap_Variable_branching_priority, METH_O, "\n"
7901 "Advanced usage: Certain MIP solvers (e.g. Gurobi or SCIP) allow you to set\n"
7902 "a per-variable priority for determining which variable to branch on.\n"
7903 "\n"
7904 "A value of 0 is treated as default, and is equivalent to not setting the\n"
7905 "branching priority. The solver looks first to branch on fractional\n"
7906 "variables in higher priority levels. As of 2019-05, only Gurobi and SCIP\n"
7907 "support setting branching priority; all other solvers will simply ignore\n"
7908 "this annotation.\n"
7909 ""},
7910 { "Variable_SetBranchingPriority", _wrap_Variable_SetBranchingPriority, METH_VARARGS, NULL},
7911 { "Variable___str__", _wrap_Variable___str__, METH_O, NULL},
7912 { "Variable___repr__", _wrap_Variable___repr__, METH_O, NULL},
7913 { "Variable_SolutionValue", _wrap_Variable_SolutionValue, METH_O, NULL},
7914 { "Variable_Integer", _wrap_Variable_Integer, METH_O, NULL},
7915 { "Variable_Lb", _wrap_Variable_Lb, METH_O, NULL},
7916 { "Variable_Ub", _wrap_Variable_Ub, METH_O, NULL},
7917 { "Variable_SetLb", _wrap_Variable_SetLb, METH_VARARGS, NULL},
7918 { "Variable_SetUb", _wrap_Variable_SetUb, METH_VARARGS, NULL},
7919 { "Variable_ReducedCost", _wrap_Variable_ReducedCost, METH_O, NULL},
7920 { "delete_Variable", _wrap_delete_Variable, METH_O, NULL},
7921 { "Variable_swigregister", Variable_swigregister, METH_O, NULL},
7922 { "Constraint_name", _wrap_Constraint_name, METH_O, " Returns the name of the constraint."},
7923 { "Constraint_Clear", _wrap_Constraint_Clear, METH_O, " Clears all variables and coefficients. Does not clear the bounds."},
7924 { "Constraint_SetCoefficient", _wrap_Constraint_SetCoefficient, METH_VARARGS, "\n"
7925 "Sets the coefficient of the variable on the constraint.\n"
7926 "\n"
7927 "If the variable does not belong to the solver, the function just returns,\n"
7928 "or crashes in non-opt mode.\n"
7929 ""},
7930 { "Constraint_GetCoefficient", _wrap_Constraint_GetCoefficient, METH_VARARGS, "\n"
7931 "Gets the coefficient of a given variable on the constraint (which is 0 if\n"
7932 "the variable does not appear in the constraint).\n"
7933 ""},
7934 { "Constraint_lb", _wrap_Constraint_lb, METH_O, " Returns the lower bound."},
7935 { "Constraint_ub", _wrap_Constraint_ub, METH_O, " Returns the upper bound."},
7936 { "Constraint_SetBounds", _wrap_Constraint_SetBounds, METH_VARARGS, " Sets both the lower and upper bounds."},
7937 { "Constraint_set_is_lazy", _wrap_Constraint_set_is_lazy, METH_VARARGS, "\n"
7938 "Advanced usage: sets the constraint \"laziness\".\n"
7939 "\n"
7940 "**This is only supported for SCIP and has no effect on other\n"
7941 "solvers.**\n"
7942 "\n"
7943 "When **laziness** is true, the constraint is only considered by the Linear\n"
7944 "Programming solver if its current solution violates the constraint. In this\n"
7945 "case, the constraint is definitively added to the problem. This may be\n"
7946 "useful in some MIP problems, and may have a dramatic impact on performance.\n"
7947 "\n"
7948 "For more info see: http://tinyurl.com/lazy-constraints.\n"
7949 ""},
7950 { "Constraint_index", _wrap_Constraint_index, METH_O, " Returns the index of the constraint in the MPSolver::constraints_."},
7951 { "Constraint_dual_value", _wrap_Constraint_dual_value, METH_O, "\n"
7952 "Advanced usage: returns the dual value of the constraint in the current\n"
7953 "solution (only available for continuous problems).\n"
7954 ""},
7955 { "Constraint_basis_status", _wrap_Constraint_basis_status, METH_O, "\n"
7956 "Advanced usage: returns the basis status of the constraint.\n"
7957 "\n"
7958 "It is only available for continuous problems).\n"
7959 "\n"
7960 "Note that if a constraint \"linear_expression in [lb, ub]\" is transformed\n"
7961 "into \"linear_expression + slack = 0\" with slack in [-ub, -lb], then this\n"
7962 "status is the same as the status of the slack variable with AT_UPPER_BOUND\n"
7963 "and AT_LOWER_BOUND swapped.\n"
7964 "\n"
7965 "See also: MPSolver::BasisStatus.\n"
7966 ""},
7967 { "Constraint_Lb", _wrap_Constraint_Lb, METH_O, NULL},
7968 { "Constraint_Ub", _wrap_Constraint_Ub, METH_O, NULL},
7969 { "Constraint_SetLb", _wrap_Constraint_SetLb, METH_VARARGS, NULL},
7970 { "Constraint_SetUb", _wrap_Constraint_SetUb, METH_VARARGS, NULL},
7971 { "Constraint_DualValue", _wrap_Constraint_DualValue, METH_O, NULL},
7972 { "delete_Constraint", _wrap_delete_Constraint, METH_O, NULL},
7973 { "Constraint_swigregister", Constraint_swigregister, METH_O, NULL},
7974 { "new_MPSolverParameters", _wrap_new_MPSolverParameters, METH_NOARGS, " The constructor sets all parameters to their default value."},
7975 { "MPSolverParameters_SetDoubleParam", _wrap_MPSolverParameters_SetDoubleParam, METH_VARARGS, " Sets a double parameter to a specific value."},
7976 { "MPSolverParameters_SetIntegerParam", _wrap_MPSolverParameters_SetIntegerParam, METH_VARARGS, " Sets a integer parameter to a specific value."},
7977 { "MPSolverParameters_GetDoubleParam", _wrap_MPSolverParameters_GetDoubleParam, METH_VARARGS, " Returns the value of a double parameter."},
7978 { "MPSolverParameters_GetIntegerParam", _wrap_MPSolverParameters_GetIntegerParam, METH_VARARGS, " Returns the value of an integer parameter."},
7979 { "delete_MPSolverParameters", _wrap_delete_MPSolverParameters, METH_O, NULL},
7980 { "MPSolverParameters_swigregister", MPSolverParameters_swigregister, METH_O, NULL},
7981 { "MPSolverParameters_swiginit", MPSolverParameters_swiginit, METH_VARARGS, NULL},
7982 { "new_ModelExportOptions", _wrap_new_ModelExportOptions, METH_NOARGS, NULL},
7983 { "delete_ModelExportOptions", _wrap_delete_ModelExportOptions, METH_O, NULL},
7984 { "ModelExportOptions_swigregister", ModelExportOptions_swigregister, METH_O, NULL},
7985 { "ModelExportOptions_swiginit", ModelExportOptions_swiginit, METH_VARARGS, NULL},
7986 { "ExportModelAsLpFormat", _wrap_ExportModelAsLpFormat, METH_VARARGS, NULL},
7987 { "ExportModelAsMpsFormat", _wrap_ExportModelAsMpsFormat, METH_VARARGS, NULL},
7988 { "FindErrorInModelProto", _wrap_FindErrorInModelProto, METH_O, NULL},
7989 { NULL, NULL, 0, NULL }
7990};
7991
7992static PyMethodDef SwigMethods_proxydocs[] = {
7993 { NULL, NULL, 0, NULL }
7994};
7995
7996
7997/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
7998
7999static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
8000static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0};
8001static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0};
8002static swig_type_info _swigt__p_operations_research__MPConstraint = {"_p_operations_research__MPConstraint", "operations_research::MPConstraint *", 0, 0, (void*)0, 0};
8003static swig_type_info _swigt__p_operations_research__MPModelExportOptions = {"_p_operations_research__MPModelExportOptions", "operations_research::MPModelExportOptions *", 0, 0, (void*)0, 0};
8004static swig_type_info _swigt__p_operations_research__MPObjective = {"_p_operations_research__MPObjective", "operations_research::MPObjective *", 0, 0, (void*)0, 0};
8005static swig_type_info _swigt__p_operations_research__MPSolver = {"_p_operations_research__MPSolver", "operations_research::MPSolver *", 0, 0, (void*)0, 0};
8006static swig_type_info _swigt__p_operations_research__MPSolverParameters = {"_p_operations_research__MPSolverParameters", "operations_research::MPSolverParameters *", 0, 0, (void*)0, 0};
8007static swig_type_info _swigt__p_operations_research__MPVariable = {"_p_operations_research__MPVariable", "operations_research::MPVariable *", 0, 0, (void*)0, 0};
8008static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
8009static 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};
8010static swig_type_info _swigt__p_std__atomicT_bool_t = {"_p_std__atomicT_bool_t", "std::atomic< bool > *", 0, 0, (void*)0, 0};
8011static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0};
8012static 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};
8013static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uintptr_t *|uint_least32_t *|uint_fast32_t *|uint32_t *|unsigned int *|uint_fast16_t *", 0, 0, (void*)0, 0};
8014static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint_least64_t *|uint_fast64_t *|uint64_t *|unsigned long long *|uintmax_t *", 0, 0, (void*)0, 0};
8015static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
8016
8035};
8036
8037static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
8038static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
8039static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
8046static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
8047static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
8049static swig_cast_info _swigc__p_std__ostream[] = { {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}};
8051static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
8054
8073};
8074
8075
8076/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
8077
8079{0, 0, 0, 0.0, 0, 0}};
8080
8081#ifdef __cplusplus
8082}
8083#endif
8084/* -----------------------------------------------------------------------------
8085 * Type initialization:
8086 * This problem is tough by the requirement that no dynamic
8087 * memory is used. Also, since swig_type_info structures store pointers to
8088 * swig_cast_info structures and swig_cast_info structures store pointers back
8089 * to swig_type_info structures, we need some lookup code at initialization.
8090 * The idea is that swig generates all the structures that are needed.
8091 * The runtime then collects these partially filled structures.
8092 * The SWIG_InitializeModule function takes these initial arrays out of
8093 * swig_module, and does all the lookup, filling in the swig_module.types
8094 * array with the correct data and linking the correct swig_cast_info
8095 * structures together.
8096 *
8097 * The generated swig_type_info structures are assigned statically to an initial
8098 * array. We just loop through that array, and handle each type individually.
8099 * First we lookup if this type has been already loaded, and if so, use the
8100 * loaded structure instead of the generated one. Then we have to fill in the
8101 * cast linked list. The cast data is initially stored in something like a
8102 * two-dimensional array. Each row corresponds to a type (there are the same
8103 * number of rows as there are in the swig_type_initial array). Each entry in
8104 * a column is one of the swig_cast_info structures for that type.
8105 * The cast_initial array is actually an array of arrays, because each row has
8106 * a variable number of columns. So to actually build the cast linked list,
8107 * we find the array of casts associated with the type, and loop through it
8108 * adding the casts to the list. The one last trick we need to do is making
8109 * sure the type pointer in the swig_cast_info struct is correct.
8110 *
8111 * First off, we lookup the cast->type name to see if it is already loaded.
8112 * There are three cases to handle:
8113 * 1) If the cast->type has already been loaded AND the type we are adding
8114 * casting info to has not been loaded (it is in this module), THEN we
8115 * replace the cast->type pointer with the type pointer that has already
8116 * been loaded.
8117 * 2) If BOTH types (the one we are adding casting info to, and the
8118 * cast->type) are loaded, THEN the cast info has already been loaded by
8119 * the previous module so we just ignore it.
8120 * 3) Finally, if cast->type has not already been loaded, then we add that
8121 * swig_cast_info to the linked list (because the cast->type) pointer will
8122 * be correct.
8123 * ----------------------------------------------------------------------------- */
8124
8125#ifdef __cplusplus
8126extern "C" {
8127#if 0
8128} /* c-mode */
8129#endif
8130#endif
8131
8132#if 0
8133#define SWIGRUNTIME_DEBUG
8134#endif
8135
8136
8137SWIGRUNTIME void
8138SWIG_InitializeModule(void *clientdata) {
8139 size_t i;
8140 swig_module_info *module_head, *iter;
8141 int init;
8142
8143 /* check to see if the circular list has been setup, if not, set it up */
8144 if (swig_module.next==0) {
8145 /* Initialize the swig_module */
8149 init = 1;
8150 } else {
8151 init = 0;
8152 }
8153
8154 /* Try and load any already created modules */
8155 module_head = SWIG_GetModule(clientdata);
8156 if (!module_head) {
8157 /* This is the first module loaded for this interpreter */
8158 /* so set the swig module into the interpreter */
8159 SWIG_SetModule(clientdata, &swig_module);
8160 } else {
8161 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
8162 iter=module_head;
8163 do {
8164 if (iter==&swig_module) {
8165 /* Our module is already in the list, so there's nothing more to do. */
8166 return;
8167 }
8168 iter=iter->next;
8169 } while (iter!= module_head);
8170
8171 /* otherwise we must add our module into the list */
8172 swig_module.next = module_head->next;
8173 module_head->next = &swig_module;
8174 }
8175
8176 /* When multiple interpreters are used, a module could have already been initialized in
8177 a different interpreter, but not yet have a pointer in this interpreter.
8178 In this case, we do not want to continue adding types... everything should be
8179 set up already */
8180 if (init == 0) return;
8181
8182 /* Now work on filling in swig_module.types */
8183#ifdef SWIGRUNTIME_DEBUG
8184 printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
8185#endif
8186 for (i = 0; i < swig_module.size; ++i) {
8187 swig_type_info *type = 0;
8188 swig_type_info *ret;
8189 swig_cast_info *cast;
8190
8191#ifdef SWIGRUNTIME_DEBUG
8192 printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
8193#endif
8194
8195 /* if there is another module already loaded */
8196 if (swig_module.next != &swig_module) {
8198 }
8199 if (type) {
8200 /* Overwrite clientdata field */
8201#ifdef SWIGRUNTIME_DEBUG
8202 printf("SWIG_InitializeModule: found type %s\n", type->name);
8203#endif
8206#ifdef SWIGRUNTIME_DEBUG
8207 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
8208#endif
8209 }
8210 } else {
8211 type = swig_module.type_initial[i];
8212 }
8213
8214 /* Insert casting types */
8215 cast = swig_module.cast_initial[i];
8216 while (cast->type) {
8217 /* Don't need to add information already in the list */
8218 ret = 0;
8219#ifdef SWIGRUNTIME_DEBUG
8220 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
8221#endif
8222 if (swig_module.next != &swig_module) {
8224#ifdef SWIGRUNTIME_DEBUG
8225 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
8226#endif
8227 }
8228 if (ret) {
8229 if (type == swig_module.type_initial[i]) {
8230#ifdef SWIGRUNTIME_DEBUG
8231 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
8232#endif
8233 cast->type = ret;
8234 ret = 0;
8235 } else {
8236 /* Check for casting already in the list */
8237 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
8238#ifdef SWIGRUNTIME_DEBUG
8239 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
8240#endif
8241 if (!ocast) ret = 0;
8242 }
8243 }
8244
8245 if (!ret) {
8246#ifdef SWIGRUNTIME_DEBUG
8247 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
8248#endif
8249 if (type->cast) {
8250 type->cast->prev = cast;
8251 cast->next = type->cast;
8252 }
8253 type->cast = cast;
8254 }
8255 cast++;
8256 }
8257 /* Set entry in modules->types array equal to the type */
8258 swig_module.types[i] = type;
8259 }
8260 swig_module.types[i] = 0;
8261
8262#ifdef SWIGRUNTIME_DEBUG
8263 printf("**** SWIG_InitializeModule: Cast List ******\n");
8264 for (i = 0; i < swig_module.size; ++i) {
8265 int j = 0;
8267 printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
8268 while (cast->type) {
8269 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
8270 cast++;
8271 ++j;
8272 }
8273 printf("---- Total casts: %d\n",j);
8274 }
8275 printf("**** SWIG_InitializeModule: Cast List ******\n");
8276#endif
8277}
8278
8279/* This function will propagate the clientdata field of type to
8280* any new swig_type_info structures that have been added into the list
8281* of equivalent types. It is like calling
8282* SWIG_TypeClientData(type, clientdata) a second time.
8283*/
8284SWIGRUNTIME void
8286 size_t i;
8287 swig_cast_info *equiv;
8288 static int init_run = 0;
8289
8290 if (init_run) return;
8291 init_run = 1;
8292
8293 for (i = 0; i < swig_module.size; i++) {
8294 if (swig_module.types[i]->clientdata) {
8295 equiv = swig_module.types[i]->cast;
8296 while (equiv) {
8297 if (!equiv->converter) {
8298 if (equiv->type && !equiv->type->clientdata)
8300 }
8301 equiv = equiv->next;
8302 }
8303 }
8304 }
8305}
8306
8307#ifdef __cplusplus
8308#if 0
8309{
8310 /* c-mode */
8311#endif
8312}
8313#endif
8314
8315
8316
8317#ifdef __cplusplus
8318extern "C" {
8319#endif
8320
8321 /* Python-specific SWIG API */
8322#define SWIG_newvarlink() SWIG_Python_newvarlink()
8323#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
8324#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
8325
8326 /* -----------------------------------------------------------------------------
8327 * global variable support code.
8328 * ----------------------------------------------------------------------------- */
8329
8330 typedef struct swig_globalvar {
8331 char *name; /* Name of global variable */
8332 PyObject *(*get_attr)(void); /* Return the current value */
8333 int (*set_attr)(PyObject *); /* Set the value */
8334 struct swig_globalvar *next;
8336
8337 typedef struct swig_varlinkobject {
8338 PyObject_HEAD
8341
8342 SWIGINTERN PyObject *
8344#if PY_VERSION_HEX >= 0x03000000
8345 return PyUnicode_InternFromString("<Swig global variables>");
8346#else
8347 return PyString_FromString("<Swig global variables>");
8348#endif
8349 }
8350
8351 SWIGINTERN PyObject *
8353#if PY_VERSION_HEX >= 0x03000000
8354 PyObject *str = PyUnicode_InternFromString("(");
8355 PyObject *tail;
8356 PyObject *joined;
8358 for (var = v->vars; var; var=var->next) {
8359 tail = PyUnicode_FromString(var->name);
8360 joined = PyUnicode_Concat(str, tail);
8361 Py_DecRef(str);
8362 Py_DecRef(tail);
8363 str = joined;
8364 if (var->next) {
8365 tail = PyUnicode_InternFromString(", ");
8366 joined = PyUnicode_Concat(str, tail);
8367 Py_DecRef(str);
8368 Py_DecRef(tail);
8369 str = joined;
8370 }
8371 }
8372 tail = PyUnicode_InternFromString(")");
8373 joined = PyUnicode_Concat(str, tail);
8374 Py_DecRef(str);
8375 Py_DecRef(tail);
8376 str = joined;
8377#else
8378 PyObject *str = PyString_FromString("(");
8380 for (var = v->vars; var; var=var->next) {
8381 PyString_ConcatAndDel(&str,PyString_FromString(var->name));
8382 if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
8383 }
8384 PyString_ConcatAndDel(&str,PyString_FromString(")"));
8385#endif
8386 return str;
8387 }
8388
8389 SWIGINTERN void
8391 swig_globalvar *var = v->vars;
8392 while (var) {
8393 swig_globalvar *n = var->next;
8394 free(var->name);
8395 free(var);
8396 var = n;
8397 }
8398 }
8399
8400 SWIGINTERN PyObject *
8402 PyObject *res = NULL;
8403 swig_globalvar *var = v->vars;
8404 while (var) {
8405 if (strcmp(var->name,n) == 0) {
8406 res = (*var->get_attr)();
8407 break;
8408 }
8409 var = var->next;
8410 }
8411 if (res == NULL && !PyErr_Occurred()) {
8412 PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
8413 }
8414 return res;
8415 }
8416
8417 SWIGINTERN int
8418 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
8419 int res = 1;
8420 swig_globalvar *var = v->vars;
8421 while (var) {
8422 if (strcmp(var->name,n) == 0) {
8423 res = (*var->set_attr)(p);
8424 break;
8425 }
8426 var = var->next;
8427 }
8428 if (res == 1 && !PyErr_Occurred()) {
8429 PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
8430 }
8431 return res;
8432 }
8433
8434 SWIGINTERN PyTypeObject*
8436 static char varlink__doc__[] = "Swig var link object";
8437 static PyTypeObject varlink_type;
8438 static int type_init = 0;
8439 if (!type_init) {
8440 const PyTypeObject tmp = {
8441#if PY_VERSION_HEX >= 0x03000000
8442 PyVarObject_HEAD_INIT(NULL, 0)
8443#else
8444 PyObject_HEAD_INIT(NULL)
8445 0, /* ob_size */
8446#endif
8447 "swigvarlink", /* tp_name */
8448 sizeof(swig_varlinkobject), /* tp_basicsize */
8449 0, /* tp_itemsize */
8450 (destructor) swig_varlink_dealloc, /* tp_dealloc */
8451 0, /* tp_print */
8452 (getattrfunc) swig_varlink_getattr, /* tp_getattr */
8453 (setattrfunc) swig_varlink_setattr, /* tp_setattr */
8454 0, /* tp_compare */
8455 (reprfunc) swig_varlink_repr, /* tp_repr */
8456 0, /* tp_as_number */
8457 0, /* tp_as_sequence */
8458 0, /* tp_as_mapping */
8459 0, /* tp_hash */
8460 0, /* tp_call */
8461 (reprfunc) swig_varlink_str, /* tp_str */
8462 0, /* tp_getattro */
8463 0, /* tp_setattro */
8464 0, /* tp_as_buffer */
8465 0, /* tp_flags */
8466 varlink__doc__, /* tp_doc */
8467 0, /* tp_traverse */
8468 0, /* tp_clear */
8469 0, /* tp_richcompare */
8470 0, /* tp_weaklistoffset */
8471 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
8472 0, /* tp_del */
8473 0, /* tp_version_tag */
8474#if PY_VERSION_HEX >= 0x03040000
8475 0, /* tp_finalize */
8476#endif
8477#if PY_VERSION_HEX >= 0x03080000
8478 0, /* tp_vectorcall */
8479#endif
8480#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
8481 0, /* tp_print */
8482#endif
8483#ifdef COUNT_ALLOCS
8484 0, /* tp_allocs */
8485 0, /* tp_frees */
8486 0, /* tp_maxalloc */
8487 0, /* tp_prev */
8488 0 /* tp_next */
8489#endif
8490 };
8491 varlink_type = tmp;
8492 type_init = 1;
8493 if (PyType_Ready(&varlink_type) < 0)
8494 return NULL;
8495 }
8496 return &varlink_type;
8497 }
8498
8499 /* Create a variable linking object for use later */
8500 SWIGINTERN PyObject *
8502 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
8503 if (result) {
8504 result->vars = 0;
8505 }
8506 return ((PyObject*) result);
8507 }
8508
8509 SWIGINTERN void
8510 SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
8513 if (gv) {
8514 size_t size = strlen(name)+1;
8515 gv->name = (char *)malloc(size);
8516 if (gv->name) {
8517 memcpy(gv->name, name, size);
8518 gv->get_attr = get_attr;
8519 gv->set_attr = set_attr;
8520 gv->next = v->vars;
8521 }
8522 }
8523 v->vars = gv;
8524 }
8525
8526 SWIGINTERN PyObject *
8528 static PyObject *globals = 0;
8529 if (!globals) {
8530 globals = SWIG_newvarlink();
8531 }
8532 return globals;
8533 }
8534
8535 /* -----------------------------------------------------------------------------
8536 * constants/methods manipulation
8537 * ----------------------------------------------------------------------------- */
8538
8539 /* Install Constants */
8540 SWIGINTERN void
8542 PyObject *obj = 0;
8543 size_t i;
8544 for (i = 0; constants[i].type; ++i) {
8545 switch(constants[i].type) {
8546 case SWIG_PY_POINTER:
8547 obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
8548 break;
8549 case SWIG_PY_BINARY:
8550 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
8551 break;
8552 default:
8553 obj = 0;
8554 break;
8555 }
8556 if (obj) {
8557 PyDict_SetItemString(d, constants[i].name, obj);
8558 Py_DECREF(obj);
8559 }
8560 }
8561 }
8562
8563 /* -----------------------------------------------------------------------------*/
8564 /* Fix SwigMethods to carry the callback ptrs when needed */
8565 /* -----------------------------------------------------------------------------*/
8566
8567 SWIGINTERN void
8568 SWIG_Python_FixMethods(PyMethodDef *methods,
8569 swig_const_info *const_table,
8570 swig_type_info **types,
8571 swig_type_info **types_initial) {
8572 size_t i;
8573 for (i = 0; methods[i].ml_name; ++i) {
8574 const char *c = methods[i].ml_doc;
8575 if (!c) continue;
8576 c = strstr(c, "swig_ptr: ");
8577 if (c) {
8578 int j;
8579 swig_const_info *ci = 0;
8580 const char *name = c + 10;
8581 for (j = 0; const_table[j].type; ++j) {
8582 if (strncmp(const_table[j].name, name,
8583 strlen(const_table[j].name)) == 0) {
8584 ci = &(const_table[j]);
8585 break;
8586 }
8587 }
8588 if (ci) {
8589 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
8590 if (ptr) {
8591 size_t shift = (ci->ptype) - types;
8592 swig_type_info *ty = types_initial[shift];
8593 size_t ldoc = (c - methods[i].ml_doc);
8594 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
8595 char *ndoc = (char*)malloc(ldoc + lptr + 10);
8596 if (ndoc) {
8597 char *buff = ndoc;
8598 memcpy(buff, methods[i].ml_doc, ldoc);
8599 buff += ldoc;
8600 memcpy(buff, "swig_ptr: ", 10);
8601 buff += 10;
8602 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
8603 methods[i].ml_doc = ndoc;
8604 }
8605 }
8606 }
8607 }
8608 }
8609 }
8610
8611 /* -----------------------------------------------------------------------------
8612 * Method creation and docstring support functions
8613 * ----------------------------------------------------------------------------- */
8614
8615 /* -----------------------------------------------------------------------------
8616 * Function to find the method definition with the correct docstring for the
8617 * proxy module as opposed to the low-level API
8618 * ----------------------------------------------------------------------------- */
8619
8620 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
8621 /* Find the function in the modified method table */
8622 size_t offset = 0;
8623 int found = 0;
8624 while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
8625 if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
8626 found = 1;
8627 break;
8628 }
8629 offset++;
8630 }
8631 /* Use the copy with the modified docstring if available */
8632 return found ? &SwigMethods_proxydocs[offset] : NULL;
8633 }
8634
8635 /* -----------------------------------------------------------------------------
8636 * Wrapper of PyInstanceMethod_New() used in Python 3
8637 * It is exported to the generated module, used for -fastproxy
8638 * ----------------------------------------------------------------------------- */
8639
8640 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
8641 if (PyCFunction_Check(func)) {
8642 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8643 PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
8644 if (ml)
8645 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8646 }
8647#if PY_VERSION_HEX >= 0x03000000
8648 return PyInstanceMethod_New(func);
8649#else
8650 return PyMethod_New(func, NULL, NULL);
8651#endif
8652 }
8653
8654 /* -----------------------------------------------------------------------------
8655 * Wrapper of PyStaticMethod_New()
8656 * It is exported to the generated module, used for -fastproxy
8657 * ----------------------------------------------------------------------------- */
8658
8659 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
8660 if (PyCFunction_Check(func)) {
8661 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8662 PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
8663 if (ml)
8664 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8665 }
8666 return PyStaticMethod_New(func);
8667 }
8668
8669#ifdef __cplusplus
8670}
8671#endif
8672
8673/* -----------------------------------------------------------------------------*
8674 * Partial Init method
8675 * -----------------------------------------------------------------------------*/
8676
8677#ifdef __cplusplus
8678extern "C"
8679#endif
8680
8682#if PY_VERSION_HEX >= 0x03000000
8683PyObject*
8684#else
8685void
8686#endif
8687SWIG_init(void) {
8688 PyObject *m, *d, *md, *globals;
8689
8690#if PY_VERSION_HEX >= 0x03000000
8691 static struct PyModuleDef SWIG_module = {
8692 PyModuleDef_HEAD_INIT,
8693 SWIG_name,
8694 NULL,
8695 -1,
8697 NULL,
8698 NULL,
8699 NULL,
8700 NULL
8701 };
8702#endif
8703
8704#if defined(SWIGPYTHON_BUILTIN)
8705 static SwigPyClientData SwigPyObject_clientdata = {
8706 0, 0, 0, 0, 0, 0, 0
8707 };
8708 static PyGetSetDef this_getset_def = {
8709 (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
8710 };
8711 static SwigPyGetSet thisown_getset_closure = {
8714 };
8715 static PyGetSetDef thisown_getset_def = {
8716 (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
8717 };
8718 PyTypeObject *builtin_pytype;
8719 int builtin_base_count;
8720 swig_type_info *builtin_basetype;
8721 PyObject *tuple;
8722 PyGetSetDescrObject *static_getset;
8723 PyTypeObject *metatype;
8724 PyTypeObject *swigpyobject;
8725 SwigPyClientData *cd;
8726 PyObject *public_interface, *public_symbol;
8727 PyObject *this_descr;
8728 PyObject *thisown_descr;
8729 PyObject *self = 0;
8730 int i;
8731
8732 (void)builtin_pytype;
8733 (void)builtin_base_count;
8734 (void)builtin_basetype;
8735 (void)tuple;
8736 (void)static_getset;
8737 (void)self;
8738
8739 /* Metaclass is used to implement static member variables */
8740 metatype = SwigPyObjectType();
8741 assert(metatype);
8742#endif
8743
8744 (void)globals;
8745
8746 /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
8747 SWIG_This();
8750#ifndef SWIGPYTHON_BUILTIN
8752#endif
8753
8754 /* Fix SwigMethods to carry the callback ptrs when needed */
8756
8757#if PY_VERSION_HEX >= 0x03000000
8758 m = PyModule_Create(&SWIG_module);
8759#else
8760 m = Py_InitModule(SWIG_name, SwigMethods);
8761#endif
8762
8763 md = d = PyModule_GetDict(m);
8764 (void)md;
8765
8767
8768#ifdef SWIGPYTHON_BUILTIN
8769 swigpyobject = SwigPyObject_TypeOnce();
8770
8771 SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
8772 assert(SwigPyObject_stype);
8773 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
8774 if (!cd) {
8775 SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
8776 SwigPyObject_clientdata.pytype = swigpyobject;
8777 } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
8778 PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
8779# if PY_VERSION_HEX >= 0x03000000
8780 return NULL;
8781# else
8782 return;
8783# endif
8784 }
8785
8786 /* All objects have a 'this' attribute */
8787 this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
8788 (void)this_descr;
8789
8790 /* All objects have a 'thisown' attribute */
8791 thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
8792 (void)thisown_descr;
8793
8794 public_interface = PyList_New(0);
8795 public_symbol = 0;
8796 (void)public_symbol;
8797
8798 PyDict_SetItemString(md, "__all__", public_interface);
8799 Py_DECREF(public_interface);
8800 for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
8801 SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
8802 for (i = 0; swig_const_table[i].name != 0; ++i)
8803 SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
8804#endif
8805
8807
8808 SWIG_Python_SetConstant(d, "Solver_CLP_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CLP_LINEAR_PROGRAMMING)));
8809 SWIG_Python_SetConstant(d, "Solver_GLPK_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLPK_LINEAR_PROGRAMMING)));
8810 SWIG_Python_SetConstant(d, "Solver_GLOP_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLOP_LINEAR_PROGRAMMING)));
8811 SWIG_Python_SetConstant(d, "Solver_SCIP_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING)));
8812 SWIG_Python_SetConstant(d, "Solver_GLPK_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING)));
8813 SWIG_Python_SetConstant(d, "Solver_CBC_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CBC_MIXED_INTEGER_PROGRAMMING)));
8814 SWIG_Python_SetConstant(d, "Solver_GUROBI_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GUROBI_LINEAR_PROGRAMMING)));
8815 SWIG_Python_SetConstant(d, "Solver_GUROBI_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::GUROBI_MIXED_INTEGER_PROGRAMMING)));
8816 SWIG_Python_SetConstant(d, "Solver_CPLEX_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CPLEX_LINEAR_PROGRAMMING)));
8817 SWIG_Python_SetConstant(d, "Solver_CPLEX_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::CPLEX_MIXED_INTEGER_PROGRAMMING)));
8818 SWIG_Python_SetConstant(d, "Solver_XPRESS_LINEAR_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::XPRESS_LINEAR_PROGRAMMING)));
8819 SWIG_Python_SetConstant(d, "Solver_XPRESS_MIXED_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::XPRESS_MIXED_INTEGER_PROGRAMMING)));
8820 SWIG_Python_SetConstant(d, "Solver_BOP_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::BOP_INTEGER_PROGRAMMING)));
8821 SWIG_Python_SetConstant(d, "Solver_SAT_INTEGER_PROGRAMMING",SWIG_From_int(static_cast< int >(operations_research::MPSolver::SAT_INTEGER_PROGRAMMING)));
8822 SWIG_Python_SetConstant(d, "Solver_OPTIMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolver::OPTIMAL)));
8823 SWIG_Python_SetConstant(d, "Solver_FEASIBLE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FEASIBLE)));
8824 SWIG_Python_SetConstant(d, "Solver_INFEASIBLE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::INFEASIBLE)));
8825 SWIG_Python_SetConstant(d, "Solver_UNBOUNDED",SWIG_From_int(static_cast< int >(operations_research::MPSolver::UNBOUNDED)));
8826 SWIG_Python_SetConstant(d, "Solver_ABNORMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolver::ABNORMAL)));
8827 SWIG_Python_SetConstant(d, "Solver_NOT_SOLVED",SWIG_From_int(static_cast< int >(operations_research::MPSolver::NOT_SOLVED)));
8828 SWIG_Python_SetConstant(d, "Solver_FREE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FREE)));
8829 SWIG_Python_SetConstant(d, "Solver_AT_LOWER_BOUND",SWIG_From_int(static_cast< int >(operations_research::MPSolver::AT_LOWER_BOUND)));
8830 SWIG_Python_SetConstant(d, "Solver_AT_UPPER_BOUND",SWIG_From_int(static_cast< int >(operations_research::MPSolver::AT_UPPER_BOUND)));
8831 SWIG_Python_SetConstant(d, "Solver_FIXED_VALUE",SWIG_From_int(static_cast< int >(operations_research::MPSolver::FIXED_VALUE)));
8832 SWIG_Python_SetConstant(d, "Solver_BASIC",SWIG_From_int(static_cast< int >(operations_research::MPSolver::BASIC)));
8833 SWIG_Python_SetConstant(d, "MPSolverParameters_RELATIVE_MIP_GAP",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::RELATIVE_MIP_GAP)));
8834 SWIG_Python_SetConstant(d, "MPSolverParameters_PRIMAL_TOLERANCE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRIMAL_TOLERANCE)));
8835 SWIG_Python_SetConstant(d, "MPSolverParameters_DUAL_TOLERANCE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::DUAL_TOLERANCE)));
8836 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE)));
8837 SWIG_Python_SetConstant(d, "MPSolverParameters_LP_ALGORITHM",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::LP_ALGORITHM)));
8838 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY)));
8839 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING)));
8840 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE_OFF)));
8841 SWIG_Python_SetConstant(d, "MPSolverParameters_PRESOLVE_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRESOLVE_ON)));
8842 SWIG_Python_SetConstant(d, "MPSolverParameters_DUAL",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::DUAL)));
8843 SWIG_Python_SetConstant(d, "MPSolverParameters_PRIMAL",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::PRIMAL)));
8844 SWIG_Python_SetConstant(d, "MPSolverParameters_BARRIER",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::BARRIER)));
8845 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY_OFF)));
8846 SWIG_Python_SetConstant(d, "MPSolverParameters_INCREMENTALITY_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::INCREMENTALITY_ON)));
8847 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING_OFF",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING_OFF)));
8848 SWIG_Python_SetConstant(d, "MPSolverParameters_SCALING_ON",SWIG_From_int(static_cast< int >(operations_research::MPSolverParameters::SCALING_ON)));
8849 globals = SWIG_globals();
8850 if (!globals) {
8851 PyErr_SetString(PyExc_TypeError, "Failure to create SWIG globals.");
8852#if PY_VERSION_HEX >= 0x03000000
8853 return NULL;
8854#else
8855 return;
8856#endif
8857 }
8858 PyDict_SetItemString(md, "cvar", globals);
8859 Py_DECREF(globals);
8865#if PY_VERSION_HEX >= 0x03000000
8866 return m;
8867#else
8868 return;
8869#endif
8870}
8871
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:479
#define LOG(severity)
Definition: base/logging.h:420
The class for constraints of a Mathematical Programming (MP) model.
void SetUB(double ub)
Sets the upper bound.
double ub() const
Returns the upper bound.
double lb() const
Returns the lower bound.
void SetLB(double lb)
Sets the lower bound.
double dual_value() const
Advanced usage: returns the dual value of the constraint in the current solution (only available for ...
A class to express a linear objective.
double offset() const
Gets the constant term in the objective.
This mathematical programming (MP) solver class is the main class though which users build and solve ...
int64_t iterations() const
Returns the number of simplex iterations.
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.
void SetHint(std::vector< std::pair< const MPVariable *, double > > hint)
Sets a hint for solution.
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.
void set_time_limit(int64_t time_limit_milliseconds)
OptimizationProblemType
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
absl::Status LoadSolutionFromProto(const MPSolutionResponse &response, double tolerance=std::numeric_limits< double >::infinity())
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interf...
absl::Status SetNumThreads(int num_threads)
Sets the number of threads to use by the underlying solver.
void ExportModelToProto(MPModelProto *output_model) const
Exports model to protocol buffer.
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...
MPSolverResponseStatus LoadModelFromProto(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
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.
MPSolverResponseStatus LoadModelFromProtoWithUniqueNamesOrDie(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
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.
const std::string & name() const
Returns the name of the variable.
void SetUB(double ub)
Sets the upper bound.
double ub() const
Returns the upper bound.
double reduced_cost() const
Advanced usage: returns the reduced cost of the variable in the current solution (only available for ...
bool integer() const
Returns the integrality requirement of the variable.
double lb() const
Returns the lower bound.
void SetLB(double lb)
Sets the lower bound.
double solution_value() const
Returns the value of the variable in the current solution.
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
absl::Status status
Definition: g_gurobi.cc:35
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)
static swig_type_info _swigt__p_long_long
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
#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[]
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
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())
static swig_cast_info _swigc__p_long_long[]
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
static swig_type_info _swigt__p_unsigned_long_long
#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)
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[]
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)
#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_type_info * swig_types[18]
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)
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)
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_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)
static swig_cast_info _swigc__p_unsigned_long_long[]
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
std::optional< int64_t > end
int64_t start
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