16 #define SWIG_DIRECTORS
21 template<
typename T>
class SwigValueWrapper {
22 struct SwigMovePointer {
24 SwigMovePointer(T *p) : ptr(p) { }
25 ~SwigMovePointer() {
delete ptr; }
26 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0;
delete oldptr; ptr = rhs.ptr; rhs.ptr = 0;
return *
this; }
28 SwigValueWrapper& operator=(
const SwigValueWrapper<T>& rhs);
29 SwigValueWrapper(
const SwigValueWrapper<T>& rhs);
31 SwigValueWrapper() : pointer(0) { }
32 SwigValueWrapper& operator=(
const T& t) { SwigMovePointer tmp(
new T(t)); pointer = tmp;
return *
this; }
33 operator T&()
const {
return *pointer.ptr; }
34 T *operator&() {
return pointer.ptr; }
37 template <
typename T> T SwigValueInit() {
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR
49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
50 # define SWIGTEMPLATEDISAMBIGUATOR template
51 # elif defined(__HP_aCC)
54 # define SWIGTEMPLATEDISAMBIGUATOR template
56 # define SWIGTEMPLATEDISAMBIGUATOR
62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
63 # define SWIGINLINE inline
71 # if defined(__GNUC__)
72 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
73 # define SWIGUNUSED __attribute__ ((__unused__))
78 # define SWIGUNUSED __attribute__ ((__unused__))
84 #ifndef SWIG_MSC_UNSUPPRESS_4505
85 # if defined(_MSC_VER)
86 # pragma warning(disable : 4505)
90 #ifndef SWIGUNUSEDPARM
92 # define SWIGUNUSEDPARM(p)
94 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
100 # define SWIGINTERN static SWIGUNUSED
104 #ifndef SWIGINTERNINLINE
105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
109 #if defined(__GNUC__)
110 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
111 # ifndef GCC_HASCLASSVISIBILITY
112 # define GCC_HASCLASSVISIBILITY
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 # if defined(STATIC_LINKED)
122 # define SWIGEXPORT __declspec(dllexport)
125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 # define SWIGEXPORT __attribute__ ((visibility("default")))
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 # define SWIGSTDCALL __stdcall
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
162 #ifdef __INTEL_COMPILER
163 # pragma warning disable 592
300 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else
313 #ifdef SWIG_DIRECTOR_STATIC
324 #if defined(DEBUG_DIRECTOR_OWNED)
336 class DirectorException :
public std::exception {
350 const char *
what()
const throw() {
356 class DirectorPureVirtualException :
public DirectorException {
361 static void raise(
const char *msg) {
371 #define SWIGWORDSIZE64
375 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
376 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
396 #include "ortools/sat/swig_helper.h"
407 swig_init_callbacks();
416 if (!swig_callbackOnSolutionCallback) {
420 swig_callbackOnSolutionCallback();
425 swig_callbackOnSolutionCallback = callbackOnSolutionCallback;
428 void SwigDirector_SolutionCallback::swig_init_callbacks() {
429 swig_callbackOnSolutionCallback = 0;
438 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
440 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
446 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
448 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
449 ((operations_research::sat::SolutionCallback
const *)arg1)->OnSolutionCallback();
455 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
458 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
459 result = (
int64)((operations_research::sat::SolutionCallback
const *)arg1)->NumBooleans();
467 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
470 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
471 result = (
int64)((operations_research::sat::SolutionCallback
const *)arg1)->NumBranches();
479 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
482 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
483 result = (
int64)((operations_research::sat::SolutionCallback
const *)arg1)->NumConflicts();
491 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
494 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
495 result = (
int64)((operations_research::sat::SolutionCallback
const *)arg1)->NumBinaryPropagations();
503 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
506 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
507 result = (
int64)((operations_research::sat::SolutionCallback
const *)arg1)->NumIntegerPropagations();
515 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
518 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
519 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->WallTime();
527 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
530 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
531 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->UserTime();
539 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
542 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
543 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->ObjectiveValue();
551 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
554 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
555 result = (double)((operations_research::sat::SolutionCallback
const *)arg1)->BestObjectiveBound();
563 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
567 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
569 result = (
int64)(arg1)->SolutionIntegerValue(arg2);
576 unsigned int jresult ;
577 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
581 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
583 result = (bool)(arg1)->SolutionBooleanValue(arg2);
590 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
592 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
593 (arg1)->StopSearch();
599 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
602 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
603 result = ((operations_research::sat::SolutionCallback
const *)arg1)->Response();
605 const long size = (&result)->ByteSizeLong();
606 jresult =
new uint8[size + 4];
607 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
608 jresult[0] = size & 0xFF;
609 jresult[1] = (size >> 8) & 0xFF;
610 jresult[2] = (size >> 16) & 0xFF;
611 jresult[3] = (size >> 24) & 0xFF;
619 operations_research::sat::SolutionCallback *result = 0 ;
622 jresult = (
void *)result;
628 operations_research::sat::SolutionCallback *obj = (operations_research::sat::SolutionCallback *)objarg;
641 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
645 "Unable to parse operations_research::sat::CpModelProto protocol message.");
650 const long size = (&result)->ByteSizeLong();
651 jresult =
new uint8[size + 4];
652 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
653 jresult[0] = size & 0xFF;
654 jresult[1] = (size >> 8) & 0xFF;
655 jresult[2] = (size >> 16) & 0xFF;
656 jresult[3] = (size >> 24) & 0xFF;
668 std::string *arg2 = 0 ;
673 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
677 "Unable to parse operations_research::sat::CpModelProto protocol message.");
684 std::string arg2_str(jarg2);
688 const long size = (&result)->ByteSizeLong();
689 jresult =
new uint8[size + 4];
690 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
691 jresult[0] = size & 0xFF;
692 jresult[1] = (size >> 8) & 0xFF;
693 jresult[2] = (size >> 16) & 0xFF;
694 jresult[3] = (size >> 24) & 0xFF;
706 std::string *arg2 = 0 ;
707 operations_research::sat::SolutionCallback *arg3 = 0 ;
712 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
716 "Unable to parse operations_research::sat::CpModelProto protocol message.");
723 std::string arg2_str(jarg2);
725 arg3 = (operations_research::sat::SolutionCallback *)jarg3;
730 result = operations_research::sat::SatHelper::SolveWithStringParametersAndSolutionCallback((
operations_research::sat::CpModelProto const &)*arg1,(std::string
const &)*arg2,(operations_research::sat::SolutionCallback
const &)*arg3);
732 const long size = (&result)->ByteSizeLong();
733 jresult =
new uint8[size + 4];
734 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
735 jresult[0] = size & 0xFF;
736 jresult[1] = (size >> 8) & 0xFF;
737 jresult[2] = (size >> 16) & 0xFF;
738 jresult[3] = (size >> 24) & 0xFF;
754 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
758 "Unable to parse operations_research::sat::CpModelProto protocol message.");
777 bool parsed_ok = arg1->ParseFromArray(jarg1, response_size);
781 "Unable to parse operations_research::sat::CpSolverResponse protocol message.");
800 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
804 "Unable to parse operations_research::sat::CpModelProto protocol message.");
823 bool parsed_ok = arg1->ParseFromArray(jarg1, variable_proto_size);
827 "Unable to parse operations_research::sat::IntegerVariableProto protocol message.");
841 operations_research::sat::SatHelper *result = 0 ;
843 result = (operations_research::sat::SatHelper *)
new operations_research::sat::SatHelper();
844 jresult = (
void *)result;
850 operations_research::sat::SatHelper *arg1 = (operations_research::sat::SatHelper *) 0 ;
852 arg1 = (operations_research::sat::SatHelper *)jarg1;