16 #define SWIG_DIRECTORS
17 #define SWIG_PYTHON_THREADS
18 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
23 template<
typename T>
class SwigValueWrapper {
24 struct SwigMovePointer {
26 SwigMovePointer(T *p) : ptr(p) { }
27 ~SwigMovePointer() {
delete ptr; }
28 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0;
delete oldptr; ptr = rhs.ptr; rhs.ptr = 0;
return *
this; }
30 SwigValueWrapper& operator=(
const SwigValueWrapper<T>& rhs);
31 SwigValueWrapper(
const SwigValueWrapper<T>& rhs);
33 SwigValueWrapper() : pointer(0) { }
34 SwigValueWrapper& operator=(
const T& t) { SwigMovePointer tmp(
new T(t)); pointer = tmp;
return *
this; }
35 operator T&()
const {
return *pointer.ptr; }
36 T *operator&() {
return pointer.ptr; }
39 template <
typename T> T SwigValueInit() {
50 #ifndef SWIGTEMPLATEDISAMBIGUATOR
51 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
52 # define SWIGTEMPLATEDISAMBIGUATOR template
53 # elif defined(__HP_aCC)
56 # define SWIGTEMPLATEDISAMBIGUATOR template
58 # define SWIGTEMPLATEDISAMBIGUATOR
64 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
65 # define SWIGINLINE inline
73 # if defined(__GNUC__)
74 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
75 # define SWIGUNUSED __attribute__ ((__unused__))
80 # define SWIGUNUSED __attribute__ ((__unused__))
86 #ifndef SWIG_MSC_UNSUPPRESS_4505
87 # if defined(_MSC_VER)
88 # pragma warning(disable : 4505)
92 #ifndef SWIGUNUSEDPARM
94 # define SWIGUNUSEDPARM(p)
96 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
102 # define SWIGINTERN static SWIGUNUSED
106 #ifndef SWIGINTERNINLINE
107 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
111 #if defined(__GNUC__)
112 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
113 # ifndef GCC_HASCLASSVISIBILITY
114 # define GCC_HASCLASSVISIBILITY
120 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
121 # if defined(STATIC_LINKED)
124 # define SWIGEXPORT __declspec(dllexport)
127 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
128 # define SWIGEXPORT __attribute__ ((visibility("default")))
137 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
138 # define SWIGSTDCALL __stdcall
145 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
146 # define _CRT_SECURE_NO_DEPRECATE
150 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
151 # define _SCL_SECURE_NO_DEPRECATE
155 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
156 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
164 #ifdef __INTEL_COMPILER
165 # pragma warning disable 592
169 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
174 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
192 #define SWIG_RUNTIME_VERSION "4"
195 #ifdef SWIG_TYPE_TABLE
196 # define SWIG_QUOTE_STRING(x) #x
197 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
198 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
200 # define SWIG_TYPE_TABLE_NAME
213 # define SWIGRUNTIME SWIGINTERN
216 #ifndef SWIGRUNTIMEINLINE
217 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
221 #ifndef SWIG_BUFFER_SIZE
222 # define SWIG_BUFFER_SIZE 1024
226 #define SWIG_POINTER_DISOWN 0x1
227 #define SWIG_CAST_NEW_MEMORY 0x2
228 #define SWIG_POINTER_NO_NULL 0x4
231 #define SWIG_POINTER_OWN 0x1
314 #define SWIG_ERROR (-1)
315 #define SWIG_IsOK(r) (r >= 0)
316 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
319 #define SWIG_CASTRANKLIMIT (1 << 8)
321 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
323 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
325 #define SWIG_BADOBJ (SWIG_ERROR)
326 #define SWIG_OLDOBJ (SWIG_OK)
327 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
328 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
330 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
331 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
332 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
333 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
334 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
335 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
338 #if defined(SWIG_CASTRANK_MODE)
339 # ifndef SWIG_TypeRank
340 # define SWIG_TypeRank unsigned long
342 # ifndef SWIG_MAXCASTRANK
343 # define SWIG_MAXCASTRANK (2)
345 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
346 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
351 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
354 # define SWIG_AddCast(r) (r)
355 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
365 typedef void *(*swig_converter_func)(
void *,
int *);
407 const char *f2,
const char *l2) {
408 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
409 while ((*f1 ==
' ') && (f1 != l1)) ++f1;
410 while ((*f2 ==
' ') && (f2 != l2)) ++f2;
411 if (*f1 != *f2)
return (*f1 > *f2) ? 1 : -1;
413 return (
int)((l1 - f1) - (l2 - f2));
423 const char* te = tb + strlen(tb);
425 while (equiv != 0 && *ne) {
426 for (nb = ne; *ne; ++ne) {
427 if (*ne ==
'|')
break;
452 if (strcmp(iter->
type->
name, c) == 0) {
453 if (iter == ty->
cast)
479 if (iter->
type == from) {
480 if (iter == ty->
cast)
512 if (!ty || !ty->
dcast)
return ty;
513 while (ty && (ty->
dcast)) {
514 ty = (*ty->
dcast)(ptr);
538 if (!type)
return NULL;
539 if (type->
str != NULL) {
540 const char *last_name = type->
str;
542 for (s = type->
str; *s; s++)
543 if (*s ==
'|') last_name = s+1;
591 size_t r = iter->
size - 1;
594 size_t i = (l + r) >> 1;
595 const char *iname = iter->
types[i]->
name;
597 int compare = strcmp(
name, iname);
599 return iter->
types[i];
600 }
else if (compare < 0) {
606 }
else if (compare > 0) {
615 }
while (iter != end);
642 for (; i < iter->
size; ++i) {
644 return iter->
types[i];
647 }
while (iter != end);
659 static const char hex[17] =
"0123456789abcdef";
660 const unsigned char *u = (
unsigned char *) ptr;
661 const unsigned char *eu = u + sz;
662 for (; u != eu; ++u) {
663 unsigned char uu = *u;
664 *(c++) = hex[(uu & 0xf0) >> 4];
665 *(c++) = hex[uu & 0xf];
675 unsigned char *u = (
unsigned char *) ptr;
676 const unsigned char *eu = u + sz;
677 for (; u != eu; ++u) {
680 if ((d >=
'0') && (d <=
'9'))
681 uu = (
unsigned char)((d -
'0') << 4);
682 else if ((d >=
'a') && (d <=
'f'))
683 uu = (
unsigned char)((d - (
'a'-10)) << 4);
687 if ((d >=
'0') && (d <=
'9'))
688 uu |= (
unsigned char)(d -
'0');
689 else if ((d >=
'a') && (d <=
'f'))
690 uu |= (
unsigned char)(d - (
'a'-10));
704 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
707 if (strlen(
name) + 1 > (bsz - (r - buff)))
return 0;
715 if (strcmp(c,
"NULL") == 0) {
728 size_t lname = (
name ? strlen(
name) : 0);
729 if ((2*sz + 2 + lname) > bsz)
return 0;
733 strncpy(r,
name,lname+1);
743 if (strcmp(c,
"NULL") == 0) {
758 #define SWIG_UnknownError -1
759 #define SWIG_IOError -2
760 #define SWIG_RuntimeError -3
761 #define SWIG_IndexError -4
762 #define SWIG_TypeError -5
763 #define SWIG_DivisionByZero -6
764 #define SWIG_OverflowError -7
765 #define SWIG_SyntaxError -8
766 #define SWIG_ValueError -9
767 #define SWIG_SystemError -10
768 #define SWIG_AttributeError -11
769 #define SWIG_MemoryError -12
770 #define SWIG_NullReferenceError -13
775 #if PY_VERSION_HEX >= 0x03000000
777 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
778 #define PyInt_Check(x) PyLong_Check(x)
779 #define PyInt_AsLong(x) PyLong_AsLong(x)
780 #define PyInt_FromLong(x) PyLong_FromLong(x)
781 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
782 #define PyString_Check(name) PyBytes_Check(name)
783 #define PyString_FromString(x) PyUnicode_FromString(x)
784 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
785 #define PyString_AsString(str) PyBytes_AsString(str)
786 #define PyString_Size(str) PyBytes_Size(str)
787 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
788 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
789 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
790 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
795 # define Py_TYPE(op) ((op)->ob_type)
800 #if PY_VERSION_HEX >= 0x03000000
801 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
803 # define SWIG_Python_str_FromFormat PyString_FromFormat
813 #if PY_VERSION_HEX >= 0x03030000
814 return (
char *)PyUnicode_AsUTF8(str);
815 #elif PY_VERSION_HEX >= 0x03000000
817 str = PyUnicode_AsUTF8String(str);
821 if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
822 newstr = (
char *)
malloc(len+1);
824 memcpy(newstr, cstr, len+1);
830 return PyString_AsString(str);
834 #if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
835 # define SWIG_Python_str_DelForPy3(x)
837 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
844 #if PY_VERSION_HEX >= 0x03000000
845 return PyUnicode_FromString(c);
847 return PyString_FromString(c);
852 # define PyObject_DEL PyObject_Del
857 # define SWIGPY_USE_CAPSULE
858 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
860 #if PY_VERSION_HEX < 0x03020000
861 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
862 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
863 #define Py_hash_t long
875 type = PyExc_MemoryError;
878 type = PyExc_IOError;
881 type = PyExc_RuntimeError;
884 type = PyExc_IndexError;
887 type = PyExc_TypeError;
890 type = PyExc_ZeroDivisionError;
893 type = PyExc_OverflowError;
896 type = PyExc_SyntaxError;
899 type = PyExc_ValueError;
902 type = PyExc_SystemError;
905 type = PyExc_AttributeError;
908 type = PyExc_RuntimeError;
919 PyObject *traceback = 0;
921 if (PyErr_Occurred())
922 PyErr_Fetch(&type, &
value, &traceback);
924 PyObject *old_str = PyObject_Str(
value);
929 PyErr_Format(type,
"%s %s", tmp, mesg);
931 PyErr_Format(type,
"%s", mesg);
936 PyErr_SetString(PyExc_RuntimeError, mesg);
946 error = PyErr_Occurred();
947 return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
956 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
957 PyErr_Fetch(&type, &
value, &traceback);
958 #if PY_VERSION_HEX >= 0x03000000
959 newvalue = PyUnicode_FromFormat(
"%S\nAdditional information:\n%s",
value,
message);
961 newvalue = PyString_FromFormat(
"%s\nAdditional information:\n%s", PyString_AsString(
value),
message);
964 PyErr_Restore(type, newvalue, traceback);
967 PyErr_SetString(PyExc_TypeError,
message);
971 #if defined(SWIG_PYTHON_NO_THREADS)
972 # if defined(SWIG_PYTHON_THREADS)
973 # undef SWIG_PYTHON_THREADS
976 #if defined(SWIG_PYTHON_THREADS)
977 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
978 # define SWIG_PYTHON_USE_GIL
980 # if defined(SWIG_PYTHON_USE_GIL)
981 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
982 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
985 class SWIG_Python_Thread_Block {
987 PyGILState_STATE state;
989 void end() {
if (status) { PyGILState_Release(state); status =
false;} }
990 SWIG_Python_Thread_Block() : status(
true), state(PyGILState_Ensure()) {}
991 ~SWIG_Python_Thread_Block() { end(); }
993 class SWIG_Python_Thread_Allow {
997 void end() {
if (status) { PyEval_RestoreThread(save); status =
false; }}
998 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
999 ~SWIG_Python_Thread_Allow() { end(); }
1001 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1002 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1003 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1004 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1006 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1007 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1008 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1009 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1012 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1013 # define SWIG_PYTHON_INITIALIZE_THREADS
1015 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1016 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1018 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1019 # define SWIG_PYTHON_THREAD_END_BLOCK
1021 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1022 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1024 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1025 # define SWIG_PYTHON_THREAD_END_ALLOW
1029 # define SWIG_PYTHON_INITIALIZE_THREADS
1030 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1031 # define SWIG_PYTHON_THREAD_END_BLOCK
1032 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1033 # define SWIG_PYTHON_THREAD_END_ALLOW
1049 #define SWIG_PY_POINTER 4
1050 #define SWIG_PY_BINARY 5
1076 #if PY_VERSION_HEX < 0x02070000
1077 # error "This version of SWIG only supports Python >= 2.7"
1080 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1081 # error "This version of SWIG only supports Python 3 >= 3.2"
1087 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1088 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1089 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1091 #ifdef SWIGPYTHON_BUILTIN
1092 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1094 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1097 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1099 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1100 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1101 #define swig_owntype int
1104 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1105 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1108 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1109 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1112 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1113 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1116 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1117 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1122 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1123 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1124 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1126 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1127 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1128 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1129 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1130 #define SWIG_fail goto fail
1140 PyErr_SetObject(errtype, obj);
1148 PyErr_SetString(errtype, msg);
1152 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1156 #if defined(SWIGPYTHON_BUILTIN)
1159 SwigPyBuiltin_AddPublicSymbol(PyObject *seq,
const char *key) {
1160 PyObject *s = PyString_InternFromString(key);
1161 PyList_Append(seq, s);
1167 PyDict_SetItemString(d,
name, obj);
1169 if (public_interface)
1170 SwigPyBuiltin_AddPublicSymbol(public_interface,
name);
1177 PyDict_SetItemString(d,
name, obj);
1189 }
else if (result == Py_None) {
1193 if (!PyList_Check(result)) {
1194 PyObject *o2 = result;
1195 result = PyList_New(1);
1196 PyList_SetItem(result, 0, o2);
1198 PyList_Append(result,obj);
1213 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got none",
1218 if (!PyTuple_Check(args)) {
1219 if (min <= 1 && max >= 1) {
1222 for (i = 1; i <
max; ++i) {
1227 PyErr_SetString(PyExc_SystemError,
"UnpackTuple() argument list is not a tuple");
1230 Py_ssize_t l = PyTuple_GET_SIZE(args);
1232 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1235 }
else if (l >
max) {
1236 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1241 for (i = 0; i < l; ++i) {
1242 objs[i] = PyTuple_GET_ITEM(args, i);
1244 for (; l <
max; ++l) {
1256 assert(PyDict_Check(kwargs));
1257 if (PyDict_Size(kwargs) > 0) {
1258 PyErr_Format(PyExc_TypeError,
"%s() does not take keyword arguments",
name);
1266 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1273 #define SWIG_STATIC_POINTER(var) var
1275 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1283 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1284 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1286 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1288 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1289 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1300 PyObject *none = Py_None;
1314 PyTypeObject *pytype;
1323 PyErr_SetString(PyExc_TypeError,
"Implicit conversion is prohibited for explicit constructors.");
1330 PyObject *klass = data ? data->
klass : 0;
1331 return (klass ? klass : PyExc_RuntimeError);
1344 Py_INCREF(data->
klass);
1346 if (PyClass_Check(obj)) {
1351 data->
newraw = PyObject_GetAttrString(data->
klass,
"__new__");
1354 data->
newargs = PyTuple_New(1);
1355 PyTuple_SetItem(data->
newargs, 0, obj);
1362 data->
destroy = PyObject_GetAttrString(data->
klass,
"__swig_destroy__");
1363 if (PyErr_Occurred()) {
1370 flags = PyCFunction_GET_FLAGS(data->
destroy);
1371 data->
delargs = !(flags & (METH_O));
1383 Py_XDECREF(data->
newraw);
1396 #ifdef SWIGPYTHON_BUILTIN
1402 #ifdef SWIGPYTHON_BUILTIN
1405 SwigPyObject_get___dict__(PyObject *v, PyObject *
SWIGUNUSEDPARM(args))
1410 sobj->dict = PyDict_New();
1412 Py_INCREF(sobj->dict);
1421 return PyLong_FromVoidPtr(v->
ptr);
1427 PyObject *res = NULL;
1428 PyObject *args = PyTuple_New(1);
1433 #if PY_VERSION_HEX >= 0x03000000
1434 res = PyUnicode_Format(ofmt,args);
1436 res = PyString_Format(ofmt,args);
1465 # if PY_VERSION_HEX >= 0x03000000
1466 PyObject *joined = PyUnicode_Concat(repr, nrep);
1471 PyString_ConcatAndDel(&repr,nrep);
1490 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1498 if( op != Py_EQ && op != Py_NE ) {
1499 Py_INCREF(Py_NotImplemented);
1500 return Py_NotImplemented;
1509 #ifdef SWIGPYTHON_BUILTIN
1514 assert(SwigPyObject_stype);
1530 #ifdef SWIGPYTHON_BUILTIN
1532 if (PyType_IsSubtype(op->ob_type, target_tp))
1534 return (strcmp(op->ob_type->tp_name,
"SwigPyObject") == 0);
1537 || (strcmp(
Py_TYPE(op)->tp_name,
"SwigPyObject") == 0);
1552 PyObject *destroy = data ? data->
destroy : 0;
1564 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
1565 PyErr_Fetch(&type, &
value, &traceback);
1573 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1574 PyObject *mself = PyCFunction_GET_SELF(destroy);
1575 res = ((*meth)(mself, v));
1578 PyErr_WriteUnraisable(destroy);
1580 PyErr_Restore(type,
value, traceback);
1584 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1587 printf(
"swig/python detected a memory leak of type '%s', no destructor found.\n", (
name ?
name :
"unknown"));
1600 PyErr_SetString(PyExc_TypeError,
"Attempt to append a non SwigPyObject");
1613 Py_INCREF(sobj->
next);
1640 if (!PyArg_UnpackTuple(args,
"own", 0, 1, &val)) {
1644 PyObject *obj = PyBool_FromLong(sobj->
own);
1646 if (PyObject_IsTrue(val)) {
1660 {
"own",
SwigPyObject_own, METH_VARARGS,
"returns/sets ownership of the pointer"},
1669 static char swigobject_doc[] =
"Swig object carries a C/C++ instance pointer";
1671 static PyNumberMethods SwigPyObject_as_number = {
1676 #
if PY_VERSION_HEX < 0x03000000
1692 #
if PY_VERSION_HEX < 0x03000000
1696 #if PY_VERSION_HEX < 0x03000000
1702 #if PY_VERSION_HEX < 0x03000000
1706 #if PY_VERSION_HEX >= 0x03050000
1707 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1708 #elif PY_VERSION_HEX >= 0x03000000
1709 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1711 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1715 static PyTypeObject swigpyobject_type;
1716 static int type_init = 0;
1718 const PyTypeObject tmp = {
1719 #if PY_VERSION_HEX >= 0x03000000
1720 PyVarObject_HEAD_INIT(NULL, 0)
1722 PyObject_HEAD_INIT(NULL)
1732 #if PY_VERSION_HEX >= 0x03000000
1738 &SwigPyObject_as_number,
1744 PyObject_GenericGetAttr,
1775 #
if PY_VERSION_HEX >= 0x03040000
1778 #
if PY_VERSION_HEX >= 0x03080000
1781 #
if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1792 swigpyobject_type = tmp;
1794 if (PyType_Ready(&swigpyobject_type) < 0)
1797 return &swigpyobject_type;
1810 return (PyObject *)sobj;
1851 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1852 return s ? s : strncmp((
const char *)v->
pack, (
const char *)w->
pack, 2*v->
size);
1866 || (strcmp((op)->ob_type->tp_name,
"SwigPyPacked") == 0);
1881 static char swigpacked_doc[] =
"Swig object carries a C/C++ instance pointer";
1882 static PyTypeObject swigpypacked_type;
1883 static int type_init = 0;
1885 const PyTypeObject tmp = {
1886 #if PY_VERSION_HEX>=0x03000000
1887 PyVarObject_HEAD_INIT(NULL, 0)
1889 PyObject_HEAD_INIT(NULL)
1899 #if PY_VERSION_HEX>=0x03000000
1911 PyObject_GenericGetAttr,
1942 #
if PY_VERSION_HEX >= 0x03040000
1945 #
if PY_VERSION_HEX >= 0x03080000
1948 #
if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1959 swigpypacked_type = tmp;
1961 if (PyType_Ready(&swigpypacked_type) < 0)
1964 return &swigpypacked_type;
1972 void *pack =
malloc(size);
1974 memcpy(pack, ptr, size);
1983 return (PyObject *) sobj;
1991 if (sobj->
size != size)
return 0;
1992 memcpy(ptr, sobj->
pack, size);
2016 #if PY_VERSION_HEX>=0x03000000
2017 #define SWIG_PYTHON_SLOW_GETSET_THIS
2028 #ifdef SWIGPYTHON_BUILTIN
2030 # ifdef PyWeakref_CheckProxy
2031 if (PyWeakref_CheckProxy(pyobj)) {
2032 pyobj = PyWeakref_GET_OBJECT(pyobj);
2042 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2043 if (PyInstance_Check(pyobj)) {
2044 obj = _PyInstance_Lookup(pyobj,
SWIG_This());
2046 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2047 if (dictptr != NULL) {
2048 PyObject *dict = *dictptr;
2049 obj = dict ? PyDict_GetItem(dict,
SWIG_This()) : 0;
2051 #ifdef PyWeakref_CheckProxy
2052 if (PyWeakref_CheckProxy(pyobj)) {
2053 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2057 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2061 if (PyErr_Occurred()) PyErr_Clear();
2067 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2071 if (PyErr_Occurred()) PyErr_Clear();
2091 int oldown = sobj->
own;
2109 if (obj == Py_None && !implicit_conv) {
2121 void *vptr = sobj->
ptr;
2126 if (ptr) *ptr = vptr;
2146 if (ptr) *ptr = vptr;
2152 *own = *own | sobj->
own;
2158 if (implicit_conv) {
2161 PyObject *klass = data->
klass;
2167 if (PyErr_Occurred()) {
2192 if (!
SWIG_IsOK(res) && obj == Py_None) {
2195 if (PyErr_Occurred())
2208 if (!PyCFunction_Check(obj)) {
2215 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2216 const char *desc = doc ? strstr(doc,
"swig_ptr: ") : 0;
2262 PyObject *newraw = data->
newraw;
2264 inst = PyObject_Call(newraw, data->
newargs, NULL);
2266 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2267 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2268 if (dictptr != NULL) {
2269 PyObject *dict = *dictptr;
2271 dict = PyDict_New();
2273 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2277 if (PyObject_SetAttr(inst,
SWIG_This(), swig_this) == -1) {
2284 #if PY_VERSION_HEX >= 0x03000000
2285 PyObject *empty_args = PyTuple_New(0);
2287 PyObject *empty_kwargs = PyDict_New();
2289 inst = ((PyTypeObject *)data->
newargs)->tp_new((PyTypeObject *)data->
newargs, empty_args, empty_kwargs);
2290 Py_DECREF(empty_kwargs);
2292 if (PyObject_SetAttr(inst,
SWIG_This(), swig_this) == -1) {
2296 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2300 Py_DECREF(empty_args);
2303 PyObject *dict = PyDict_New();
2305 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2306 inst = PyInstance_NewRaw(data->
newargs, dict);
2317 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2318 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2319 if (dictptr != NULL) {
2320 PyObject *dict = *dictptr;
2322 dict = PyDict_New();
2325 return PyDict_SetItem(dict,
SWIG_This(), swig_this);
2328 return PyObject_SetAttr(inst,
SWIG_This(), swig_this);
2362 if (clientdata && clientdata->
pytype) {
2367 PyObject *next_self = clientdata->
pytype->tp_alloc(clientdata->
pytype, 0);
2368 while (newobj->
next)
2370 newobj->
next = next_self;
2372 #ifdef SWIGPYTHON_BUILTIN
2378 #ifdef SWIGPYTHON_BUILTIN
2387 return (PyObject*) newobj;
2414 #ifdef SWIG_LINK_RUNTIME
2415 void *SWIG_ReturnGlobalTypeList(
void *);
2420 static void *type_pointer = (
void *)0;
2422 if (!type_pointer) {
2423 #ifdef SWIG_LINK_RUNTIME
2424 type_pointer = SWIG_ReturnGlobalTypeList((
void *)0);
2427 if (PyErr_Occurred()) {
2429 type_pointer = (
void *)0;
2455 #if PY_VERSION_HEX >= 0x03000000
2459 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };
2460 PyObject *module = Py_InitModule(
"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2463 if (pointer && module) {
2466 Py_XDECREF(pointer);
2482 PyObject *obj = PyDict_GetItem(cache, key);
2490 obj = PyCapsule_New((
void*) descriptor, NULL, NULL);
2491 PyDict_SetItem(cache, key, obj);
2502 #define SWIG_POINTER_EXCEPTION 0
2503 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2504 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2509 if (PyErr_Occurred()) {
2511 PyObject *
value = 0;
2512 PyObject *traceback = 0;
2513 PyErr_Fetch(&type, &
value, &traceback);
2515 PyObject *old_str = PyObject_Str(
value);
2517 const char *errmesg = tmp ? tmp :
"Invalid error message";
2521 PyErr_Format(type,
"%s %s", mesg, errmesg);
2523 PyErr_Format(type,
"%s %s", errmesg, mesg);
2537 if (PyErr_Occurred()) {
2540 PyOS_snprintf(mesg,
sizeof(mesg),
"argument number %d:", argnum);
2552 return ty ? ty->
str :
"";
2559 #if defined(SWIG_COBJECT_TYPES)
2563 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, 'SwigPyObject(%s)' is received",
2570 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2572 PyObject *str = PyObject_Str(obj);
2575 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s(%s)' is received",
2579 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s' is received",
2586 PyErr_Format(PyExc_TypeError,
"a '%s' is expected", type);
2588 PyErr_Format(PyExc_TypeError,
"unexpected type is received");
2599 #if SWIG_POINTER_EXCEPTION
2609 #ifdef SWIGPYTHON_BUILTIN
2611 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *
name, PyObject *
value) {
2612 PyTypeObject *tp = obj->ob_type;
2614 PyObject *encoded_name;
2618 # ifdef Py_USING_UNICODE
2619 if (PyString_Check(
name)) {
2620 name = PyUnicode_Decode(PyString_AsString(
name), PyString_Size(
name), NULL, NULL);
2623 }
else if (!PyUnicode_Check(
name))
2625 if (!PyString_Check(
name))
2628 PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
name->ob_type->tp_name);
2635 if (PyType_Ready(tp) < 0)
2639 descr = _PyType_Lookup(tp,
name);
2642 f = descr->ob_type->tp_descr_set;
2644 if (PyString_Check(
name)) {
2645 encoded_name =
name;
2648 encoded_name = PyUnicode_AsUTF8String(
name);
2652 PyErr_Format(PyExc_AttributeError,
"'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2653 Py_DECREF(encoded_name);
2655 res = f(descr, obj,
value);
2671 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2673 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2692 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2705 #ifdef SWIG_DIRECTOR_STATIC
2716 #ifndef SWIG_DIRECTOR_PYTHON_HEADER_
2717 #define SWIG_DIRECTOR_PYTHON_HEADER_
2721 #include <exception>
2732 #ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE
2733 #ifndef SWIG_PYTHON_DIRECTOR_VTABLE
2734 #define SWIG_PYTHON_DIRECTOR_VTABLE
2744 #ifndef SWIG_DIRECTOR_NO_UEH
2745 #ifndef SWIG_DIRECTOR_UEH
2746 #define SWIG_DIRECTOR_UEH
2756 #ifdef SWIG_DIRECTOR_NORTTI
2761 # ifndef SWIG_DIRECTOR_RTDIR
2762 # define SWIG_DIRECTOR_RTDIR
2766 SWIGINTERN std::map<void *, Director *>& get_rtdir_map() {
2767 static std::map<void *, Director *> rtdir_map;
2772 get_rtdir_map()[vptr] = rtdir;
2776 std::map<void *, Director *>::const_iterator pos = get_rtdir_map().find(vptr);
2777 Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0;
2783 # define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast<void *>(ARG))
2784 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast<void *>(ARG1), ARG2)
2788 # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG)
2789 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
2831 struct GCItem_Object : GCItem {
2846 template <
typename Type>
2847 struct GCItem_T : GCItem {
2859 template <
typename Type>
2860 struct GCArray_T : GCItem {
2873 class DirectorException :
public std::exception {
2883 if (!PyErr_Occurred()) {
2884 PyErr_SetString(error,
what());
2901 static void raise(PyObject *error,
const char *msg) {
2905 static void raise(
const char *msg) {
2906 raise(PyExc_RuntimeError, msg);
2911 class DirectorTypeMismatchException :
public DirectorException {
2921 static void raise(PyObject *error,
const char *msg) {
2925 static void raise(
const char *msg) {
2931 class DirectorMethodException :
public DirectorException {
2937 static void raise(
const char *msg) {
2943 class DirectorPureVirtualException :
public DirectorException {
2946 :
DirectorException(PyExc_RuntimeError,
"SWIG director pure virtual method called", msg) {
2949 static void raise(
const char *msg) {
2955 #if defined(SWIG_PYTHON_THREADS)
2957 # if !defined(__THREAD__)
2958 # define __THREAD__ 1
2963 # include "pythread.h"
2965 PyThread_type_lock &mutex_;
2968 Guard(PyThread_type_lock & mutex) : mutex_(mutex) {
2969 PyThread_acquire_lock(mutex_, WAIT_LOCK);
2973 PyThread_release_lock(mutex_);
2976 # define SWIG_GUARD(mutex) Guard _guard(mutex)
2978 # define SWIG_GUARD(mutex)
2985 PyObject *swig_self;
2987 mutable bool swig_disown_flag;
2990 void swig_decref()
const {
2991 if (swig_disown_flag) {
2993 Py_DECREF(swig_self);
3000 Director(PyObject *
self) : swig_self(self), swig_disown_flag(false) {
3015 if (!swig_disown_flag) {
3016 swig_disown_flag=
true;
3023 if (swig_disown_flag) {
3024 Py_INCREF(swig_self);
3038 typedef std::map<void *, GCItem_var> swig_ownership_map;
3039 mutable swig_ownership_map swig_owner;
3041 static PyThread_type_lock swig_mutex_own;
3045 template <
typename Type>
3053 template <
typename Type>
3072 swig_ownership_map::iterator iter = swig_owner.find(vptr);
3073 if (iter != swig_owner.end()) {
3074 own = iter->second->get_own();
3075 swig_owner.erase(iter);
3081 template <
typename Type>
3088 return PyWeakref_NewProxy(pyobj, NULL);
3093 PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock();
3101 #define SWIGTYPE_p_char swig_types[0]
3102 #define SWIGTYPE_p_int swig_types[1]
3103 #define SWIGTYPE_p_long swig_types[2]
3104 #define SWIGTYPE_p_operations_research__Domain swig_types[3]
3105 #define SWIGTYPE_p_operations_research__sat__CpSatHelper swig_types[4]
3106 #define SWIGTYPE_p_operations_research__sat__IntegerVariableProto swig_types[5]
3107 #define SWIGTYPE_p_operations_research__sat__SolutionCallback swig_types[6]
3108 #define SWIGTYPE_p_operations_research__sat__SolveWrapper swig_types[7]
3109 #define SWIGTYPE_p_short swig_types[8]
3110 #define SWIGTYPE_p_signed_char swig_types[9]
3111 #define SWIGTYPE_p_unsigned_char swig_types[10]
3112 #define SWIGTYPE_p_unsigned_int swig_types[11]
3113 #define SWIGTYPE_p_unsigned_long swig_types[12]
3114 #define SWIGTYPE_p_unsigned_short swig_types[13]
3117 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3118 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3122 #ifdef SWIG_TypeQuery
3123 # undef SWIG_TypeQuery
3125 #define SWIG_TypeQuery SWIG_Python_TypeQuery
3130 #if PY_VERSION_HEX >= 0x03000000
3131 # define SWIG_init PyInit__pywrapsat
3134 # define SWIG_init init_pywrapsat
3137 #define SWIG_name "_pywrapsat"
3139 #define SWIGVERSION 0x040002
3140 #define SWIG_VERSION SWIGVERSION
3143 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3144 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3147 #include <stdexcept>
3151 class SwigPtr_PyObject {
3179 Py_XINCREF(item._obj);
3193 operator PyObject *()
const
3207 struct SwigVar_PyObject : SwigPtr_PyObject {
3230 #define SWIGWORDSIZE64
3234 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
3235 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
3242 #include "ortools/base/python-swig.h"
3245 #include <functional>
3257 PyObject*
get()
const {
return obj_; }
3263 PyObject*
const obj_;
3266 template <
typename ReturnT>
3269 ReturnT result = ReturnT();
3271 if (!PyErr_Occurred()) {
3272 PyErr_SetString(PyExc_RuntimeError,
3273 "SWIG std::function invocation failed.");
3277 if (!PyObjAs<ReturnT>(pyresult, &result)) {
3278 if (!PyErr_Occurred()) {
3279 PyErr_SetString(PyExc_RuntimeError,
3280 "SWIG std::function invocation failed.");
3283 Py_DECREF(pyresult);
3291 if (!PyErr_Occurred()) {
3292 PyErr_SetString(PyExc_RuntimeError,
3293 "SWIG std::function invocation failed.");
3296 Py_DECREF(pyresult);
3300 template <
typename ReturnT,
typename... Args>
3302 const char* format, Args... args) {
3305 return HandleResult<ReturnT>(
3306 PyObject_CallFunction(pyfunc,
const_cast<char*
>(format), args...));
3309 template <
typename ReturnT>
3311 return HandleResult<ReturnT>(PyObject_CallFunctionObjArgs(pyfunc,
nullptr));
3318 #include "ortools/sat/swig_helper.h"
3321 #define SWIG_From_long PyInt_FromLong
3324 #define SWIG_From_double PyFloat_FromDouble
3328 #if !defined(SWIG_NO_LLONG_MAX)
3329 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3330 # define LLONG_MAX __LONG_LONG_MAX__
3331 # define LLONG_MIN (-LLONG_MAX - 1LL)
3332 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3341 if (PyFloat_Check(obj)) {
3342 if (val) *val = PyFloat_AsDouble(obj);
3344 #if PY_VERSION_HEX < 0x03000000
3345 }
else if (PyInt_Check(obj)) {
3346 if (val) *val = (double) PyInt_AsLong(obj);
3349 }
else if (PyLong_Check(obj)) {
3350 double v = PyLong_AsDouble(obj);
3351 if (!PyErr_Occurred()) {
3358 #ifdef SWIG_PYTHON_CAST_MODE
3361 double d = PyFloat_AsDouble(obj);
3362 if (!PyErr_Occurred()) {
3369 long v = PyLong_AsLong(obj);
3370 if (!PyErr_Occurred()) {
3392 if ((
min <= x && x <=
max)) {
3393 double fx = floor(x);
3394 double cx = ceil(x);
3395 double rd = ((x - fx) < 0.5) ? fx : cx;
3396 if ((errno == EDOM) || (errno == ERANGE)) {
3399 double summ, reps, diff;
3402 }
else if (rd > x) {
3409 if (reps < 8*DBL_EPSILON) {
3422 #if PY_VERSION_HEX < 0x03000000
3423 if (PyInt_Check(obj)) {
3424 if (val) *val = PyInt_AsLong(obj);
3428 if (PyLong_Check(obj)) {
3429 long v = PyLong_AsLong(obj);
3430 if (!PyErr_Occurred()) {
3438 #ifdef SWIG_PYTHON_CAST_MODE
3441 long v = PyInt_AsLong(obj);
3442 if (!PyErr_Occurred()) {
3452 if (val) *val = (long)(d);
3468 if ((v < INT_MIN || v > INT_MAX)) {
3471 if (val) *val =
static_cast< int >(v);
3481 return PyBool_FromLong(
value ? 1 : 0);
3488 static int init = 0;
3502 if (size > INT_MAX) {
3504 return pchar_descriptor ?
3507 #if PY_VERSION_HEX >= 0x03000000
3508 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3509 return PyBytes_FromStringAndSize(carray,
static_cast< Py_ssize_t
>(size));
3511 return PyUnicode_DecodeUTF8(carray,
static_cast< Py_ssize_t
>(size),
"surrogateescape");
3514 return PyString_FromStringAndSize(carray,
static_cast< Py_ssize_t
>(size));
3533 #if PY_VERSION_HEX>=0x03000000
3534 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3535 if (PyBytes_Check(obj))
3537 if (PyUnicode_Check(obj))
3540 if (PyString_Check(obj))
3543 char *cstr; Py_ssize_t len;
3545 #if PY_VERSION_HEX>=0x03000000
3546 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3547 if (!alloc && cptr) {
3554 obj = PyUnicode_AsUTF8String(obj);
3560 if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
3563 if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
3569 *cptr =
reinterpret_cast< char*
>(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
3576 #if PY_VERSION_HEX>=0x03000000
3577 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3578 *cptr = PyBytes_AsString(obj);
3589 if (psize) *psize = len + 1;
3590 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3595 #if defined(SWIG_PYTHON_2_UNICODE)
3596 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3597 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3599 #if PY_VERSION_HEX<0x03000000
3600 if (PyUnicode_Check(obj)) {
3601 char *cstr; Py_ssize_t len;
3602 if (!alloc && cptr) {
3605 obj = PyUnicode_AsUTF8String(obj);
3608 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3611 *cptr =
reinterpret_cast< char*
>(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
3613 if (psize) *psize = len + 1;
3625 if (pchar_descriptor) {
3628 if (cptr) *cptr = (
char *) vptr;
3629 if (psize) *psize = vptr ? (strlen((
char *)vptr) + 1) : 0;
3642 char* buf = 0 ;
size_t size = 0;
int alloc =
SWIG_OLDOBJ;
3645 if (val) *val =
new std::string(buf, size - 1);
3653 static int init = 0;
3693 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
3694 const size_t swig_method_index = 0;
3695 const char *
const swig_method_name =
"OnSolutionCallback";
3696 PyObject *method = swig_get_method(swig_method_index, swig_method_name);
3704 PyObject *error = PyErr_Occurred();
3718 PyObject *resultobj = 0;
3719 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3722 PyObject *swig_obj[1] ;
3728 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3730 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3744 PyObject *resultobj = 0;
3745 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3748 PyObject *swig_obj[1] ;
3750 bool upcall =
false;
3756 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_OnSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3758 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3760 upcall = (director && (director->
swig_get_self()==swig_obj[0]));
3765 ((operations_research::sat::SolutionCallback
const *)arg1)->OnSolutionCallback();
3778 PyObject *resultobj = 0;
3779 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3782 PyObject *swig_obj[1] ;
3789 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBooleans" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3791 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3794 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBooleans();
3805 PyObject *resultobj = 0;
3806 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3809 PyObject *swig_obj[1] ;
3816 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBranches" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3818 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3821 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBranches();
3832 PyObject *resultobj = 0;
3833 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3836 PyObject *swig_obj[1] ;
3843 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumConflicts" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3845 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3848 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumConflicts();
3859 PyObject *resultobj = 0;
3860 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3863 PyObject *swig_obj[1] ;
3870 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBinaryPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3872 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3875 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBinaryPropagations();
3886 PyObject *resultobj = 0;
3887 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3890 PyObject *swig_obj[1] ;
3897 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumIntegerPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3899 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3902 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumIntegerPropagations();
3913 PyObject *resultobj = 0;
3914 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3917 PyObject *swig_obj[1] ;
3924 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_WallTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3926 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3929 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->WallTime();
3940 PyObject *resultobj = 0;
3941 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3944 PyObject *swig_obj[1] ;
3951 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_UserTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3953 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3956 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->UserTime();
3967 PyObject *resultobj = 0;
3968 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3971 PyObject *swig_obj[1] ;
3978 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_ObjectiveValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3980 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
3983 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->ObjectiveValue();
3994 PyObject *resultobj = 0;
3995 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3998 PyObject *swig_obj[1] ;
4005 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_BestObjectiveBound" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4007 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4010 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->BestObjectiveBound();
4021 PyObject *resultobj = 0;
4022 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4028 PyObject *swig_obj[2] ;
4034 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4036 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4041 arg2 =
static_cast< int >(val2);
4044 result = (int64_t)(arg1)->SolutionIntegerValue(arg2);
4055 PyObject *resultobj = 0;
4056 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4062 PyObject *swig_obj[2] ;
4068 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_SolutionBooleanValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4070 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4075 arg2 =
static_cast< int >(val2);
4078 result = (bool)(arg1)->SolutionBooleanValue(arg2);
4089 PyObject *resultobj = 0;
4090 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4093 PyObject *swig_obj[1] ;
4099 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4101 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4104 (arg1)->StopSearch();
4115 PyObject *resultobj = 0;
4116 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4119 PyObject *swig_obj[1] ;
4120 operations_research::sat::CpSolverResponse result;
4126 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_Response" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4128 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4131 result = ((operations_research::sat::SolutionCallback
const *)arg1)->Response();
4135 PyObject*
const module = PyImport_ImportModule(
"ortools.sat.cp_model_pb2");
4136 if (module !=
nullptr) {
4137 PyObject*
const dict = PyModule_GetDict(module);
4138 if (dict !=
nullptr) {
4139 PyObject*
const clss = PyDict_GetItemString(dict,
"CpSolverResponse");
4140 if (clss !=
nullptr) {
4141 std::string encoded_protobuf;
4142 (&result)->SerializeToString(&encoded_protobuf);
4144 PyObject*
const python_encoded_protobuf = PyBytes_FromStringAndSize(
4145 encoded_protobuf.c_str(), encoded_protobuf.size());
4150 PyObject*
const result = PyObject_CallMethod(
4151 clss,
const_cast<char*
>(
"FromString"),
4152 const_cast<char*
>(
"(O)"),
4153 python_encoded_protobuf);
4154 Py_DECREF(python_encoded_protobuf);
4168 PyObject *resultobj = 0;
4169 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4172 PyObject *swig_obj[1] ;
4179 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_HasResponse" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4181 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4184 result = (bool)((operations_research::sat::SolutionCallback
const *)arg1)->HasResponse();
4195 PyObject *resultobj = 0;
4196 PyObject *arg1 = (PyObject *) 0 ;
4197 PyObject *swig_obj[1] ;
4198 operations_research::sat::SolutionCallback *result = 0 ;
4205 if ( arg1 != Py_None ) {
4209 SWIG_SetErrorMsg(PyExc_RuntimeError,
"accessing abstract class or protected constructor");
4223 PyObject *resultobj = 0;
4224 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4227 PyObject *swig_obj[1] ;
4233 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "disown_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4235 arg1 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp1);
4264 PyObject *resultobj = 0;
4265 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4266 operations_research::sat::SatParameters *arg2 = 0 ;
4269 PyObject *swig_obj[2] ;
4274 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_SetParameters" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4276 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4278 arg2 =
new operations_research::sat::SatParameters;
4279 PyObject*
const pyresult = PyObject_CallMethod(
4280 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4281 if (pyresult !=
nullptr) {
4282 char* buffer =
nullptr;
4283 Py_ssize_t length = 0;
4284 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4285 if (buffer !=
nullptr) {
4286 arg2->ParseFromArray(buffer, length);
4288 Py_DECREF(pyresult);
4293 (arg1)->SetParameters((operations_research::sat::SatParameters
const &)*arg2);
4310 PyObject *resultobj = 0;
4311 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4312 operations_research::sat::SolutionCallback *arg2 = 0 ;
4317 PyObject *swig_obj[2] ;
4322 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_AddSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4324 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4327 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4330 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4332 arg2 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp2);
4335 (arg1)->AddSolutionCallback((operations_research::sat::SolutionCallback
const &)*arg2);
4346 PyObject *resultobj = 0;
4347 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4348 operations_research::sat::SolutionCallback *arg2 = 0 ;
4353 PyObject *swig_obj[2] ;
4358 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4360 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4363 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4366 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4368 arg2 =
reinterpret_cast< operations_research::sat::SolutionCallback *
>(argp2);
4371 (arg1)->ClearSolutionCallback((operations_research::sat::SolutionCallback
const &)*arg2);
4382 PyObject *resultobj = 0;
4383 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4384 SwigValueWrapper< std::function< void (std::string
const &) > > arg2 ;
4387 PyObject *swig_obj[2] ;
4392 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_AddLogCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4394 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4397 arg2 = [
input](
const std::string& str) {
4398 PyObject* py_str = PyUnicode_FromStringAndSize(str.c_str(), str.size());
4401 result = PyObject_CallFunction(
input.get(),
"O", py_str);
4409 (arg1)->AddLogCallback(arg2);
4420 PyObject *resultobj = 0;
4421 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4422 operations_research::sat::CpModelProto *arg2 = 0 ;
4425 PyObject *swig_obj[2] ;
4426 operations_research::sat::CpSolverResponse result;
4433 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4435 arg2 =
new operations_research::sat::CpModelProto;
4436 PyObject*
const pyresult = PyObject_CallMethod(
4437 swig_obj[1],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4438 if (pyresult !=
nullptr) {
4439 char* buffer =
nullptr;
4440 Py_ssize_t length = 0;
4441 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4442 if (buffer !=
nullptr) {
4443 arg2->ParseFromArray(buffer, length);
4445 Py_DECREF(pyresult);
4450 result = (arg1)->
Solve((operations_research::sat::CpModelProto
const &)*arg2);
4454 PyObject*
const module = PyImport_ImportModule(
"ortools.sat.cp_model_pb2");
4455 if (module !=
nullptr) {
4456 PyObject*
const dict = PyModule_GetDict(module);
4457 if (dict !=
nullptr) {
4458 PyObject*
const clss = PyDict_GetItemString(dict,
"CpSolverResponse");
4459 if (clss !=
nullptr) {
4460 std::string encoded_protobuf;
4461 (&result)->SerializeToString(&encoded_protobuf);
4463 PyObject*
const python_encoded_protobuf = PyBytes_FromStringAndSize(
4464 encoded_protobuf.c_str(), encoded_protobuf.size());
4469 PyObject*
const result = PyObject_CallMethod(
4470 clss,
const_cast<char*
>(
"FromString"),
4471 const_cast<char*
>(
"(O)"),
4472 python_encoded_protobuf);
4473 Py_DECREF(python_encoded_protobuf);
4493 PyObject *resultobj = 0;
4494 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4497 PyObject *swig_obj[1] ;
4503 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4505 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4508 (arg1)->StopSearch();
4519 PyObject *resultobj = 0;
4520 operations_research::sat::SolveWrapper *result = 0 ;
4525 result = (operations_research::sat::SolveWrapper *)
new operations_research::sat::SolveWrapper();
4536 PyObject *resultobj = 0;
4537 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4540 PyObject *swig_obj[1] ;
4546 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_SolveWrapper" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4548 arg1 =
reinterpret_cast< operations_research::sat::SolveWrapper *
>(argp1);
4573 PyObject *resultobj = 0;
4574 operations_research::sat::CpModelProto *arg1 = 0 ;
4575 PyObject *swig_obj[1] ;
4581 arg1 =
new operations_research::sat::CpModelProto;
4582 PyObject*
const pyresult = PyObject_CallMethod(
4583 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4584 if (pyresult !=
nullptr) {
4585 char* buffer =
nullptr;
4586 Py_ssize_t length = 0;
4587 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4588 if (buffer !=
nullptr) {
4589 arg1->ParseFromArray(buffer, length);
4591 Py_DECREF(pyresult);
4596 result = operations_research::sat::CpSatHelper::ModelStats((operations_research::sat::CpModelProto
const &)*arg1);
4613 PyObject *resultobj = 0;
4614 operations_research::sat::CpSolverResponse *arg1 = 0 ;
4615 PyObject *swig_obj[1] ;
4621 arg1 =
new operations_research::sat::CpSolverResponse;
4622 PyObject*
const pyresult = PyObject_CallMethod(
4623 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4624 if (pyresult !=
nullptr) {
4625 char* buffer =
nullptr;
4626 Py_ssize_t length = 0;
4627 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4628 if (buffer !=
nullptr) {
4629 arg1->ParseFromArray(buffer, length);
4631 Py_DECREF(pyresult);
4636 result = operations_research::sat::CpSatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse
const &)*arg1);
4653 PyObject *resultobj = 0;
4654 operations_research::sat::CpModelProto *arg1 = 0 ;
4655 PyObject *swig_obj[1] ;
4661 arg1 =
new operations_research::sat::CpModelProto;
4662 PyObject*
const pyresult = PyObject_CallMethod(
4663 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4664 if (pyresult !=
nullptr) {
4665 char* buffer =
nullptr;
4666 Py_ssize_t length = 0;
4667 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4668 if (buffer !=
nullptr) {
4669 arg1->ParseFromArray(buffer, length);
4671 Py_DECREF(pyresult);
4693 PyObject *resultobj = 0;
4694 operations_research::sat::IntegerVariableProto *arg1 = 0 ;
4697 PyObject *swig_obj[1] ;
4704 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4707 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4709 arg1 =
reinterpret_cast< operations_research::sat::IntegerVariableProto *
>(argp1);
4712 result = operations_research::sat::CpSatHelper::VariableDomain((operations_research::sat::IntegerVariableProto
const &)*arg1);
4723 PyObject *resultobj = 0;
4724 operations_research::sat::CpModelProto *arg1 = 0 ;
4725 std::string *arg2 = 0 ;
4727 PyObject *swig_obj[2] ;
4732 arg1 =
new operations_research::sat::CpModelProto;
4733 PyObject*
const pyresult = PyObject_CallMethod(
4734 swig_obj[0],
const_cast<char*
>(
"SerializeToString"),
nullptr);
4735 if (pyresult !=
nullptr) {
4736 char* buffer =
nullptr;
4737 Py_ssize_t length = 0;
4738 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4739 if (buffer !=
nullptr) {
4740 arg1->ParseFromArray(buffer, length);
4742 Py_DECREF(pyresult);
4746 std::string *ptr = (std::string *)0;
4752 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "CpSatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4758 result = (bool)operations_research::sat::CpSatHelper::WriteModelToFile((operations_research::sat::CpModelProto
const &)*arg1,(std::string
const &)*arg2);
4777 PyObject *resultobj = 0;
4778 operations_research::sat::CpSatHelper *result = 0 ;
4783 result = (operations_research::sat::CpSatHelper *)
new operations_research::sat::CpSatHelper();
4794 PyObject *resultobj = 0;
4795 operations_research::sat::CpSatHelper *arg1 = (operations_research::sat::CpSatHelper *) 0 ;
4798 PyObject *swig_obj[1] ;
4806 arg1 =
reinterpret_cast< operations_research::sat::CpSatHelper *
>(argp1);
4871 { NULL, NULL, 0, NULL }
4875 { NULL, NULL, 0, NULL }
4883 static swig_type_info _swigt__p_long = {
"_p_long",
"intptr_t *|int_least64_t *|int_fast32_t *|int_fast64_t *|int64_t *|long *|int_fast16_t *|intmax_t *", 0, 0, (
void*)0, 0};
4893 static swig_type_info _swigt__p_unsigned_long = {
"_p_unsigned_long",
"uintptr_t *|uint_least64_t *|uint_fast32_t *|uint_fast64_t *|uint64_t *|unsigned long *|uint_fast16_t *|uintmax_t *", 0, 0, (
void*)0, 0};
4949 {0, 0, 0, 0.0, 0, 0}};
5003 #define SWIGRUNTIME_DEBUG
5039 }
while (iter!= module_head);
5050 if (init == 0)
return;
5053 #ifdef SWIGRUNTIME_DEBUG
5054 printf(
"SWIG_InitializeModule: size %lu\n", (
unsigned long)
swig_module.
size);
5061 #ifdef SWIGRUNTIME_DEBUG
5071 #ifdef SWIGRUNTIME_DEBUG
5072 printf(
"SWIG_InitializeModule: found type %s\n", type->
name);
5076 #ifdef SWIGRUNTIME_DEBUG
5077 printf(
"SWIG_InitializeModule: found and overwrite type %s \n", type->
name);
5086 while (cast->
type) {
5089 #ifdef SWIGRUNTIME_DEBUG
5090 printf(
"SWIG_InitializeModule: look cast %s\n", cast->
type->
name);
5094 #ifdef SWIGRUNTIME_DEBUG
5095 if (ret) printf(
"SWIG_InitializeModule: found cast %s\n", ret->
name);
5100 #ifdef SWIGRUNTIME_DEBUG
5101 printf(
"SWIG_InitializeModule: skip old type %s\n", ret->
name);
5108 #ifdef SWIGRUNTIME_DEBUG
5109 if (ocast) printf(
"SWIG_InitializeModule: skip old cast %s\n", ret->
name);
5111 if (!ocast) ret = 0;
5116 #ifdef SWIGRUNTIME_DEBUG
5117 printf(
"SWIG_InitializeModule: adding cast %s\n", cast->
type->
name);
5132 #ifdef SWIGRUNTIME_DEBUG
5133 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
5138 while (cast->
type) {
5139 printf(
"SWIG_InitializeModule: cast type %s\n", cast->
type->
name);
5143 printf(
"---- Total casts: %d\n",j);
5145 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
5158 static int init_run = 0;
5160 if (init_run)
return;
5171 equiv = equiv->
next;
5192 #define SWIG_newvarlink() SWIG_Python_newvarlink()
5193 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
5194 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
5202 PyObject *(*get_attr)(void);
5214 #if PY_VERSION_HEX >= 0x03000000
5215 return PyUnicode_InternFromString(
"<Swig global variables>");
5217 return PyString_FromString(
"<Swig global variables>");
5223 #if PY_VERSION_HEX >= 0x03000000
5224 PyObject *str = PyUnicode_InternFromString(
"(");
5229 tail = PyUnicode_FromString(
var->name);
5230 joined = PyUnicode_Concat(str,
tail);
5235 tail = PyUnicode_InternFromString(
", ");
5236 joined = PyUnicode_Concat(str,
tail);
5242 tail = PyUnicode_InternFromString(
")");
5243 joined = PyUnicode_Concat(str,
tail);
5248 PyObject *str = PyString_FromString(
"(");
5251 PyString_ConcatAndDel(&str,PyString_FromString(
var->name));
5252 if (
var->next) PyString_ConcatAndDel(&str,PyString_FromString(
", "));
5254 PyString_ConcatAndDel(&str,PyString_FromString(
")"));
5272 PyObject *res = NULL;
5275 if (strcmp(
var->name,n) == 0) {
5276 res = (*
var->get_attr)();
5281 if (res == NULL && !PyErr_Occurred()) {
5282 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
5292 if (strcmp(
var->name,n) == 0) {
5293 res = (*
var->set_attr)(p);
5298 if (res == 1 && !PyErr_Occurred()) {
5299 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
5306 static char varlink__doc__[] =
"Swig var link object";
5307 static PyTypeObject varlink_type;
5308 static int type_init = 0;
5310 const PyTypeObject tmp = {
5311 #if PY_VERSION_HEX >= 0x03000000
5312 PyVarObject_HEAD_INIT(NULL, 0)
5314 PyObject_HEAD_INIT(NULL)
5341 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5344 #if PY_VERSION_HEX >= 0x03040000
5347 #if PY_VERSION_HEX >= 0x03080000
5350 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
5363 if (PyType_Ready(&varlink_type) < 0)
5366 return &varlink_type;
5376 return ((PyObject*) result);
5384 size_t size = strlen(
name)+1;
5398 static PyObject *globals = 0;
5414 for (i = 0; constants[i].
type; ++i) {
5415 switch(constants[i].type) {
5420 obj =
SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
5427 PyDict_SetItemString(d, constants[i].
name, obj);
5443 for (i = 0; methods[i].ml_name; ++i) {
5444 const char *c = methods[i].ml_doc;
5446 c = strstr(c,
"swig_ptr: ");
5450 const char *
name = c + 10;
5451 for (j = 0; const_table[j].
type; ++j) {
5452 if (strncmp(const_table[j].
name,
name,
5453 strlen(const_table[j].
name)) == 0) {
5454 ci = &(const_table[j]);
5461 size_t shift = (ci->
ptype) - types;
5463 size_t ldoc = (c - methods[i].ml_doc);
5464 size_t lptr = strlen(ty->
name)+2*
sizeof(
void*)+2;
5465 char *ndoc = (
char*)
malloc(ldoc + lptr + 10);
5468 memcpy(buff, methods[i].ml_doc, ldoc);
5470 memcpy(buff,
"swig_ptr: ", 10);
5473 methods[i].ml_doc = ndoc;
5511 if (PyCFunction_Check(func)) {
5512 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5515 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5517 #if PY_VERSION_HEX >= 0x03000000
5518 return PyInstanceMethod_New(func);
5520 return PyMethod_New(func, NULL, NULL);
5530 if (PyCFunction_Check(func)) {
5531 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5534 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5536 return PyStaticMethod_New(func);
5552 #if PY_VERSION_HEX >= 0x03000000
5558 PyObject *m, *d, *md, *globals;
5560 #if PY_VERSION_HEX >= 0x03000000
5561 static struct PyModuleDef SWIG_module = {
5562 PyModuleDef_HEAD_INIT,
5574 #if defined(SWIGPYTHON_BUILTIN)
5578 static PyGetSetDef this_getset_def = {
5579 (
char *)
"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
5581 static SwigPyGetSet thisown_getset_closure = {
5585 static PyGetSetDef thisown_getset_def = {
5586 (
char *)
"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
5588 PyTypeObject *builtin_pytype;
5589 int builtin_base_count;
5592 PyGetSetDescrObject *static_getset;
5593 PyTypeObject *metatype;
5594 PyTypeObject *swigpyobject;
5596 PyObject *public_interface, *public_symbol;
5597 PyObject *this_descr;
5598 PyObject *thisown_descr;
5602 (void)builtin_pytype;
5603 (void)builtin_base_count;
5604 (void)builtin_basetype;
5606 (void)static_getset;
5610 metatype = SwigPyObjectType();
5620 #ifndef SWIGPYTHON_BUILTIN
5627 #if PY_VERSION_HEX >= 0x03000000
5628 m = PyModule_Create(&SWIG_module);
5633 md = d = PyModule_GetDict(m);
5638 #ifdef SWIGPYTHON_BUILTIN
5642 assert(SwigPyObject_stype);
5645 SwigPyObject_stype->
clientdata = &SwigPyObject_clientdata;
5646 SwigPyObject_clientdata.
pytype = swigpyobject;
5647 }
else if (swigpyobject->tp_basicsize != cd->
pytype->tp_basicsize) {
5648 PyErr_SetString(PyExc_RuntimeError,
"Import error: attempted to load two incompatible swig-generated modules.");
5649 # if PY_VERSION_HEX >= 0x03000000
5662 (void)thisown_descr;
5664 public_interface = PyList_New(0);
5666 (void)public_symbol;
5668 PyDict_SetItemString(md,
"__all__", public_interface);
5669 Py_DECREF(public_interface);
5671 SwigPyBuiltin_AddPublicSymbol(public_interface,
SwigMethods[i].ml_name);
5681 #if PY_VERSION_HEX >= 0x03000000
SharedPyPtr(const SharedPyPtr &other)
SharedPyPtr(PyObject *obj)
static void raise(JNIEnv *jenv, jthrowable throwable)
const char * getMessage() const
const char * what() const
DirectorException(const char *msg)
DirectorException(PyObject *error, const char *hdr="", const char *msg="")
virtual ~DirectorException()
PyObject * swig_get_self() const
int swig_release_ownership(void *vptr) const
jobject swig_get_self(JNIEnv *jenv) const
virtual void swig_set_inner(const char *, bool) const
static PyObject * swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
void swig_acquire_ownership_array(Type *vptr) const
void swig_acquire_ownership_obj(void *vptr, int own) const
virtual bool swig_get_inner(const char *) const
void swig_acquire_ownership(Type *vptr) const
DirectorMethodException(const char *msg="")
static void raise(const char *msg)
static void raise(const char *msg)
DirectorPureVirtualException(const char *msg)
DirectorPureVirtualException(const char *msg="")
DirectorTypeMismatchException(PyObject *error, const char *msg="")
DirectorTypeMismatchException(const char *msg="")
Guard(PyThread_type_lock &mutex)
virtual ~SwigDirector_SolutionCallback()
virtual void OnSolutionCallback() const
SwigDirector_SolutionCallback()
We call domain any subset of Int64 = [kint64min, kint64max].
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
SwigPtr_PyObject(const SwigPtr_PyObject &item)
PyObject * operator->() const
absl::Status ValidateModel(const ModelProto &model, const bool check_names)
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
Collection of objects used to extend the Constraint Solver library.
static int input(yyscan_t yyscanner)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
#define SWIG_MangledTypeQuery(name)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
static PyObject * Swig_This_global
SWIGINTERN PyObject * _wrap_SolveWrapper_SetParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
SWIGINTERN PyObject * _wrap_CpSatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__Domain
#define SWIG_TypeQuery(name)
#define SWIG_CheckState(r)
static swig_cast_info _swigc__p_int[]
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
#define SWIG_POINTER_IMPLICIT_CONV
SWIGINTERN PyObject * _wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_CpSatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SolveWrapper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static ReturnT HandleResult(PyObject *pyresult)
struct swig_cast_info swig_cast_info
#define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
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)
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
#define SWIG_PYTHON_THREAD_END_BLOCK
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
SWIGINTERN PyObject * _wrap_new_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_RuntimeError
SWIGINTERN PyObject * _wrap_SolveWrapper_AddSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_varlinkobject swig_varlinkobject
#define SWIG_NewClientData(obj)
static swig_type_info _swigt__p_operations_research__sat__SolutionCallback
SWIGINTERN PyObject * _wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
static swig_type_info _swigt__p_unsigned_char
static swig_cast_info _swigc__p_operations_research__sat__IntegerVariableProto[]
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * _wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_RUNTIME_VERSION
#define SWIG_POINTER_NOSHADOW
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
static swig_type_info _swigt__p_short
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
static PyMethodDef swigobject_methods[]
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
#define SWIG_exception_fail(code, msg)
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
#define SWIG_DIRECTOR_CAST(ARG)
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
SWIGINTERN PyObject * _wrap_delete_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
#define SWIG_AttributeError
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_module_info swig_module
static swig_cast_info _swigc__p_unsigned_char[]
static swig_cast_info _swigc__p_short[]
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
#define SWIG_SetModule(clientdata, pointer)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGINTERN PyObject * _wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
SWIGINTERN PyObject * _wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGUNUSEDPARM(p)
SWIGRUNTIME PyObject * SWIG_This(void)
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
#define SWIG_as_voidptr(a)
static swig_const_info swig_const_table[]
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
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)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
struct swig_const_info swig_const_info
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
void HandleResult< void >(PyObject *pyresult)
SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name)
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
SWIGINTERN PyObject * _wrap_SolveWrapper_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
SWIGINTERN PyObject * SolveWrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_newvarlink()
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
static swig_type_info _swigt__p_unsigned_long
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_char[]
static swig_type_info _swigt__p_operations_research__sat__CpSatHelper
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
SWIGINTERN PyObject * _wrap_SolveWrapper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
SWIGINTERN PyObject * _wrap_SolveWrapper_AddLogCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
static swig_cast_info _swigc__p_unsigned_short[]
struct swig_globalvar swig_globalvar
#define SWIGPY_CAPSULE_NAME
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_NewPointerObj(ptr, type, flags)
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
#define SWIG_GUARD(mutex)
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
void *(* swig_converter_func)(void *, int *)
#define SWIG_POINTER_NO_NULL
#define SWIG_Python_str_FromFormat
SWIGINTERN PyObject * _wrap_CpSatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_InstallConstants(d, constants)
SWIGINTERN PyObject * _wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyMethodDef SwigMethods[]
#define SWIGTYPE_p_operations_research__sat__SolutionCallback
#define SWIG_NullReferenceError
static swig_cast_info _swigc__p_operations_research__sat__SolveWrapper[]
#define SWIG_POINTER_DISOWN
#define SWIG_STATIC_POINTER(var)
struct swig_type_info swig_type_info
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
static swig_type_info _swigt__p_signed_char
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGINTERN PyObject * SWIG_globals(void)
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
#define SWIG_NewPackedObj(ptr, sz, type)
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
#define SWIG_GetModule(clientdata)
static swig_cast_info _swigc__p_unsigned_int[]
static swig_type_info _swigt__p_int
SWIGINTERN PyObject * _wrap_SolutionCallback_NumIntegerPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_PropagateClientData(void)
static swig_cast_info _swigc__p_unsigned_long[]
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN PyObject * CpSatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGINTERN PyObject * _wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
#define SWIGTYPE_p_operations_research__Domain
static swig_type_info _swigt__p_long
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
static PyMethodDef SwigMethods_proxydocs[]
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
#define SWIG_TYPE_TABLE_NAME
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
#define SWIG_BUILTIN_TP_INIT
static swig_type_info _swigt__p_unsigned_int
#define SWIG_CAST_NEW_MEMORY
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
SWIGINTERN PyObject * _wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_PYTHON_THREAD_END_ALLOW
struct swig_module_info swig_module_info
SWIGINTERN PyObject * _wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
SWIGINTERN PyObject * _wrap_delete_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__sat__SolutionCallback[]
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
#define SWIGTYPE_p_operations_research__sat__CpSatHelper
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_long[]
static swig_type_info * swig_type_initial[]
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
static ReturnT InvokePythonCallableReturning(PyObject *pyfunc, const char *format, Args... args)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
SWIGINTERN PyObject * _wrap_SolveWrapper_ClearSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_operations_research__sat__CpSatHelper[]
SWIGINTERN PyObject * _wrap_CpSatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
SWIGINTERN PyObject * _wrap_new_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto
#define SWIG_DivisionByZero
static swig_type_info _swigt__p_char
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
static swig_cast_info _swigc__p_operations_research__Domain[]
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
#define SWIG_OverflowError
SWIGINTERN PyObject * _wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__sat__SolveWrapper
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
static swig_type_info _swigt__p_operations_research__sat__SolveWrapper
struct swig_type_info *(* swig_dycast_func)(void **)
#define SWIGTYPE_p_operations_research__sat__IntegerVariableProto
SWIGINTERN PyObject * _wrap_CpSatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info * swig_types[15]
#define SWIG_PYTHON_INITIALIZE_THREADS
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
#define SWIG_AddNewMask(r)
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
SWIGINTERN PyObject * CpSatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
static swig_cast_info _swigc__p_signed_char[]
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
#define SWIGRUNTIMEINLINE
GCItem_var(GCItem *item=0)
GCItem_var & operator=(GCItem *item)
GCItem * operator->() const
virtual int get_own() const
PyObject_HEAD void * pack
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