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 >= 0x03000000 815 str = PyUnicode_AsUTF8String(str);
819 PyBytes_AsStringAndSize(str, &cstr, &len);
820 newstr = (
char *)
malloc(len+1);
821 memcpy(newstr, cstr, len+1);
826 return PyString_AsString(str);
830 #if PY_VERSION_HEX >= 0x03000000 831 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) 833 # define SWIG_Python_str_DelForPy3(x) 840 #if PY_VERSION_HEX >= 0x03000000 841 return PyUnicode_FromString(c);
843 return PyString_FromString(c);
848 # define PyObject_DEL PyObject_Del 853 # define SWIGPY_USE_CAPSULE 854 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) 856 #if PY_VERSION_HEX < 0x03020000 857 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) 858 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) 859 #define Py_hash_t long 871 type = PyExc_MemoryError;
874 type = PyExc_IOError;
877 type = PyExc_RuntimeError;
880 type = PyExc_IndexError;
883 type = PyExc_TypeError;
886 type = PyExc_ZeroDivisionError;
889 type = PyExc_OverflowError;
892 type = PyExc_SyntaxError;
895 type = PyExc_ValueError;
898 type = PyExc_SystemError;
901 type = PyExc_AttributeError;
904 type = PyExc_RuntimeError;
915 PyObject *traceback = 0;
917 if (PyErr_Occurred())
918 PyErr_Fetch(&type, &
value, &traceback);
920 PyObject *old_str = PyObject_Str(
value);
925 PyErr_Format(type,
"%s %s", tmp, mesg);
927 PyErr_Format(type,
"%s", mesg);
932 PyErr_SetString(PyExc_RuntimeError, mesg);
942 error = PyErr_Occurred();
943 return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
952 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
953 PyErr_Fetch(&type, &
value, &traceback);
954 #if PY_VERSION_HEX >= 0x03000000 955 newvalue = PyUnicode_FromFormat(
"%S\nAdditional information:\n%s",
value,
message);
957 newvalue = PyString_FromFormat(
"%s\nAdditional information:\n%s", PyString_AsString(
value),
message);
960 PyErr_Restore(type, newvalue, traceback);
963 PyErr_SetString(PyExc_TypeError,
message);
967 #if defined(SWIG_PYTHON_NO_THREADS) 968 # if defined(SWIG_PYTHON_THREADS) 969 # undef SWIG_PYTHON_THREADS 972 #if defined(SWIG_PYTHON_THREADS) 973 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) 974 # define SWIG_PYTHON_USE_GIL 976 # if defined(SWIG_PYTHON_USE_GIL) 977 # ifndef SWIG_PYTHON_INITIALIZE_THREADS 978 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() 981 class SWIG_Python_Thread_Block {
983 PyGILState_STATE state;
985 void end() {
if (status) { PyGILState_Release(state); status =
false;} }
986 SWIG_Python_Thread_Block() : status(
true), state(PyGILState_Ensure()) {}
987 ~SWIG_Python_Thread_Block() { end(); }
989 class SWIG_Python_Thread_Allow {
993 void end() {
if (status) { PyEval_RestoreThread(save); status =
false; }}
994 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
995 ~SWIG_Python_Thread_Allow() { end(); }
997 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block 998 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() 999 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow 1000 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() 1002 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() 1003 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) 1004 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() 1005 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) 1008 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS) 1009 # define SWIG_PYTHON_INITIALIZE_THREADS 1011 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) 1012 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK 1014 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK) 1015 # define SWIG_PYTHON_THREAD_END_BLOCK 1017 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) 1018 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW 1020 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW) 1021 # define SWIG_PYTHON_THREAD_END_ALLOW 1025 # define SWIG_PYTHON_INITIALIZE_THREADS 1026 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK 1027 # define SWIG_PYTHON_THREAD_END_BLOCK 1028 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW 1029 # define SWIG_PYTHON_THREAD_END_ALLOW 1045 #define SWIG_PY_POINTER 4 1046 #define SWIG_PY_BINARY 5 1072 #if PY_VERSION_HEX < 0x02070000 1073 # error "This version of SWIG only supports Python >= 2.7" 1076 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 1077 # error "This version of SWIG only supports Python 3 >= 3.2" 1083 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) 1084 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) 1085 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) 1087 #ifdef SWIGPYTHON_BUILTIN 1088 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) 1090 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) 1093 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) 1095 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) 1096 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) 1097 #define swig_owntype int 1100 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) 1101 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) 1104 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) 1105 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) 1108 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) 1109 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) 1112 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) 1113 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) 1118 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) 1119 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) 1120 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) 1122 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj 1123 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg 1124 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) 1125 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 1126 #define SWIG_fail goto fail 1136 PyErr_SetObject(errtype, obj);
1144 PyErr_SetString(errtype, msg);
1148 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) 1152 #if defined(SWIGPYTHON_BUILTIN) 1155 SwigPyBuiltin_AddPublicSymbol(PyObject *seq,
const char *key) {
1156 PyObject *s = PyString_InternFromString(key);
1157 PyList_Append(seq, s);
1163 PyDict_SetItemString(d,
name, obj);
1165 if (public_interface)
1166 SwigPyBuiltin_AddPublicSymbol(public_interface,
name);
1173 PyDict_SetItemString(d,
name, obj);
1185 }
else if (result == Py_None) {
1189 if (!PyList_Check(result)) {
1190 PyObject *o2 = result;
1191 result = PyList_New(1);
1192 PyList_SetItem(result, 0, o2);
1194 PyList_Append(result,obj);
1209 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got none",
1214 if (!PyTuple_Check(args)) {
1215 if (min <= 1 && max >= 1) {
1218 for (i = 1; i <
max; ++i) {
1223 PyErr_SetString(PyExc_SystemError,
"UnpackTuple() argument list is not a tuple");
1226 Py_ssize_t l = PyTuple_GET_SIZE(args);
1228 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1231 }
else if (l >
max) {
1232 PyErr_Format(PyExc_TypeError,
"%s expected %s%d arguments, got %d",
1237 for (i = 0; i < l; ++i) {
1238 objs[i] = PyTuple_GET_ITEM(args, i);
1240 for (; l <
max; ++l) {
1249 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); 1256 #define SWIG_STATIC_POINTER(var) var 1258 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var 1266 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) 1267 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) 1269 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) 1271 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) 1272 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) 1283 PyObject *none = Py_None;
1297 PyTypeObject *pytype;
1306 PyErr_SetString(PyExc_TypeError,
"Implicit conversion is prohibited for explicit constructors.");
1313 PyObject *klass = data ? data->
klass : 0;
1314 return (klass ? klass : PyExc_RuntimeError);
1327 Py_INCREF(data->
klass);
1329 if (PyClass_Check(obj)) {
1334 data->
newraw = PyObject_GetAttrString(data->
klass,
"__new__");
1337 data->
newargs = PyTuple_New(1);
1338 PyTuple_SetItem(data->
newargs, 0, obj);
1345 data->
destroy = PyObject_GetAttrString(data->
klass,
"__swig_destroy__");
1346 if (PyErr_Occurred()) {
1353 flags = PyCFunction_GET_FLAGS(data->
destroy);
1354 data->
delargs = !(flags & (METH_O));
1366 Py_XDECREF(data->
newraw);
1379 #ifdef SWIGPYTHON_BUILTIN 1385 #ifdef SWIGPYTHON_BUILTIN 1388 SwigPyObject_get___dict__(PyObject *v, PyObject *
SWIGUNUSEDPARM(args))
1393 sobj->dict = PyDict_New();
1395 Py_INCREF(sobj->dict);
1404 return PyLong_FromVoidPtr(v->
ptr);
1410 PyObject *res = NULL;
1411 PyObject *args = PyTuple_New(1);
1416 #if PY_VERSION_HEX >= 0x03000000 1417 res = PyUnicode_Format(ofmt,args);
1419 res = PyString_Format(ofmt,args);
1448 # if PY_VERSION_HEX >= 0x03000000 1449 PyObject *joined = PyUnicode_Concat(repr, nrep);
1454 PyString_ConcatAndDel(&repr,nrep);
1473 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1481 if( op != Py_EQ && op != Py_NE ) {
1482 Py_INCREF(Py_NotImplemented);
1483 return Py_NotImplemented;
1492 #ifdef SWIGPYTHON_BUILTIN 1497 assert(SwigPyObject_stype);
1513 #ifdef SWIGPYTHON_BUILTIN 1515 if (PyType_IsSubtype(op->ob_type, target_tp))
1517 return (strcmp(op->ob_type->tp_name,
"SwigPyObject") == 0);
1520 || (strcmp(
Py_TYPE(op)->tp_name,
"SwigPyObject") == 0);
1535 PyObject *destroy = data ? data->
destroy : 0;
1547 PyObject *type = NULL, *
value = NULL, *traceback = NULL;
1548 PyErr_Fetch(&type, &
value, &traceback);
1556 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1557 PyObject *mself = PyCFunction_GET_SELF(destroy);
1558 res = ((*meth)(mself, v));
1561 PyErr_WriteUnraisable(destroy);
1563 PyErr_Restore(type,
value, traceback);
1567 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) 1570 printf(
"swig/python detected a memory leak of type '%s', no destructor found.\n", (
name ?
name :
"unknown"));
1583 PyErr_SetString(PyExc_TypeError,
"Attempt to append a non SwigPyObject");
1596 Py_INCREF(sobj->
next);
1623 if (!PyArg_UnpackTuple(args,
"own", 0, 1, &val)) {
1627 PyObject *obj = PyBool_FromLong(sobj->
own);
1629 if (PyObject_IsTrue(val)) {
1643 {
"own",
SwigPyObject_own, METH_VARARGS,
"returns/sets ownership of the pointer"},
1652 static char swigobject_doc[] =
"Swig object carries a C/C++ instance pointer";
1654 static PyNumberMethods SwigPyObject_as_number = {
1659 #
if PY_VERSION_HEX < 0x03000000
1675 #
if PY_VERSION_HEX < 0x03000000
1679 #if PY_VERSION_HEX < 0x03000000 1685 #if PY_VERSION_HEX < 0x03000000 1689 #if PY_VERSION_HEX >= 0x03050000 1690 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1691 #elif PY_VERSION_HEX >= 0x03000000 1692 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1694 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1698 static PyTypeObject swigpyobject_type;
1699 static int type_init = 0;
1701 const PyTypeObject tmp = {
1702 #if PY_VERSION_HEX >= 0x03000000 1703 PyVarObject_HEAD_INIT(NULL, 0)
1705 PyObject_HEAD_INIT(NULL)
1715 #if PY_VERSION_HEX >= 0x03000000 1721 &SwigPyObject_as_number,
1727 PyObject_GenericGetAttr,
1758 #
if PY_VERSION_HEX >= 0x03040000
1769 swigpyobject_type = tmp;
1771 if (PyType_Ready(&swigpyobject_type) < 0)
1774 return &swigpyobject_type;
1787 return (PyObject *)sobj;
1828 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1829 return s ? s : strncmp((
const char *)v->
pack, (
const char *)w->
pack, 2*v->
size);
1843 || (strcmp((op)->ob_type->tp_name,
"SwigPyPacked") == 0);
1858 static char swigpacked_doc[] =
"Swig object carries a C/C++ instance pointer";
1859 static PyTypeObject swigpypacked_type;
1860 static int type_init = 0;
1862 const PyTypeObject tmp = {
1863 #if PY_VERSION_HEX>=0x03000000 1864 PyVarObject_HEAD_INIT(NULL, 0)
1866 PyObject_HEAD_INIT(NULL)
1876 #if PY_VERSION_HEX>=0x03000000 1888 PyObject_GenericGetAttr,
1919 #
if PY_VERSION_HEX >= 0x03040000
1930 swigpypacked_type = tmp;
1932 if (PyType_Ready(&swigpypacked_type) < 0)
1935 return &swigpypacked_type;
1943 void *pack =
malloc(size);
1945 memcpy(pack, ptr, size);
1954 return (PyObject *) sobj;
1962 if (sobj->
size != size)
return 0;
1963 memcpy(ptr, sobj->
pack, size);
1987 #if PY_VERSION_HEX>=0x03000000 1988 #define SWIG_PYTHON_SLOW_GETSET_THIS 1999 #ifdef SWIGPYTHON_BUILTIN 2001 # ifdef PyWeakref_CheckProxy 2002 if (PyWeakref_CheckProxy(pyobj)) {
2003 pyobj = PyWeakref_GET_OBJECT(pyobj);
2013 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2014 if (PyInstance_Check(pyobj)) {
2015 obj = _PyInstance_Lookup(pyobj,
SWIG_This());
2017 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2018 if (dictptr != NULL) {
2019 PyObject *dict = *dictptr;
2020 obj = dict ? PyDict_GetItem(dict,
SWIG_This()) : 0;
2022 #ifdef PyWeakref_CheckProxy 2023 if (PyWeakref_CheckProxy(pyobj)) {
2024 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2028 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2032 if (PyErr_Occurred()) PyErr_Clear();
2038 obj = PyObject_GetAttr(pyobj,
SWIG_This());
2042 if (PyErr_Occurred()) PyErr_Clear();
2062 int oldown = sobj->
own;
2080 if (obj == Py_None && !implicit_conv) {
2092 void *vptr = sobj->
ptr;
2097 if (ptr) *ptr = vptr;
2117 if (ptr) *ptr = vptr;
2123 *own = *own | sobj->
own;
2129 if (implicit_conv) {
2132 PyObject *klass = data->
klass;
2138 if (PyErr_Occurred()) {
2163 if (!
SWIG_IsOK(res) && obj == Py_None) {
2166 if (PyErr_Occurred())
2179 if (!PyCFunction_Check(obj)) {
2186 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2187 const char *desc = doc ? strstr(doc,
"swig_ptr: ") : 0;
2233 PyObject *newraw = data->
newraw;
2235 inst = PyObject_Call(newraw, data->
newargs, NULL);
2237 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2238 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2239 if (dictptr != NULL) {
2240 PyObject *dict = *dictptr;
2242 dict = PyDict_New();
2244 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2249 PyObject_SetAttr(inst, key, swig_this);
2253 #if PY_VERSION_HEX >= 0x03000000 2254 PyObject *empty_args = PyTuple_New(0);
2256 PyObject *empty_kwargs = PyDict_New();
2258 inst = ((PyTypeObject *)data->
newargs)->tp_new((PyTypeObject *)data->
newargs, empty_args, empty_kwargs);
2259 Py_DECREF(empty_kwargs);
2261 PyObject_SetAttr(inst,
SWIG_This(), swig_this);
2262 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2265 Py_DECREF(empty_args);
2268 PyObject *dict = PyDict_New();
2270 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2271 inst = PyInstance_NewRaw(data->
newargs, dict);
2283 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) 2284 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2285 if (dictptr != NULL) {
2288 dict = PyDict_New();
2291 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2295 dict = PyObject_GetAttrString(inst,
"__dict__");
2296 PyDict_SetItem(dict,
SWIG_This(), swig_this);
2330 if (clientdata && clientdata->
pytype) {
2335 PyObject *next_self = clientdata->
pytype->tp_alloc(clientdata->
pytype, 0);
2336 while (newobj->
next)
2338 newobj->
next = next_self;
2340 #ifdef SWIGPYTHON_BUILTIN 2346 #ifdef SWIGPYTHON_BUILTIN 2355 return (PyObject*) newobj;
2382 #ifdef SWIG_LINK_RUNTIME 2383 void *SWIG_ReturnGlobalTypeList(
void *);
2388 static void *type_pointer = (
void *)0;
2390 if (!type_pointer) {
2391 #ifdef SWIG_LINK_RUNTIME 2392 type_pointer = SWIG_ReturnGlobalTypeList((
void *)0);
2395 if (PyErr_Occurred()) {
2397 type_pointer = (
void *)0;
2423 #if PY_VERSION_HEX >= 0x03000000 2427 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };
2428 PyObject *module = Py_InitModule(
"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2431 if (pointer && module) {
2434 Py_XDECREF(pointer);
2450 PyObject *obj = PyDict_GetItem(cache, key);
2458 obj = PyCapsule_New((
void*) descriptor, NULL, NULL);
2459 PyDict_SetItem(cache, key, obj);
2470 #define SWIG_POINTER_EXCEPTION 0 2471 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) 2472 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) 2477 if (PyErr_Occurred()) {
2479 PyObject *
value = 0;
2480 PyObject *traceback = 0;
2481 PyErr_Fetch(&type, &
value, &traceback);
2483 PyObject *old_str = PyObject_Str(
value);
2485 const char *errmesg = tmp ? tmp :
"Invalid error message";
2489 PyErr_Format(type,
"%s %s", mesg, errmesg);
2491 PyErr_Format(type,
"%s %s", errmesg, mesg);
2505 if (PyErr_Occurred()) {
2508 PyOS_snprintf(mesg,
sizeof(mesg),
"argument number %d:", argnum);
2520 return ty ? ty->
str :
"";
2527 #if defined(SWIG_COBJECT_TYPES) 2531 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, 'SwigPyObject(%s)' is received",
2538 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2540 PyObject *str = PyObject_Str(obj);
2543 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s(%s)' is received",
2547 PyErr_Format(PyExc_TypeError,
"a '%s' is expected, '%s' is received",
2554 PyErr_Format(PyExc_TypeError,
"a '%s' is expected", type);
2556 PyErr_Format(PyExc_TypeError,
"unexpected type is received");
2567 #if SWIG_POINTER_EXCEPTION 2577 #ifdef SWIGPYTHON_BUILTIN 2579 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *
name, PyObject *
value) {
2580 PyTypeObject *tp = obj->ob_type;
2582 PyObject *encoded_name;
2586 # ifdef Py_USING_UNICODE 2587 if (PyString_Check(
name)) {
2588 name = PyUnicode_Decode(PyString_AsString(
name), PyString_Size(
name), NULL, NULL);
2591 }
else if (!PyUnicode_Check(
name))
2593 if (!PyString_Check(
name))
2596 PyErr_Format(PyExc_TypeError,
"attribute name must be string, not '%.200s'",
name->ob_type->tp_name);
2603 if (PyType_Ready(tp) < 0)
2607 descr = _PyType_Lookup(tp,
name);
2610 f = descr->ob_type->tp_descr_set;
2612 if (PyString_Check(
name)) {
2613 encoded_name =
name;
2616 encoded_name = PyUnicode_AsUTF8String(
name);
2620 PyErr_Format(PyExc_AttributeError,
"'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2621 Py_DECREF(encoded_name);
2623 res = f(descr, obj,
value);
2639 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 2641 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 2660 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 2673 #ifdef SWIG_DIRECTOR_STATIC 2684 #ifndef SWIG_DIRECTOR_PYTHON_HEADER_ 2685 #define SWIG_DIRECTOR_PYTHON_HEADER_ 2689 #include <exception> 2700 #ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE 2701 #ifndef SWIG_PYTHON_DIRECTOR_VTABLE 2702 #define SWIG_PYTHON_DIRECTOR_VTABLE 2712 #ifndef SWIG_DIRECTOR_NO_UEH 2713 #ifndef SWIG_DIRECTOR_UEH 2714 #define SWIG_DIRECTOR_UEH 2724 #ifdef SWIG_DIRECTOR_NORTTI 2729 # ifndef SWIG_DIRECTOR_RTDIR 2730 # define SWIG_DIRECTOR_RTDIR 2734 SWIGINTERN std::map<void *, Director *>& get_rtdir_map() {
2735 static std::map<void *, Director *> rtdir_map;
2740 get_rtdir_map()[vptr] = rtdir;
2744 std::map<void *, Director *>::const_iterator pos = get_rtdir_map().find(vptr);
2745 Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0;
2751 # define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast<void *>(ARG)) 2752 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast<void *>(ARG1), ARG2) 2756 # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG) 2757 # define SWIG_DIRECTOR_RGTR(ARG1, ARG2) 2799 struct GCItem_Object : GCItem {
2814 template <
typename Type>
2815 struct GCItem_T : GCItem {
2827 template <
typename Type>
2828 struct GCArray_T : GCItem {
2841 class DirectorException :
public std::exception {
2851 if (!PyErr_Occurred()) {
2852 PyErr_SetString(error,
what());
2869 static void raise(PyObject *error,
const char *msg) {
2873 static void raise(
const char *msg) {
2874 raise(PyExc_RuntimeError, msg);
2879 class DirectorTypeMismatchException :
public DirectorException {
2889 static void raise(PyObject *error,
const char *msg) {
2893 static void raise(
const char *msg) {
2899 class DirectorMethodException :
public DirectorException {
2905 static void raise(
const char *msg) {
2911 class DirectorPureVirtualException :
public DirectorException {
2914 :
DirectorException(PyExc_RuntimeError,
"SWIG director pure virtual method called", msg) {
2917 static void raise(
const char *msg) {
2923 #if defined(SWIG_PYTHON_THREADS) 2925 # if !defined(__THREAD__) 2926 # define __THREAD__ 1 2931 # include "pythread.h" 2933 PyThread_type_lock &mutex_;
2936 Guard(PyThread_type_lock & mutex) : mutex_(mutex) {
2937 PyThread_acquire_lock(mutex_, WAIT_LOCK);
2941 PyThread_release_lock(mutex_);
2944 # define SWIG_GUARD(mutex) Guard _guard(mutex) 2946 # define SWIG_GUARD(mutex) 2953 PyObject *swig_self;
2955 mutable bool swig_disown_flag;
2958 void swig_decref()
const {
2959 if (swig_disown_flag) {
2961 Py_DECREF(swig_self);
2968 Director(PyObject *
self) : swig_self(self), swig_disown_flag(false) {
2983 if (!swig_disown_flag) {
2984 swig_disown_flag=
true;
2991 if (swig_disown_flag) {
2992 Py_INCREF(swig_self);
3006 typedef std::map<void *, GCItem_var> swig_ownership_map;
3007 mutable swig_ownership_map swig_owner;
3009 static PyThread_type_lock swig_mutex_own;
3013 template <
typename Type>
3021 template <
typename Type>
3040 swig_ownership_map::iterator iter = swig_owner.find(vptr);
3041 if (iter != swig_owner.end()) {
3042 own = iter->second->get_own();
3043 swig_owner.erase(iter);
3049 template <
typename Type>
3056 return PyWeakref_NewProxy(pyobj, NULL);
3061 PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock();
3069 #define SWIGTYPE_p_char swig_types[0] 3070 #define SWIGTYPE_p_int swig_types[1] 3071 #define SWIGTYPE_p_long swig_types[2] 3072 #define SWIGTYPE_p_operations_research__Domain swig_types[3] 3073 #define SWIGTYPE_p_operations_research__sat__CpSatHelper swig_types[4] 3074 #define SWIGTYPE_p_operations_research__sat__IntegerVariableProto swig_types[5] 3075 #define SWIGTYPE_p_operations_research__sat__SolutionCallback swig_types[6] 3076 #define SWIGTYPE_p_operations_research__sat__SolveWrapper swig_types[7] 3077 #define SWIGTYPE_p_short swig_types[8] 3078 #define SWIGTYPE_p_signed_char swig_types[9] 3079 #define SWIGTYPE_p_unsigned_char swig_types[10] 3080 #define SWIGTYPE_p_unsigned_int swig_types[11] 3081 #define SWIGTYPE_p_unsigned_long swig_types[12] 3082 #define SWIGTYPE_p_unsigned_short swig_types[13] 3085 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) 3086 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) 3090 #ifdef SWIG_TypeQuery 3091 # undef SWIG_TypeQuery 3093 #define SWIG_TypeQuery SWIG_Python_TypeQuery 3098 #if PY_VERSION_HEX >= 0x03000000 3099 # define SWIG_init PyInit__pywrapsat 3102 # define SWIG_init init_pywrapsat 3105 #define SWIG_name "_pywrapsat" 3107 #define SWIGVERSION 0x040001 3108 #define SWIG_VERSION SWIGVERSION 3111 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 3112 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 3115 #include <stdexcept> 3119 class SwigPtr_PyObject {
3147 Py_XINCREF(item._obj);
3161 operator PyObject *()
const 3175 struct SwigVar_PyObject : SwigPtr_PyObject {
3198 #define SWIGWORDSIZE64 3202 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) 3203 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32" 3210 #include "ortools/base/python-swig.h" 3213 #include <functional> 3225 PyObject*
get()
const {
return obj_; }
3231 PyObject*
const obj_;
3234 template <
typename ReturnT>
3237 ReturnT result = ReturnT();
3239 if (!PyErr_Occurred()) {
3240 PyErr_SetString(PyExc_RuntimeError,
3241 "SWIG std::function invocation failed.");
3245 if (!PyObjAs<ReturnT>(pyresult, &result)) {
3246 if (!PyErr_Occurred()) {
3247 PyErr_SetString(PyExc_RuntimeError,
3248 "SWIG std::function invocation failed.");
3251 Py_DECREF(pyresult);
3259 if (!PyErr_Occurred()) {
3260 PyErr_SetString(PyExc_RuntimeError,
3261 "SWIG std::function invocation failed.");
3264 Py_DECREF(pyresult);
3268 template <
typename ReturnT,
typename... Args>
3270 const char* format, Args... args) {
3273 return HandleResult<ReturnT>(
3274 PyObject_CallFunction(pyfunc, const_cast<char*>(format), args...));
3277 template <
typename ReturnT>
3279 return HandleResult<ReturnT>(PyObject_CallFunctionObjArgs(pyfunc,
nullptr));
3286 #include "ortools/sat/swig_helper.h" 3289 #define SWIG_From_long PyInt_FromLong 3292 #define SWIG_From_double PyFloat_FromDouble 3296 #if !defined(SWIG_NO_LLONG_MAX) 3297 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) 3298 # define LLONG_MAX __LONG_LONG_MAX__ 3299 # define LLONG_MIN (-LLONG_MAX - 1LL) 3300 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) 3309 if (PyFloat_Check(obj)) {
3310 if (val) *val = PyFloat_AsDouble(obj);
3312 #if PY_VERSION_HEX < 0x03000000 3313 }
else if (PyInt_Check(obj)) {
3314 if (val) *val = (double) PyInt_AsLong(obj);
3317 }
else if (PyLong_Check(obj)) {
3318 double v = PyLong_AsDouble(obj);
3319 if (!PyErr_Occurred()) {
3326 #ifdef SWIG_PYTHON_CAST_MODE 3329 double d = PyFloat_AsDouble(obj);
3330 if (!PyErr_Occurred()) {
3337 long v = PyLong_AsLong(obj);
3338 if (!PyErr_Occurred()) {
3360 if ((
min <= x && x <=
max)) {
3361 double fx = floor(x);
3362 double cx = ceil(x);
3363 double rd = ((x - fx) < 0.5) ? fx : cx;
3364 if ((errno == EDOM) || (errno == ERANGE)) {
3367 double summ, reps, diff;
3370 }
else if (rd > x) {
3377 if (reps < 8*DBL_EPSILON) {
3390 #if PY_VERSION_HEX < 0x03000000 3391 if (PyInt_Check(obj)) {
3392 if (val) *val = PyInt_AsLong(obj);
3396 if (PyLong_Check(obj)) {
3397 long v = PyLong_AsLong(obj);
3398 if (!PyErr_Occurred()) {
3406 #ifdef SWIG_PYTHON_CAST_MODE 3409 long v = PyInt_AsLong(obj);
3410 if (!PyErr_Occurred()) {
3420 if (val) *val = (long)(d);
3436 if ((v < INT_MIN || v > INT_MAX)) {
3439 if (val) *val = static_cast< int >(v);
3449 return PyBool_FromLong(
value ? 1 : 0);
3456 static int init = 0;
3470 if (size > INT_MAX) {
3472 return pchar_descriptor ?
3475 #if PY_VERSION_HEX >= 0x03000000 3476 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3477 return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3479 return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size),
"surrogateescape");
3482 return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3501 #if PY_VERSION_HEX>=0x03000000 3502 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3503 if (PyBytes_Check(obj))
3505 if (PyUnicode_Check(obj))
3508 if (PyString_Check(obj))
3511 char *cstr; Py_ssize_t len;
3513 #if PY_VERSION_HEX>=0x03000000 3514 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3515 if (!alloc && cptr) {
3522 obj = PyUnicode_AsUTF8String(obj);
3528 PyBytes_AsStringAndSize(obj, &cstr, &len);
3530 PyString_AsStringAndSize(obj, &cstr, &len);
3535 *cptr = reinterpret_cast< char* >(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
3542 #if PY_VERSION_HEX>=0x03000000 3543 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3544 *cptr = PyBytes_AsString(obj);
3555 if (psize) *psize = len + 1;
3556 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3561 #if defined(SWIG_PYTHON_2_UNICODE) 3562 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) 3563 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" 3565 #if PY_VERSION_HEX<0x03000000 3566 if (PyUnicode_Check(obj)) {
3567 char *cstr; Py_ssize_t len;
3568 if (!alloc && cptr) {
3571 obj = PyUnicode_AsUTF8String(obj);
3574 if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3577 *cptr = reinterpret_cast< char* >(memcpy(
new char[len + 1], cstr,
sizeof(
char)*(len + 1)));
3579 if (psize) *psize = len + 1;
3591 if (pchar_descriptor) {
3594 if (cptr) *cptr = (
char *) vptr;
3595 if (psize) *psize = vptr ? (strlen((
char *)vptr) + 1) : 0;
3608 char* buf = 0 ;
size_t size = 0;
int alloc =
SWIG_OLDOBJ;
3611 if (val) *val =
new std::string(buf, size - 1);
3619 static int init = 0;
3659 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE) 3660 const size_t swig_method_index = 0;
3661 const char *
const swig_method_name =
"OnSolutionCallback";
3662 PyObject *method = swig_get_method(swig_method_index, swig_method_name);
3670 PyObject *error = PyErr_Occurred();
3684 PyObject *resultobj = 0;
3685 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3688 PyObject *swig_obj[1] ;
3694 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
3696 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3710 PyObject *resultobj = 0;
3711 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3714 PyObject *swig_obj[1] ;
3716 bool upcall =
false;
3722 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_OnSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3724 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3726 upcall = (director && (director->
swig_get_self()==swig_obj[0]));
3731 ((operations_research::sat::SolutionCallback
const *)arg1)->OnSolutionCallback();
3744 PyObject *resultobj = 0;
3745 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3748 PyObject *swig_obj[1] ;
3755 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBooleans" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3757 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3760 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBooleans();
3771 PyObject *resultobj = 0;
3772 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3775 PyObject *swig_obj[1] ;
3782 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBranches" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3784 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3787 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBranches();
3798 PyObject *resultobj = 0;
3799 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3802 PyObject *swig_obj[1] ;
3809 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumConflicts" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3811 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3814 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumConflicts();
3825 PyObject *resultobj = 0;
3826 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3829 PyObject *swig_obj[1] ;
3836 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumBinaryPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3838 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3841 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumBinaryPropagations();
3852 PyObject *resultobj = 0;
3853 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3856 PyObject *swig_obj[1] ;
3863 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_NumIntegerPropagations" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3865 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3868 result = (int64_t)((operations_research::sat::SolutionCallback
const *)arg1)->NumIntegerPropagations();
3879 PyObject *resultobj = 0;
3880 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3883 PyObject *swig_obj[1] ;
3890 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_WallTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3892 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3895 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->WallTime();
3906 PyObject *resultobj = 0;
3907 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3910 PyObject *swig_obj[1] ;
3917 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_UserTime" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3919 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3922 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->UserTime();
3933 PyObject *resultobj = 0;
3934 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3937 PyObject *swig_obj[1] ;
3944 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_ObjectiveValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3946 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3949 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->ObjectiveValue();
3960 PyObject *resultobj = 0;
3961 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3964 PyObject *swig_obj[1] ;
3971 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_BestObjectiveBound" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
3973 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
3976 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->BestObjectiveBound();
3987 PyObject *resultobj = 0;
3988 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
3994 PyObject *swig_obj[2] ;
4000 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_SolutionIntegerValue" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4002 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4007 arg2 = static_cast< int >(val2);
4010 result = (int64_t)(arg1)->SolutionIntegerValue(arg2);
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_SolutionBooleanValue" "', 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 = (bool)(arg1)->SolutionBooleanValue(arg2);
4055 PyObject *resultobj = 0;
4056 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4059 PyObject *swig_obj[1] ;
4065 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4067 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4070 (arg1)->StopSearch();
4081 PyObject *resultobj = 0;
4082 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4085 PyObject *swig_obj[1] ;
4092 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_Response" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4094 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4097 result = ((operations_research::sat::SolutionCallback
const *)arg1)->Response();
4101 PyObject*
const module = PyImport_ImportModule(
"ortools.sat.cp_model_pb2");
4102 if (module !=
nullptr) {
4103 PyObject*
const dict = PyModule_GetDict(module);
4104 if (dict !=
nullptr) {
4105 PyObject*
const clss = PyDict_GetItemString(dict,
"CpSolverResponse");
4106 if (clss !=
nullptr) {
4107 std::string encoded_protobuf;
4108 (&result)->SerializeToString(&encoded_protobuf);
4110 PyObject*
const python_encoded_protobuf = PyBytes_FromStringAndSize(
4111 encoded_protobuf.c_str(), encoded_protobuf.size());
4116 PyObject*
const result = PyObject_CallMethod(
4117 clss, const_cast<char*>(
"FromString"),
4118 const_cast<char*>(
"(O)"),
4119 python_encoded_protobuf);
4120 Py_DECREF(python_encoded_protobuf);
4134 PyObject *resultobj = 0;
4135 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4138 PyObject *swig_obj[1] ;
4145 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolutionCallback_HasResponse" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback const *""'");
4147 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4150 result = (bool)((operations_research::sat::SolutionCallback
const *)arg1)->HasResponse();
4161 PyObject *resultobj = 0;
4162 PyObject *arg1 = (PyObject *) 0 ;
4163 PyObject *swig_obj[1] ;
4164 operations_research::sat::SolutionCallback *result = 0 ;
4171 if ( arg1 != Py_None ) {
4175 SWIG_SetErrorMsg(PyExc_RuntimeError,
"accessing abstract class or protected constructor");
4189 PyObject *resultobj = 0;
4190 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
4193 PyObject *swig_obj[1] ;
4199 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "disown_SolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolutionCallback *""'");
4201 arg1 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp1);
4230 PyObject *resultobj = 0;
4231 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4235 PyObject *swig_obj[2] ;
4240 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_SetParameters" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4242 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4245 PyObject*
const pyresult = PyObject_CallMethod(
4246 swig_obj[1], const_cast<char*>(
"SerializeToString"),
nullptr);
4247 if (pyresult !=
nullptr) {
4248 char* buffer =
nullptr;
4249 Py_ssize_t length = 0;
4250 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4251 if (buffer !=
nullptr) {
4252 arg2->ParseFromArray(buffer, length);
4254 Py_DECREF(pyresult);
4276 PyObject *resultobj = 0;
4277 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4278 operations_research::sat::SolutionCallback *arg2 = 0 ;
4283 PyObject *swig_obj[2] ;
4288 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_AddSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4290 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4293 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4296 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "SolveWrapper_AddSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4298 arg2 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp2);
4301 (arg1)->AddSolutionCallback((operations_research::sat::SolutionCallback
const &)*arg2);
4312 PyObject *resultobj = 0;
4313 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4314 operations_research::sat::SolutionCallback *arg2 = 0 ;
4319 PyObject *swig_obj[2] ;
4324 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4326 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4329 SWIG_exception_fail(
SWIG_ArgError(res2),
"in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4332 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "SolveWrapper_ClearSolutionCallback" "', argument " "2"" of type '" "operations_research::sat::SolutionCallback const &""'");
4334 arg2 = reinterpret_cast< operations_research::sat::SolutionCallback * >(argp2);
4337 (arg1)->ClearSolutionCallback((operations_research::sat::SolutionCallback
const &)*arg2);
4348 PyObject *resultobj = 0;
4349 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4350 SwigValueWrapper< std::function< void (std::string
const &) > > arg2 ;
4353 PyObject *swig_obj[2] ;
4358 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_AddLogCallback" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4360 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4363 arg2 = [
input](
const std::string& str) {
4364 PyObject* py_str = PyUnicode_FromStringAndSize(str.c_str(), str.size());
4367 result = PyObject_CallFunction(
input.get(),
"O", py_str);
4375 (arg1)->AddLogCallback(arg2);
4386 PyObject *resultobj = 0;
4387 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4391 PyObject *swig_obj[2] ;
4399 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4402 PyObject*
const pyresult = PyObject_CallMethod(
4403 swig_obj[1], const_cast<char*>(
"SerializeToString"),
nullptr);
4404 if (pyresult !=
nullptr) {
4405 char* buffer =
nullptr;
4406 Py_ssize_t length = 0;
4407 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4408 if (buffer !=
nullptr) {
4409 arg2->ParseFromArray(buffer, length);
4411 Py_DECREF(pyresult);
4420 PyObject*
const module = PyImport_ImportModule(
"ortools.sat.cp_model_pb2");
4421 if (module !=
nullptr) {
4422 PyObject*
const dict = PyModule_GetDict(module);
4423 if (dict !=
nullptr) {
4424 PyObject*
const clss = PyDict_GetItemString(dict,
"CpSolverResponse");
4425 if (clss !=
nullptr) {
4426 std::string encoded_protobuf;
4427 (&result)->SerializeToString(&encoded_protobuf);
4429 PyObject*
const python_encoded_protobuf = PyBytes_FromStringAndSize(
4430 encoded_protobuf.c_str(), encoded_protobuf.size());
4435 PyObject*
const result = PyObject_CallMethod(
4436 clss, const_cast<char*>(
"FromString"),
4437 const_cast<char*>(
"(O)"),
4438 python_encoded_protobuf);
4439 Py_DECREF(python_encoded_protobuf);
4459 PyObject *resultobj = 0;
4460 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4463 PyObject *swig_obj[1] ;
4469 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "SolveWrapper_StopSearch" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4471 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4474 (arg1)->StopSearch();
4485 PyObject *resultobj = 0;
4486 operations_research::sat::SolveWrapper *result = 0 ;
4491 result = (operations_research::sat::SolveWrapper *)
new operations_research::sat::SolveWrapper();
4502 PyObject *resultobj = 0;
4503 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
4506 PyObject *swig_obj[1] ;
4512 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "delete_SolveWrapper" "', argument " "1"" of type '" "operations_research::sat::SolveWrapper *""'");
4514 arg1 = reinterpret_cast< operations_research::sat::SolveWrapper * >(argp1);
4539 PyObject *resultobj = 0;
4541 PyObject *swig_obj[1] ;
4548 PyObject*
const pyresult = PyObject_CallMethod(
4549 swig_obj[0], const_cast<char*>(
"SerializeToString"),
nullptr);
4550 if (pyresult !=
nullptr) {
4551 char* buffer =
nullptr;
4552 Py_ssize_t length = 0;
4553 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4554 if (buffer !=
nullptr) {
4555 arg1->ParseFromArray(buffer, length);
4557 Py_DECREF(pyresult);
4579 PyObject *resultobj = 0;
4581 PyObject *swig_obj[1] ;
4588 PyObject*
const pyresult = PyObject_CallMethod(
4589 swig_obj[0], const_cast<char*>(
"SerializeToString"),
nullptr);
4590 if (pyresult !=
nullptr) {
4591 char* buffer =
nullptr;
4592 Py_ssize_t length = 0;
4593 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4594 if (buffer !=
nullptr) {
4595 arg1->ParseFromArray(buffer, length);
4597 Py_DECREF(pyresult);
4619 PyObject *resultobj = 0;
4621 PyObject *swig_obj[1] ;
4628 PyObject*
const pyresult = PyObject_CallMethod(
4629 swig_obj[0], const_cast<char*>(
"SerializeToString"),
nullptr);
4630 if (pyresult !=
nullptr) {
4631 char* buffer =
nullptr;
4632 Py_ssize_t length = 0;
4633 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4634 if (buffer !=
nullptr) {
4635 arg1->ParseFromArray(buffer, length);
4637 Py_DECREF(pyresult);
4659 PyObject *resultobj = 0;
4663 PyObject *swig_obj[1] ;
4670 SWIG_exception_fail(
SWIG_ArgError(res1),
"in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4673 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "CpSatHelper_VariableDomain" "', argument " "1"" of type '" "operations_research::sat::IntegerVariableProto const &""'");
4675 arg1 = reinterpret_cast< operations_research::sat::IntegerVariableProto * >(argp1);
4689 PyObject *resultobj = 0;
4691 std::string *arg2 = 0 ;
4693 PyObject *swig_obj[2] ;
4699 PyObject*
const pyresult = PyObject_CallMethod(
4700 swig_obj[0], const_cast<char*>(
"SerializeToString"),
nullptr);
4701 if (pyresult !=
nullptr) {
4702 char* buffer =
nullptr;
4703 Py_ssize_t length = 0;
4704 int result = PyString_AsStringAndSize(pyresult, &buffer, &length);
4705 if (buffer !=
nullptr) {
4706 arg1->ParseFromArray(buffer, length);
4708 Py_DECREF(pyresult);
4712 std::string *ptr = (std::string *)0;
4718 SWIG_exception_fail(
SWIG_ValueError,
"invalid null reference " "in method '" "CpSatHelper_WriteModelToFile" "', argument " "2"" of type '" "std::string const &""'");
4743 PyObject *resultobj = 0;
4744 operations_research::sat::CpSatHelper *result = 0 ;
4749 result = (operations_research::sat::CpSatHelper *)
new operations_research::sat::CpSatHelper();
4760 PyObject *resultobj = 0;
4761 operations_research::sat::CpSatHelper *arg1 = (operations_research::sat::CpSatHelper *) 0 ;
4764 PyObject *swig_obj[1] ;
4772 arg1 = reinterpret_cast< operations_research::sat::CpSatHelper * >(argp1);
4837 { NULL, NULL, 0, NULL }
4841 { NULL, NULL, 0, NULL }
4849 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};
4859 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};
4915 {0, 0, 0, 0.0, 0, 0}};
4969 #define SWIGRUNTIME_DEBUG 5005 }
while (iter!= module_head);
5016 if (init == 0)
return;
5019 #ifdef SWIGRUNTIME_DEBUG 5020 printf(
"SWIG_InitializeModule: size %lu\n", (
unsigned long)
swig_module.
size);
5027 #ifdef SWIGRUNTIME_DEBUG 5037 #ifdef SWIGRUNTIME_DEBUG 5038 printf(
"SWIG_InitializeModule: found type %s\n", type->
name);
5042 #ifdef SWIGRUNTIME_DEBUG 5043 printf(
"SWIG_InitializeModule: found and overwrite type %s \n", type->
name);
5052 while (cast->
type) {
5055 #ifdef SWIGRUNTIME_DEBUG 5056 printf(
"SWIG_InitializeModule: look cast %s\n", cast->
type->
name);
5060 #ifdef SWIGRUNTIME_DEBUG 5061 if (ret) printf(
"SWIG_InitializeModule: found cast %s\n", ret->
name);
5066 #ifdef SWIGRUNTIME_DEBUG 5067 printf(
"SWIG_InitializeModule: skip old type %s\n", ret->
name);
5074 #ifdef SWIGRUNTIME_DEBUG 5075 if (ocast) printf(
"SWIG_InitializeModule: skip old cast %s\n", ret->
name);
5077 if (!ocast) ret = 0;
5082 #ifdef SWIGRUNTIME_DEBUG 5083 printf(
"SWIG_InitializeModule: adding cast %s\n", cast->
type->
name);
5098 #ifdef SWIGRUNTIME_DEBUG 5099 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
5104 while (cast->
type) {
5105 printf(
"SWIG_InitializeModule: cast type %s\n", cast->
type->
name);
5109 printf(
"---- Total casts: %d\n",j);
5111 printf(
"**** SWIG_InitializeModule: Cast List ******\n");
5124 static int init_run = 0;
5126 if (init_run)
return;
5137 equiv = equiv->
next;
5158 #define SWIG_newvarlink() SWIG_Python_newvarlink() 5159 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) 5160 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) 5168 PyObject *(*get_attr)(void);
5180 #if PY_VERSION_HEX >= 0x03000000 5181 return PyUnicode_InternFromString(
"<Swig global variables>");
5183 return PyString_FromString(
"<Swig global variables>");
5189 #if PY_VERSION_HEX >= 0x03000000 5190 PyObject *str = PyUnicode_InternFromString(
"(");
5195 tail = PyUnicode_FromString(
var->name);
5196 joined = PyUnicode_Concat(str,
tail);
5201 tail = PyUnicode_InternFromString(
", ");
5202 joined = PyUnicode_Concat(str,
tail);
5208 tail = PyUnicode_InternFromString(
")");
5209 joined = PyUnicode_Concat(str,
tail);
5214 PyObject *str = PyString_FromString(
"(");
5217 PyString_ConcatAndDel(&str,PyString_FromString(
var->name));
5218 if (
var->next) PyString_ConcatAndDel(&str,PyString_FromString(
", "));
5220 PyString_ConcatAndDel(&str,PyString_FromString(
")"));
5238 PyObject *res = NULL;
5241 if (strcmp(
var->name,n) == 0) {
5242 res = (*
var->get_attr)();
5247 if (res == NULL && !PyErr_Occurred()) {
5248 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
5258 if (strcmp(
var->name,n) == 0) {
5259 res = (*
var->set_attr)(p);
5264 if (res == 1 && !PyErr_Occurred()) {
5265 PyErr_Format(PyExc_AttributeError,
"Unknown C global variable '%s'", n);
5272 static char varlink__doc__[] =
"Swig var link object";
5273 static PyTypeObject varlink_type;
5274 static int type_init = 0;
5276 const PyTypeObject tmp = {
5277 #if PY_VERSION_HEX >= 0x03000000 5278 PyVarObject_HEAD_INIT(NULL, 0)
5280 PyObject_HEAD_INIT(NULL)
5307 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5310 #if PY_VERSION_HEX >= 0x03040000 5323 if (PyType_Ready(&varlink_type) < 0)
5326 return &varlink_type;
5336 return ((PyObject*) result);
5344 size_t size = strlen(
name)+1;
5358 static PyObject *globals = 0;
5374 for (i = 0; constants[i].
type; ++i) {
5375 switch(constants[i].type) {
5380 obj =
SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
5387 PyDict_SetItemString(d, constants[i].
name, obj);
5403 for (i = 0; methods[i].ml_name; ++i) {
5404 const char *c = methods[i].ml_doc;
5406 c = strstr(c,
"swig_ptr: ");
5410 const char *
name = c + 10;
5411 for (j = 0; const_table[j].
type; ++j) {
5412 if (strncmp(const_table[j].
name,
name,
5413 strlen(const_table[j].
name)) == 0) {
5414 ci = &(const_table[j]);
5421 size_t shift = (ci->
ptype) - types;
5423 size_t ldoc = (c - methods[i].ml_doc);
5424 size_t lptr = strlen(ty->
name)+2*
sizeof(
void*)+2;
5425 char *ndoc = (
char*)
malloc(ldoc + lptr + 10);
5428 memcpy(buff, methods[i].ml_doc, ldoc);
5430 memcpy(buff,
"swig_ptr: ", 10);
5433 methods[i].ml_doc = ndoc;
5471 if (PyCFunction_Check(func)) {
5472 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5475 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5477 #if PY_VERSION_HEX >= 0x03000000 5478 return PyInstanceMethod_New(func);
5480 return PyMethod_New(func, NULL, NULL);
5490 if (PyCFunction_Check(func)) {
5491 PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
5494 func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
5496 return PyStaticMethod_New(func);
5512 #if PY_VERSION_HEX >= 0x03000000 5518 PyObject *m, *d, *md, *globals;
5520 #if PY_VERSION_HEX >= 0x03000000 5521 static struct PyModuleDef SWIG_module = {
5522 PyModuleDef_HEAD_INIT,
5534 #if defined(SWIGPYTHON_BUILTIN) 5538 static PyGetSetDef this_getset_def = {
5539 (
char *)
"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
5541 static SwigPyGetSet thisown_getset_closure = {
5545 static PyGetSetDef thisown_getset_def = {
5546 (
char *)
"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
5548 PyTypeObject *builtin_pytype;
5549 int builtin_base_count;
5552 PyGetSetDescrObject *static_getset;
5553 PyTypeObject *metatype;
5554 PyTypeObject *swigpyobject;
5556 PyObject *public_interface, *public_symbol;
5557 PyObject *this_descr;
5558 PyObject *thisown_descr;
5562 (void)builtin_pytype;
5563 (void)builtin_base_count;
5564 (void)builtin_basetype;
5566 (void)static_getset;
5570 metatype = SwigPyObjectType();
5580 #ifndef SWIGPYTHON_BUILTIN 5587 #if PY_VERSION_HEX >= 0x03000000 5588 m = PyModule_Create(&SWIG_module);
5593 md = d = PyModule_GetDict(m);
5598 #ifdef SWIGPYTHON_BUILTIN 5602 assert(SwigPyObject_stype);
5605 SwigPyObject_stype->
clientdata = &SwigPyObject_clientdata;
5606 SwigPyObject_clientdata.
pytype = swigpyobject;
5607 }
else if (swigpyobject->tp_basicsize != cd->
pytype->tp_basicsize) {
5608 PyErr_SetString(PyExc_RuntimeError,
"Import error: attempted to load two incompatible swig-generated modules.");
5609 # if PY_VERSION_HEX >= 0x03000000 5622 (void)thisown_descr;
5624 public_interface = PyList_New(0);
5626 (void)public_symbol;
5628 PyDict_SetItemString(md,
"__all__", public_interface);
5629 Py_DECREF(public_interface);
5631 SwigPyBuiltin_AddPublicSymbol(public_interface,
SwigMethods[i].ml_name);
5641 #if PY_VERSION_HEX >= 0x03000000 SWIGINTERN PyObject * SolveWrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_int
SWIGINTERN PyObject * _wrap_CpSatHelper_ValidateModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
virtual ~DirectorException()
SWIGINTERN PyObject * _wrap_SolveWrapper_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char *carray, size_t size)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
virtual void OnSolutionCallback() const
SWIGINTERN PyObject * CpSatHelper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_cast_info * cast
static swig_cast_info _swigc__p_operations_research__Domain[]
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
struct swig_cast_info * next
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static swig_type_info _swigt__p_unsigned_int
PyObject * swig_get_self() const
SWIGRUNTIME PyObject * SWIG_This(void)
#define SWIG_MangledTypeQuery(name)
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
void *(* swig_converter_func)(void *, int *)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGINTERN PyObject * _wrap_SolutionCallback_StopSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
static swig_cast_info _swigc__p_operations_research__sat__IntegerVariableProto[]
static swig_cast_info _swigc__p_unsigned_short[]
SWIGINTERN PyObject * CpSatHelper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
#define SWIGTYPE_p_operations_research__Domain
SWIGINTERN PyObject * _wrap_CpSatHelper_VariableDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
struct swig_cast_info swig_cast_info
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
#define SWIG_NullReferenceError
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
static swig_type_info _swigt__p_signed_char
static swig_cast_info _swigc__p_signed_char[]
PyObject * operator->() const
SWIGINTERN int SWIG_AsVal_long(PyObject *obj, long *val)
const char * what() const
struct swig_type_info swig_type_info
DirectorMethodException(const char *msg="")
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
#define SWIG_RUNTIME_VERSION
swig_type_info ** type_initial
DirectorPureVirtualException(const char *msg)
virtual ~SwigDirector_SolutionCallback()
SWIGINTERN PyObject * _wrap_new_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolveWrapper_AddLogCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static void raise(const char *msg)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
SharedPyPtr(const SharedPyPtr &other)
SWIGRUNTIME void SWIG_PropagateClientData(void)
virtual int get_own() const
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
SWIGINTERN PyObject * _wrap_SolutionCallback_OnSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
#define SWIG_OverflowError
static swig_cast_info _swigc__p_short[]
#define SWIG_STATIC_POINTER(var)
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
SWIGINTERN PyObject * _wrap_SolutionCallback_BestObjectiveBound(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
SWIGINTERN PyObject * _wrap_SolutionCallback_ObjectiveValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionBooleanValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGINTERN PyObject * SolveWrapper_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_SolveWrapper_AddSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
GCItem_var(GCItem *item=0)
#define SWIGPY_CAPSULE_NAME
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
PyObject_HEAD void * pack
#define SWIG_SetModule(clientdata, pointer)
GCItem * operator->() const
PyObject *(* get_attr)(void)
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max)
PyObject_HEAD swig_globalvar * vars
static swig_type_info _swigt__p_operations_research__sat__SolutionCallback
void swig_acquire_ownership(Type *vptr) const
struct swig_type_info *(* swig_dycast_func)(void **)
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
int(* set_attr)(PyObject *)
static swig_type_info * swig_type_initial[]
virtual void swig_set_inner(const char *, bool) const
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
swig_cast_info ** cast_initial
static void raise(const char *msg)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
static PyMethodDef SwigMethods_proxydocs[]
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SWIGINTERN PyObject * _wrap_delete_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
void swig_acquire_ownership_array(Type *vptr) const
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
#define SWIG_PYTHON_INITIALIZE_THREADS
struct swig_globalvar * next
SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
#define SWIGTYPE_p_operations_research__sat__CpSatHelper
SWIGINTERN PyObject * _wrap_delete_SolveWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_Python_str_FromFormat
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_POINTER_NO_NULL
static PyMethodDef swigobject_methods[]
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
static swig_cast_info * swig_cast_initial[]
SWIGINTERN PyObject * _wrap_SolutionCallback_WallTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
#define SWIGUNUSEDPARM(p)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumIntegerPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_cast_info * prev
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
SWIGINTERN PyObject * SolutionCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_DISOWN
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
static swig_cast_info _swigc__p_operations_research__sat__SolutionCallback[]
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
SWIGINTERN PyObject * _wrap_disown_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AddNewMask(r)
static swig_cast_info _swigc__p_operations_research__sat__CpSatHelper[]
#define SWIG_POINTER_NOSHADOW
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
static swig_cast_info _swigc__p_unsigned_char[]
#define SWIG_NewPackedObj(ptr, sz, type)
SwigDirector_SolutionCallback()
#define SWIG_Python_str_DelForPy3(x)
static swig_cast_info _swigc__p_unsigned_long[]
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
struct swig_module_info swig_module_info
#define SWIG_exception_fail(code, msg)
#define SWIG_GetModule(clientdata)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
static swig_type_info _swigt__p_char
#define SWIG_NewPointerObj(ptr, type, flags)
static ReturnT HandleResult(PyObject *pyresult)
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
SWIGINTERN PyObject * _wrap_SolutionCallback_SolutionIntegerValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_operations_research__sat__IntegerVariableProto
#define SWIGTYPE_p_operations_research__sat__SolveWrapper
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
static void raise(JNIEnv *jenv, jthrowable throwable)
#define SWIG_DIRECTOR_CAST(ARG)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
#define SWIG_GUARD(mutex)
struct swig_varlinkobject swig_varlinkobject
static int input(yyscan_t yyscanner)
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
#define SWIG_TypeQuery(name)
static swig_const_info swig_const_table[]
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
SWIGINTERNINLINE PyObject * SWIG_From_std_string(const std::string &s)
SwigVar_PyObject(PyObject *obj=0)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumConflicts(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_new_SolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
struct swig_module_info * next
DirectorException(PyObject *error, const char *hdr="", const char *msg="")
SWIGINTERN PyObject * _wrap_SolveWrapper_Solve(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SWIGINTERN PyObject * _wrap_SolutionCallback_Response(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_BUILTIN_TP_INIT
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
#define SWIG_NewClientData(obj)
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBooleans(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * _wrap_delete_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
struct swig_const_info swig_const_info
#define SWIG_Python_CallFunctor(functor, obj)
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static PyMethodDef SwigMethods[]
#define SWIG_CAST_NEW_MEMORY
static swig_module_info swig_module
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
#define SWIG_RuntimeError
DirectorTypeMismatchException(PyObject *error, const char *msg="")
#define SWIGTYPE_p_operations_research__sat__IntegerVariableProto
static swig_cast_info _swigc__p_int[]
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
#define SWIG_TYPE_TABLE_NAME
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
static swig_type_info _swigt__p_operations_research__sat__CpSatHelper
#define SWIGRUNTIMEINLINE
#define SWIG_ConvertPtr(obj, pptr, type, flags)
SwigVar_PyObject & operator=(PyObject *obj)
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
static swig_cast_info _swigc__p_char[]
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
We call domain any subset of Int64 = [kint64min, kint64max].
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
SWIGINTERN PyObject * _wrap_SolveWrapper_ClearSolutionCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
SWIGINTERN PyObject * _wrap_SolutionCallback_UserTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info _swigt__p_unsigned_long
SharedPyPtr(PyObject *obj)
SWIGINTERN PyObject * _wrap_CpSatHelper_ModelStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBranches(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIGTYPE_p_operations_research__sat__SolutionCallback
SWIGINTERN PyObject * _wrap_SolveWrapper_SetParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
#define SWIG_DIRECTOR_RGTR(ARG1, ARG2)
DirectorException(const char *msg)
void HandleResult< void >(PyObject *pyresult)
SWIGINTERN PyObject * _wrap_SolutionCallback_HasResponse(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyObject * SWIG_globals(void)
#define SWIG_CheckState(r)
struct swig_globalvar swig_globalvar
static swig_type_info _swigt__p_unsigned_short
SWIGINTERN PyObject * _wrap_SolutionCallback_NumBinaryPropagations(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AttributeError
SWIGINTERN PyObject * _wrap_CpSatHelper_SolverResponseStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
static PyObject * swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
absl::Status ValidateModel(const ModelProto &model, const bool check_names)
SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val)
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
Collection of objects used to extend the Constraint Solver library.
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
DirectorPureVirtualException(const char *msg="")
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
Guard(PyThread_type_lock &mutex)
GCItem_var & operator=(GCItem *item)
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
#define SWIG_PYTHON_THREAD_END_BLOCK
#define SWIG_as_voidptr(a)
const char * getMessage() const
void swig_acquire_ownership_obj(void *vptr, int own) const
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
jobject swig_get_self(JNIEnv *jenv) const
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
static swig_type_info _swigt__p_operations_research__Domain
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
static swig_type_info _swigt__p_unsigned_char
#define SWIG_newvarlink()
#define SWIG_PYTHON_THREAD_END_ALLOW
swig_converter_func converter
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
virtual bool swig_get_inner(const char *) const
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
static swig_cast_info _swigc__p_unsigned_int[]
DirectorTypeMismatchException(const char *msg="")
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static swig_cast_info _swigc__p_long[]
static swig_cast_info _swigc__p_operations_research__sat__SolveWrapper[]
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
int swig_release_ownership(void *vptr) const
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
static swig_type_info * swig_types[15]
#define SWIG_DivisionByZero
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN PyObject * _wrap_CpSatHelper_WriteModelToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_POINTER_IMPLICIT_CONV
static ReturnT InvokePythonCallableReturning(PyObject *pyfunc, const char *format, Args... args)
static swig_type_info _swigt__p_long
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val)
#define SWIG_InstallConstants(d, constants)
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
static swig_type_info _swigt__p_operations_research__sat__SolveWrapper
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGINTERN PyObject * _wrap_new_CpSatHelper(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
static swig_type_info _swigt__p_short
SWIGINTERN PyObject * SolutionCallback_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static PyObject * Swig_This_global
SwigPtr_PyObject(const SwigPtr_PyObject &item)