16#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
21template<
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; }
37template <
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
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
86# pragma warning(disable : 4505)
92# define SWIGUNUSEDPARM(p)
94# define SWIGUNUSEDPARM(p) p SWIGUNUSED
100# define SWIGINTERN static SWIGUNUSED
104#ifndef SWIGINTERNINLINE
105# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
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)
363typedef 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 >= 0x03030000
812 return (
char *)PyUnicode_AsUTF8(str);
813#elif PY_VERSION_HEX >= 0x03000000
815 str = PyUnicode_AsUTF8String(str);
819 if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
820 newstr = (
char *)
malloc(len+1);
822 memcpy(newstr, cstr, len+1);
828 return PyString_AsString(str);
832#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
833# define SWIG_Python_str_DelForPy3(x)
835# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
842#if PY_VERSION_HEX >= 0x03000000
843 return PyUnicode_FromString(c);
845 return PyString_FromString(c);
850# define PyObject_DEL PyObject_Del
855# define SWIGPY_USE_CAPSULE
856# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
858#if PY_VERSION_HEX < 0x03020000
859#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
860#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
861#define Py_hash_t long
873 type = PyExc_MemoryError;
876 type = PyExc_IOError;
879 type = PyExc_RuntimeError;
882 type = PyExc_IndexError;
885 type = PyExc_TypeError;
888 type = PyExc_ZeroDivisionError;
891 type = PyExc_OverflowError;
894 type = PyExc_SyntaxError;
897 type = PyExc_ValueError;
900 type = PyExc_SystemError;
903 type = PyExc_AttributeError;
906 type = PyExc_RuntimeError;
917 PyObject *traceback = 0;
919 if (PyErr_Occurred())
920 PyErr_Fetch(&type, &
value, &traceback);
922 PyObject *old_str = PyObject_Str(
value);
927 PyErr_Format(type,
"%s %s", tmp, mesg);
929 PyErr_Format(type,
"%s", mesg);
934 PyErr_SetString(PyExc_RuntimeError, mesg);
944 error = PyErr_Occurred();
945 return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
954 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
955 PyErr_Fetch(&type, &
value, &traceback);
956#if PY_VERSION_HEX >= 0x03000000
957 newvalue = PyUnicode_FromFormat(
"%S\nAdditional information:\n%s",
value,
message);
959 newvalue = PyString_FromFormat(
"%s\nAdditional information:\n%s", PyString_AsString(
value),
message);
962 PyErr_Restore(type, newvalue, traceback);
965 PyErr_SetString(PyExc_TypeError,
message);
969#if defined(SWIG_PYTHON_NO_THREADS)
970# if defined(SWIG_PYTHON_THREADS)
971# undef SWIG_PYTHON_THREADS
974#if defined(SWIG_PYTHON_THREADS)
975# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
976# define SWIG_PYTHON_USE_GIL
978# if defined(SWIG_PYTHON_USE_GIL)
979# ifndef SWIG_PYTHON_INITIALIZE_THREADS
980# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
983 class SWIG_Python_Thread_Block {
985 PyGILState_STATE state;
987 void end() {
if (
status) { PyGILState_Release(state);
status =
false;} }
988 SWIG_Python_Thread_Block() :
status(true), state(PyGILState_Ensure()) {}
989 ~SWIG_Python_Thread_Block() {
end(); }
991 class SWIG_Python_Thread_Allow {
995 void end() {
if (
status) { PyEval_RestoreThread(save);
status =
false; }}
996 SWIG_Python_Thread_Allow() :
status(true), save(PyEval_SaveThread()) {}
997 ~SWIG_Python_Thread_Allow() {
end(); }
999# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1000# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1001# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1002# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1004# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1005# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1006# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1007# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1010# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1011# define SWIG_PYTHON_INITIALIZE_THREADS
1013# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1014# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1016# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1017# define SWIG_PYTHON_THREAD_END_BLOCK
1019# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1020# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1022# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1023# define SWIG_PYTHON_THREAD_END_ALLOW
1027# define SWIG_PYTHON_INITIALIZE_THREADS
1028# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1029# define SWIG_PYTHON_THREAD_END_BLOCK
1030# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1031# define SWIG_PYTHON_THREAD_END_ALLOW
1047#define SWIG_PY_POINTER 4
1048#define SWIG_PY_BINARY 5
1074#if PY_VERSION_HEX < 0x02070000
1075# error "This version of SWIG only supports Python >= 2.7"
1078#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1079# error "This version of SWIG only supports Python 3 >= 3.2"
1085#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1086#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1087#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1089#ifdef SWIGPYTHON_BUILTIN
1090#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1092#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1095#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1097#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1098#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1099#define swig_owntype int
1102#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1103#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1106#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1107#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1110#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1111#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1114#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1115#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1120#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1121#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1122#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1124#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1125#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1126#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1127#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1128#define SWIG_fail goto fail
1138 PyErr_SetObject(errtype, obj);
1146 PyErr_SetString(errtype, msg);
1150#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1154#if defined(SWIGPYTHON_BUILTIN)
1157SwigPyBuiltin_AddPublicSymbol(PyObject *seq,
const char *key) {
1158 PyObject *s = PyString_InternFromString(key);
1159 PyList_Append(seq, s);
1165 PyDict_SetItemString(d,
name, obj);
1167 if (public_interface)
1168 SwigPyBuiltin_AddPublicSymbol(public_interface,
name);
1175 PyDict_SetItemString(d,
name, obj);
1187 }
else if (result == Py_None) {
1191 if (!PyList_Check(result)) {
1192 PyObject *o2 = result;
1193 result = PyList_New(1);
1194 PyList_SetItem(result, 0, o2);
1196 PyList_Append(result,obj);
1211 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got none",
1216 if (!PyTuple_Check(args)) {
1217 if (min <= 1 && max >= 1) {
1220 for (i = 1; i <
max; ++i) {
1225 PyErr_SetString(PyExc_SystemError,
"UnpackTuple() argument list is not a tuple");
1228 Py_ssize_t l = PyTuple_GET_SIZE(args);
1230 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1233 }
else if (l >
max) {
1234 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1239 for (i = 0; i < l; ++i) {
1240 objs[i] = PyTuple_GET_ITEM(args, i);
1242 for (; l <
max; ++l) {
1254 assert(PyDict_Check(kwargs));
1255 if (PyDict_Size(kwargs) > 0) {
1256 PyErr_Format(PyExc_TypeError,
"%s() does not take keyword arguments",
name);
1264#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1271#define SWIG_STATIC_POINTER(var) var
1273#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1281#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1282#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1284#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1286#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1287#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1298 PyObject *none = Py_None;
1312 PyTypeObject *pytype;
1321 PyErr_SetString(PyExc_TypeError,
"Implicit conversion is prohibited for explicit constructors.");
1328 PyObject *klass = data ? data->
klass : 0;
1329 return (klass ? klass : PyExc_RuntimeError);
1342 Py_INCREF(data->
klass);
1344 if (PyClass_Check(obj)) {
1349 data->
newraw = PyObject_GetAttrString(data->
klass,
"__new__");
1352 data->
newargs = PyTuple_New(1);
1353 PyTuple_SetItem(data->
newargs, 0, obj);
1360 data->
destroy = PyObject_GetAttrString(data->
klass,
"__swig_destroy__");
1361 if (PyErr_Occurred()) {
1368 flags = PyCFunction_GET_FLAGS(data->
destroy);
1369 data->
delargs = !(flags & (METH_O));
1381 Py_XDECREF(data->
newraw);
1394#ifdef SWIGPYTHON_BUILTIN
1400#ifdef SWIGPYTHON_BUILTIN
1403SwigPyObject_get___dict__(PyObject *v, PyObject *
SWIGUNUSEDPARM(args))
1408 sobj->dict = PyDict_New();
1410 Py_INCREF(sobj->dict);
1419 return PyLong_FromVoidPtr(v->
ptr);
1425 PyObject *res = NULL;
1426 PyObject *args = PyTuple_New(1);
1431#if PY_VERSION_HEX >= 0x03000000
1432 res = PyUnicode_Format(ofmt,args);
1434 res = PyString_Format(ofmt,args);
1463# if PY_VERSION_HEX >= 0x03000000
1464 PyObject *joined = PyUnicode_Concat(repr, nrep);
1469 PyString_ConcatAndDel(&repr,nrep);
1488 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1496 if( op != Py_EQ && op != Py_NE ) {
1497 Py_INCREF(Py_NotImplemented);
1498 return Py_NotImplemented;
1507#ifdef SWIGPYTHON_BUILTIN
1512 assert(SwigPyObject_stype);
1528#ifdef SWIGPYTHON_BUILTIN
1530 if (PyType_IsSubtype(op->ob_type, target_tp))
1532 return (strcmp(op->ob_type->tp_name,
"SwigPyObject") == 0);
1535 || (strcmp(
Py_TYPE(op)->tp_name,
"SwigPyObject") == 0);
1550 PyObject *destroy = data ? data->
destroy : 0;
1562 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
1563 PyErr_Fetch(&type, &
value, &traceback);
1571 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1572 PyObject *mself = PyCFunction_GET_SELF(destroy);
1573 res = ((*meth)(mself, v));
1576 PyErr_WriteUnraisable(destroy);
1578 PyErr_Restore(type,
value, traceback);
1582#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1585 printf(
"swig/python detected a memory leak of type '%s', no destructor found.\n", (
name ?
name :
"unknown"));
1598 PyErr_SetString(PyExc_TypeError,
"Attempt to append a non SwigPyObject");
1611 Py_INCREF(sobj->
next);
1638 if (!PyArg_UnpackTuple(args,
"own", 0, 1, &val)) {
1642 PyObject *obj = PyBool_FromLong(sobj->
own);
1644 if (PyObject_IsTrue(val)) {
1658 {
"own",
SwigPyObject_own, METH_VARARGS,
"returns/sets ownership of the pointer"},
1667 static char swigobject_doc[] =
"Swig object carries a C/C++ instance pointer";
1669 static PyNumberMethods SwigPyObject_as_number = {
1674#
if PY_VERSION_HEX < 0x03000000
1690#
if PY_VERSION_HEX < 0x03000000
1694#if PY_VERSION_HEX < 0x03000000
1700#if PY_VERSION_HEX < 0x03000000
1704#if PY_VERSION_HEX >= 0x03050000
1705 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1706#elif PY_VERSION_HEX >= 0x03000000
1707 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1709 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1713 static PyTypeObject swigpyobject_type;
1714 static int type_init = 0;
1716 const PyTypeObject tmp = {
1717#if PY_VERSION_HEX >= 0x03000000
1718 PyVarObject_HEAD_INIT(NULL, 0)
1720 PyObject_HEAD_INIT(NULL)
1730#if PY_VERSION_HEX >= 0x03000000
1736 &SwigPyObject_as_number,
1742 PyObject_GenericGetAttr,
1773#
if PY_VERSION_HEX >= 0x03040000
1776#
if PY_VERSION_HEX >= 0x03080000
1779#
if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1790 swigpyobject_type = tmp;
1792 if (PyType_Ready(&swigpyobject_type) < 0)
1795 return &swigpyobject_type;
1808 return (PyObject *)sobj;
1849 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1850 return s ? s : strncmp((
const char *)v->
pack, (
const char *)w->
pack, 2*v->
size);
1864 || (strcmp((op)->ob_type->tp_name,
"SwigPyPacked") == 0);
1879 static char swigpacked_doc[] =
"Swig object carries a C/C++ instance pointer";
1880 static PyTypeObject swigpypacked_type;
1881 static int type_init = 0;
1883 const PyTypeObject tmp = {
1884#if PY_VERSION_HEX>=0x03000000
1885 PyVarObject_HEAD_INIT(NULL, 0)
1887 PyObject_HEAD_INIT(NULL)
1897#if PY_VERSION_HEX>=0x03000000
1909 PyObject_GenericGetAttr,
1940#
if PY_VERSION_HEX >= 0x03040000
1943#
if PY_VERSION_HEX >= 0x03080000
1946#
if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1957 swigpypacked_type = tmp;
1959 if (PyType_Ready(&swigpypacked_type) < 0)
1962 return &swigpypacked_type;
1970 void *pack =
malloc(size);
1972 memcpy(pack, ptr, size);
1981 return (PyObject *) sobj;
1989 if (sobj->
size != size)
return 0;
1990 memcpy(ptr, sobj->
pack, size);
2014#if PY_VERSION_HEX>=0x03000000
2015#define SWIG_PYTHON_SLOW_GETSET_THIS
2026#ifdef SWIGPYTHON_BUILTIN
2028# ifdef PyWeakref_CheckProxy
2029 if (PyWeakref_CheckProxy(pyobj)) {
2030 pyobj = PyWeakref_GET_OBJECT(pyobj);
2040#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2041 if (PyInstance_Check(pyobj)) {
2042 obj = _PyInstance_Lookup(pyobj,
SWIG_This());
2044 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2045 if (dictptr != NULL) {
2046 PyObject *dict = *dictptr;
2047 obj = dict ? PyDict_GetItem(dict,
SWIG_This()) : 0;
2049#ifdef PyWeakref_CheckProxy
2050 if (PyWeakref_CheckProxy(pyobj)) {
2051 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2055 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2059 if (PyErr_Occurred()) PyErr_Clear();
2065 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2069 if (PyErr_Occurred()) PyErr_Clear();
2089 int oldown = sobj->
own;
2107 if (obj == Py_None && !implicit_conv) {
2119 void *vptr = sobj->
ptr;
2124 if (ptr) *ptr = vptr;
2144 if (ptr) *ptr = vptr;
2150 *own = *own | sobj->
own;
2156 if (implicit_conv) {
2159 PyObject *klass = data->
klass;
2165 if (PyErr_Occurred()) {
2190 if (!
SWIG_IsOK(res) && obj == Py_None) {
2193 if (PyErr_Occurred())
2206 if (!PyCFunction_Check(obj)) {
2213 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2214 const char *desc = doc ? strstr(doc,
"swig_ptr: ") : 0;
2260 PyObject *newraw = data->
newraw;
2262 inst = PyObject_Call(newraw, data->
newargs, NULL);
2264#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2265 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2266 if (dictptr != NULL) {
2267 PyObject *dict = *dictptr;
2269 dict = PyDict_New();
2271 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2275 if (PyObject_SetAttr(inst,
SWIG_This(), swig_this) == -1) {
2282#if PY_VERSION_HEX >= 0x03000000
2283 PyObject *empty_args = PyTuple_New(0);
2285 PyObject *empty_kwargs = PyDict_New();
2287 inst = ((PyTypeObject *)data->
newargs)->tp_new((PyTypeObject *)data->
newargs, empty_args, empty_kwargs);
2288 Py_DECREF(empty_kwargs);
2290 if (PyObject_SetAttr(inst,
SWIG_This(), swig_this) == -1) {
2294 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2298 Py_DECREF(empty_args);
2301 PyObject *dict = PyDict_New();
2303 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2304 inst = PyInstance_NewRaw(data->
newargs, dict);
2315#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2316 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2317 if (dictptr != NULL) {
2318 PyObject *dict = *dictptr;
2320 dict = PyDict_New();
2323 return PyDict_SetItem(dict,
SWIG_This(), swig_this);
2326 return PyObject_SetAttr(inst,
SWIG_This(), swig_this);
2360 if (clientdata && clientdata->
pytype) {
2365 PyObject *next_self = clientdata->
pytype->tp_alloc(clientdata->
pytype, 0);
2366 while (newobj->
next)
2368 newobj->
next = next_self;
2370#ifdef SWIGPYTHON_BUILTIN
2376#ifdef SWIGPYTHON_BUILTIN
2385 return (PyObject*) newobj;
2412#ifdef SWIG_LINK_RUNTIME
2413void *SWIG_ReturnGlobalTypeList(
void *);
2418 static void *type_pointer = (
void *)0;
2420 if (!type_pointer) {
2421#ifdef SWIG_LINK_RUNTIME
2422 type_pointer = SWIG_ReturnGlobalTypeList((
void *)0);
2425 if (PyErr_Occurred()) {
2427 type_pointer = (
void *)0;
2453#if PY_VERSION_HEX >= 0x03000000
2457 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };
2458 PyObject *module = Py_InitModule(
"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2461 if (pointer && module) {
2464 Py_XDECREF(pointer);
2480 PyObject *obj = PyDict_GetItem(cache, key);
2488 obj = PyCapsule_New((
void*) descriptor, NULL, NULL);
2489 PyDict_SetItem(cache, key, obj);
2500#define SWIG_POINTER_EXCEPTION 0
2501#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2502#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2507 if (PyErr_Occurred()) {
2509 PyObject *
value = 0;
2510 PyObject *traceback = 0;
2511 PyErr_Fetch(&type, &
value, &traceback);
2513 PyObject *old_str = PyObject_Str(
value);
2515 const char *errmesg = tmp ? tmp :
"Invalid error message";
2519 PyErr_Format(type,
"%s %s", mesg, errmesg);
2521 PyErr_Format(type,
"%s %s", errmesg, mesg);
2535 if (PyErr_Occurred()) {
2538 PyOS_snprintf(mesg,
sizeof(mesg),
"argument number %d:", argnum);
2550 return ty ? ty->
str :
"";
2557#if defined(SWIG_COBJECT_TYPES)
2561 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, 'SwigPyObject(%s)' is received",
2568 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2570 PyObject *str = PyObject_Str(obj);
2573 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s(%s)' is received",
2577 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s' is received",
2584 PyErr_Format(PyExc_TypeError,
"a '%s' is expected", type);
2586 PyErr_Format(PyExc_TypeError,
"unexpected type is received");
2597#if SWIG_POINTER_EXCEPTION
2607#ifdef SWIGPYTHON_BUILTIN
2609SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *
name, PyObject *
value) {
2610 PyTypeObject *tp = obj->ob_type;
2612 PyObject *encoded_name;
2616# ifdef Py_USING_UNICODE
2617 if (PyString_Check(
name)) {
2618 name = PyUnicode_Decode(PyString_AsString(
name), PyString_Size(
name), NULL, NULL);
2621 }
else if (!PyUnicode_Check(
name))
2623 if (!PyString_Check(
name))
2626 PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
name->ob_type->tp_name);
2633 if (PyType_Ready(tp) < 0)
2637 descr = _PyType_Lookup(tp,
name);
2640 f = descr->ob_type->tp_descr_set;
2642 if (PyString_Check(
name)) {
2643 encoded_name =
name;
2646 encoded_name = PyUnicode_AsUTF8String(
name);
2650 PyErr_Format(PyExc_AttributeError,
"'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2651 Py_DECREF(encoded_name);
2653 res = f(descr, obj,
value);
2669#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2671#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2690 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2695#define SWIGTYPE_p_char swig_types[0]
2696#define SWIGTYPE_p_int swig_types[1]
2697#define SWIGTYPE_p_long_long swig_types[2]
2698#define SWIGTYPE_p_operations_research__MPConstraint swig_types[3]
2699#define SWIGTYPE_p_operations_research__MPModelExportOptions swig_types[4]
2700#define SWIGTYPE_p_operations_research__MPObjective swig_types[5]
2701#define SWIGTYPE_p_operations_research__MPSolver swig_types[6]
2702#define SWIGTYPE_p_operations_research__MPSolverParameters swig_types[7]
2703#define SWIGTYPE_p_operations_research__MPVariable swig_types[8]
2704#define SWIGTYPE_p_short swig_types[9]
2705#define SWIGTYPE_p_signed_char swig_types[10]
2706#define SWIGTYPE_p_std__atomicT_bool_t swig_types[11]
2707#define SWIGTYPE_p_std__ostream swig_types[12]
2708#define SWIGTYPE_p_unsigned_char swig_types[13]
2709#define SWIGTYPE_p_unsigned_int swig_types[14]
2710#define SWIGTYPE_p_unsigned_long_long swig_types[15]
2711#define SWIGTYPE_p_unsigned_short swig_types[16]
2714#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2715#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2719#ifdef SWIG_TypeQuery
2720# undef SWIG_TypeQuery
2722#define SWIG_TypeQuery SWIG_Python_TypeQuery
2727#if PY_VERSION_HEX >= 0x03000000
2728# define SWIG_init PyInit__pywraplp
2731# define SWIG_init init_pywraplp
2734#define SWIG_name "_pywraplp"
2736#define SWIGVERSION 0x040002
2737#define SWIG_VERSION SWIGVERSION
2740#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2741#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2748 class SwigPtr_PyObject {
2776 Py_XINCREF(item._obj);
2790 operator PyObject *()
const
2804 struct SwigVar_PyObject : SwigPtr_PyObject {
2830#include "ortools/base/python-swig.h"
2835#include "ortools/linear_solver/model_exporter_swig_helper.h"
2882 return PyInt_FromLong((
long)
value);
2889 static int init = 0;
2902#if PY_VERSION_HEX>=0x03000000
2903#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2904 if (PyBytes_Check(obj))
2906 if (PyUnicode_Check(obj))
2909 if (PyString_Check(obj))
2912 char *cstr; Py_ssize_t len;
2914#if PY_VERSION_HEX>=0x03000000
2915#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2916 if (!alloc && cptr) {
2923 obj = PyUnicode_AsUTF8String(obj);
2929 if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
2932 if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
2938 *cptr =
reinterpret_cast< char*
>(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
2945#if PY_VERSION_HEX>=0x03000000
2946#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2947 *cptr = PyBytes_AsString(obj);
2958 if (psize) *psize = len + 1;
2959#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2964#if defined(SWIG_PYTHON_2_UNICODE)
2965#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2966#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
2968#if PY_VERSION_HEX<0x03000000
2969 if (PyUnicode_Check(obj)) {
2970 char *cstr; Py_ssize_t len;
2971 if (!alloc && cptr) {
2974 obj = PyUnicode_AsUTF8String(obj);
2977 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
2980 *cptr =
reinterpret_cast< char*
>(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
2982 if (psize) *psize = len + 1;
2994 if (pchar_descriptor) {
2997 if (cptr) *cptr = (
char *) vptr;
2998 if (psize) *psize = vptr ? (strlen((
char *)vptr) + 1) : 0;
3011 char* buf = 0 ;
size_t size = 0;
int alloc =
SWIG_OLDOBJ;
3014 if (val) *val =
new std::string(buf, size - 1);
3022 static int init = 0;
3040#if !defined(SWIG_NO_LLONG_MAX)
3041# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3042# define LLONG_MAX __LONG_LONG_MAX__
3043# define LLONG_MIN (-LLONG_MAX - 1LL)
3044# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3053 if (PyFloat_Check(obj)) {
3054 if (val) *val = PyFloat_AsDouble(obj);
3056#if PY_VERSION_HEX < 0x03000000
3057 }
else if (PyInt_Check(obj)) {
3058 if (val) *val = (double) PyInt_AsLong(obj);
3061 }
else if (PyLong_Check(obj)) {
3062 double v = PyLong_AsDouble(obj);
3063 if (!PyErr_Occurred()) {
3070#ifdef SWIG_PYTHON_CAST_MODE
3073 double d = PyFloat_AsDouble(obj);
3074 if (!PyErr_Occurred()) {
3081 long v = PyLong_AsLong(obj);
3082 if (!PyErr_Occurred()) {
3104 if ((
min <= x && x <=
max)) {
3105 double fx = floor(x);
3106 double cx = ceil(x);
3107 double rd = ((x - fx) < 0.5) ? fx : cx;
3108 if ((errno == EDOM) || (errno == ERANGE)) {
3111 double summ, reps, diff;
3114 }
else if (rd > x) {
3121 if (reps < 8*DBL_EPSILON) {
3134#if PY_VERSION_HEX < 0x03000000
3135 if (PyInt_Check(obj)) {
3136 if (val) *val = PyInt_AsLong(obj);
3140 if (PyLong_Check(obj)) {
3141 long v = PyLong_AsLong(obj);
3142 if (!PyErr_Occurred()) {
3150#ifdef SWIG_PYTHON_CAST_MODE
3153 long v = PyInt_AsLong(obj);
3154 if (!PyErr_Occurred()) {
3164 if (val) *val = (long)(d);
3180 if ((v < INT_MIN || v > INT_MAX)) {
3183 if (val) *val =
static_cast< int >(v);
3193 return PyBool_FromLong(
value ? 1 : 0);
3201 if (!PyBool_Check(obj))
3203 r = PyObject_IsTrue(obj);
3206 if (val) *val = r ? true :
false;
3211 #define SWIG_From_double PyFloat_FromDouble
3214#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
3215# define SWIG_LONG_LONG_AVAILABLE
3219#ifdef SWIG_LONG_LONG_AVAILABLE
3221SWIG_From_long_SS_long (
long long value)
3223 return ((
value < LONG_MIN) || (
value > LONG_MAX)) ?
3224 PyLong_FromLongLong(
value) : PyInt_FromLong(
static_cast< long >(
value));
3229#ifdef SWIG_LONG_LONG_AVAILABLE
3231SWIG_AsVal_long_SS_long (PyObject *obj,
long long *val)
3234 if (PyLong_Check(obj)) {
3235 long long v = PyLong_AsLongLong(obj);
3236 if (!PyErr_Occurred()) {
3251#ifdef SWIG_PYTHON_CAST_MODE
3253 const double mant_max = 1LL << DBL_MANT_DIG;
3254 const double mant_min = -mant_max;
3260 if (val) *val = (
long long)(d);
3271 std::string error_message;
3273 return error_message;
3280 if (size > INT_MAX) {
3282 return pchar_descriptor ?
3285#if PY_VERSION_HEX >= 0x03000000
3286#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3287 return PyBytes_FromStringAndSize(carray,
static_cast< Py_ssize_t
>(size));
3289 return PyUnicode_DecodeUTF8(carray,
static_cast< Py_ssize_t
>(size),
"surrogateescape");
3292 return PyString_FromStringAndSize(carray,
static_cast< Py_ssize_t
>(size));
3308 std::string error_message;
3310 return error_message;
3313 const absl::Status
status =
3333 if (variables.size() != values.size()) {
3334 LOG(
FATAL) <<
"Different number of variables and values when setting "
3337 std::vector<std::pair<const operations_research::MPVariable*, double> >
3338 hint(variables.size());
3339 for (
int i = 0; i < variables.size(); ++i) {
3340 hint[i] = std::make_pair(variables[i], values[i]);
3353 return self->
name();
3356 return self->
name();
3374 PyObject *resultobj = 0;
3375 std::string *arg1 = 0 ;
3380 PyObject *swig_obj[2] ;
3385 std::string *ptr = (std::string *)0;
3397 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "new_Solver" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3411 PyObject *resultobj = 0;
3415 PyObject *swig_obj[1] ;
3433 PyObject *resultobj = 0;
3434 std::string *arg1 = 0 ;
3436 PyObject *swig_obj[1] ;
3442 std::string *ptr = (std::string *)0;
3463 PyObject *resultobj = 0;
3467 PyObject *swig_obj[1] ;
3474 SWIG_exception_fail(
SWIG_ArgError(ecode1),
"in method '" "Solver_SupportsProblemType" "', argument " "1"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
3486 PyObject *resultobj = 0;
3490 PyObject *swig_obj[1] ;
3508 PyObject *resultobj = 0;
3512 PyObject *swig_obj[1] ;
3531 PyObject *resultobj = 0;
3535 PyObject *swig_obj[1] ;
3536 std::vector< operations_research::MPVariable * > *result = 0 ;
3556 PyObject *resultobj = 0;
3563 PyObject *swig_obj[2] ;
3576 arg2 =
static_cast< int >(val2);
3586 PyObject *resultobj = 0;
3588 std::string *arg2 = 0 ;
3592 PyObject *swig_obj[2] ;
3602 std::string *ptr = (std::string *)0;
3623 PyObject *resultobj = 0;
3628 std::string *arg5 = 0 ;
3638 PyObject *swig_obj[5] ;
3651 arg2 =
static_cast< double >(val2);
3656 arg3 =
static_cast< double >(val3);
3661 arg4 =
static_cast< bool >(val4);
3663 std::string *ptr = (std::string *)0;
3684 PyObject *resultobj = 0;
3688 std::string *arg4 = 0 ;
3696 PyObject *swig_obj[4] ;
3709 arg2 =
static_cast< double >(val2);
3714 arg3 =
static_cast< double >(val3);
3716 std::string *ptr = (std::string *)0;
3737 PyObject *resultobj = 0;
3741 std::string *arg4 = 0 ;
3749 PyObject *swig_obj[4] ;
3762 arg2 =
static_cast< double >(val2);
3767 arg3 =
static_cast< double >(val3);
3769 std::string *ptr = (std::string *)0;
3790 PyObject *resultobj = 0;
3792 std::string *arg2 = 0 ;
3796 PyObject *swig_obj[2] ;
3806 std::string *ptr = (std::string *)0;
3827 PyObject *resultobj = 0;
3831 PyObject *swig_obj[1] ;
3850 PyObject *resultobj = 0;
3854 PyObject *swig_obj[1] ;
3855 std::vector< operations_research::MPConstraint * > *result = 0 ;
3875 PyObject *resultobj = 0;
3882 PyObject *swig_obj[2] ;
3895 arg2 =
static_cast< int >(val2);
3905 PyObject *resultobj = 0;
3907 std::string *arg2 = 0 ;
3911 PyObject *swig_obj[2] ;
3917 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LookupConstraint" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
3921 std::string *ptr = (std::string *)0;
3942 PyObject *resultobj = 0;
3954 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
3964 arg2 =
static_cast< double >(val2);
3969 arg3 =
static_cast< double >(val3);
3979 PyObject *resultobj = 0;
3985 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
4000 PyObject *resultobj = 0;
4004 std::string *arg4 = 0 ;
4014 if ((nobjs < 4) || (nobjs > 4))
SWIG_fail;
4024 arg2 =
static_cast< double >(val2);
4029 arg3 =
static_cast< double >(val3);
4031 std::string *ptr = (std::string *)0;
4052 PyObject *resultobj = 0;
4054 std::string *arg2 = 0 ;
4060 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
4067 std::string *ptr = (std::string *)0;
4089 PyObject *argv[5] = {
4166 " Possible C/C++ prototypes are:\n"
4167 " operations_research::MPSolver::MakeRowConstraint(double,double)\n"
4168 " operations_research::MPSolver::MakeRowConstraint()\n"
4169 " operations_research::MPSolver::MakeRowConstraint(double,double,std::string const &)\n"
4170 " operations_research::MPSolver::MakeRowConstraint(std::string const &)\n");
4176 PyObject *resultobj = 0;
4180 PyObject *swig_obj[1] ;
4199 PyObject *resultobj = 0;
4205 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
4220 PyObject *resultobj = 0;
4229 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
4237 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4240 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "Solver_Solve" "', argument " "2"" of type '" "operations_research::MPSolverParameters const &""'");
4253 PyObject *argv[3] = {
4284 " Possible C/C++ prototypes are:\n"
4285 " operations_research::MPSolver::Solve()\n"
4286 " operations_research::MPSolver::Solve(operations_research::MPSolverParameters const &)\n");
4292 PyObject *resultobj = 0;
4296 PyObject *swig_obj[1] ;
4297 std::vector< double > result;
4303 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ComputeConstraintActivities" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4308 resultobj = vector_output_helper(&result, &PyFloat_FromDouble);
4317 PyObject *resultobj = 0;
4327 PyObject *swig_obj[3] ;
4340 arg2 =
static_cast< double >(val2);
4345 arg3 =
static_cast< bool >(val3);
4355 PyObject *resultobj = 0;
4359 PyObject *swig_obj[1] ;
4378 PyObject *resultobj = 0;
4383 PyObject *swig_obj[2] ;
4388 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_FillSolutionResponseProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4393 PyObject*
const pyresult = PyObject_CallMethod(
4394 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4395 if (pyresult !=
nullptr) {
4396 char* buffer =
nullptr;
4397 Py_ssize_t length = 0;
4398 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4399 if (buffer !=
nullptr) {
4400 arg2->ParseFromArray(buffer, length);
4402 Py_DECREF(pyresult);
4408 std::string encoded_protobuf;
4409 arg2->SerializeToString(&encoded_protobuf);
4411 PyObject*
const python_encoded_protobuf =
4412 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4413 encoded_protobuf.size());
4419 if (python_encoded_protobuf !=
nullptr) {
4420 PyObject*
const result = PyObject_CallMethod(
4421 swig_obj[1],
const_cast<char*
>(
"ParseFromString"),
4422 const_cast<char*
>(
"(O)"), python_encoded_protobuf);
4423 Py_DECREF(python_encoded_protobuf);
4424 if (result !=
nullptr) {
4442 PyObject *resultobj = 0;
4445 std::atomic< bool > *arg3 = (std::atomic< bool > *) 0 ;
4449 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
4452 PyObject*
const pyresult = PyObject_CallMethod(
4453 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4454 if (pyresult !=
nullptr) {
4455 char* buffer =
nullptr;
4456 Py_ssize_t length = 0;
4457 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4458 if (buffer !=
nullptr) {
4459 arg1->ParseFromArray(buffer, length);
4461 Py_DECREF(pyresult);
4466 PyObject*
const pyresult = PyObject_CallMethod(
4467 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4468 if (pyresult !=
nullptr) {
4469 char* buffer =
nullptr;
4470 Py_ssize_t length = 0;
4471 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4472 if (buffer !=
nullptr) {
4473 arg2->ParseFromArray(buffer, length);
4475 Py_DECREF(pyresult);
4482 arg3 =
reinterpret_cast< std::atomic< bool > *
>(argp3);
4486 std::string encoded_protobuf;
4487 arg2->SerializeToString(&encoded_protobuf);
4489 PyObject*
const python_encoded_protobuf =
4490 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4491 encoded_protobuf.size());
4497 if (python_encoded_protobuf !=
nullptr) {
4498 PyObject*
const result = PyObject_CallMethod(
4499 swig_obj[1],
const_cast<char*
>(
"ParseFromString"),
4500 const_cast<char*
>(
"(O)"), python_encoded_protobuf);
4501 Py_DECREF(python_encoded_protobuf);
4502 if (result !=
nullptr) {
4526 PyObject *resultobj = 0;
4530 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
4533 PyObject*
const pyresult = PyObject_CallMethod(
4534 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4535 if (pyresult !=
nullptr) {
4536 char* buffer =
nullptr;
4537 Py_ssize_t length = 0;
4538 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4539 if (buffer !=
nullptr) {
4540 arg1->ParseFromArray(buffer, length);
4542 Py_DECREF(pyresult);
4547 PyObject*
const pyresult = PyObject_CallMethod(
4548 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4549 if (pyresult !=
nullptr) {
4550 char* buffer =
nullptr;
4551 Py_ssize_t length = 0;
4552 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4553 if (buffer !=
nullptr) {
4554 arg2->ParseFromArray(buffer, length);
4556 Py_DECREF(pyresult);
4562 std::string encoded_protobuf;
4563 arg2->SerializeToString(&encoded_protobuf);
4565 PyObject*
const python_encoded_protobuf =
4566 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4567 encoded_protobuf.size());
4573 if (python_encoded_protobuf !=
nullptr) {
4574 PyObject*
const result = PyObject_CallMethod(
4575 swig_obj[1],
const_cast<char*
>(
"ParseFromString"),
4576 const_cast<char*
>(
"(O)"), python_encoded_protobuf);
4577 Py_DECREF(python_encoded_protobuf);
4578 if (result !=
nullptr) {
4603 PyObject *argv[4] = {
4613 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
4614 if (module !=
nullptr) {
4615 PyObject*
const dict = PyModule_GetDict(module);
4616 if (dict !=
nullptr) {
4617 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelRequest");
4618 if (clss !=
nullptr) {
4619 if (PyObject_IsInstance(argv[0], clss)) {
4631 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
4632 if (module !=
nullptr) {
4633 PyObject*
const dict = PyModule_GetDict(module);
4634 if (dict !=
nullptr) {
4635 PyObject*
const clss = PyDict_GetItemString(dict,
"MPSolutionResponse");
4636 if (clss !=
nullptr) {
4637 if (PyObject_IsInstance(argv[1], clss)) {
4655 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
4656 if (module !=
nullptr) {
4657 PyObject*
const dict = PyModule_GetDict(module);
4658 if (dict !=
nullptr) {
4659 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelRequest");
4660 if (clss !=
nullptr) {
4661 if (PyObject_IsInstance(argv[0], clss)) {
4673 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
4674 if (module !=
nullptr) {
4675 PyObject*
const dict = PyModule_GetDict(module);
4676 if (dict !=
nullptr) {
4677 PyObject*
const clss = PyDict_GetItemString(dict,
"MPSolutionResponse");
4678 if (clss !=
nullptr) {
4679 if (PyObject_IsInstance(argv[1], clss)) {
4701 " Possible C/C++ prototypes are:\n"
4702 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *,std::atomic< bool > *)\n"
4703 " operations_research::MPSolver::SolveWithProto(operations_research::MPModelRequest const &,operations_research::MPSolutionResponse *)\n");
4709 PyObject *resultobj = 0;
4714 PyObject *swig_obj[2] ;
4719 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelToProto" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4724 PyObject*
const pyresult = PyObject_CallMethod(
4725 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4726 if (pyresult !=
nullptr) {
4727 char* buffer =
nullptr;
4728 Py_ssize_t length = 0;
4729 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4730 if (buffer !=
nullptr) {
4731 arg2->ParseFromArray(buffer, length);
4733 Py_DECREF(pyresult);
4739 std::string encoded_protobuf;
4740 arg2->SerializeToString(&encoded_protobuf);
4742 PyObject*
const python_encoded_protobuf =
4743 PyBytes_FromStringAndSize(encoded_protobuf.c_str(),
4744 encoded_protobuf.size());
4750 if (python_encoded_protobuf !=
nullptr) {
4751 PyObject*
const result = PyObject_CallMethod(
4752 swig_obj[1],
const_cast<char*
>(
"ParseFromString"),
4753 const_cast<char*
>(
"(O)"), python_encoded_protobuf);
4754 Py_DECREF(python_encoded_protobuf);
4755 if (result !=
nullptr) {
4773 PyObject *resultobj = 0;
4775 std::string *arg2 = 0 ;
4779 PyObject *swig_obj[2] ;
4785 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
4789 std::string *ptr = (std::string *)0;
4792 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4795 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "Solver_SetSolverSpecificParametersAsString" "', argument " "2"" of type '" "std::string const &""'");
4799 result = (bool)(arg1)->SetSolverSpecificParametersAsString((std::string
const &)*arg2);
4810 PyObject *resultobj = 0;
4823 PyObject *resultobj = 0;
4827 PyObject *swig_obj[1] ;
4836 (arg1)->EnableOutput();
4845 PyObject *resultobj = 0;
4849 PyObject *swig_obj[1] ;
4858 (arg1)->SuppressOutput();
4867 PyObject *resultobj = 0;
4871 PyObject *swig_obj[1] ;
4882 resultobj = SWIG_From_long_SS_long(
static_cast< long long >(result));
4890 PyObject *resultobj = 0;
4894 PyObject *swig_obj[1] ;
4905 resultobj = SWIG_From_long_SS_long(
static_cast< long long >(result));
4913 PyObject *resultobj = 0;
4917 PyObject *swig_obj[1] ;
4924 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ComputeExactConditionNumber" "', argument " "1"" of type '" "operations_research::MPSolver const *""'");
4936 PyObject *resultobj = 0;
4940 PyObject *swig_obj[1] ;
4959 PyObject *resultobj = 0;
4966 PyObject *swig_obj[2] ;
4974 ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2);
4978 arg2 =
static_cast< int64_t
>(val2);
4979 (arg1)->set_time_limit(arg2);
4988 PyObject *resultobj = 0;
4992 PyObject *swig_obj[1] ;
5003 resultobj = SWIG_From_long_SS_long(
static_cast< long long >(result));
5011 PyObject *resultobj = 0;
5016 PyObject *swig_obj[2] ;
5027 PyObject*
const pyresult = PyObject_CallMethod(
5028 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
5029 if (pyresult !=
nullptr) {
5030 char* buffer =
nullptr;
5031 Py_ssize_t length = 0;
5032 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5033 if (buffer !=
nullptr) {
5034 arg2->ParseFromArray(buffer, length);
5036 Py_DECREF(pyresult);
5054 PyObject *resultobj = 0;
5059 PyObject *swig_obj[2] ;
5065 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadModelFromProtoWithUniqueNamesOrDie" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5070 PyObject*
const pyresult = PyObject_CallMethod(
5071 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
5072 if (pyresult !=
nullptr) {
5073 char* buffer =
nullptr;
5074 Py_ssize_t length = 0;
5075 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5076 if (buffer !=
nullptr) {
5077 arg2->ParseFromArray(buffer, length);
5079 Py_DECREF(pyresult);
5097 PyObject *resultobj = 0;
5107 if ((nobjs < 3) || (nobjs > 3))
SWIG_fail;
5110 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5115 PyObject*
const pyresult = PyObject_CallMethod(
5116 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
5117 if (pyresult !=
nullptr) {
5118 char* buffer =
nullptr;
5119 Py_ssize_t length = 0;
5120 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5121 if (buffer !=
nullptr) {
5122 arg2->ParseFromArray(buffer, length);
5124 Py_DECREF(pyresult);
5131 arg3 =
static_cast< double >(val3);
5147 PyObject *resultobj = 0;
5154 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5157 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_LoadSolutionFromProto" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5162 PyObject*
const pyresult = PyObject_CallMethod(
5163 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
5164 if (pyresult !=
nullptr) {
5165 char* buffer =
nullptr;
5166 Py_ssize_t length = 0;
5167 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
5168 if (buffer !=
nullptr) {
5169 arg2->ParseFromArray(buffer, length);
5171 Py_DECREF(pyresult);
5190 PyObject *argv[4] = {
5204 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
5205 if (module !=
nullptr) {
5206 PyObject*
const dict = PyModule_GetDict(module);
5207 if (dict !=
nullptr) {
5208 PyObject*
const clss = PyDict_GetItemString(dict,
"MPSolutionResponse");
5209 if (clss !=
nullptr) {
5210 if (PyObject_IsInstance(argv[1], clss)) {
5232 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
5233 if (module !=
nullptr) {
5234 PyObject*
const dict = PyModule_GetDict(module);
5235 if (dict !=
nullptr) {
5236 PyObject*
const clss = PyDict_GetItemString(dict,
"MPSolutionResponse");
5237 if (clss !=
nullptr) {
5238 if (PyObject_IsInstance(argv[1], clss)) {
5261 " Possible C/C++ prototypes are:\n"
5262 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &,double)\n"
5263 " operations_research::MPSolver::LoadSolutionFromProto(operations_research::MPSolutionResponse const &)\n");
5269 PyObject *resultobj = 0;
5276 PyObject *swig_obj[2] ;
5282 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelAsLpFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5289 arg2 =
static_cast< bool >(val2);
5299 PyObject *resultobj = 0;
5309 PyObject *swig_obj[3] ;
5315 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Solver_ExportModelAsMpsFormat" "', argument " "1"" of type '" "operations_research::MPSolver *""'");
5322 arg2 =
static_cast< bool >(val2);
5327 arg3 =
static_cast< bool >(val3);
5337 PyObject *resultobj = 0;
5339 std::vector< operations_research::MPVariable * > *arg2 = 0 ;
5340 std::vector< double > *arg3 = 0 ;
5343 std::vector< operations_research::MPVariable * > temp2 ;
5344 std::vector< double > temp3 ;
5345 PyObject *swig_obj[3] ;
5354 if (!vector_input_helper(swig_obj[1], &temp2, PyObjAs<operations_research::MPVariable*>)) {
5355 if (!PyErr_Occurred())
5362 if (!vector_input_helper(swig_obj[2], &temp3, PyObjAs<double>)) {
5363 if (!PyErr_Occurred())
5378 PyObject *resultobj = 0;
5385 PyObject *swig_obj[2] ;
5398 arg2 =
static_cast< int >(val2);
5408 PyObject *resultobj = 0;
5421 PyObject *resultobj = 0;
5428 PyObject *swig_obj[2] ;
5436 ecode2 = SWIG_AsVal_long_SS_long(swig_obj[1], &val2);
5440 arg2 =
static_cast< int64_t
>(val2);
5450 PyObject *resultobj = 0;
5454 PyObject *swig_obj[1] ;
5465 resultobj = SWIG_From_long_SS_long(
static_cast< long long >(result));
5473 PyObject *resultobj = 0;
5477 PyObject *swig_obj[1] ;
5488 resultobj = SWIG_From_long_SS_long(
static_cast< long long >(result));
5507 PyObject *resultobj = 0;
5508 std::ostream *arg1 = 0 ;
5514 std::ostream *result = 0 ;
5516 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5524 arg1 =
reinterpret_cast< std::ostream *
>(argp1);
5527 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "__lshift__" "', argument " "2"" of type '" "operations_research::MPSolver::OptimizationProblemType""'");
5530 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5535 Py_INCREF(Py_NotImplemented);
5536 return Py_NotImplemented;
5541 PyObject *resultobj = 0;
5542 std::ostream *arg1 = 0 ;
5548 std::ostream *result = 0 ;
5550 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
5558 arg1 =
reinterpret_cast< std::ostream *
>(argp1);
5564 result = (std::ostream *) &operations_research::operator <<(*arg1,arg2);
5569 Py_INCREF(Py_NotImplemented);
5570 return Py_NotImplemented;
5576 PyObject *argv[3] = {
5614 Py_INCREF(Py_NotImplemented);
5615 return Py_NotImplemented;
5620 PyObject *resultobj = 0;
5624 PyObject *swig_obj[1] ;
5642 PyObject *resultobj = 0;
5650 PyObject *swig_obj[3] ;
5665 arg3 =
static_cast< double >(val3);
5675 PyObject *resultobj = 0;
5680 PyObject *swig_obj[2] ;
5686 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5701 PyObject *resultobj = 0;
5708 PyObject *swig_obj[2] ;
5720 arg2 =
static_cast< double >(val2);
5721 (arg1)->SetOffset(arg2);
5730 PyObject *resultobj = 0;
5734 PyObject *swig_obj[1] ;
5753 PyObject *resultobj = 0;
5760 PyObject *swig_obj[2] ;
5765 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetOptimizationDirection" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5772 arg2 =
static_cast< bool >(val2);
5773 (arg1)->SetOptimizationDirection(arg2);
5782 PyObject *resultobj = 0;
5786 PyObject *swig_obj[1] ;
5792 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetMinimization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5795 (arg1)->SetMinimization();
5804 PyObject *resultobj = 0;
5808 PyObject *swig_obj[1] ;
5814 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_SetMaximization" "', argument " "1"" of type '" "operations_research::MPObjective *""'");
5817 (arg1)->SetMaximization();
5826 PyObject *resultobj = 0;
5830 PyObject *swig_obj[1] ;
5837 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_maximization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5849 PyObject *resultobj = 0;
5853 PyObject *swig_obj[1] ;
5860 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_minimization" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5872 PyObject *resultobj = 0;
5876 PyObject *swig_obj[1] ;
5895 PyObject *resultobj = 0;
5899 PyObject *swig_obj[1] ;
5906 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Objective_BestBound" "', argument " "1"" of type '" "operations_research::MPObjective const *""'");
5918 PyObject *resultobj = 0;
5922 PyObject *swig_obj[1] ;
5941 PyObject *resultobj = 0;
5945 PyObject *swig_obj[1] ;
5970 PyObject *resultobj = 0;
5974 PyObject *swig_obj[1] ;
5975 std::string *result = 0 ;
5993 PyObject *resultobj = 0;
6000 PyObject *swig_obj[2] ;
6012 arg2 =
static_cast< bool >(val2);
6013 (arg1)->SetInteger(arg2);
6022 PyObject *resultobj = 0;
6026 PyObject *swig_obj[1] ;
6045 PyObject *resultobj = 0;
6049 PyObject *swig_obj[1] ;
6056 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_solution_value" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6068 PyObject *resultobj = 0;
6072 PyObject *swig_obj[1] ;
6091 PyObject *resultobj = 0;
6095 PyObject *swig_obj[1] ;
6114 PyObject *resultobj = 0;
6118 PyObject *swig_obj[1] ;
6137 PyObject *resultobj = 0;
6147 PyObject *swig_obj[3] ;
6159 arg2 =
static_cast< double >(val2);
6164 arg3 =
static_cast< double >(val3);
6165 (arg1)->SetBounds(arg2,arg3);
6174 PyObject *resultobj = 0;
6178 PyObject *swig_obj[1] ;
6185 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_reduced_cost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6197 PyObject *resultobj = 0;
6201 PyObject *swig_obj[1] ;
6208 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_basis_status" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6220 PyObject *resultobj = 0;
6224 PyObject *swig_obj[1] ;
6231 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_branching_priority" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6243 PyObject *resultobj = 0;
6250 PyObject *swig_obj[2] ;
6255 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_SetBranchingPriority" "', argument " "1"" of type '" "operations_research::MPVariable *""'");
6262 arg2 =
static_cast< int >(val2);
6263 (arg1)->SetBranchingPriority(arg2);
6272 PyObject *resultobj = 0;
6276 PyObject *swig_obj[1] ;
6295 PyObject *resultobj = 0;
6299 PyObject *swig_obj[1] ;
6318 PyObject *resultobj = 0;
6322 PyObject *swig_obj[1] ;
6329 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_SolutionValue" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6341 PyObject *resultobj = 0;
6345 PyObject *swig_obj[1] ;
6364 PyObject *resultobj = 0;
6368 PyObject *swig_obj[1] ;
6387 PyObject *resultobj = 0;
6391 PyObject *swig_obj[1] ;
6410 PyObject *resultobj = 0;
6417 PyObject *swig_obj[2] ;
6429 arg2 =
static_cast< double >(val2);
6439 PyObject *resultobj = 0;
6446 PyObject *swig_obj[2] ;
6458 arg2 =
static_cast< double >(val2);
6468 PyObject *resultobj = 0;
6472 PyObject *swig_obj[1] ;
6479 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Variable_ReducedCost" "', argument " "1"" of type '" "operations_research::MPVariable const *""'");
6491 PyObject *resultobj = 0;
6495 PyObject *swig_obj[1] ;
6520 PyObject *resultobj = 0;
6524 PyObject *swig_obj[1] ;
6525 std::string *result = 0 ;
6543 PyObject *resultobj = 0;
6547 PyObject *swig_obj[1] ;
6565 PyObject *resultobj = 0;
6573 PyObject *swig_obj[3] ;
6578 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_SetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint *""'");
6588 arg3 =
static_cast< double >(val3);
6598 PyObject *resultobj = 0;
6603 PyObject *swig_obj[2] ;
6609 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_GetCoefficient" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6624 PyObject *resultobj = 0;
6628 PyObject *swig_obj[1] ;
6647 PyObject *resultobj = 0;
6651 PyObject *swig_obj[1] ;
6670 PyObject *resultobj = 0;
6680 PyObject *swig_obj[3] ;
6692 arg2 =
static_cast< double >(val2);
6697 arg3 =
static_cast< double >(val3);
6698 (arg1)->SetBounds(arg2,arg3);
6707 PyObject *resultobj = 0;
6714 PyObject *swig_obj[2] ;
6726 arg2 =
static_cast< bool >(val2);
6727 (arg1)->set_is_lazy(arg2);
6736 PyObject *resultobj = 0;
6740 PyObject *swig_obj[1] ;
6759 PyObject *resultobj = 0;
6763 PyObject *swig_obj[1] ;
6770 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_dual_value" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6782 PyObject *resultobj = 0;
6786 PyObject *swig_obj[1] ;
6793 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_basis_status" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6805 PyObject *resultobj = 0;
6809 PyObject *swig_obj[1] ;
6828 PyObject *resultobj = 0;
6832 PyObject *swig_obj[1] ;
6851 PyObject *resultobj = 0;
6858 PyObject *swig_obj[2] ;
6870 arg2 =
static_cast< double >(val2);
6880 PyObject *resultobj = 0;
6887 PyObject *swig_obj[2] ;
6899 arg2 =
static_cast< double >(val2);
6909 PyObject *resultobj = 0;
6913 PyObject *swig_obj[1] ;
6920 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "Constraint_DualValue" "', argument " "1"" of type '" "operations_research::MPConstraint const *""'");
6932 PyObject *resultobj = 0;
6936 PyObject *swig_obj[1] ;
6967 PyObject *pyobj = 0;
6981 PyObject *pyobj = 0;
6995 PyObject *pyobj = 0;
7009 PyObject *pyobj = 0;
7023 PyObject *pyobj = 0;
7031 PyObject *resultobj = 0;
7044 PyObject *resultobj = 0;
7054 PyObject *swig_obj[3] ;
7059 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_SetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7064 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_SetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7071 arg3 =
static_cast< double >(val3);
7072 (arg1)->SetDoubleParam(arg2,arg3);
7081 PyObject *resultobj = 0;
7091 PyObject *swig_obj[3] ;
7096 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_SetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7101 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_SetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7108 arg3 =
static_cast< int >(val3);
7109 (arg1)->SetIntegerParam(arg2,arg3);
7118 PyObject *resultobj = 0;
7125 PyObject *swig_obj[2] ;
7131 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_GetDoubleParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7136 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_GetDoubleParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::DoubleParam""'");
7148 PyObject *resultobj = 0;
7155 PyObject *swig_obj[2] ;
7161 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "MPSolverParameters_GetIntegerParam" "', argument " "1"" of type '" "operations_research::MPSolverParameters const *""'");
7166 SWIG_exception_fail(
SWIG_ArgError(ecode2),
"in method '" "MPSolverParameters_GetIntegerParam" "', argument " "2"" of type '" "operations_research::MPSolverParameters::IntegerParam""'");
7178 PyObject *resultobj = 0;
7182 PyObject *swig_obj[1] ;
7188 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_MPSolverParameters" "', argument " "1"" of type '" "operations_research::MPSolverParameters *""'");
7211 PyObject *resultobj = 0;
7224 PyObject *resultobj = 0;
7228 PyObject *swig_obj[1] ;
7234 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_ModelExportOptions" "', argument " "1"" of type '" "operations_research::MPModelExportOptions *""'");
7257 PyObject *resultobj = 0;
7264 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
7267 PyObject*
const pyresult = PyObject_CallMethod(
7268 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
7269 if (pyresult !=
nullptr) {
7270 char* buffer =
nullptr;
7271 Py_ssize_t length = 0;
7272 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7273 if (buffer !=
nullptr) {
7274 arg1->ParseFromArray(buffer, length);
7276 Py_DECREF(pyresult);
7281 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7284 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "ExportModelAsLpFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7302 PyObject *resultobj = 0;
7306 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
7309 PyObject*
const pyresult = PyObject_CallMethod(
7310 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
7311 if (pyresult !=
nullptr) {
7312 char* buffer =
nullptr;
7313 Py_ssize_t length = 0;
7314 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7315 if (buffer !=
nullptr) {
7316 arg1->ParseFromArray(buffer, length);
7318 Py_DECREF(pyresult);
7337 PyObject *argv[3] = {
7347 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
7348 if (module !=
nullptr) {
7349 PyObject*
const dict = PyModule_GetDict(module);
7350 if (dict !=
nullptr) {
7351 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelProto");
7352 if (clss !=
nullptr) {
7353 if (PyObject_IsInstance(argv[0], clss)) {
7370 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
7371 if (module !=
nullptr) {
7372 PyObject*
const dict = PyModule_GetDict(module);
7373 if (dict !=
nullptr) {
7374 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelProto");
7375 if (clss !=
nullptr) {
7376 if (PyObject_IsInstance(argv[0], clss)) {
7396 " Possible C/C++ prototypes are:\n"
7397 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7398 " operations_research::ExportModelAsLpFormatReturnString(operations_research::MPModelProto const &)\n");
7404 PyObject *resultobj = 0;
7411 if ((nobjs < 2) || (nobjs > 2))
SWIG_fail;
7414 PyObject*
const pyresult = PyObject_CallMethod(
7415 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
7416 if (pyresult !=
nullptr) {
7417 char* buffer =
nullptr;
7418 Py_ssize_t length = 0;
7419 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7420 if (buffer !=
nullptr) {
7421 arg1->ParseFromArray(buffer, length);
7423 Py_DECREF(pyresult);
7428 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7431 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "ExportModelAsMpsFormat" "', argument " "2"" of type '" "operations_research::MPModelExportOptions const &""'");
7449 PyObject *resultobj = 0;
7453 if ((nobjs < 1) || (nobjs > 1))
SWIG_fail;
7456 PyObject*
const pyresult = PyObject_CallMethod(
7457 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
7458 if (pyresult !=
nullptr) {
7459 char* buffer =
nullptr;
7460 Py_ssize_t length = 0;
7461 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7462 if (buffer !=
nullptr) {
7463 arg1->ParseFromArray(buffer, length);
7465 Py_DECREF(pyresult);
7484 PyObject *argv[3] = {
7494 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
7495 if (module !=
nullptr) {
7496 PyObject*
const dict = PyModule_GetDict(module);
7497 if (dict !=
nullptr) {
7498 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelProto");
7499 if (clss !=
nullptr) {
7500 if (PyObject_IsInstance(argv[0], clss)) {
7517 PyObject*
const module = PyImport_ImportModule(
"ortools.linear_solver.linear_solver_pb2");
7518 if (module !=
nullptr) {
7519 PyObject*
const dict = PyModule_GetDict(module);
7520 if (dict !=
nullptr) {
7521 PyObject*
const clss = PyDict_GetItemString(dict,
"MPModelProto");
7522 if (clss !=
nullptr) {
7523 if (PyObject_IsInstance(argv[0], clss)) {
7543 " Possible C/C++ prototypes are:\n"
7544 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &,operations_research::MPModelExportOptions const &)\n"
7545 " operations_research::ExportModelAsMpsFormatReturnString(operations_research::MPModelProto const &)\n");
7551 PyObject *resultobj = 0;
7553 PyObject *swig_obj[1] ;
7560 PyObject*
const pyresult = PyObject_CallMethod(
7561 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
7562 if (pyresult !=
nullptr) {
7563 char* buffer =
nullptr;
7564 Py_ssize_t length = 0;
7565 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
7566 if (buffer !=
nullptr) {
7567 arg1->ParseFromArray(buffer, length);
7569 Py_DECREF(pyresult);
7588 {
"new_Solver",
_wrap_new_Solver, METH_VARARGS,
" Create a solver with the given name and underlying solver backend."},
7591 "Recommended factory method to create a MPSolver instance, especially in\n"
7592 "non C++ languages.\n"
7594 "It returns a newly created solver instance if successful, or a nullptr\n"
7595 "otherwise. This can occur if the relevant interface is not linked in, or if\n"
7596 "a needed license is not accessible for commercial solvers.\n"
7598 "Ownership of the solver is passed on to the caller of this method.\n"
7599 "It will accept both string names of the OptimizationProblemType enum, as\n"
7600 "well as a short version (i.e. \"SCIP_MIXED_INTEGER_PROGRAMMING\" or \"SCIP\").\n"
7602 "solver_id is case insensitive, and the following names are supported:\n"
7603 " - CLP_LINEAR_PROGRAMMING or CLP\n"
7604 " - CBC_MIXED_INTEGER_PROGRAMMING or CBC\n"
7605 " - GLOP_LINEAR_PROGRAMMING or GLOP\n"
7606 " - BOP_INTEGER_PROGRAMMING or BOP\n"
7607 " - SAT_INTEGER_PROGRAMMING or SAT or CP_SAT\n"
7608 " - SCIP_MIXED_INTEGER_PROGRAMMING or SCIP\n"
7609 " - GUROBI_LINEAR_PROGRAMMING or GUROBI_LP\n"
7610 " - GUROBI_MIXED_INTEGER_PROGRAMMING or GUROBI or GUROBI_MIP\n"
7611 " - CPLEX_LINEAR_PROGRAMMING or CPLEX_LP\n"
7612 " - CPLEX_MIXED_INTEGER_PROGRAMMING or CPLEX or CPLEX_MIP\n"
7613 " - XPRESS_LINEAR_PROGRAMMING or XPRESS_LP\n"
7614 " - XPRESS_MIXED_INTEGER_PROGRAMMING or XPRESS or XPRESS_MIP\n"
7615 " - GLPK_LINEAR_PROGRAMMING or GLPK_LP\n"
7616 " - GLPK_MIXED_INTEGER_PROGRAMMING or GLPK or GLPK_MIP\n"
7619 "Whether the given problem type is supported (this will depend on the\n"
7620 "targets that you linked).\n"
7623 "Clears the objective (including the optimization direction), all variables\n"
7624 "and constraints. All the other properties of the MPSolver (like the time\n"
7625 "limit) are kept untouched.\n"
7629 "Returns the array of variables handled by the MPSolver. (They are listed in\n"
7630 "the order in which they were created.)\n"
7632 {
"Solver_variable",
_wrap_Solver_variable, METH_VARARGS,
"Returns the variable at position index."},
7634 "Looks up a variable by name, and returns nullptr if it does not exist. The\n"
7635 "first call has a O(n) complexity, as the variable name index is lazily\n"
7636 "created upon first use. Will crash if variable names are not unique.\n"
7639 "Creates a variable with the given bounds, integrality requirement and\n"
7640 "name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns\n"
7641 "the variable (i.e. the returned pointer is borrowed). Variable names are\n"
7642 "optional. If you give an empty name, name() will auto-generate one for you\n"
7650 "Returns the array of constraints handled by the MPSolver.\n"
7652 "They are listed in the order in which they were created.\n"
7656 " Looks up a constraint by name, and returns nullptr if it does not exist.\n"
7658 "The first call has a O(n) complexity, as the constraint name index is\n"
7659 "lazily created upon first use. Will crash if constraint names are not\n"
7665 "Creates a linear constraint with given bounds.\n"
7667 "Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class\n"
7668 "assumes ownership of the constraint.\n"
7670 ":rtype: :py:class:`MPConstraint`\n"
7671 ":return: a pointer to the newly created constraint.\n"
7676 " Creates a constraint with -infinity and +infinity bounds.\n"
7681 " Creates a named constraint with given bounds.\n"
7686 " Creates a named constraint with -infinity and +infinity bounds.\n"
7691 "Solves the problem using the default parameter values.\n"
7696 "Solves the problem using the specified parameter values.\n"
7699 "Advanced usage: compute the \"activities\" of all constraints, which are the\n"
7700 "sums of their linear terms. The activities are returned in the same order\n"
7701 "as constraints(), which is the order in which constraints were added; but\n"
7702 "you can also use MPConstraint::index() to get a constraint's index.\n"
7705 "Advanced usage: Verifies the *correctness* of the solution.\n"
7707 "It verifies that all variables must be within their domains, all\n"
7708 "constraints must be satisfied, and the reported objective value must be\n"
7712 "- This can only be called after Solve() was called.\n"
7713 "- \"tolerance\" is interpreted as an absolute error threshold.\n"
7714 "- For the objective value only, if the absolute error is too large,\n"
7715 " the tolerance is interpreted as a relative error threshold instead.\n"
7716 "- If \"log_errors\" is true, every single violation will be logged.\n"
7717 "- If \"tolerance\" is negative, it will be set to infinity().\n"
7719 "Most users should just set the --verify_solution flag and not bother using\n"
7720 "this method directly.\n"
7723 " Interrupts the Solve() execution to terminate processing if possible.\n"
7725 "If the underlying interface supports interruption; it does that and returns\n"
7726 "true regardless of whether there's an ongoing Solve() or not. The Solve()\n"
7727 "call may still linger for a while depending on the conditions. If\n"
7728 "interruption is not supported; returns false and does nothing.\n"
7729 "MPSolver::SolverTypeSupportsInterruption can be used to check if\n"
7730 "interruption is supported for a given solver type.\n"
7734 "Solves the model encoded by a MPModelRequest protocol buffer and fills the\n"
7735 "solution encoded as a MPSolutionResponse. The solve is stopped prematurely\n"
7736 "if interrupt is non-null at set to true during (or before) solving.\n"
7737 "Interruption is only supported if SolverTypeSupportsInterruption() returns\n"
7738 "true for the requested solver. Passing a non-null interruption with any\n"
7739 "other solver type immediately returns an MPSOLVER_INCOMPATIBLE_OPTIONS\n"
7742 "Note(user): This attempts to first use `DirectlySolveProto()` (if\n"
7743 "implemented). Consequently, this most likely does *not* override any of\n"
7744 "the default parameters of the underlying solver. This behavior *differs*\n"
7745 "from `MPSolver::Solve()` which by default sets the feasibility tolerance\n"
7746 "and the gap limit (as of 2020/02/11, to 1e-7 and 0.0001, respectively).\n"
7750 "Advanced usage: pass solver specific parameters in text format.\n"
7752 "The format is solver-specific and is the same as the corresponding solver\n"
7753 "configuration file format. Returns true if the operation was successful.\n"
7758 "You can use -MPSolver::infinity() for negative infinity.\n"
7764 "Returns the number of branch-and-bound nodes evaluated during the solve.\n"
7766 "Only available for discrete problems.\n"
7769 " Advanced usage: computes the exact condition number of the current scaled\n"
7770 "basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.\n"
7772 "This method requires that a basis exists: it should be called after Solve.\n"
7773 "It is only available for continuous problems. It is implemented for GLPK\n"
7774 "but not CLP because CLP does not provide the API for doing it.\n"
7776 "The condition number measures how well the constraint matrix is conditioned\n"
7777 "and can be used to predict whether numerical issues will arise during the\n"
7778 "solve: the model is declared infeasible whereas it is feasible (or\n"
7779 "vice-versa), the solution obtained is not optimal or violates some\n"
7780 "constraints, the resolution is slow because of repeated singularities.\n"
7782 "The rule of thumb to interpret the condition number kappa is:\n"
7783 " - o kappa <= 1e7: virtually no chance of numerical issues\n"
7784 " - o 1e7 < kappa <= 1e10: small chance of numerical issues\n"
7785 " - o 1e10 < kappa <= 1e13: medium chance of numerical issues\n"
7786 " - o kappa > 1e13: high chance of numerical issues\n"
7788 "The computation of the condition number depends on the quality of the LU\n"
7789 "decomposition, so it is not very accurate when the matrix is ill\n"
7793 "Some solvers (MIP only, not LP) can produce multiple solutions to the\n"
7794 "problem. Returns true when another solution is available, and updates the\n"
7795 "MPVariable* objects to make the new solution queryable. Call only after\n"
7798 "The optimality properties of the additional solutions found, and whether or\n"
7799 "not the solver computes them ahead of time or when NextSolution() is called\n"
7800 "is solver specific.\n"
7802 "As of 2020-02-10, only Gurobi and SCIP support NextSolution(), see\n"
7803 "linear_solver_interfaces_test for an example of how to configure these\n"
7804 "solvers for multiple solutions. Other solvers return false unconditionally.\n"
7814 "Set a hint for solution.\n"
7816 "If a feasible or almost-feasible solution to the problem is already known,\n"
7817 "it may be helpful to pass it to the solver so that it can be used. A\n"
7818 "solver that supports this feature will try to use this information to\n"
7819 "create its initial feasible solution.\n"
7821 "Note that it may not always be faster to give a hint like this to the\n"
7822 "solver. There is also no guarantee that the solver will use this hint or\n"
7823 "try to return a solution \"close\" to this assignment in case of multiple\n"
7824 "optimal solutions.\n"
7826 {
"Solver_SetNumThreads",
_wrap_Solver_SetNumThreads, METH_VARARGS,
" Sets the number of threads to be used by the solver."},
7835 " Clears the offset, all variables and coefficients, and the optimization\n"
7839 "Sets the coefficient of the variable in the objective.\n"
7841 "If the variable does not belong to the solver, the function just returns,\n"
7842 "or crashes in non-opt mode.\n"
7845 " Gets the coefficient of a given variable in the objective\n"
7847 "It returns 0 if the variable does not appear in the objective).\n"
7857 "Returns the objective value of the best solution found so far.\n"
7859 "It is the optimal objective value if the problem has been solved to\n"
7862 "Note: the objective value may be slightly different than what you could\n"
7863 "compute yourself using ``MPVariable::solution_value();`` please use the\n"
7864 "--verify_solution flag to gain confidence about the numerical stability of\n"
7868 "Returns the best objective bound.\n"
7870 "In case of minimization, it is a lower bound on the objective value of the\n"
7871 "optimal integer solution. Only available for discrete problems.\n"
7877 {
"Variable_SetInteger",
_wrap_Variable_SetInteger, METH_VARARGS,
" Sets the integrality requirement of the variable."},
7878 {
"Variable_integer",
_wrap_Variable_integer, METH_O,
" Returns the integrality requirement of the variable."},
7880 "Returns the value of the variable in the current solution.\n"
7882 "If the variable is integer, then the value will always be an integer (the\n"
7883 "underlying solver handles floating-point values only, but this function\n"
7884 "automatically rounds it to the nearest integer; see: man 3 round).\n"
7886 {
"Variable_index",
_wrap_Variable_index, METH_O,
" Returns the index of the variable in the MPSolver::variables_."},
7891 "Advanced usage: returns the reduced cost of the variable in the current\n"
7892 "solution (only available for continuous problems).\n"
7895 "Advanced usage: returns the basis status of the variable in the current\n"
7896 "solution (only available for continuous problems).\n"
7898 "See also: MPSolver::BasisStatus.\n"
7901 "Advanced usage: Certain MIP solvers (e.g. Gurobi or SCIP) allow you to set\n"
7902 "a per-variable priority for determining which variable to branch on.\n"
7904 "A value of 0 is treated as default, and is equivalent to not setting the\n"
7905 "branching priority. The solver looks first to branch on fractional\n"
7906 "variables in higher priority levels. As of 2019-05, only Gurobi and SCIP\n"
7907 "support setting branching priority; all other solvers will simply ignore\n"
7908 "this annotation.\n"
7923 {
"Constraint_Clear",
_wrap_Constraint_Clear, METH_O,
" Clears all variables and coefficients. Does not clear the bounds."},
7925 "Sets the coefficient of the variable on the constraint.\n"
7927 "If the variable does not belong to the solver, the function just returns,\n"
7928 "or crashes in non-opt mode.\n"
7931 "Gets the coefficient of a given variable on the constraint (which is 0 if\n"
7932 "the variable does not appear in the constraint).\n"
7938 "Advanced usage: sets the constraint \"laziness\".\n"
7940 "**This is only supported for SCIP and has no effect on other\n"
7943 "When **laziness** is true, the constraint is only considered by the Linear\n"
7944 "Programming solver if its current solution violates the constraint. In this\n"
7945 "case, the constraint is definitively added to the problem. This may be\n"
7946 "useful in some MIP problems, and may have a dramatic impact on performance.\n"
7948 "For more info see: http://tinyurl.com/lazy-constraints.\n"
7950 {
"Constraint_index",
_wrap_Constraint_index, METH_O,
" Returns the index of the constraint in the MPSolver::constraints_."},
7952 "Advanced usage: returns the dual value of the constraint in the current\n"
7953 "solution (only available for continuous problems).\n"
7956 "Advanced usage: returns the basis status of the constraint.\n"
7958 "It is only available for continuous problems).\n"
7960 "Note that if a constraint \"linear_expression in [lb, ub]\" is transformed\n"
7961 "into \"linear_expression + slack = 0\" with slack in [-ub, -lb], then this\n"
7962 "status is the same as the status of the slack variable with AT_UPPER_BOUND\n"
7963 "and AT_LOWER_BOUND swapped.\n"
7965 "See also: MPSolver::BasisStatus.\n"
7974 {
"new_MPSolverParameters",
_wrap_new_MPSolverParameters, METH_NOARGS,
" The constructor sets all parameters to their default value."},
7989 { NULL, NULL, 0, NULL }
7993 { NULL, NULL, 0, NULL }
8079{0, 0, 0, 0.0, 0, 0}};
8133#define SWIGRUNTIME_DEBUG
8169 }
while (iter!= module_head);
8180 if (init == 0)
return;
8183#ifdef SWIGRUNTIME_DEBUG
8184 printf(
"SWIG_InitializeModule: size %lu\n", (
unsigned long)
swig_module.
size);
8191#ifdef SWIGRUNTIME_DEBUG
8201#ifdef SWIGRUNTIME_DEBUG
8202 printf(
"SWIG_InitializeModule: found type %s\n", type->
name);
8206#ifdef SWIGRUNTIME_DEBUG
8207 printf(
"SWIG_InitializeModule: found and overwrite type %s \n", type->
name);
8216 while (cast->
type) {
8219#ifdef SWIGRUNTIME_DEBUG
8220 printf(
"SWIG_InitializeModule: look cast %s\n", cast->
type->
name);
8224#ifdef SWIGRUNTIME_DEBUG
8225 if (ret) printf(
"SWIG_InitializeModule: found cast %s\n", ret->
name);
8230#ifdef SWIGRUNTIME_DEBUG
8231 printf(
"SWIG_InitializeModule: skip old type %s\n", ret->
name);
8238#ifdef SWIGRUNTIME_DEBUG
8239 if (ocast) printf(
"SWIG_InitializeModule: skip old cast %s\n", ret->
name);
8241 if (!ocast) ret = 0;
8246#ifdef SWIGRUNTIME_DEBUG
8247 printf(
"SWIG_InitializeModule: adding cast %s\n", cast->
type->
name);
8262#ifdef SWIGRUNTIME_DEBUG
8263 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
8268 while (cast->
type) {
8269 printf(
"SWIG_InitializeModule: cast type %s\n", cast->
type->
name);
8273 printf(
"---- Total casts: %d\n",j);
8275 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
8288 static int init_run = 0;
8290 if (init_run)
return;
8301 equiv = equiv->
next;
8322#define SWIG_newvarlink() SWIG_Python_newvarlink()
8323#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
8324#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
8332 PyObject *(*get_attr)(void);
8344#if PY_VERSION_HEX >= 0x03000000
8345 return PyUnicode_InternFromString(
"<Swig global variables>");
8347 return PyString_FromString(
"<Swig global variables>");
8353#if PY_VERSION_HEX >= 0x03000000
8354 PyObject *str = PyUnicode_InternFromString(
"(");
8359 tail = PyUnicode_FromString(
var->name);
8360 joined = PyUnicode_Concat(str,
tail);
8365 tail = PyUnicode_InternFromString(
", ");
8366 joined = PyUnicode_Concat(str,
tail);
8372 tail = PyUnicode_InternFromString(
")");
8373 joined = PyUnicode_Concat(str,
tail);
8378 PyObject *str = PyString_FromString(
"(");
8381 PyString_ConcatAndDel(&str,PyString_FromString(
var->name));
8382 if (
var->next) PyString_ConcatAndDel(&str,PyString_FromString(
", "));
8384 PyString_ConcatAndDel(&str,PyString_FromString(
")"));
8402 PyObject *res = NULL;
8405 if (strcmp(
var->name,n) == 0) {
8406 res = (*
var->get_attr)();
8411 if (res == NULL && !PyErr_Occurred()) {
8412 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
8422 if (strcmp(
var->name,n) == 0) {
8423 res = (*
var->set_attr)(p);
8428 if (res == 1 && !PyErr_Occurred()) {
8429 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
8436 static char varlink__doc__[] =
"Swig var link object";
8437 static PyTypeObject varlink_type;
8438 static int type_init = 0;
8440 const PyTypeObject tmp = {
8441#if PY_VERSION_HEX >= 0x03000000
8442 PyVarObject_HEAD_INIT(NULL, 0)
8444 PyObject_HEAD_INIT(NULL)
8471 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
8474#if PY_VERSION_HEX >= 0x03040000
8477#if PY_VERSION_HEX >= 0x03080000
8480#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
8493 if (PyType_Ready(&varlink_type) < 0)
8496 return &varlink_type;
8506 return ((PyObject*) result);
8514 size_t size = strlen(
name)+1;
8528 static PyObject *globals = 0;
8544 for (i = 0; constants[i].
type; ++i) {
8545 switch(constants[i].type) {
8550 obj =
SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
8557 PyDict_SetItemString(d, constants[i].
name, obj);
8573 for (i = 0; methods[i].ml_name; ++i) {
8574 const char *c = methods[i].ml_doc;
8576 c = strstr(c,
"swig_ptr: ");
8580 const char *
name = c + 10;
8581 for (j = 0; const_table[j].
type; ++j) {
8582 if (strncmp(const_table[j].
name,
name,
8583 strlen(const_table[j].
name)) == 0) {
8584 ci = &(const_table[j]);
8591 size_t shift = (ci->
ptype) - types;
8593 size_t ldoc = (c - methods[i].ml_doc);
8594 size_t lptr = strlen(ty->
name)+2*
sizeof(
void*)+2;
8595 char *ndoc = (
char*)
malloc(ldoc + lptr + 10);
8598 memcpy(buff, methods[i].ml_doc, ldoc);
8600 memcpy(buff,
"swig_ptr: ", 10);
8603 methods[i].ml_doc = ndoc;
8641 if (PyCFunction_Check(func)) {
8642 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8645 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8647#if PY_VERSION_HEX >= 0x03000000
8648 return PyInstanceMethod_New(func);
8650 return PyMethod_New(func, NULL, NULL);
8660 if (PyCFunction_Check(func)) {
8661 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
8664 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
8666 return PyStaticMethod_New(func);
8682#if PY_VERSION_HEX >= 0x03000000
8688 PyObject *m, *d, *md, *globals;
8690#if PY_VERSION_HEX >= 0x03000000
8691 static struct PyModuleDef SWIG_module = {
8692 PyModuleDef_HEAD_INIT,
8704#if defined(SWIGPYTHON_BUILTIN)
8708 static PyGetSetDef this_getset_def = {
8709 (
char *)
"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
8711 static SwigPyGetSet thisown_getset_closure = {
8715 static PyGetSetDef thisown_getset_def = {
8716 (
char *)
"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
8718 PyTypeObject *builtin_pytype;
8719 int builtin_base_count;
8722 PyGetSetDescrObject *static_getset;
8723 PyTypeObject *metatype;
8724 PyTypeObject *swigpyobject;
8726 PyObject *public_interface, *public_symbol;
8727 PyObject *this_descr;
8728 PyObject *thisown_descr;
8732 (void)builtin_pytype;
8733 (void)builtin_base_count;
8734 (void)builtin_basetype;
8736 (void)static_getset;
8740 metatype = SwigPyObjectType();
8750#ifndef SWIGPYTHON_BUILTIN
8757#if PY_VERSION_HEX >= 0x03000000
8758 m = PyModule_Create(&SWIG_module);
8763 md = d = PyModule_GetDict(m);
8768#ifdef SWIGPYTHON_BUILTIN
8772 assert(SwigPyObject_stype);
8775 SwigPyObject_stype->
clientdata = &SwigPyObject_clientdata;
8776 SwigPyObject_clientdata.
pytype = swigpyobject;
8777 }
else if (swigpyobject->tp_basicsize != cd->
pytype->tp_basicsize) {
8778 PyErr_SetString(PyExc_RuntimeError,
"Import error: attempted to load two incompatible swig-generated modules.");
8779# if PY_VERSION_HEX >= 0x03000000
8792 (void)thisown_descr;
8794 public_interface = PyList_New(0);
8796 (void)public_symbol;
8798 PyDict_SetItemString(md,
"__all__", public_interface);
8799 Py_DECREF(public_interface);
8801 SwigPyBuiltin_AddPublicSymbol(public_interface,
SwigMethods[i].ml_name);
8851 PyErr_SetString(PyExc_TypeError,
"Failure to create SWIG globals.");
8852#if PY_VERSION_HEX >= 0x03000000
8858 PyDict_SetItemString(md,
"cvar", globals);
8865#if PY_VERSION_HEX >= 0x03000000
#define LOG_IF(severity, condition)
The class for constraints of a Mathematical Programming (MP) model.
void SetUB(double ub)
Sets the upper bound.
double ub() const
Returns the upper bound.
double lb() const
Returns the lower bound.
void SetLB(double lb)
Sets the lower bound.
double dual_value() const
Advanced usage: returns the dual value of the constraint in the current solution (only available for ...
A class to express a linear objective.
double offset() const
Gets the constant term in the objective.
This mathematical programming (MP) solver class is the main class though which users build and solve ...
int64_t iterations() const
Returns the number of simplex iterations.
static bool SupportsProblemType(OptimizationProblemType problem_type)
Whether the given problem type is supported (this will depend on the targets that you linked).
static MPSolver * CreateSolver(const std::string &solver_id)
Recommended factory method to create a MPSolver instance, especially in non C++ languages.
void SetHint(std::vector< std::pair< const MPVariable *, double > > hint)
Sets a hint for solution.
ResultStatus
The status of solving the problem.
@ FEASIBLE
feasible, or stopped by limit.
@ NOT_SOLVED
not been solved yet.
@ INFEASIBLE
proven infeasible.
@ UNBOUNDED
proven unbounded.
@ ABNORMAL
abnormal, i.e., error of some kind.
int64_t wall_time() const
void set_time_limit(int64_t time_limit_milliseconds)
OptimizationProblemType
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
@ GLOP_LINEAR_PROGRAMMING
@ CPLEX_MIXED_INTEGER_PROGRAMMING
@ XPRESS_LINEAR_PROGRAMMING
@ GLPK_LINEAR_PROGRAMMING
@ CPLEX_LINEAR_PROGRAMMING
@ GUROBI_LINEAR_PROGRAMMING
@ XPRESS_MIXED_INTEGER_PROGRAMMING
@ GUROBI_MIXED_INTEGER_PROGRAMMING
@ BOP_INTEGER_PROGRAMMING
@ SCIP_MIXED_INTEGER_PROGRAMMING
@ SAT_INTEGER_PROGRAMMING
@ GLPK_MIXED_INTEGER_PROGRAMMING
@ CBC_MIXED_INTEGER_PROGRAMMING
absl::Status LoadSolutionFromProto(const MPSolutionResponse &response, double tolerance=std::numeric_limits< double >::infinity())
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interf...
absl::Status SetNumThreads(int num_threads)
Sets the number of threads to use by the underlying solver.
void ExportModelToProto(MPModelProto *output_model) const
Exports model to protocol buffer.
std::vector< double > ComputeConstraintActivities() const
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms...
static double infinity()
Infinity.
static void SolveWithProto(const MPModelRequest &model_request, MPSolutionResponse *response, std::atomic< bool > *interrupt=nullptr)
Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSo...
MPSolverResponseStatus LoadModelFromProto(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
ABSL_MUST_USE_RESULT bool NextSolution()
Some solvers (MIP only, not LP) can produce multiple solutions to the problem.
bool InterruptSolve()
Interrupts the Solve() execution to terminate processing if possible.
ResultStatus Solve()
Solves the problem using the default parameter values.
MPSolverResponseStatus LoadModelFromProtoWithUniqueNamesOrDie(const MPModelProto &input_model, std::string *error_message)
Loads model from protocol buffer.
BasisStatus
Advanced usage: possible basis status values for a variable and the slack variable of a linear constr...
This class stores parameter settings for LP and MIP solvers.
static const double kDefaultRelativeMipGap
@ INCREMENTALITY_OFF
Start solve from scratch.
@ INCREMENTALITY_ON
Reuse results from previous solve as much as the underlying solver allows.
@ SCALING_ON
Scaling is on.
@ SCALING_OFF
Scaling is off.
static const IncrementalityValues kDefaultIncrementality
DoubleParam
Enumeration of parameters that take continuous values.
@ DUAL_TOLERANCE
Advanced usage: tolerance for dual feasibility of basic solutions.
@ PRIMAL_TOLERANCE
Advanced usage: tolerance for primal feasibility of basic solutions.
@ RELATIVE_MIP_GAP
Limit for relative MIP gap.
static const PresolveValues kDefaultPresolve
static const double kDefaultDualTolerance
IntegerParam
Enumeration of parameters that take integer or categorical values.
@ LP_ALGORITHM
Algorithm to solve linear programs.
@ SCALING
Advanced usage: enable or disable matrix scaling.
@ PRESOLVE
Advanced usage: presolve mode.
@ INCREMENTALITY
Advanced usage: incrementality from one solve to the next.
@ BARRIER
Barrier algorithm.
@ PRESOLVE_ON
Presolve is on.
@ PRESOLVE_OFF
Presolve is off.
static const double kDefaultPrimalTolerance
The class for variables of a Mathematical Programming (MP) model.
const std::string & name() const
Returns the name of the variable.
void SetUB(double ub)
Sets the upper bound.
double ub() const
Returns the upper bound.
double reduced_cost() const
Advanced usage: returns the reduced cost of the variable in the current solution (only available for ...
bool integer() const
Returns the integrality requirement of the variable.
double lb() const
Returns the lower bound.
void SetLB(double lb)
Sets the lower bound.
double solution_value() const
Returns the value of the variable in the current solution.
PyObject * operator->() const
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
SwigPtr_PyObject(const SwigPtr_PyObject &item)
SharedResponseManager * response
A C++ wrapper that provides a simple and unified interface to several linear programming and mixed in...
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
static swig_cast_info _swigc__p_operations_research__MPObjective[]
#define SWIG_Error(code, msg)
SWIGINTERN PyObject * _wrap_Solver_LookupConstraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_From_int(int value)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
PyObject * FromObjectMPConstraint(operations_research::MPConstraint *obj)
SWIGINTERN PyObject * _wrap_Objective_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_ExportModelToProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * _wrap_Variable_solution_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__MPSolverParameters
SWIGINTERN PyObject * _wrap_Variable_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultPrimalTolerance_set(PyObject *)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat(PyObject *self, PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_SetInteger(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
#define SWIG_MangledTypeQuery(name)
SWIGINTERN PyObject * _wrap_delete_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
static swig_type_info _swigt__p_operations_research__MPSolverParameters
SWIGINTERN PyObject * _wrap___lshift____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * Variable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
bool CanConvertToMPConstraint(PyObject *py_obj)
SWIGINTERN PyObject * _wrap_Constraint_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Constraint_Ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_reduced_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_SupportsProblemType(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NumConstraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyObject * Swig_This_global
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGINTERN PyObject * Solver_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_long_long
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
#define SWIG_TypeQuery(name)
static swig_cast_info _swigc__p_operations_research__MPVariable[]
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_EXCEPTION
SWIGINTERN PyObject * _wrap_Solver_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Objective_SetMinimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_CheckState(r)
SWIGINTERN PyObject * _wrap_Solver_nodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__MPConstraint[]
static swig_cast_info _swigc__p_int[]
SWIGINTERN std::string operations_research_MPVariable___repr__(operations_research::MPVariable *self)
static swig_cast_info _swigc__p_std__atomicT_bool_t[]
SWIGINTERN PyObject * _wrap_Variable_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
SWIGINTERN PyObject * _wrap_Solver_SetSolverSpecificParametersAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_VerifySolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN double operations_research_MPSolver_Infinity()
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
SWIGINTERN PyObject * _wrap_Solver_BoolVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * Objective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_LoadModelFromProtoWithUniqueNamesOrDie(operations_research::MPSolver *self, operations_research::MPModelProto const &input_model)
#define SWIGTYPE_p_operations_research__MPSolver
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
#define SWIG_POINTER_IMPLICIT_CONV
SWIGINTERN PyObject * _wrap_Constraint_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_FindErrorInModelProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
struct swig_cast_info swig_cast_info
SWIGINTERN PyObject * _wrap_MPSolverParameters_GetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
SWIGINTERN PyObject * _wrap_Solver_constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__MPConstraint
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
#define SWIG_PYTHON_THREAD_END_BLOCK
SWIGINTERN std::string operations_research_MPSolver_LoadModelFromProto(operations_research::MPSolver *self, operations_research::MPModelProto const &input_model)
SWIGINTERN PyObject * _wrap_Constraint_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPVariable
SWIGINTERN PyObject * _wrap_Solver_LookupVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_RuntimeError
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
SWIGINTERN PyObject * _wrap_delete_Constraint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_varlinkobject swig_varlinkobject
#define SWIG_NewClientData(obj)
SWIGINTERN bool operations_research_MPSolver_LoadSolutionFromProto__SWIG_0(operations_research::MPSolver *self, operations_research::MPSolutionResponse const &response, double tolerance=std::numeric_limits< double >::infinity())
static swig_cast_info _swigc__p_long_long[]
SWIGINTERN PyObject * _wrap_Constraint_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultRelativeMipGap_get(void)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Solver_SuppressOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
bool CanConvertToMPVariable(PyObject *py_obj)
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
static swig_type_info _swigt__p_unsigned_char
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
SWIGINTERN PyObject * _wrap_Objective_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap___lshift____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Objective_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN double operations_research_MPVariable_Lb(operations_research::MPVariable const *self)
static swig_type_info _swigt__p_operations_research__MPModelExportOptions
static swig_type_info _swigt__p_unsigned_long_long
#define SWIG_RUNTIME_VERSION
SWIGINTERN void operations_research_MPVariable_SetLb(operations_research::MPVariable *self, double x)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
SWIGINTERN PyObject * _wrap_Solver_EnableOutput(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_addvarlink(p, name, get_attr, set_attr)
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_POINTER_NOSHADOW
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
static swig_type_info _swigt__p_short
SWIGINTERN PyObject * _wrap_Variable_lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * _wrap_Constraint_set_is_lazy(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static PyMethodDef swigobject_methods[]
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
static swig_cast_info _swigc__p_std__ostream[]
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN PyObject * _wrap_Variable_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_IntVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_exception_fail(code, msg)
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultIncrementality_get(void)
SWIGINTERN PyObject * _wrap_Solver_NumVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int64_t operations_research_MPSolver_WallTime(operations_research::MPSolver const *self)
SWIGINTERN PyObject * _wrap_Solver_ComputeConstraintActivities(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN bool operations_research_MPVariable_Integer(operations_research::MPVariable const *self)
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
#define SWIG_AttributeError
SWIGINTERN PyObject * _wrap_Variable_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
SWIGINTERN PyObject * _wrap_Solver_SetTimeLimit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_module_info swig_module
static swig_cast_info _swigc__p_unsigned_char[]
SWIGINTERN PyObject * _wrap_Solver_wall_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_short[]
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGINTERN PyObject * _wrap_Variable_branching_priority(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
#define SWIG_SetModule(clientdata, pointer)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
#define SWIGUNUSEDPARM(p)
SWIGINTERN PyObject * _wrap_Variable_SetUb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_ExportModelAsLpFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Constraint__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * ModelExportOptions_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPSolver
SWIGINTERN int64_t operations_research_MPSolver_Iterations(operations_research::MPSolver const *self)
SWIGINTERN PyObject * _wrap_Solver_SetHint(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
#define SWIG_as_voidptr(a)
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
static swig_const_info swig_const_table[]
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * _wrap_Solver_ComputeExactConditionNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Constraint_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
SWIGINTERN PyObject * _wrap_Constraint_ub(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NextSolution(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_unsigned_short
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
#define SWIG_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
SWIGINTERN PyObject * _wrap_Solver_infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_const_info swig_const_info
#define SWIGTYPE_p_operations_research__MPModelExportOptions
SWIGINTERN PyObject * _wrap_new_ModelExportOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Objective_SetMaximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Solve(PyObject *self, PyObject *args)
SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name)
SWIGINTERN PyObject * _wrap_Objective_minimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_NumVariables(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_InterruptSolve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__MPSolver[]
void *(* swig_converter_func)(void *, int *)
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Solver_Var(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_new_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__MPObjective
SWIGINTERN PyObject * _wrap_Constraint_SetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
SWIGINTERN PyObject * _wrap_Variable_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
SWIGINTERN PyObject * _wrap_Solver_Solve__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Objective_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
SWIGINTERN PyObject * _wrap_Constraint_basis_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_newvarlink()
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
SWIGINTERN PyObject * _wrap_Solver_SolveWithProto(PyObject *self, PyObject *args)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
SWIGINTERN PyObject * _wrap_Variable___repr__(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
bool PyObjAs(PyObject *py_obj, operations_research::MPConstraint **b)
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_char[]
SWIGINTERN PyObject * _wrap_delete_Objective(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void operations_research_MPSolver_SetHint(operations_research::MPSolver *self, std::vector< operations_research::MPVariable * > const &variables, std::vector< double > const &values)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat(PyObject *self, PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_Integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
SWIGINTERN PyObject * _wrap_Solver_CreateSolver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
#define SWIGTYPE_p_operations_research__MPObjective
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGINTERN PyObject * _wrap_Constraint_Lb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_unsigned_short[]
struct swig_globalvar swig_globalvar
#define SWIGPY_CAPSULE_NAME
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
SWIGINTERN PyObject * _wrap_Constraint_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
#define SWIG_NewPointerObj(ptr, type, flags)
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
#define SWIG_POINTER_NO_NULL
#define SWIG_Python_str_FromFormat
SWIGINTERN PyObject * _wrap_Solver_Constraint(PyObject *self, PyObject *args)
#define SWIG_InstallConstants(d, constants)
SWIGINTERN PyObject * _wrap_Constraint_dual_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_Infinity(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_type_info *(* swig_dycast_func)(void **)
SWIGINTERN PyObject * ModelExportOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultDualTolerance_set(PyObject *)
static swig_type_info _swigt__p_std__ostream
static swig_type_info _swigt__p_operations_research__MPConstraint
static swig_cast_info _swigc__p_operations_research__MPModelExportOptions[]
static swig_cast_info _swigc__p_operations_research__MPSolverParameters[]
static PyMethodDef SwigMethods[]
#define SWIG_NullReferenceError
SWIGINTERN std::string operations_research_MPVariable___str__(operations_research::MPVariable *self)
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGINTERN PyObject * _wrap_new_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_ExportModelAsLpFormat(operations_research::MPSolver *self, bool obfuscated)
#define SWIG_POINTER_DISOWN
#define SWIG_STATIC_POINTER(var)
struct swig_type_info swig_type_info
SWIGINTERN double operations_research_MPVariable_Ub(operations_research::MPVariable const *self)
SWIGINTERN PyObject * _wrap_Solver_Solve__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGINTERN PyObject * _wrap_delete_Solver(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Variable_ReducedCost(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Objective_Value(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
SWIGINTERN PyObject * _wrap_Solver_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_set_time_limit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto(PyObject *self, PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGINTERN PyObject * _wrap_Solver_ExportModelAsMpsFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_delete_MPSolverParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_signed_char
SWIGINTERN PyObject * Solver_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
SWIGINTERN PyObject * _wrap_Objective_BestBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_FillSolutionResponseProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_NewPackedObj(ptr, sz, type)
#define SWIG_GetModule(clientdata)
static swig_cast_info _swigc__p_unsigned_int[]
static swig_type_info _swigt__p_int
SWIGRUNTIME void SWIG_PropagateClientData(void)
static swig_type_info * swig_types[18]
SWIGINTERN PyObject * _wrap_Solver_constraints(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultIncrementality_set(PyObject *)
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
SWIGINTERN PyObject * _wrap_Variable_SetBranchingPriority(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
SWIGINTERN PyObject * _wrap_Constraint_SetBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
static PyMethodDef SwigMethods_proxydocs[]
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultPresolve_set(PyObject *)
SWIGRUNTIME PyObject * SWIG_This(void)
SWIGINTERN PyObject * _wrap_Solver_variables(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultPrimalTolerance_get(void)
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
#define SWIG_TYPE_TABLE_NAME
#define SWIG_BUILTIN_TP_INIT
SWIGINTERN double operations_research_MPVariable_SolutionValue(operations_research::MPVariable const *self)
SWIGINTERN PyObject * _wrap_delete_Variable(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_unsigned_int
#define SWIG_CAST_NEW_MEMORY
SWIGINTERN PyObject * _wrap_Solver_LoadModelFromProtoWithUniqueNamesOrDie(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
SWIGINTERN PyObject * Constraint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
SWIGINTERN PyObject * _wrap_Solver_Clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_module_info swig_module_info
SWIGINTERN PyObject * _wrap_Solver_Iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN bool operations_research_MPSolver_SetNumThreads(operations_research::MPSolver *self, int num_theads)
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
SWIGINTERN int SWIG_AsVal_bool(PyObject *obj, bool *val)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
SWIGINTERN PyObject * _wrap_Variable_SolutionValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
PyObject * FromObjectMPVariable(operations_research::MPVariable *obj)
SWIGINTERN PyObject * _wrap_MPSolverParameters_SetDoubleParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
SWIGINTERN double operations_research_MPConstraint_Ub(operations_research::MPConstraint const *self)
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGINTERN double operations_research_MPObjective_Offset(operations_research::MPObjective const *self)
static swig_type_info * swig_type_initial[]
#define SWIGTYPE_p_std__ostream
SWIGINTERN PyObject * _wrap_Variable___str__(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
static swig_type_info _swigt__p_std__atomicT_bool_t
SWIGINTERN PyObject * _wrap_Objective_maximization(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
SWIGINTERN PyObject * _wrap_Objective_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
SWIGINTERN PyObject * _wrap_Objective_SetOptimizationDirection(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
SWIGINTERN PyObject * MPSolverParameters_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * MPSolverParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_LoadModelFromProto(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_Solver_iterations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_DivisionByZero
SWIGINTERN PyObject * _wrap_Objective_Offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_char
#define SWIGTYPE_p_operations_research__MPVariable
SWIGINTERN PyObject * _wrap___lshift__(PyObject *self, PyObject *args)
SWIGINTERN void operations_research_MPSolver_SetTimeLimit(operations_research::MPSolver *self, int64_t x)
SWIGINTERN PyObject * _wrap_Solver_LoadSolutionFromProto__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Variable_SetLb(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
#define SWIG_OverflowError
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultPresolve_get(void)
SWIGINTERN PyObject * Swig_var_MPSolverParameters_kDefaultDualTolerance_get(void)
static swig_cast_info _swigc__p_unsigned_long_long[]
SWIGINTERN int Swig_var_MPSolverParameters_kDefaultRelativeMipGap_set(PyObject *)
#define SWIGTYPE_p_std__atomicT_bool_t
SWIGINTERN PyObject * _wrap_Constraint_DualValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
SWIGINTERN double operations_research_MPVariable_ReducedCost(operations_research::MPVariable const *self)
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN double operations_research_MPConstraint_Lb(operations_research::MPConstraint const *self)
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SWIGINTERN PyObject * _wrap_ExportModelAsMpsFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
#define SWIG_AddNewMask(r)
SWIGINTERN PyObject * SWIG_globals(void)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGINTERN void operations_research_MPConstraint_SetLb(operations_research::MPConstraint *self, double x)
SWIGINTERN PyObject * _wrap_ExportModelAsLpFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj)
SWIGINTERN PyObject * _wrap_Solver_SetNumThreads(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN std::string operations_research_MPSolver_ExportModelAsMpsFormat(operations_research::MPSolver *self, bool fixed_format, bool obfuscated)
SWIGINTERN void operations_research_MPConstraint_SetUb(operations_research::MPConstraint *self, double x)
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
SWIGINTERN PyObject * _wrap_MPSolverParameters_SetIntegerParam(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_signed_char[]
SWIGINTERN PyObject * _wrap_Constraint_GetCoefficient(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGINTERN void operations_research_MPVariable_SetUb(operations_research::MPVariable *self, double x)
#define SWIGRUNTIMEINLINE
SWIGINTERN double operations_research_MPConstraint_DualValue(operations_research::MPConstraint const *self)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
int NumVariables(const VariablesProto &variables)
int NumConstraints(const LinearConstraintsProto &linear_constraints)
IntegerValue GetCoefficient(const IntegerVariable var, const LinearExpression &expr)
std::function< int64_t(const Model &)> Value(IntegerVariable v)
absl::StatusOr< std::string > ExportModelAsMpsFormat(const MPModelProto &model, const MPModelExportOptions &options)
Outputs the current model (variables, constraints, objective) as a string encoded in MPS file format,...
std::string FindErrorInMPModelProto(const MPModelProto &model, double abs_value_threshold, const bool accept_trivially_infeasible_bounds)
Returns an empty string iff the model is valid and not trivially infeasible.
absl::StatusOr< std::string > ExportModelAsLpFormat(const MPModelProto &model, const MPModelExportOptions &options)
Outputs the current model (variables, constraints, objective) as a string encoded in the so-called "C...
std::optional< int64_t > end
PyObject_HEAD void * pack
bool obfuscate
Obfuscates variable and constraint names.
SwigVar_PyObject(PyObject *obj=0)
SwigVar_PyObject & operator=(PyObject *obj)
struct swig_cast_info * prev
struct swig_cast_info * next
swig_converter_func converter
int(* set_attr)(PyObject *)
struct swig_globalvar * next
PyObject *(* get_attr)(void)
swig_type_info ** type_initial
struct swig_module_info * next
swig_cast_info ** cast_initial
struct swig_cast_info * cast
PyObject_HEAD swig_globalvar * vars