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