OR-Tools  9.0
sat_csharp_wrap.cc
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGCSHARP
13 #define SWIGCSHARP
14 #endif
15 
16 #define SWIG_DIRECTORS
17 
18 
19 #ifdef __cplusplus
20 /* SwigValueWrapper is described in swig.swg */
21 template<typename T> class SwigValueWrapper {
22  struct SwigMovePointer {
23  T *ptr;
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; }
27  } pointer;
28  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
29  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
30 public:
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; }
35 };
36 
37 template <typename T> T SwigValueInit() {
38  return T();
39 }
40 #endif
41 
42 /* -----------------------------------------------------------------------------
43  * This section contains generic SWIG labels for method/variable
44  * declarations/attributes, and other compiler dependent labels.
45  * ----------------------------------------------------------------------------- */
46 
47 /* template workaround for compilers that cannot correctly implement the C++ standard */
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR
49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
50 # define SWIGTEMPLATEDISAMBIGUATOR template
51 # elif defined(__HP_aCC)
52 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
53 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
54 # define SWIGTEMPLATEDISAMBIGUATOR template
55 # else
56 # define SWIGTEMPLATEDISAMBIGUATOR
57 # endif
58 #endif
59 
60 /* inline attribute */
61 #ifndef SWIGINLINE
62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
63 # define SWIGINLINE inline
64 # else
65 # define SWIGINLINE
66 # endif
67 #endif
68 
69 /* attribute recognised by some compilers to avoid 'unused' warnings */
70 #ifndef SWIGUNUSED
71 # if defined(__GNUC__)
72 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
73 # define SWIGUNUSED __attribute__ ((__unused__))
74 # else
75 # define SWIGUNUSED
76 # endif
77 # elif defined(__ICC)
78 # define SWIGUNUSED __attribute__ ((__unused__))
79 # else
80 # define SWIGUNUSED
81 # endif
82 #endif
83 
84 #ifndef SWIG_MSC_UNSUPPRESS_4505
85 # if defined(_MSC_VER)
86 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
87 # endif
88 #endif
89 
90 #ifndef SWIGUNUSEDPARM
91 # ifdef __cplusplus
92 # define SWIGUNUSEDPARM(p)
93 # else
94 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
95 # endif
96 #endif
97 
98 /* internal SWIG method */
99 #ifndef SWIGINTERN
100 # define SWIGINTERN static SWIGUNUSED
101 #endif
102 
103 /* internal inline SWIG method */
104 #ifndef SWIGINTERNINLINE
105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
106 #endif
107 
108 /* exporting methods */
109 #if defined(__GNUC__)
110 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
111 # ifndef GCC_HASCLASSVISIBILITY
112 # define GCC_HASCLASSVISIBILITY
113 # endif
114 # endif
115 #endif
116 
117 #ifndef SWIGEXPORT
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 # if defined(STATIC_LINKED)
120 # define SWIGEXPORT
121 # else
122 # define SWIGEXPORT __declspec(dllexport)
123 # endif
124 # else
125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 # define SWIGEXPORT __attribute__ ((visibility("default")))
127 # else
128 # define SWIGEXPORT
129 # endif
130 # endif
131 #endif
132 
133 /* calling conventions for Windows */
134 #ifndef SWIGSTDCALL
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 # define SWIGSTDCALL __stdcall
137 # else
138 # define SWIGSTDCALL
139 # endif
140 #endif
141 
142 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
145 #endif
146 
147 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
150 #endif
151 
152 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
155 #endif
156 
157 /* Intel's compiler complains if a variable which was never initialised is
158  * cast to void, which is a common idiom which we use to indicate that we
159  * are aware a variable isn't used. So we just silence that warning.
160  * See: https://github.com/swig/swig/issues/192 for more discussion.
161  */
162 #ifdef __INTEL_COMPILER
163 # pragma warning disable 592
164 #endif
165 
166 
167 #include <stdlib.h>
168 #include <string.h>
169 #include <stdio.h>
170 
171 
172 /* Support for throwing C# exceptions from C/C++. There are two types:
173  * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */
174 typedef enum {
187 
188 typedef enum {
193 
194 typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);
195 typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);
196 
197 typedef struct {
201 
202 typedef struct {
206 
214  { SWIG_CSharpIOException, NULL },
219 };
220 
225 };
226 
229  if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
231  }
232  callback(msg);
233 }
234 
235 static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
237  if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
239  }
240  callback(msg, param_name);
241 }
242 
243 
244 #ifdef __cplusplus
245 extern "C"
246 #endif
248  SWIG_CSharpExceptionCallback_t applicationCallback,
249  SWIG_CSharpExceptionCallback_t arithmeticCallback,
250  SWIG_CSharpExceptionCallback_t divideByZeroCallback,
251  SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,
252  SWIG_CSharpExceptionCallback_t invalidCastCallback,
253  SWIG_CSharpExceptionCallback_t invalidOperationCallback,
255  SWIG_CSharpExceptionCallback_t nullReferenceCallback,
256  SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
257  SWIG_CSharpExceptionCallback_t overflowCallback,
258  SWIG_CSharpExceptionCallback_t systemCallback) {
270 }
271 
272 #ifdef __cplusplus
273 extern "C"
274 #endif
277  SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,
278  SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) {
282 }
283 
284 
285 /* Callback for returning strings to C# without leaking memory */
286 typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);
288 
289 
290 #ifdef __cplusplus
291 extern "C"
292 #endif
295 }
296 
297 
298 /* Contract support */
299 
300 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else
301 
302 /* -----------------------------------------------------------------------------
303  * director_common.swg
304  *
305  * This file contains support for director classes which is common between
306  * languages.
307  * ----------------------------------------------------------------------------- */
308 
309 /*
310  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
311  'Swig' namespace. This could be useful for multi-modules projects.
312 */
313 #ifdef SWIG_DIRECTOR_STATIC
314 /* Force anonymous (static) namespace */
315 #define Swig
316 #endif
317 /* -----------------------------------------------------------------------------
318  * director.swg
319  *
320  * This file contains support for director classes so that C# proxy
321  * methods can be called from C++.
322  * ----------------------------------------------------------------------------- */
323 
324 #if defined(DEBUG_DIRECTOR_OWNED)
325 #include <iostream>
326 #endif
327 #include <string>
328 #include <exception>
329 
330 namespace Swig {
331  /* Director base class - not currently used in C# directors */
332  class Director {
333  };
334 
335  /* Base class for director exceptions */
336  class DirectorException : public std::exception {
337  protected:
338  std::string swig_msg;
339 
340  public:
341  DirectorException(const char *msg) : swig_msg(msg) {
342  }
343 
344  DirectorException(const std::string &msg) : swig_msg(msg) {
345  }
346 
347  virtual ~DirectorException() throw() {
348  }
349 
350  const char *what() const throw() {
351  return swig_msg.c_str();
352  }
353  };
354 
355  /* Pure virtual method exception */
356  class DirectorPureVirtualException : public DirectorException {
357  public:
358  DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) {
359  }
360 
361  static void raise(const char *msg) {
362  throw DirectorPureVirtualException(msg);
363  }
364  };
365 }
366 
367 
368 #include <stdint.h> // Use the C99 official header
369 
370 
371 #define SWIGWORDSIZE64
372 #ifndef LONG_MAX
373 #include <limits.h>
374 #endif
375 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
376 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
377 #endif
378 
379 
380 #include <cstdint>
381 #include <string>
382 #include <vector>
383 
384 #include "ortools/base/basictypes.h"
385 
386 
387 #include <string>
388 
389 
390 #include <vector>
392 
393 
394 #include "ortools/sat/cp_model.pb.h"
396 #include "ortools/sat/swig_helper.h"
397 
398 
399 
400 /* ---------------------------------------------------
401  * C++ director class methods
402  * --------------------------------------------------- */
403 
404 #include "sat_csharp_wrap.h"
405 
407  swig_init_callbacks();
408 }
409 
411 
412 }
413 
414 
416  if (!swig_callbackOnSolutionCallback) {
417  Swig::DirectorPureVirtualException::raise("operations_research::sat::SolutionCallback::OnSolutionCallback");
418  return;
419  } else {
420  swig_callbackOnSolutionCallback();
421  }
422 }
423 
424 void SwigDirector_SolutionCallback::swig_connect_director(SWIG_Callback0_t callbackOnSolutionCallback) {
425  swig_callbackOnSolutionCallback = callbackOnSolutionCallback;
426 }
427 
428 void SwigDirector_SolutionCallback::swig_init_callbacks() {
429  swig_callbackOnSolutionCallback = 0;
430 }
431 
433  swig_init_callbacks();
434 }
435 
437 
438 }
439 
440 
442  char * jmessage = 0 ;
443 
444  if (!swig_callbackNewMessage) {
445  Swig::DirectorPureVirtualException::raise("operations_research::sat::LogCallback::NewMessage");
446  return;
447  } else {
448  jmessage = SWIG_csharp_string_callback((&message)->c_str());
449  swig_callbackNewMessage(jmessage);
450  }
451 }
452 
453 void SwigDirector_LogCallback::swig_connect_director(SWIG_Callback0_t callbackNewMessage) {
454  swig_callbackNewMessage = callbackNewMessage;
455 }
456 
457 void SwigDirector_LogCallback::swig_init_callbacks() {
458  swig_callbackNewMessage = 0;
459 }
460 
461 
462 #ifdef __cplusplus
463 extern "C" {
464 #endif
465 
467  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
468 
469  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
470  delete arg1;
471 }
472 
473 
475  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
476 
477  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
478  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
479 }
480 
481 
483  long long jresult ;
484  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
485  int64_t result;
486 
487  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
488  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
489  jresult = result;
490  return jresult;
491 }
492 
493 
495  long long jresult ;
496  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
497  int64_t result;
498 
499  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
500  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
501  jresult = result;
502  return jresult;
503 }
504 
505 
507  long long jresult ;
508  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
509  int64_t result;
510 
511  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
512  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
513  jresult = result;
514  return jresult;
515 }
516 
517 
519  long long jresult ;
520  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
521  int64_t result;
522 
523  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
524  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
525  jresult = result;
526  return jresult;
527 }
528 
529 
531  long long jresult ;
532  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
533  int64_t result;
534 
535  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
536  result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
537  jresult = result;
538  return jresult;
539 }
540 
541 
543  double jresult ;
544  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
545  double result;
546 
547  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
548  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
549  jresult = result;
550  return jresult;
551 }
552 
553 
555  double jresult ;
556  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
557  double result;
558 
559  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
560  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
561  jresult = result;
562  return jresult;
563 }
564 
565 
567  double jresult ;
568  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
569  double result;
570 
571  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
572  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
573  jresult = result;
574  return jresult;
575 }
576 
577 
579  double jresult ;
580  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
581  double result;
582 
583  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
584  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
585  jresult = result;
586  return jresult;
587 }
588 
589 
591  long long jresult ;
592  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
593  int arg2 ;
594  int64_t result;
595 
596  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
597  arg2 = (int)jarg2;
598  result = (int64_t)(arg1)->SolutionIntegerValue(arg2);
599  jresult = result;
600  return jresult;
601 }
602 
603 
605  unsigned int jresult ;
606  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
607  int arg2 ;
608  bool result;
609 
610  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
611  arg2 = (int)jarg2;
612  result = (bool)(arg1)->SolutionBooleanValue(arg2);
613  jresult = result;
614  return jresult;
615 }
616 
617 
619  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
620 
621  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
622  (arg1)->StopSearch();
623 }
624 
625 
627  uint8_t* jresult ;
628  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
629  operations_research::sat::CpSolverResponse result;
630 
631  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
632  result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
633  {
634  const long size = (&result)->ByteSizeLong();
635  jresult = new uint8_t[size + 4];
636  (&result)->SerializeWithCachedSizesToArray(jresult + 4);
637  jresult[0] = size & 0xFF;
638  jresult[1] = (size >> 8) & 0xFF;
639  jresult[2] = (size >> 16) & 0xFF;
640  jresult[3] = (size >> 24) & 0xFF;
641  }
642  return jresult;
643 }
644 
645 
647  void * jresult ;
648  operations_research::sat::SolutionCallback *result = 0 ;
649 
650  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback();
651  jresult = (void *)result;
652  return jresult;
653 }
654 
655 
657  operations_research::sat::SolutionCallback *obj = (operations_research::sat::SolutionCallback *)objarg;
658  SwigDirector_SolutionCallback *director = static_cast<SwigDirector_SolutionCallback *>(obj);
659  director->swig_connect_director(callback0);
660 }
661 
662 
664  operations_research::sat::LogCallback *arg1 = (operations_research::sat::LogCallback *) 0 ;
665 
666  arg1 = (operations_research::sat::LogCallback *)jarg1;
667  delete arg1;
668 }
669 
670 
672  operations_research::sat::LogCallback *arg1 = (operations_research::sat::LogCallback *) 0 ;
673  std::string *arg2 = 0 ;
674 
675  arg1 = (operations_research::sat::LogCallback *)jarg1;
676  if (!jarg2) {
678  return ;
679  }
680  std::string arg2_str(jarg2);
681  arg2 = &arg2_str;
682  (arg1)->NewMessage((std::string const &)*arg2);
683 }
684 
685 
687  void * jresult ;
688  operations_research::sat::LogCallback *result = 0 ;
689 
690  result = (operations_research::sat::LogCallback *)new SwigDirector_LogCallback();
691  jresult = (void *)result;
692  return jresult;
693 }
694 
695 
697  operations_research::sat::LogCallback *obj = (operations_research::sat::LogCallback *)objarg;
698  SwigDirector_LogCallback *director = static_cast<SwigDirector_LogCallback *>(obj);
699  director->swig_connect_director(callback0);
700 }
701 
702 
704  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
705  std::string *arg2 = 0 ;
706 
707  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
708  if (!jarg2) {
710  return ;
711  }
712  std::string arg2_str(jarg2);
713  arg2 = &arg2_str;
714  (arg1)->SetStringParameters((std::string const &)*arg2);
715 }
716 
717 
719  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
720  operations_research::sat::SolutionCallback *arg2 = 0 ;
721 
722  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
723  arg2 = (operations_research::sat::SolutionCallback *)jarg2;
724  if (!arg2) {
725  SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "operations_research::sat::SolutionCallback const & type is null", 0);
726  return ;
727  }
728  (arg1)->AddSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
729 }
730 
731 
733  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
734  operations_research::sat::SolutionCallback *arg2 = 0 ;
735 
736  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
737  arg2 = (operations_research::sat::SolutionCallback *)jarg2;
738  if (!arg2) {
739  SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "operations_research::sat::SolutionCallback const & type is null", 0);
740  return ;
741  }
742  (arg1)->ClearSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
743 }
744 
745 
747  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
748  operations_research::sat::LogCallback *arg2 = (operations_research::sat::LogCallback *) 0 ;
749 
750  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
751  arg2 = (operations_research::sat::LogCallback *)jarg2;
752  (arg1)->AddLogCallbackFromClass(arg2);
753 }
754 
755 
756 SWIGEXPORT uint8_t* SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_Solve___(void * jarg1, int model_proto_size, uint8_t* jarg2) {
757  uint8_t* jresult ;
758  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
759  operations_research::sat::CpModelProto *arg2 = 0 ;
760  operations_research::sat::CpSolverResponse result;
761 
762  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
763  {
764  arg2 = new operations_research::sat::CpModelProto;
765  bool parsed_ok = arg2->ParseFromArray(jarg2, model_proto_size);
766  if (!parsed_ok) {
769  "Unable to parse operations_research::sat::CpModelProto protocol message.");
770  }
771  }
772  result = (arg1)->Solve((operations_research::sat::CpModelProto const &)*arg2);
773  {
774  const long size = (&result)->ByteSizeLong();
775  jresult = new uint8_t[size + 4];
776  (&result)->SerializeWithCachedSizesToArray(jresult + 4);
777  jresult[0] = size & 0xFF;
778  jresult[1] = (size >> 8) & 0xFF;
779  jresult[2] = (size >> 16) & 0xFF;
780  jresult[3] = (size >> 24) & 0xFF;
781  }
782  {
783  delete arg2;
784  }
785  return jresult;
786 }
787 
788 
790  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
791 
792  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
793  (arg1)->StopSearch();
794 }
795 
796 
798  void * jresult ;
799  operations_research::sat::SolveWrapper *result = 0 ;
800 
801  result = (operations_research::sat::SolveWrapper *)new operations_research::sat::SolveWrapper();
802  jresult = (void *)result;
803  return jresult;
804 }
805 
806 
808  operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
809 
810  arg1 = (operations_research::sat::SolveWrapper *)jarg1;
811  delete arg1;
812 }
813 
814 
815 SWIGEXPORT char * SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_ModelStats___(int model_proto_size, uint8_t* jarg1) {
816  char * jresult ;
817  operations_research::sat::CpModelProto *arg1 = 0 ;
818  std::string result;
819 
820  {
821  arg1 = new operations_research::sat::CpModelProto;
822  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
823  if (!parsed_ok) {
826  "Unable to parse operations_research::sat::CpModelProto protocol message.");
827  }
828  }
829  result = operations_research::sat::CpSatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
830  jresult = SWIG_csharp_string_callback((&result)->c_str());
831  {
832  delete arg1;
833  }
834  return jresult;
835 }
836 
837 
839  char * jresult ;
840  operations_research::sat::CpSolverResponse *arg1 = 0 ;
841  std::string result;
842 
843  {
844  arg1 = new operations_research::sat::CpSolverResponse;
845  bool parsed_ok = arg1->ParseFromArray(jarg1, response_size);
846  if (!parsed_ok) {
849  "Unable to parse operations_research::sat::CpSolverResponse protocol message.");
850  }
851  }
852  result = operations_research::sat::CpSatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
853  jresult = SWIG_csharp_string_callback((&result)->c_str());
854  {
855  delete arg1;
856  }
857  return jresult;
858 }
859 
860 
862  char * jresult ;
863  operations_research::sat::CpModelProto *arg1 = 0 ;
864  std::string result;
865 
866  {
867  arg1 = new operations_research::sat::CpModelProto;
868  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
869  if (!parsed_ok) {
872  "Unable to parse operations_research::sat::CpModelProto protocol message.");
873  }
874  }
875  result = operations_research::sat::CpSatHelper::ValidateModel((operations_research::sat::CpModelProto const &)*arg1);
876  jresult = SWIG_csharp_string_callback((&result)->c_str());
877  {
878  delete arg1;
879  }
880  return jresult;
881 }
882 
883 
884 SWIGEXPORT void * SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_VariableDomain___(int variable_proto_size, uint8_t* jarg1) {
885  void * jresult ;
886  operations_research::sat::IntegerVariableProto *arg1 = 0 ;
888 
889  {
890  arg1 = new operations_research::sat::IntegerVariableProto;
891  bool parsed_ok = arg1->ParseFromArray(jarg1, variable_proto_size);
892  if (!parsed_ok) {
895  "Unable to parse operations_research::sat::IntegerVariableProto protocol message.");
896  }
897  }
898  result = operations_research::sat::CpSatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
899  jresult = new operations_research::Domain((const operations_research::Domain &)result);
900  {
901  delete arg1;
902  }
903  return jresult;
904 }
905 
906 
907 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_WriteModelToFile___(int model_proto_size, uint8_t* jarg1, char * jarg2) {
908  unsigned int jresult ;
909  operations_research::sat::CpModelProto *arg1 = 0 ;
910  std::string *arg2 = 0 ;
911  bool result;
912 
913  {
914  arg1 = new operations_research::sat::CpModelProto;
915  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
916  if (!parsed_ok) {
919  "Unable to parse operations_research::sat::CpModelProto protocol message.");
920  }
921  }
922  if (!jarg2) {
924  return 0;
925  }
926  std::string arg2_str(jarg2);
927  arg2 = &arg2_str;
928  result = (bool)operations_research::sat::CpSatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
929  jresult = result;
930  {
931  delete arg1;
932  }
933  return jresult;
934 }
935 
936 
938  void * jresult ;
939  operations_research::sat::CpSatHelper *result = 0 ;
940 
941  result = (operations_research::sat::CpSatHelper *)new operations_research::sat::CpSatHelper();
942  jresult = (void *)result;
943  return jresult;
944 }
945 
946 
948  operations_research::sat::CpSatHelper *arg1 = (operations_research::sat::CpSatHelper *) 0 ;
949 
950  arg1 = (operations_research::sat::CpSatHelper *)jarg1;
951  delete arg1;
952 }
953 
954 
955 #ifdef __cplusplus
956 }
957 #endif
958 
DirectorException(const std::string &msg)
const char * what() const
DirectorException(const char *msg)
virtual void NewMessage(std::string const &message)
void(SWIGSTDCALL * SWIG_Callback0_t)(char *)
void swig_connect_director(SWIG_Callback0_t callbackNewMessage)
void swig_connect_director(SWIG_Callback0_t callbackOnSolutionCallback)
virtual void OnSolutionCallback() const
void(SWIGSTDCALL * SWIG_Callback0_t)()
We call domain any subset of Int64 = [kint64min, kint64max].
MPCallback * callback
SWIG_CSharpExceptionArgumentCodes
absl::Status ValidateModel(const ModelProto &model, const bool check_names)
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
Collection of objects used to extend the Constraint Solver library.
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_LogCallback_director_connect___(void *objarg, SwigDirector_LogCallback::SWIG_Callback0_t callback0)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_SetStringParameters___(void *jarg1, char *jarg2)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_OnSolutionCallback___(void *jarg1)
static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[]
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_LogCallback___(void *jarg1)
void(SWIGSTDCALL * SWIG_CSharpExceptionCallback_t)(const char *)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBranches___(void *jarg1)
static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name)
SWIGEXPORT uint8_t *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_Solve___(void *jarg1, int model_proto_size, uint8_t *jarg2)
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_WallTime___(void *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_AddLogCallbackFromClass___(void *jarg1, void *jarg2)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_VariableDomain___(int variable_proto_size, uint8_t *jarg1)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_SolutionCallback___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBinaryPropagations___(void *jarg1)
SWIGEXPORT uint8_t *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_Response___(void *jarg1)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_CpSatHelper___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBooleans___(void *jarg1)
void(SWIGSTDCALL * SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *)
static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_SolveWrapper___()
#define SWIGUNUSED
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_StopSearch___(void *jarg1)
static SWIG_CSharpException_t SWIG_csharp_exceptions[]
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_SolveWrapper___(void *jarg1)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_LogCallback___()
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_AddSolutionCallback___(void *jarg1, void *jarg2)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumIntegerPropagations___(void *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_LogCallback_NewMessage___(void *jarg1, char *jarg2)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_StopSearch___(void *jarg1)
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_operations_research_sat(SWIG_CSharpExceptionArgumentCallback_t argumentCallback, SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback)
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_UserTime___(void *jarg1)
SWIG_CSharpExceptionArgumentCodes
@ SWIG_CSharpArgumentException
@ SWIG_CSharpArgumentOutOfRangeException
@ SWIG_CSharpArgumentNullException
char *(SWIGSTDCALL * SWIG_CSharpStringHelperCallback)(const char *)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_SolutionCallback___(void *jarg1)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_ModelStats___(int model_proto_size, uint8_t *jarg1)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumConflicts___(void *jarg1)
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_SolutionBooleanValue___(void *jarg1, int jarg2)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_SolverResponseStats___(int response_size, uint8_t *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_ClearSolutionCallback___(void *jarg1, void *jarg2)
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_WriteModelToFile___(int model_proto_size, uint8_t *jarg1, char *jarg2)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_ValidateModel___(int model_proto_size, uint8_t *jarg1)
static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_director_connect___(void *objarg, SwigDirector_SolutionCallback::SWIG_Callback0_t callback0)
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_operations_research_sat(SWIG_CSharpExceptionCallback_t applicationCallback, SWIG_CSharpExceptionCallback_t arithmeticCallback, SWIG_CSharpExceptionCallback_t divideByZeroCallback, SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, SWIG_CSharpExceptionCallback_t invalidCastCallback, SWIG_CSharpExceptionCallback_t invalidOperationCallback, SWIG_CSharpExceptionCallback_t ioCallback, SWIG_CSharpExceptionCallback_t nullReferenceCallback, SWIG_CSharpExceptionCallback_t outOfMemoryCallback, SWIG_CSharpExceptionCallback_t overflowCallback, SWIG_CSharpExceptionCallback_t systemCallback)
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_ObjectiveValue___(void *jarg1)
#define SWIGSTDCALL
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_BestObjectiveBound___(void *jarg1)
#define SWIGEXPORT
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_CpSatHelper___(void *jarg1)
SWIG_CSharpExceptionCodes
@ SWIG_CSharpDivideByZeroException
@ SWIG_CSharpOutOfMemoryException
@ SWIG_CSharpArithmeticException
@ SWIG_CSharpSystemException
@ SWIG_CSharpApplicationException
@ SWIG_CSharpNullReferenceException
@ SWIG_CSharpInvalidCastException
@ SWIG_CSharpInvalidOperationException
@ SWIG_CSharpOverflowException
@ SWIG_CSharpIOException
@ SWIG_CSharpIndexOutOfRangeException
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_SolutionIntegerValue___(void *jarg1, int jarg2)
SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_operations_research_sat(SWIG_CSharpStringHelperCallback callback)
SWIG_CSharpExceptionCallback_t callback
SWIG_CSharpExceptionArgumentCallback_t callback
std::string message
Definition: trace.cc:398