16 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE 21 template<
typename T>
class SwigValueWrapper {
22 struct SwigMovePointer {
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; }
28 SwigValueWrapper& operator=(
const SwigValueWrapper<T>& rhs);
29 SwigValueWrapper(
const SwigValueWrapper<T>& rhs);
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; }
37 template <
typename T> T SwigValueInit() {
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR 49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) 50 # define SWIGTEMPLATEDISAMBIGUATOR template 51 # elif defined(__HP_aCC) 54 # define SWIGTEMPLATEDISAMBIGUATOR template 56 # define SWIGTEMPLATEDISAMBIGUATOR 62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 63 # define SWIGINLINE inline 71 # if defined(__GNUC__) 72 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 73 # define SWIGUNUSED __attribute__ ((__unused__)) 78 # define SWIGUNUSED __attribute__ ((__unused__)) 84 #ifndef SWIG_MSC_UNSUPPRESS_4505 85 # if defined(_MSC_VER) 86 # pragma warning(disable : 4505) 90 #ifndef SWIGUNUSEDPARM 92 # define SWIGUNUSEDPARM(p) 94 # define SWIGUNUSEDPARM(p) p SWIGUNUSED 100 # define SWIGINTERN static SWIGUNUSED 104 #ifndef SWIGINTERNINLINE 105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 109 #if defined(__GNUC__) 110 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 111 # ifndef GCC_HASCLASSVISIBILITY 112 # define GCC_HASCLASSVISIBILITY 118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 119 # if defined(STATIC_LINKED) 122 # define SWIGEXPORT __declspec(dllexport) 125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) 126 # define SWIGEXPORT __attribute__ ((visibility("default"))) 135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 136 # define SWIGSTDCALL __stdcall 143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 144 # define _CRT_SECURE_NO_DEPRECATE 148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) 149 # define _SCL_SECURE_NO_DEPRECATE 153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) 154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 162 #ifdef __INTEL_COMPILER 163 # pragma warning disable 592 167 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) 172 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) 190 #define SWIG_RUNTIME_VERSION "4" 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) 198 # define SWIG_TYPE_TABLE_NAME 211 # define SWIGRUNTIME SWIGINTERN 214 #ifndef SWIGRUNTIMEINLINE 215 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE 219 #ifndef SWIG_BUFFER_SIZE 220 # define SWIG_BUFFER_SIZE 1024 224 #define SWIG_POINTER_DISOWN 0x1 225 #define SWIG_CAST_NEW_MEMORY 0x2 226 #define SWIG_POINTER_NO_NULL 0x4 229 #define SWIG_POINTER_OWN 0x1 312 #define SWIG_ERROR (-1) 313 #define SWIG_IsOK(r) (r >= 0) 314 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) 317 #define SWIG_CASTRANKLIMIT (1 << 8) 319 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) 321 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) 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) 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)) 336 #if defined(SWIG_CASTRANK_MODE) 337 # ifndef SWIG_TypeRank 338 # define SWIG_TypeRank unsigned long 340 # ifndef SWIG_MAXCASTRANK 341 # define SWIG_MAXCASTRANK (2) 343 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) 344 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) 349 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
352 # define SWIG_AddCast(r) (r) 353 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) 363 typedef void *(*swig_converter_func)(
void *,
int *);
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;
411 return (
int)((l1 - f1) - (l2 - f2));
421 const char* te = tb + strlen(tb);
423 while (equiv != 0 && *ne) {
424 for (nb = ne; *ne; ++ne) {
425 if (*ne ==
'|')
break;
450 if (strcmp(iter->
type->
name, c) == 0) {
451 if (iter == ty->
cast)
477 if (iter->
type == from) {
478 if (iter == ty->
cast)
510 if (!ty || !ty->
dcast)
return ty;
511 while (ty && (ty->
dcast)) {
512 ty = (*ty->
dcast)(ptr);
536 if (!type)
return NULL;
537 if (type->
str != NULL) {
538 const char *last_name = type->
str;
540 for (s = type->
str; *s; s++)
541 if (*s ==
'|') last_name = s+1;
589 size_t r = iter->
size - 1;
592 size_t i = (l + r) >> 1;
593 const char *iname = iter->
types[i]->
name;
595 int compare = strcmp(
name, iname);
597 return iter->
types[i];
598 }
else if (compare < 0) {
604 }
else if (compare > 0) {
613 }
while (iter != end);
640 for (; i < iter->
size; ++i) {
642 return iter->
types[i];
645 }
while (iter != end);
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];
673 unsigned char *u = (
unsigned char *) ptr;
674 const unsigned char *eu = u + sz;
675 for (; u != eu; ++u) {
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);
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));
702 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
705 if (strlen(
name) + 1 > (bsz - (r - buff)))
return 0;
713 if (strcmp(c,
"NULL") == 0) {
726 size_t lname = (
name ? strlen(
name) : 0);
727 if ((2*sz + 2 + lname) > bsz)
return 0;
731 strncpy(r,
name,lname+1);
741 if (strcmp(c,
"NULL") == 0) {
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 773 #if PY_VERSION_HEX >= 0x03000000 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) 793 # define Py_TYPE(op) ((op)->ob_type) 798 #if PY_VERSION_HEX >= 0x03000000 799 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat 801 # define SWIG_Python_str_FromFormat PyString_FromFormat 811 #if PY_VERSION_HEX >= 0x03000000 813 str = PyUnicode_AsUTF8String(str);
817 PyBytes_AsStringAndSize(str, &cstr, &len);
818 newstr = (
char *)
malloc(len+1);
819 memcpy(newstr, cstr, len+1);
824 return PyString_AsString(str);
828 #if PY_VERSION_HEX >= 0x03000000 829 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) 831 # define SWIG_Python_str_DelForPy3(x) 838 #if PY_VERSION_HEX >= 0x03000000 839 return PyUnicode_FromString(c);
841 return PyString_FromString(c);
846 # define PyObject_DEL PyObject_Del 851 # define SWIGPY_USE_CAPSULE 852 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) 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 869 type = PyExc_MemoryError;
872 type = PyExc_IOError;
875 type = PyExc_RuntimeError;
878 type = PyExc_IndexError;
881 type = PyExc_TypeError;
884 type = PyExc_ZeroDivisionError;
887 type = PyExc_OverflowError;
890 type = PyExc_SyntaxError;
893 type = PyExc_ValueError;
896 type = PyExc_SystemError;
899 type = PyExc_AttributeError;
902 type = PyExc_RuntimeError;
913 PyObject *traceback = 0;
915 if (PyErr_Occurred())
916 PyErr_Fetch(&type, &
value, &traceback);
918 PyObject *old_str = PyObject_Str(
value);
923 PyErr_Format(type,
"%s %s", tmp, mesg);
925 PyErr_Format(type,
"%s", mesg);
930 PyErr_SetString(PyExc_RuntimeError, mesg);
940 error = PyErr_Occurred();
941 return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
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);
955 newvalue = PyString_FromFormat(
"%s\nAdditional information:\n%s", PyString_AsString(
value),
message);
958 PyErr_Restore(type, newvalue, traceback);
961 PyErr_SetString(PyExc_TypeError,
message);
965 #if defined(SWIG_PYTHON_NO_THREADS) 966 # if defined(SWIG_PYTHON_THREADS) 967 # undef SWIG_PYTHON_THREADS 970 #if defined(SWIG_PYTHON_THREADS) 971 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) 972 # define SWIG_PYTHON_USE_GIL 974 # if defined(SWIG_PYTHON_USE_GIL) 975 # ifndef SWIG_PYTHON_INITIALIZE_THREADS 976 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() 979 class SWIG_Python_Thread_Block {
981 PyGILState_STATE state;
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(); }
987 class SWIG_Python_Thread_Allow {
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(); }
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() 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) 1006 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS) 1007 # define SWIG_PYTHON_INITIALIZE_THREADS 1009 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) 1010 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK 1012 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK) 1013 # define SWIG_PYTHON_THREAD_END_BLOCK 1015 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) 1016 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW 1018 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW) 1019 # define SWIG_PYTHON_THREAD_END_ALLOW 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 1043 #define SWIG_PY_POINTER 4 1044 #define SWIG_PY_BINARY 5 1070 #if PY_VERSION_HEX < 0x02070000 1071 # error "This version of SWIG only supports Python >= 2.7" 1074 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 1075 # error "This version of SWIG only supports Python 3 >= 3.2" 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) 1085 #ifdef SWIGPYTHON_BUILTIN 1086 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) 1088 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) 1091 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) 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 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) 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) 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) 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) 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) 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 1134 PyErr_SetObject(errtype, obj);
1142 PyErr_SetString(errtype, msg);
1146 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) 1150 #if defined(SWIGPYTHON_BUILTIN) 1153 SwigPyBuiltin_AddPublicSymbol(PyObject *seq,
const char *key) {
1154 PyObject *s = PyString_InternFromString(key);
1155 PyList_Append(seq, s);
1161 PyDict_SetItemString(d,
name, obj);
1163 if (public_interface)
1164 SwigPyBuiltin_AddPublicSymbol(public_interface,
name);
1171 PyDict_SetItemString(d,
name, obj);
1183 }
else if (result == Py_None) {
1187 if (!PyList_Check(result)) {
1188 PyObject *o2 = result;
1189 result = PyList_New(1);
1190 PyList_SetItem(result, 0, o2);
1192 PyList_Append(result,obj);
1207 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got none",
1212 if (!PyTuple_Check(args)) {
1213 if (min <= 1 && max >= 1) {
1216 for (i = 1; i <
max; ++i) {
1221 PyErr_SetString(PyExc_SystemError,
"UnpackTuple() argument list is not a tuple");
1224 Py_ssize_t l = PyTuple_GET_SIZE(args);
1226 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1229 }
else if (l >
max) {
1230 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1235 for (i = 0; i < l; ++i) {
1236 objs[i] = PyTuple_GET_ITEM(args, i);
1238 for (; l <
max; ++l) {
1247 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); 1254 #define SWIG_STATIC_POINTER(var) var 1256 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var 1264 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) 1265 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) 1267 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) 1269 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) 1270 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) 1281 PyObject *none = Py_None;
1295 PyTypeObject *pytype;
1304 PyErr_SetString(PyExc_TypeError,
"Implicit conversion is prohibited for explicit constructors.");
1311 PyObject *klass = data ? data->
klass : 0;
1312 return (klass ? klass : PyExc_RuntimeError);
1325 Py_INCREF(data->
klass);
1327 if (PyClass_Check(obj)) {
1332 data->
newraw = PyObject_GetAttrString(data->
klass,
"__new__");
1335 data->
newargs = PyTuple_New(1);
1336 PyTuple_SetItem(data->
newargs, 0, obj);
1343 data->
destroy = PyObject_GetAttrString(data->
klass,
"__swig_destroy__");
1344 if (PyErr_Occurred()) {
1351 flags = PyCFunction_GET_FLAGS(data->
destroy);
1352 data->
delargs = !(flags & (METH_O));
1364 Py_XDECREF(data->
newraw);
1377 #ifdef SWIGPYTHON_BUILTIN 1383 #ifdef SWIGPYTHON_BUILTIN 1386 SwigPyObject_get___dict__(PyObject *v, PyObject *
SWIGUNUSEDPARM(args))
1391 sobj->dict = PyDict_New();
1393 Py_INCREF(sobj->dict);
1402 return PyLong_FromVoidPtr(v->
ptr);
1408 PyObject *res = NULL;
1409 PyObject *args = PyTuple_New(1);
1414 #if PY_VERSION_HEX >= 0x03000000 1415 res = PyUnicode_Format(ofmt,args);
1417 res = PyString_Format(ofmt,args);
1446 # if PY_VERSION_HEX >= 0x03000000 1447 PyObject *joined = PyUnicode_Concat(repr, nrep);
1452 PyString_ConcatAndDel(&repr,nrep);
1471 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1479 if( op != Py_EQ && op != Py_NE ) {
1480 Py_INCREF(Py_NotImplemented);
1481 return Py_NotImplemented;
1490 #ifdef SWIGPYTHON_BUILTIN 1495 assert(SwigPyObject_stype);
1511 #ifdef SWIGPYTHON_BUILTIN 1513 if (PyType_IsSubtype(op->ob_type, target_tp))
1515 return (strcmp(op->ob_type->tp_name,
"SwigPyObject") == 0);
1518 || (strcmp(
Py_TYPE(op)->tp_name,
"SwigPyObject") == 0);
1533 PyObject *destroy = data ? data->
destroy : 0;
1545 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
1546 PyErr_Fetch(&type, &
value, &traceback);
1554 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1555 PyObject *mself = PyCFunction_GET_SELF(destroy);
1556 res = ((*meth)(mself, v));
1559 PyErr_WriteUnraisable(destroy);
1561 PyErr_Restore(type,
value, traceback);
1565 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) 1568 printf(
"swig/python detected a memory leak of type '%s', no destructor found.\n", (
name ?
name :
"unknown"));
1581 PyErr_SetString(PyExc_TypeError,
"Attempt to append a non SwigPyObject");
1594 Py_INCREF(sobj->
next);
1621 if (!PyArg_UnpackTuple(args,
"own", 0, 1, &val)) {
1625 PyObject *obj = PyBool_FromLong(sobj->
own);
1627 if (PyObject_IsTrue(val)) {
1641 {
"own",
SwigPyObject_own, METH_VARARGS,
"returns/sets ownership of the pointer"},
1650 static char swigobject_doc[] =
"Swig object carries a C/C++ instance pointer";
1652 static PyNumberMethods SwigPyObject_as_number = {
1657 #
if PY_VERSION_HEX < 0x03000000
1673 #
if PY_VERSION_HEX < 0x03000000
1677 #if PY_VERSION_HEX < 0x03000000 1683 #if PY_VERSION_HEX < 0x03000000 1687 #if PY_VERSION_HEX >= 0x03050000 1688 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1689 #elif PY_VERSION_HEX >= 0x03000000 1690 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1692 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1696 static PyTypeObject swigpyobject_type;
1697 static int type_init = 0;
1699 const PyTypeObject tmp = {
1700 #if PY_VERSION_HEX >= 0x03000000 1701 PyVarObject_HEAD_INIT(NULL, 0)
1703 PyObject_HEAD_INIT(NULL)
1713 #if PY_VERSION_HEX >= 0x03000000 1719 &SwigPyObject_as_number,
1725 PyObject_GenericGetAttr,
1756 #
if PY_VERSION_HEX >= 0x03040000
1767 swigpyobject_type = tmp;
1769 if (PyType_Ready(&swigpyobject_type) < 0)
1772 return &swigpyobject_type;
1785 return (PyObject *)sobj;
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);
1841 || (strcmp((op)->ob_type->tp_name,
"SwigPyPacked") == 0);
1856 static char swigpacked_doc[] =
"Swig object carries a C/C++ instance pointer";
1857 static PyTypeObject swigpypacked_type;
1858 static int type_init = 0;
1860 const PyTypeObject tmp = {
1861 #if PY_VERSION_HEX>=0x03000000 1862 PyVarObject_HEAD_INIT(NULL, 0)
1864 PyObject_HEAD_INIT(NULL)
1874 #if PY_VERSION_HEX>=0x03000000 1886 PyObject_GenericGetAttr,
1917 #
if PY_VERSION_HEX >= 0x03040000
1928 swigpypacked_type = tmp;
1930 if (PyType_Ready(&swigpypacked_type) < 0)
1933 return &swigpypacked_type;
1941 void *pack =
malloc(size);
1943 memcpy(pack, ptr, size);
1952 return (PyObject *) sobj;
1960 if (sobj->
size != size)
return 0;
1961 memcpy(ptr, sobj->
pack, size);
1985 #if PY_VERSION_HEX>=0x03000000 1986 #define SWIG_PYTHON_SLOW_GETSET_THIS 1997 #ifdef SWIGPYTHON_BUILTIN 1999 # ifdef PyWeakref_CheckProxy 2000 if (PyWeakref_CheckProxy(pyobj)) {
2001 pyobj = PyWeakref_GET_OBJECT(pyobj);
2011 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2012 if (PyInstance_Check(pyobj)) {
2013 obj = _PyInstance_Lookup(pyobj,
SWIG_This());
2015 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2016 if (dictptr != NULL) {
2017 PyObject *dict = *dictptr;
2018 obj = dict ? PyDict_GetItem(dict,
SWIG_This()) : 0;
2020 #ifdef PyWeakref_CheckProxy 2021 if (PyWeakref_CheckProxy(pyobj)) {
2022 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2026 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2030 if (PyErr_Occurred()) PyErr_Clear();
2036 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2040 if (PyErr_Occurred()) PyErr_Clear();
2060 int oldown = sobj->
own;
2078 if (obj == Py_None && !implicit_conv) {
2090 void *vptr = sobj->
ptr;
2095 if (ptr) *ptr = vptr;
2115 if (ptr) *ptr = vptr;
2121 *own = *own | sobj->
own;
2127 if (implicit_conv) {
2130 PyObject *klass = data->
klass;
2136 if (PyErr_Occurred()) {
2161 if (!
SWIG_IsOK(res) && obj == Py_None) {
2164 if (PyErr_Occurred())
2177 if (!PyCFunction_Check(obj)) {
2184 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2185 const char *desc = doc ? strstr(doc,
"swig_ptr: ") : 0;
2231 PyObject *newraw = data->
newraw;
2233 inst = PyObject_Call(newraw, data->
newargs, NULL);
2235 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2236 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2237 if (dictptr != NULL) {
2238 PyObject *dict = *dictptr;
2240 dict = PyDict_New();
2242 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2247 PyObject_SetAttr(inst, key, swig_this);
2251 #if PY_VERSION_HEX >= 0x03000000 2252 PyObject *empty_args = PyTuple_New(0);
2254 PyObject *empty_kwargs = PyDict_New();
2256 inst = ((PyTypeObject *)data->
newargs)->tp_new((PyTypeObject *)data->
newargs, empty_args, empty_kwargs);
2257 Py_DECREF(empty_kwargs);
2259 PyObject_SetAttr(inst,
SWIG_This(), swig_this);
2260 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2263 Py_DECREF(empty_args);
2266 PyObject *dict = PyDict_New();
2268 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2269 inst = PyInstance_NewRaw(data->
newargs, dict);
2281 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2282 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2283 if (dictptr != NULL) {
2286 dict = PyDict_New();
2289 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2293 dict = PyObject_GetAttrString(inst,
"__dict__");
2294 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2328 if (clientdata && clientdata->
pytype) {
2333 PyObject *next_self = clientdata->
pytype->tp_alloc(clientdata->
pytype, 0);
2334 while (newobj->
next)
2336 newobj->
next = next_self;
2338 #ifdef SWIGPYTHON_BUILTIN 2344 #ifdef SWIGPYTHON_BUILTIN 2353 return (PyObject*) newobj;
2380 #ifdef SWIG_LINK_RUNTIME 2381 void *SWIG_ReturnGlobalTypeList(
void *);
2386 static void *type_pointer = (
void *)0;
2388 if (!type_pointer) {
2389 #ifdef SWIG_LINK_RUNTIME 2390 type_pointer = SWIG_ReturnGlobalTypeList((
void *)0);
2393 if (PyErr_Occurred()) {
2395 type_pointer = (
void *)0;
2421 #if PY_VERSION_HEX >= 0x03000000 2425 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };
2426 PyObject *module = Py_InitModule(
"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2429 if (pointer && module) {
2432 Py_XDECREF(pointer);
2448 PyObject *obj = PyDict_GetItem(cache, key);
2456 obj = PyCapsule_New((
void*) descriptor, NULL, NULL);
2457 PyDict_SetItem(cache, key, obj);
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) 2475 if (PyErr_Occurred()) {
2477 PyObject *
value = 0;
2478 PyObject *traceback = 0;
2479 PyErr_Fetch(&type, &
value, &traceback);
2481 PyObject *old_str = PyObject_Str(
value);
2483 const char *errmesg = tmp ? tmp :
"Invalid error message";
2487 PyErr_Format(type,
"%s %s", mesg, errmesg);
2489 PyErr_Format(type,
"%s %s", errmesg, mesg);
2503 if (PyErr_Occurred()) {
2506 PyOS_snprintf(mesg,
sizeof(mesg),
"argument number %d:", argnum);
2518 return ty ? ty->
str :
"";
2525 #if defined(SWIG_COBJECT_TYPES) 2529 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, 'SwigPyObject(%s)' is received",
2536 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2538 PyObject *str = PyObject_Str(obj);
2541 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s(%s)' is received",
2545 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s' is received",
2552 PyErr_Format(PyExc_TypeError,
"a '%s' is expected", type);
2554 PyErr_Format(PyExc_TypeError,
"unexpected type is received");
2565 #if SWIG_POINTER_EXCEPTION 2575 #ifdef SWIGPYTHON_BUILTIN 2577 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *
name, PyObject *
value) {
2578 PyTypeObject *tp = obj->ob_type;
2580 PyObject *encoded_name;
2584 # ifdef Py_USING_UNICODE 2585 if (PyString_Check(
name)) {
2586 name = PyUnicode_Decode(PyString_AsString(
name), PyString_Size(
name), NULL, NULL);
2589 }
else if (!PyUnicode_Check(
name))
2591 if (!PyString_Check(
name))
2594 PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
name->ob_type->tp_name);
2601 if (PyType_Ready(tp) < 0)
2605 descr = _PyType_Lookup(tp,
name);
2608 f = descr->ob_type->tp_descr_set;
2610 if (PyString_Check(
name)) {
2611 encoded_name =
name;
2614 encoded_name = PyUnicode_AsUTF8String(
name);
2618 PyErr_Format(PyExc_AttributeError,
"'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2619 Py_DECREF(encoded_name);
2621 res = f(descr, obj,
value);
2637 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 2639 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 2658 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 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] 2682 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) 2683 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) 2687 #ifdef SWIG_TypeQuery 2688 # undef SWIG_TypeQuery 2690 #define SWIG_TypeQuery SWIG_Python_TypeQuery 2695 #if PY_VERSION_HEX >= 0x03000000 2696 # define SWIG_init PyInit__pywraplp 2699 # define SWIG_init init_pywraplp 2702 #define SWIG_name "_pywraplp" 2704 #define SWIGVERSION 0x040001 2705 #define SWIG_VERSION SWIGVERSION 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)) 2712 #include <stdexcept> 2716 class SwigPtr_PyObject {
2744 Py_XINCREF(item._obj);
2758 operator PyObject *()
const 2772 struct SwigVar_PyObject : SwigPtr_PyObject {
2795 #define SWIGWORDSIZE64 2799 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) 2800 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32" 2807 #include "ortools/base/python-swig.h" 2812 #include "ortools/linear_solver/model_exporter_swig_helper.h" 2859 return PyInt_FromLong((
long)
value);
2866 static int init = 0;
2879 #if PY_VERSION_HEX>=0x03000000 2880 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 2881 if (PyBytes_Check(obj))
2883 if (PyUnicode_Check(obj))
2886 if (PyString_Check(obj))
2889 char *cstr; Py_ssize_t len;
2891 #if PY_VERSION_HEX>=0x03000000 2892 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 2893 if (!alloc && cptr) {
2900 obj = PyUnicode_AsUTF8String(obj);
2906 PyBytes_AsStringAndSize(obj, &cstr, &len);
2908 PyString_AsStringAndSize(obj, &cstr, &len);
2913 *cptr = reinterpret_cast< char* >(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
2920 #if PY_VERSION_HEX>=0x03000000 2921 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 2922 *cptr = PyBytes_AsString(obj);
2933 if (psize) *psize = len + 1;
2934 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 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" 2943 #if PY_VERSION_HEX<0x03000000 2944 if (PyUnicode_Check(obj)) {
2945 char *cstr; Py_ssize_t len;
2946 if (!alloc && cptr) {
2949 obj = PyUnicode_AsUTF8String(obj);
2952 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
2955 *cptr = reinterpret_cast< char* >(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
2957 if (psize) *psize = len + 1;
2969 if (pchar_descriptor) {
2972 if (cptr) *cptr = (
char *) vptr;
2973 if (psize) *psize = vptr ? (strlen((
char *)vptr) + 1) : 0;
2986 char* buf = 0 ;
size_t size = 0;
int alloc =
SWIG_OLDOBJ;
2989 if (val) *val =
new std::string(buf, size - 1);
2997 static int init = 0;
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) 3028 if (PyFloat_Check(obj)) {
3029 if (val) *val = PyFloat_AsDouble(obj);
3031 #if PY_VERSION_HEX < 0x03000000 3032 }
else if (PyInt_Check(obj)) {
3033 if (val) *val = (double) PyInt_AsLong(obj);
3036 }
else if (PyLong_Check(obj)) {
3037 double v = PyLong_AsDouble(obj);
3038 if (!PyErr_Occurred()) {
3045 #ifdef SWIG_PYTHON_CAST_MODE 3048 double d = PyFloat_AsDouble(obj);
3049 if (!PyErr_Occurred()) {
3056 long v = PyLong_AsLong(obj);
3057 if (!PyErr_Occurred()) {
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;
3083 if ((errno == EDOM) || (errno == ERANGE)) {
3086 double summ, reps, diff;
3089 }
else if (rd > x) {
3096 if (reps < 8*DBL_EPSILON) {
3109 #if PY_VERSION_HEX < 0x03000000 3110 if (PyInt_Check(obj)) {
3111 if (val) *val = PyInt_AsLong(obj);
3115 if (PyLong_Check(obj)) {
3116 long v = PyLong_AsLong(obj);
3117 if (!PyErr_Occurred()) {
3125 #ifdef SWIG_PYTHON_CAST_MODE 3128 long v = PyInt_AsLong(obj);
3129 if (!PyErr_Occurred()) {
3139 if (val) *val = (long)(d);
3155 if ((v < INT_MIN || v > INT_MAX)) {
3158 if (val) *val = static_cast< int >(v);
3168 return PyBool_FromLong(
value ? 1 : 0);
3176 if (!PyBool_Check(obj))
3178 r = PyObject_IsTrue(obj);
3181 if (val) *val = r ? true :
false;
3186 #define SWIG_From_double PyFloat_FromDouble 3189 #define SWIG_From_long PyInt_FromLong 3192 std::string error_message;
3193 self->LoadModelFromProto(input_model, &error_message);
3194 return error_message;
3201 if (size > INT_MAX) {
3203 return pchar_descriptor ?
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));
3210 return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size),
"surrogateescape");
3213 return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3229 std::string error_message;
3230 self->LoadModelFromProtoWithUniqueNamesOrDie(input_model, &error_message);
3231 return error_message;
3234 const absl::Status status =
3235 self->LoadSolutionFromProto(
response, tolerance);
3236 LOG_IF(
ERROR, !status.ok()) <<
"LoadSolutionFromProto() failed: " << status;
3243 self->ExportModelToProto(&
model);
3250 self->ExportModelToProto(&
model);
3254 if (variables.size() != values.size()) {
3255 LOG(
FATAL) <<
"Different number of variables and values when setting " 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]);
3263 self->SetHint(hint);
3266 return self->SetNumThreads(num_theads).ok();
3274 return self->name();
3277 return self->name();
3295 PyObject *resultobj = 0;
3296 std::string *arg1 = 0 ;
3301 PyObject *swig_obj[2] ;
3306 std::string *ptr = (std::string *)0;
3318 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "new_Solver" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3320 arg2 = static_cast< operations_research::MPSolver::OptimizationProblemType >(val2);
3332 PyObject *resultobj = 0;
3336 PyObject *swig_obj[1] ;
3344 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3354 PyObject *resultobj = 0;
3355 std::string *arg1 = 0 ;
3357 PyObject *swig_obj[1] ;
3363 std::string *ptr = (std::string *)0;
3384 PyObject *resultobj = 0;
3388 PyObject *swig_obj[1] ;
3395 SWIG_exception_fail(
SWIG_ArgError(ecode1),
"in method '" "Solver_SupportsProblemType" "', argument " "1"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3397 arg1 = static_cast< operations_research::MPSolver::OptimizationProblemType >(val1);
3407 PyObject *resultobj = 0;
3411 PyObject *swig_obj[1] ;
3419 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3429 PyObject *resultobj = 0;
3433 PyObject *swig_obj[1] ;
3442 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3452 PyObject *resultobj = 0;
3456 PyObject *swig_obj[1] ;
3457 std::vector< operations_research::MPVariable * > *result = 0 ;
3465 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3477 PyObject *resultobj = 0;
3484 PyObject *swig_obj[2] ;
3492 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3497 arg2 = static_cast< int >(val2);
3507 PyObject *resultobj = 0;
3509 std::string *arg2 = 0 ;
3513 PyObject *swig_obj[2] ;
3521 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3523 std::string *ptr = (std::string *)0;
3544 PyObject *resultobj = 0;
3549 std::string *arg5 = 0 ;
3559 PyObject *swig_obj[5] ;
3567 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3572 arg2 = static_cast< double >(val2);
3577 arg3 = static_cast< double >(val3);
3582 arg4 = static_cast< bool >(val4);
3584 std::string *ptr = (std::string *)0;
3605 PyObject *resultobj = 0;
3609 std::string *arg4 = 0 ;
3617 PyObject *swig_obj[4] ;
3625 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3630 arg2 = static_cast< double >(val2);
3635 arg3 = static_cast< double >(val3);
3637 std::string *ptr = (std::string *)0;
3658 PyObject *resultobj = 0;
3662 std::string *arg4 = 0 ;
3670 PyObject *swig_obj[4] ;
3678 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3683 arg2 = static_cast< double >(val2);
3688 arg3 = static_cast< double >(val3);
3690 std::string *ptr = (std::string *)0;
3711 PyObject *resultobj = 0;
3713 std::string *arg2 = 0 ;
3717 PyObject *swig_obj[2] ;
3725 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3727 std::string *ptr = (std::string *)0;
3748 PyObject *resultobj = 0;
3752 PyObject *swig_obj[1] ;
3761 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3771 PyObject *resultobj = 0;
3775 PyObject *swig_obj[1] ;
3776 std::vector< operations_research::MPConstraint * > *result = 0 ;
3784 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3796 PyObject *resultobj = 0;
3803 PyObject *swig_obj[2] ;
3811 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3816 arg2 = static_cast< int >(val2);
3826 PyObject *resultobj = 0;
3828 std::string *arg2 = 0 ;
3832 PyObject *swig_obj[2] ;
3838 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LookupConstraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3840 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3842 std::string *ptr = (std::string *)0;
3863 PyObject *resultobj = 0;
3875 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
3880 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3885 arg2 = static_cast< double >(val2);
3890 arg3 = static_cast< double >(val3);
3900 PyObject *resultobj = 0;
3906 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
3911 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3921 PyObject *resultobj = 0;
3925 std::string *arg4 = 0 ;
3935 if ((nobjs < 4) || (nobjs > 4))
SWIG_fail;
3940 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3945 arg2 = static_cast< double >(val2);
3950 arg3 = static_cast< double >(val3);
3952 std::string *ptr = (std::string *)0;
3973 PyObject *resultobj = 0;
3975 std::string *arg2 = 0 ;
3981 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
3986 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
3988 std::string *ptr = (std::string *)0;
4010 PyObject *argv[5] = {
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");
4097 PyObject *resultobj = 0;
4101 PyObject *swig_obj[1] ;
4110 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4120 PyObject *resultobj = 0;
4126 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
4131 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4141 PyObject *resultobj = 0;
4150 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
4155 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4158 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4161 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4163 arg2 = reinterpret_cast< operations_research::MPSolverParameters * >(argp2);
4174 PyObject *argv[3] = {
4205 " Possible C/C++ prototypes are:\n" 4206 " operations_research::MPSolver::Solve()\n" 4207 " operations_research::MPSolver::Solve(operations_research::MPSolverParameters const &)\n");
4213 PyObject *resultobj = 0;
4217 PyObject *swig_obj[1] ;
4218 std::vector< double > result;
4224 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ComputeConstraintActivities" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4226 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4229 resultobj = vector_output_helper(&result, &PyFloat_FromDouble);
4238 PyObject *resultobj = 0;
4248 PyObject *swig_obj[3] ;
4256 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4261 arg2 = static_cast< double >(val2);
4266 arg3 = static_cast< bool >(val3);
4276 PyObject *resultobj = 0;
4280 PyObject *swig_obj[1] ;
4289 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4290 result = (bool)(arg1)->InterruptSolve();
4299 PyObject *resultobj = 0;
4304 PyObject *swig_obj[2] ;
4309 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_FillSolutionResponseProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4311 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
4323 Py_DECREF(pyresult);
4329 std::string encoded_protobuf;
4330 arg2->SerializeToString(&encoded_protobuf);
4332 PyObject*
const python_encoded_protobuf =
4333 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4334 encoded_protobuf.size());
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) {
4363 PyObject *resultobj = 0;
4366 std::atomic< bool > *arg3 = (std::atomic< bool > *) 0 ;
4370 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
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);
4382 Py_DECREF(pyresult);
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);
4396 Py_DECREF(pyresult);
4403 arg3 =
reinterpret_cast< std::atomic< bool > *
>(argp3);
4407 std::string encoded_protobuf;
4408 arg2->SerializeToString(&encoded_protobuf);
4410 PyObject*
const python_encoded_protobuf =
4411 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4412 encoded_protobuf.size());
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) {
4447 PyObject *resultobj = 0;
4451 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
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);
4463 Py_DECREF(pyresult);
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);
4477 Py_DECREF(pyresult);
4483 std::string encoded_protobuf;
4484 arg2->SerializeToString(&encoded_protobuf);
4486 PyObject*
const python_encoded_protobuf =
4487 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4488 encoded_protobuf.size());
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) {
4524 PyObject *argv[4] = {
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)) {
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)) {
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)) {
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)) {
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");
4630 PyObject *resultobj = 0;
4635 PyObject *swig_obj[2] ;
4640 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelToProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4642 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
4654 Py_DECREF(pyresult);
4660 std::string encoded_protobuf;
4661 arg2->SerializeToString(&encoded_protobuf);
4663 PyObject*
const python_encoded_protobuf =
4664 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4665 encoded_protobuf.size());
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) {
4694 PyObject *resultobj = 0;
4696 std::string *arg2 = 0 ;
4700 PyObject *swig_obj[2] ;
4706 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4708 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4710 std::string *ptr = (std::string *)0;
4713 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4716 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4720 result = (bool)(arg1)->SetSolverSpecificParametersAsString((std::string
const &)*arg2);
4731 PyObject *resultobj = 0;
4744 PyObject *resultobj = 0;
4748 PyObject *swig_obj[1] ;
4756 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4757 (arg1)->EnableOutput();
4766 PyObject *resultobj = 0;
4770 PyObject *swig_obj[1] ;
4778 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4779 (arg1)->SuppressOutput();
4788 PyObject *resultobj = 0;
4792 PyObject *swig_obj[1] ;
4801 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4811 PyObject *resultobj = 0;
4815 PyObject *swig_obj[1] ;
4824 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4834 PyObject *resultobj = 0;
4838 PyObject *swig_obj[1] ;
4845 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ComputeExactConditionNumber" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4847 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4857 PyObject *resultobj = 0;
4861 PyObject *swig_obj[1] ;
4870 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4871 result = (bool)(arg1)->NextSolution();
4880 PyObject *resultobj = 0;
4887 PyObject *swig_obj[2] ;
4894 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4899 arg2 = static_cast< int64_t >(val2);
4900 (arg1)->set_time_limit(arg2);
4909 PyObject *resultobj = 0;
4913 PyObject *swig_obj[1] ;
4922 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
4932 PyObject *resultobj = 0;
4937 PyObject *swig_obj[2] ;
4945 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
4957 Py_DECREF(pyresult);
4975 PyObject *resultobj = 0;
4980 PyObject *swig_obj[2] ;
4986 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadModelFromProtoWithUniqueNamesOrDie" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4988 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
5000 Py_DECREF(pyresult);
5018 PyObject *resultobj = 0;
5028 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
5031 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5033 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
5045 Py_DECREF(pyresult);
5052 arg3 = static_cast< double >(val3);
5068 PyObject *resultobj = 0;
5075 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5078 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5080 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
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);
5092 Py_DECREF(pyresult);
5111 PyObject *argv[4] = {
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)) {
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)) {
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");
5190 PyObject *resultobj = 0;
5197 PyObject *swig_obj[2] ;
5203 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelAsLpFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5205 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5210 arg2 = static_cast< bool >(val2);
5220 PyObject *resultobj = 0;
5230 PyObject *swig_obj[3] ;
5236 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelAsMpsFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5238 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5243 arg2 = static_cast< bool >(val2);
5248 arg3 = static_cast< bool >(val3);
5258 PyObject *resultobj = 0;
5260 std::vector< operations_research::MPVariable * > *arg2 = 0 ;
5261 std::vector< double > *arg3 = 0 ;
5264 std::vector< operations_research::MPVariable * > temp2 ;
5265 std::vector< double > temp3 ;
5266 PyObject *swig_obj[3] ;
5273 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5275 if (!vector_input_helper(swig_obj[1], &temp2, PyObjAs<operations_research::MPVariable*>)) {
5276 if (!PyErr_Occurred())
5283 if (!vector_input_helper(swig_obj[2], &temp3, PyObjAs<double>)) {
5284 if (!PyErr_Occurred())
5299 PyObject *resultobj = 0;
5306 PyObject *swig_obj[2] ;
5314 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5319 arg2 = static_cast< int >(val2);
5329 PyObject *resultobj = 0;
5342 PyObject *resultobj = 0;
5349 PyObject *swig_obj[2] ;
5356 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5361 arg2 = static_cast< int64_t >(val2);
5371 PyObject *resultobj = 0;
5375 PyObject *swig_obj[1] ;
5384 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5394 PyObject *resultobj = 0;
5398 PyObject *swig_obj[1] ;
5407 arg1 = reinterpret_cast< operations_research::MPSolver * >(argp1);
5428 PyObject *resultobj = 0;
5429 std::ostream *arg1 = 0 ;
5435 std::ostream *result = 0 ;
5437 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5445 arg1 = reinterpret_cast< std::ostream * >(argp1);
5448 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
5450 arg2 = static_cast< operations_research::MPSolver::OptimizationProblemType >(val2);
5451 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5456 Py_INCREF(Py_NotImplemented);
5457 return Py_NotImplemented;
5462 PyObject *resultobj = 0;
5463 std::ostream *arg1 = 0 ;
5469 std::ostream *result = 0 ;
5471 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5479 arg1 = reinterpret_cast< std::ostream * >(argp1);
5484 arg2 = static_cast< operations_research::MPSolver::ResultStatus >(val2);
5485 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5490 Py_INCREF(Py_NotImplemented);
5491 return Py_NotImplemented;
5497 PyObject *argv[3] = {
5535 Py_INCREF(Py_NotImplemented);
5536 return Py_NotImplemented;
5541 PyObject *resultobj = 0;
5545 PyObject *swig_obj[1] ;
5553 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5563 PyObject *resultobj = 0;
5571 PyObject *swig_obj[3] ;
5578 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5586 arg3 = static_cast< double >(val3);
5596 PyObject *resultobj = 0;
5601 PyObject *swig_obj[2] ;
5607 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5609 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5622 PyObject *resultobj = 0;
5629 PyObject *swig_obj[2] ;
5636 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5641 arg2 = static_cast< double >(val2);
5642 (arg1)->SetOffset(arg2);
5651 PyObject *resultobj = 0;
5655 PyObject *swig_obj[1] ;
5664 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5674 PyObject *resultobj = 0;
5681 PyObject *swig_obj[2] ;
5686 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetOptimizationDirection" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5688 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5693 arg2 = static_cast< bool >(val2);
5694 (arg1)->SetOptimizationDirection(arg2);
5703 PyObject *resultobj = 0;
5707 PyObject *swig_obj[1] ;
5713 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetMinimization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5715 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5716 (arg1)->SetMinimization();
5725 PyObject *resultobj = 0;
5729 PyObject *swig_obj[1] ;
5735 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetMaximization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5737 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5738 (arg1)->SetMaximization();
5747 PyObject *resultobj = 0;
5751 PyObject *swig_obj[1] ;
5758 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_maximization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5760 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5770 PyObject *resultobj = 0;
5774 PyObject *swig_obj[1] ;
5781 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_minimization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5783 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5793 PyObject *resultobj = 0;
5797 PyObject *swig_obj[1] ;
5806 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5816 PyObject *resultobj = 0;
5820 PyObject *swig_obj[1] ;
5827 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_BestBound" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5829 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5839 PyObject *resultobj = 0;
5843 PyObject *swig_obj[1] ;
5852 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5862 PyObject *resultobj = 0;
5866 PyObject *swig_obj[1] ;
5874 arg1 = reinterpret_cast< operations_research::MPObjective * >(argp1);
5891 PyObject *resultobj = 0;
5895 PyObject *swig_obj[1] ;
5896 std::string *result = 0 ;
5904 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5914 PyObject *resultobj = 0;
5921 PyObject *swig_obj[2] ;
5928 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5933 arg2 = static_cast< bool >(val2);
5934 (arg1)->SetInteger(arg2);
5943 PyObject *resultobj = 0;
5947 PyObject *swig_obj[1] ;
5956 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5966 PyObject *resultobj = 0;
5970 PyObject *swig_obj[1] ;
5977 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_solution_value" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
5979 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
5989 PyObject *resultobj = 0;
5993 PyObject *swig_obj[1] ;
6002 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6012 PyObject *resultobj = 0;
6016 PyObject *swig_obj[1] ;
6025 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6035 PyObject *resultobj = 0;
6039 PyObject *swig_obj[1] ;
6048 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6058 PyObject *resultobj = 0;
6068 PyObject *swig_obj[3] ;
6075 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6080 arg2 = static_cast< double >(val2);
6085 arg3 = static_cast< double >(val3);
6086 (arg1)->SetBounds(arg2,arg3);
6095 PyObject *resultobj = 0;
6099 PyObject *swig_obj[1] ;
6106 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_reduced_cost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6108 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6118 PyObject *resultobj = 0;
6122 PyObject *swig_obj[1] ;
6129 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_basis_status" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6131 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6141 PyObject *resultobj = 0;
6145 PyObject *swig_obj[1] ;
6152 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_branching_priority" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6154 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6164 PyObject *resultobj = 0;
6171 PyObject *swig_obj[2] ;
6176 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_SetBranchingPriority" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6178 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6183 arg2 = static_cast< int >(val2);
6184 (arg1)->SetBranchingPriority(arg2);
6193 PyObject *resultobj = 0;
6197 PyObject *swig_obj[1] ;
6206 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6216 PyObject *resultobj = 0;
6220 PyObject *swig_obj[1] ;
6229 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6239 PyObject *resultobj = 0;
6243 PyObject *swig_obj[1] ;
6250 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_SolutionValue" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6252 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6262 PyObject *resultobj = 0;
6266 PyObject *swig_obj[1] ;
6275 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6285 PyObject *resultobj = 0;
6289 PyObject *swig_obj[1] ;
6298 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6308 PyObject *resultobj = 0;
6312 PyObject *swig_obj[1] ;
6321 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6331 PyObject *resultobj = 0;
6338 PyObject *swig_obj[2] ;
6345 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6350 arg2 = static_cast< double >(val2);
6360 PyObject *resultobj = 0;
6367 PyObject *swig_obj[2] ;
6374 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6379 arg2 = static_cast< double >(val2);
6389 PyObject *resultobj = 0;
6393 PyObject *swig_obj[1] ;
6400 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_ReducedCost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6402 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6412 PyObject *resultobj = 0;
6416 PyObject *swig_obj[1] ;
6424 arg1 = reinterpret_cast< operations_research::MPVariable * >(argp1);
6441 PyObject *resultobj = 0;
6445 PyObject *swig_obj[1] ;
6446 std::string *result = 0 ;
6454 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6464 PyObject *resultobj = 0;
6468 PyObject *swig_obj[1] ;
6476 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6486 PyObject *resultobj = 0;
6494 PyObject *swig_obj[3] ;
6499 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6501 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6509 arg3 = static_cast< double >(val3);
6519 PyObject *resultobj = 0;
6524 PyObject *swig_obj[2] ;
6530 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6532 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6545 PyObject *resultobj = 0;
6549 PyObject *swig_obj[1] ;
6558 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6568 PyObject *resultobj = 0;
6572 PyObject *swig_obj[1] ;
6581 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6591 PyObject *resultobj = 0;
6601 PyObject *swig_obj[3] ;
6608 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6613 arg2 = static_cast< double >(val2);
6618 arg3 = static_cast< double >(val3);
6619 (arg1)->SetBounds(arg2,arg3);
6628 PyObject *resultobj = 0;
6635 PyObject *swig_obj[2] ;
6642 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6647 arg2 = static_cast< bool >(val2);
6648 (arg1)->set_is_lazy(arg2);
6657 PyObject *resultobj = 0;
6661 PyObject *swig_obj[1] ;
6670 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6680 PyObject *resultobj = 0;
6684 PyObject *swig_obj[1] ;
6691 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_dual_value" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6693 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6703 PyObject *resultobj = 0;
6707 PyObject *swig_obj[1] ;
6714 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_basis_status" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6716 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6726 PyObject *resultobj = 0;
6730 PyObject *swig_obj[1] ;
6739 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6749 PyObject *resultobj = 0;
6753 PyObject *swig_obj[1] ;
6762 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6772 PyObject *resultobj = 0;
6779 PyObject *swig_obj[2] ;
6786 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6791 arg2 = static_cast< double >(val2);
6801 PyObject *resultobj = 0;
6808 PyObject *swig_obj[2] ;
6815 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6820 arg2 = static_cast< double >(val2);
6830 PyObject *resultobj = 0;
6834 PyObject *swig_obj[1] ;
6841 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_DualValue" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6843 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6853 PyObject *resultobj = 0;
6857 PyObject *swig_obj[1] ;
6865 arg1 = reinterpret_cast< operations_research::MPConstraint * >(argp1);
6888 PyObject *pyobj = 0;
6902 PyObject *pyobj = 0;
6916 PyObject *pyobj = 0;
6930 PyObject *pyobj = 0;
6944 PyObject *pyobj = 0;
6952 PyObject *resultobj = 0;
6965 PyObject *resultobj = 0;
6975 PyObject *swig_obj[3] ;
6980 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_SetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
6982 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
6985 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_SetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
6987 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
6992 arg3 = static_cast< double >(val3);
6993 (arg1)->SetDoubleParam(arg2,arg3);
7002 PyObject *resultobj = 0;
7012 PyObject *swig_obj[3] ;
7017 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_SetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7019 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7022 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_SetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7024 arg2 = static_cast< operations_research::MPSolverParameters::IntegerParam >(val2);
7029 arg3 = static_cast< int >(val3);
7030 (arg1)->SetIntegerParam(arg2,arg3);
7039 PyObject *resultobj = 0;
7046 PyObject *swig_obj[2] ;
7052 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_GetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7054 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7057 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_GetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7059 arg2 = static_cast< operations_research::MPSolverParameters::DoubleParam >(val2);
7069 PyObject *resultobj = 0;
7076 PyObject *swig_obj[2] ;
7082 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_GetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7084 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7087 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_GetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7089 arg2 = static_cast< operations_research::MPSolverParameters::IntegerParam >(val2);
7099 PyObject *resultobj = 0;
7103 PyObject *swig_obj[1] ;
7109 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_MPSolverParameters" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7111 arg1 = reinterpret_cast< operations_research::MPSolverParameters * >(argp1);
7132 PyObject *resultobj = 0;
7145 PyObject *resultobj = 0;
7149 PyObject *swig_obj[1] ;
7155 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_ModelExportOptions" "', argument " "1"" of type '" "operations_research::MPModelExportOptions *""'");
7157 arg1 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp1);
7178 PyObject *resultobj = 0;
7185 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
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);
7197 Py_DECREF(pyresult);
7202 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7205 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7207 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7223 PyObject *resultobj = 0;
7227 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
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);
7239 Py_DECREF(pyresult);
7258 PyObject *argv[3] = {
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)) {
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)) {
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");
7325 PyObject *resultobj = 0;
7332 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
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);
7344 Py_DECREF(pyresult);
7349 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7352 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7354 arg2 = reinterpret_cast< operations_research::MPModelExportOptions * >(argp2);
7370 PyObject *resultobj = 0;
7374 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
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);
7386 Py_DECREF(pyresult);
7405 PyObject *argv[3] = {
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)) {
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)) {
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");
7472 PyObject *resultobj = 0;
7474 PyObject *swig_obj[1] ;
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);
7490 Py_DECREF(pyresult);
7509 {
"new_Solver",
_wrap_new_Solver, METH_VARARGS,
" Create a solver with the given name and underlying solver backend."},
7512 "Recommended factory method to create a MPSolver instance, especially in\n" 7513 "non C++ languages.\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" 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" 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" 7540 "Whether the given problem type is supported (this will depend on the\n" 7541 "targets that you linked).\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" 7550 "Returns the array of variables handled by the MPSolver. (They are listed in\n" 7551 "the order in which they were created.)\n" 7553 {
"Solver_variable",
_wrap_Solver_variable, METH_VARARGS,
"Returns the variable at position index."},
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" 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" 7571 "Returns the array of constraints handled by the MPSolver.\n" 7573 "They are listed in the order in which they were created.\n" 7577 " Looks up a constraint by name, and returns nullptr if it does not exist.\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" 7586 "Creates a linear constraint with given bounds.\n" 7588 "Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class\n" 7589 "assumes ownership of the constraint.\n" 7591 ":rtype: :py:class:`MPConstraint`\n" 7592 ":return: a pointer to the newly created constraint.\n" 7597 " Creates a constraint with -infinity and +infinity bounds.\n" 7602 " Creates a named constraint with given bounds.\n" 7607 " Creates a named constraint with -infinity and +infinity bounds.\n" 7612 "Solves the problem using the default parameter values.\n" 7617 "Solves the problem using the specified parameter values.\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" 7626 "Advanced usage: Verifies the *correctness* of the solution.\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" 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" 7640 "Most users should just set the --verify_solution flag and not bother using\n" 7641 "this method directly.\n" 7644 " Interrupts the Solve() execution to terminate processing if possible.\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" 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" 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" 7671 "Advanced usage: pass solver specific parameters in text format.\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" 7679 "You can use -MPSolver::infinity() for negative infinity.\n" 7685 "Returns the number of branch-and-bound nodes evaluated during the solve.\n" 7687 "Only available for discrete problems.\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" 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" 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" 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" 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" 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" 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" 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" 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."},
7744 " Clears the offset, all variables and coefficients, and the optimization\n" 7748 "Sets the coefficient of the variable in the objective.\n" 7750 "If the variable does not belong to the solver, the function just returns,\n" 7751 "or crashes in non-opt mode.\n" 7754 " Gets the coefficient of a given variable in the objective\n" 7756 "It returns 0 if the variable does not appear in the objective).\n" 7766 "Returns the objective value of the best solution found so far.\n" 7768 "It is the optimal objective value if the problem has been solved to\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" 7777 "Returns the best objective bound.\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" 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."},
7789 "Returns the value of the variable in the current solution.\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" 7795 {
"Variable_index",
_wrap_Variable_index, METH_O,
" Returns the index of the variable in the MPSolver::variables_."},
7800 "Advanced usage: returns the reduced cost of the variable in the current\n" 7801 "solution (only available for continuous problems).\n" 7804 "Advanced usage: returns the basis status of the variable in the current\n" 7805 "solution (only available for continuous problems).\n" 7807 "See also: MPSolver::BasisStatus.\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" 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" 7832 {
"Constraint_Clear",
_wrap_Constraint_Clear, METH_O,
" Clears all variables and coefficients. Does not clear the bounds."},
7834 "Sets the coefficient of the variable on the constraint.\n" 7836 "If the variable does not belong to the solver, the function just returns,\n" 7837 "or crashes in non-opt mode.\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" 7847 "Advanced usage: sets the constraint \"laziness\".\n" 7849 "**This is only supported for SCIP and has no effect on other\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" 7857 "For more info see: http://tinyurl.com/lazy-constraints.\n" 7859 {
"Constraint_index",
_wrap_Constraint_index, METH_O,
" Returns the index of the constraint in the MPSolver::constraints_."},
7861 "Advanced usage: returns the dual value of the constraint in the current\n" 7862 "solution (only available for continuous problems).\n" 7865 "Advanced usage: returns the basis status of the constraint.\n" 7867 "It is only available for continuous problems).\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" 7874 "See also: MPSolver::BasisStatus.\n" 7883 {
"new_MPSolverParameters",
_wrap_new_MPSolverParameters, METH_NOARGS,
" The constructor sets all parameters to their default value."},
7898 { NULL, NULL, 0, NULL }
7902 { NULL, NULL, 0, NULL }
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};
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};
7988 {0, 0, 0, 0.0, 0, 0}};
8042 #define SWIGRUNTIME_DEBUG 8078 }
while (iter!= module_head);
8089 if (init == 0)
return;
8092 #ifdef SWIGRUNTIME_DEBUG 8093 printf(
"SWIG_InitializeModule: size %lu\n", (
unsigned long)
swig_module.
size);
8100 #ifdef SWIGRUNTIME_DEBUG 8110 #ifdef SWIGRUNTIME_DEBUG 8111 printf(
"SWIG_InitializeModule: found type %s\n", type->
name);
8115 #ifdef SWIGRUNTIME_DEBUG 8116 printf(
"SWIG_InitializeModule: found and overwrite type %s \n", type->
name);
8125 while (cast->
type) {
8128 #ifdef SWIGRUNTIME_DEBUG 8129 printf(
"SWIG_InitializeModule: look cast %s\n", cast->
type->
name);
8133 #ifdef SWIGRUNTIME_DEBUG 8134 if (ret) printf(
"SWIG_InitializeModule: found cast %s\n", ret->
name);
8139 #ifdef SWIGRUNTIME_DEBUG 8140 printf(
"SWIG_InitializeModule: skip old type %s\n", ret->
name);
8147 #ifdef SWIGRUNTIME_DEBUG 8148 if (ocast) printf(
"SWIG_InitializeModule: skip old cast %s\n", ret->
name);
8150 if (!ocast) ret = 0;
8155 #ifdef SWIGRUNTIME_DEBUG 8156 printf(
"SWIG_InitializeModule: adding cast %s\n", cast->
type->
name);
8171 #ifdef SWIGRUNTIME_DEBUG 8172 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
8177 while (cast->
type) {
8178 printf(
"SWIG_InitializeModule: cast type %s\n", cast->
type->
name);
8182 printf(
"---- Total casts: %d\n",j);
8184 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
8197 static int init_run = 0;
8199 if (init_run)
return;
8210 equiv = equiv->
next;
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) 8241 PyObject *(*get_attr)(void);
8253 #if PY_VERSION_HEX >= 0x03000000 8254 return PyUnicode_InternFromString(
"<Swig global variables>");
8256 return PyString_FromString(
"<Swig global variables>");
8262 #if PY_VERSION_HEX >= 0x03000000 8263 PyObject *str = PyUnicode_InternFromString(
"(");
8268 tail = PyUnicode_FromString(
var->name);
8269 joined = PyUnicode_Concat(str,
tail);
8274 tail = PyUnicode_InternFromString(
", ");
8275 joined = PyUnicode_Concat(str,
tail);
8281 tail = PyUnicode_InternFromString(
")");
8282 joined = PyUnicode_Concat(str,
tail);
8287 PyObject *str = PyString_FromString(
"(");
8290 PyString_ConcatAndDel(&str,PyString_FromString(
var->name));
8291 if (
var->next) PyString_ConcatAndDel(&str,PyString_FromString(
", "));
8293 PyString_ConcatAndDel(&str,PyString_FromString(
")"));
8311 PyObject *res = NULL;
8314 if (strcmp(
var->name,n) == 0) {
8315 res = (*
var->get_attr)();
8320 if (res == NULL && !PyErr_Occurred()) {
8321 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
8331 if (strcmp(
var->name,n) == 0) {
8332 res = (*
var->set_attr)(p);
8337 if (res == 1 && !PyErr_Occurred()) {
8338 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
8345 static char varlink__doc__[] =
"Swig var link object";
8346 static PyTypeObject varlink_type;
8347 static int type_init = 0;
8349 const PyTypeObject tmp = {
8350 #if PY_VERSION_HEX >= 0x03000000 8351 PyVarObject_HEAD_INIT(NULL, 0)
8353 PyObject_HEAD_INIT(NULL)
8380 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
8383 #if PY_VERSION_HEX >= 0x03040000 8396 if (PyType_Ready(&varlink_type) < 0)
8399 return &varlink_type;
8409 return ((PyObject*) result);
8417 size_t size = strlen(
name)+1;
8431 static PyObject *globals = 0;
8447 for (i = 0; constants[i].
type; ++i) {
8448 switch(constants[i].type) {
8453 obj =
SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
8460 PyDict_SetItemString(d, constants[i].
name, obj);
8476 for (i = 0; methods[i].ml_name; ++i) {
8477 const char *c = methods[i].ml_doc;
8479 c = strstr(c,
"swig_ptr: ");
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]);
8494 size_t shift = (ci->
ptype) - types;
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);
8501 memcpy(buff, methods[i].ml_doc, ldoc);
8503 memcpy(buff,
"swig_ptr: ", 10);
8506 methods[i].ml_doc = ndoc;
8544 if (PyCFunction_Check(func)) {
8545 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8548 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8550 #if PY_VERSION_HEX >= 0x03000000 8551 return PyInstanceMethod_New(func);
8553 return PyMethod_New(func, NULL, NULL);
8563 if (PyCFunction_Check(func)) {
8564 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8567 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8569 return PyStaticMethod_New(func);
8585 #if PY_VERSION_HEX >= 0x03000000 8591 PyObject *m, *d, *md, *globals;
8593 #if PY_VERSION_HEX >= 0x03000000 8594 static struct PyModuleDef SWIG_module = {
8595 PyModuleDef_HEAD_INIT,
8607 #if defined(SWIGPYTHON_BUILTIN) 8611 static PyGetSetDef this_getset_def = {
8612 (
char *)
"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
8614 static SwigPyGetSet thisown_getset_closure = {
8618 static PyGetSetDef thisown_getset_def = {
8619 (
char *)
"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
8621 PyTypeObject *builtin_pytype;
8622 int builtin_base_count;
8625 PyGetSetDescrObject *static_getset;
8626 PyTypeObject *metatype;
8627 PyTypeObject *swigpyobject;
8629 PyObject *public_interface, *public_symbol;
8630 PyObject *this_descr;
8631 PyObject *thisown_descr;
8635 (void)builtin_pytype;
8636 (void)builtin_base_count;
8637 (void)builtin_basetype;
8639 (void)static_getset;
8643 metatype = SwigPyObjectType();
8653 #ifndef SWIGPYTHON_BUILTIN 8660 #if PY_VERSION_HEX >= 0x03000000 8661 m = PyModule_Create(&SWIG_module);
8666 md = d = PyModule_GetDict(m);
8671 #ifdef SWIGPYTHON_BUILTIN 8675 assert(SwigPyObject_stype);
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 8695 (void)thisown_descr;
8697 public_interface = PyList_New(0);
8699 (void)public_symbol;
8701 PyDict_SetItemString(md,
"__all__", public_interface);
8702 Py_DECREF(public_interface);
8704 SwigPyBuiltin_AddPublicSymbol(public_interface,
SwigMethods[i].ml_name);
8754 PyErr_SetString(PyExc_TypeError,
"Failure to create SWIG globals.");
8755 #if PY_VERSION_HEX >= 0x03000000 8761 PyDict_SetItemString(md,
"cvar", globals);
8768 #if PY_VERSION_HEX >= 0x03000000 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)
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)
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
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)
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
static const double kDefaultPrimalTolerance
#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)
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
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)
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)
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)
SWIGINTERN PyObject * _wrap_Constraint_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
PyObject * operator->() const
static double infinity()
Infinity.
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)
swig_type_info ** type_initial
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)
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)
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)
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
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))
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)
static const double kDefaultRelativeMipGap
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)
Advanced usage: presolve mode.
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)
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[]
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)
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)
PyObject *(* get_attr)(void)
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__MPConstraint[]
PyObject_HEAD swig_globalvar * vars
SWIGINTERN PyObject * SWIG_globals(void)
std::function< int64_t(const Model &)> Value(IntegerVariable v)
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
int(* set_attr)(PyObject *)
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
swig_cast_info ** cast_initial
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)
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)
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_globalvar * 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)
Limit for relative MIP gap.
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[]
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)
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)
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
SwigVar_PyObject(PyObject *obj=0)
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.
static const double kDefaultDualTolerance
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
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[]
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 LOG_IF(severity, condition)
SwigVar_PyObject & operator=(PyObject *obj)
static swig_type_info _swigt__p_int
SWIGINTERN PyObject * _wrap_Solver_variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
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)
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)
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)
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)
Start solve from scratch.
#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
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)
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
Algorithm to solve linear programs.
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)
static PyMethodDef SwigMethods[]
struct swig_cast_info swig_cast_info
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
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)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
#define SWIGTYPE_p_operations_research__MPSolverParameters
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
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)
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)