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