OR-Tools  8.2
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 
432 
433 #ifdef __cplusplus
434 extern "C" {
435 #endif
436 
438  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
439 
440  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
441  delete arg1;
442 }
443 
444 
446  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
447 
448  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
449  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
450 }
451 
452 
454  long long jresult ;
455  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
456  int64 result;
457 
458  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
459  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
460  jresult = result;
461  return jresult;
462 }
463 
464 
466  long long jresult ;
467  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
468  int64 result;
469 
470  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
471  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
472  jresult = result;
473  return jresult;
474 }
475 
476 
478  long long jresult ;
479  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
480  int64 result;
481 
482  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
483  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
484  jresult = result;
485  return jresult;
486 }
487 
488 
490  long long jresult ;
491  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
492  int64 result;
493 
494  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
495  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
496  jresult = result;
497  return jresult;
498 }
499 
500 
502  long long jresult ;
503  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
504  int64 result;
505 
506  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
507  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
508  jresult = result;
509  return jresult;
510 }
511 
512 
514  double jresult ;
515  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
516  double result;
517 
518  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
519  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
520  jresult = result;
521  return jresult;
522 }
523 
524 
526  double jresult ;
527  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
528  double result;
529 
530  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
531  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
532  jresult = result;
533  return jresult;
534 }
535 
536 
538  double jresult ;
539  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
540  double result;
541 
542  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
543  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
544  jresult = result;
545  return jresult;
546 }
547 
548 
550  double jresult ;
551  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
552  double result;
553 
554  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
555  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
556  jresult = result;
557  return jresult;
558 }
559 
560 
562  long long jresult ;
563  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
564  int arg2 ;
565  int64 result;
566 
567  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
568  arg2 = (int)jarg2;
569  result = (int64)(arg1)->SolutionIntegerValue(arg2);
570  jresult = result;
571  return jresult;
572 }
573 
574 
576  unsigned int jresult ;
577  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
578  int arg2 ;
579  bool result;
580 
581  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
582  arg2 = (int)jarg2;
583  result = (bool)(arg1)->SolutionBooleanValue(arg2);
584  jresult = result;
585  return jresult;
586 }
587 
588 
590  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
591 
592  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
593  (arg1)->StopSearch();
594 }
595 
596 
598  uint8* jresult ;
599  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
600  operations_research::sat::CpSolverResponse result;
601 
602  arg1 = (operations_research::sat::SolutionCallback *)jarg1;
603  result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
604  {
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;
612  }
613  return jresult;
614 }
615 
616 
618  void * jresult ;
619  operations_research::sat::SolutionCallback *result = 0 ;
620 
621  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback();
622  jresult = (void *)result;
623  return jresult;
624 }
625 
626 
628  operations_research::sat::SolutionCallback *obj = (operations_research::sat::SolutionCallback *)objarg;
629  SwigDirector_SolutionCallback *director = static_cast<SwigDirector_SolutionCallback *>(obj);
630  director->swig_connect_director(callback0);
631 }
632 
633 
635  uint8* jresult ;
636  operations_research::sat::CpModelProto *arg1 = 0 ;
637  operations_research::sat::CpSolverResponse result;
638 
639  {
640  arg1 = new operations_research::sat::CpModelProto;
641  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
642  if (!parsed_ok) {
645  "Unable to parse operations_research::sat::CpModelProto protocol message.");
646  }
647  }
648  result = operations_research::sat::SatHelper::Solve((operations_research::sat::CpModelProto const &)*arg1);
649  {
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;
657  }
658  {
659  delete arg1;
660  }
661  return jresult;
662 }
663 
664 
666  uint8* jresult ;
667  operations_research::sat::CpModelProto *arg1 = 0 ;
668  std::string *arg2 = 0 ;
669  operations_research::sat::CpSolverResponse result;
670 
671  {
672  arg1 = new operations_research::sat::CpModelProto;
673  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
674  if (!parsed_ok) {
677  "Unable to parse operations_research::sat::CpModelProto protocol message.");
678  }
679  }
680  if (!jarg2) {
682  return 0;
683  }
684  std::string arg2_str(jarg2);
685  arg2 = &arg2_str;
686  result = operations_research::sat::SatHelper::SolveWithStringParameters((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
687  {
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;
695  }
696  {
697  delete arg1;
698  }
699  return jresult;
700 }
701 
702 
704  uint8* jresult ;
705  operations_research::sat::CpModelProto *arg1 = 0 ;
706  std::string *arg2 = 0 ;
707  operations_research::sat::SolutionCallback *arg3 = 0 ;
708  operations_research::sat::CpSolverResponse result;
709 
710  {
711  arg1 = new operations_research::sat::CpModelProto;
712  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
713  if (!parsed_ok) {
716  "Unable to parse operations_research::sat::CpModelProto protocol message.");
717  }
718  }
719  if (!jarg2) {
721  return 0;
722  }
723  std::string arg2_str(jarg2);
724  arg2 = &arg2_str;
725  arg3 = (operations_research::sat::SolutionCallback *)jarg3;
726  if (!arg3) {
727  SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "operations_research::sat::SolutionCallback const & type is null", 0);
728  return 0;
729  }
730  result = operations_research::sat::SatHelper::SolveWithStringParametersAndSolutionCallback((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2,(operations_research::sat::SolutionCallback const &)*arg3);
731  {
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;
739  }
740  {
741  delete arg1;
742  }
743  return jresult;
744 }
745 
746 
748  char * jresult ;
749  operations_research::sat::CpModelProto *arg1 = 0 ;
750  std::string result;
751 
752  {
753  arg1 = new operations_research::sat::CpModelProto;
754  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
755  if (!parsed_ok) {
758  "Unable to parse operations_research::sat::CpModelProto protocol message.");
759  }
760  }
761  result = operations_research::sat::SatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
762  jresult = SWIG_csharp_string_callback((&result)->c_str());
763  {
764  delete arg1;
765  }
766  return jresult;
767 }
768 
769 
771  char * jresult ;
772  operations_research::sat::CpSolverResponse *arg1 = 0 ;
773  std::string result;
774 
775  {
776  arg1 = new operations_research::sat::CpSolverResponse;
777  bool parsed_ok = arg1->ParseFromArray(jarg1, response_size);
778  if (!parsed_ok) {
781  "Unable to parse operations_research::sat::CpSolverResponse protocol message.");
782  }
783  }
784  result = operations_research::sat::SatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
785  jresult = SWIG_csharp_string_callback((&result)->c_str());
786  {
787  delete arg1;
788  }
789  return jresult;
790 }
791 
792 
794  char * jresult ;
795  operations_research::sat::CpModelProto *arg1 = 0 ;
796  std::string result;
797 
798  {
799  arg1 = new operations_research::sat::CpModelProto;
800  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
801  if (!parsed_ok) {
804  "Unable to parse operations_research::sat::CpModelProto protocol message.");
805  }
806  }
807  result = operations_research::sat::SatHelper::ValidateModel((operations_research::sat::CpModelProto const &)*arg1);
808  jresult = SWIG_csharp_string_callback((&result)->c_str());
809  {
810  delete arg1;
811  }
812  return jresult;
813 }
814 
815 
817  void * jresult ;
818  operations_research::sat::IntegerVariableProto *arg1 = 0 ;
820 
821  {
822  arg1 = new operations_research::sat::IntegerVariableProto;
823  bool parsed_ok = arg1->ParseFromArray(jarg1, variable_proto_size);
824  if (!parsed_ok) {
827  "Unable to parse operations_research::sat::IntegerVariableProto protocol message.");
828  }
829  }
830  result = operations_research::sat::SatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
831  jresult = new operations_research::Domain((const operations_research::Domain &)result);
832  {
833  delete arg1;
834  }
835  return jresult;
836 }
837 
838 
839 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_WriteModelToFile___(int model_proto_size, uint8* jarg1, char * jarg2) {
840  unsigned int jresult ;
841  operations_research::sat::CpModelProto *arg1 = 0 ;
842  std::string *arg2 = 0 ;
843  bool result;
844 
845  {
846  arg1 = new operations_research::sat::CpModelProto;
847  bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
848  if (!parsed_ok) {
851  "Unable to parse operations_research::sat::CpModelProto protocol message.");
852  }
853  }
854  if (!jarg2) {
856  return 0;
857  }
858  std::string arg2_str(jarg2);
859  arg2 = &arg2_str;
860  result = (bool)operations_research::sat::SatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
861  jresult = result;
862  {
863  delete arg1;
864  }
865  return jresult;
866 }
867 
868 
870  void * jresult ;
871  operations_research::sat::SatHelper *result = 0 ;
872 
873  result = (operations_research::sat::SatHelper *)new operations_research::sat::SatHelper();
874  jresult = (void *)result;
875  return jresult;
876 }
877 
878 
880  operations_research::sat::SatHelper *arg1 = (operations_research::sat::SatHelper *) 0 ;
881 
882  arg1 = (operations_research::sat::SatHelper *)jarg1;
883  delete arg1;
884 }
885 
886 
887 #ifdef __cplusplus
888 }
889 #endif
890 
DirectorException(const std::string &msg)
const char * what() const
DirectorException(const char *msg)
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
int64_t int64
unsigned char uint8
SWIG_CSharpExceptionArgumentCodes
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_SatHelper___(void *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_OnSolutionCallback___(void *jarg1)
static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[]
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 void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_SatHelper___()
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_WallTime___(void *jarg1)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_SolutionCallback___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBinaryPropagations___(void *jarg1)
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
#define SWIGUNUSED
static SWIG_CSharpException_t SWIG_csharp_exceptions[]
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumIntegerPropagations___(void *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_StopSearch___(void *jarg1)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_SolverResponseStats___(int response_size, uint8 *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
SWIGEXPORT uint8 *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_SolveWithStringParametersAndSolutionCallback___(int model_proto_size, uint8 *jarg1, char *jarg2, void *jarg3)
SWIGEXPORT uint8 *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_Response___(void *jarg1)
char *(SWIGSTDCALL * SWIG_CSharpStringHelperCallback)(const char *)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_VariableDomain___(int variable_proto_size, uint8 *jarg1)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_SolutionCallback___(void *jarg1)
SWIGEXPORT uint8 *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_SolveWithStringParameters___(int model_proto_size, uint8 *jarg1, char *jarg2)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumConflicts___(void *jarg1)
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_SolutionBooleanValue___(void *jarg1, int jarg2)
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 char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_ModelStats___(int model_proto_size, uint8 *jarg1)
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_WriteModelToFile___(int model_proto_size, uint8 *jarg1, char *jarg2)
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)
SWIGEXPORT uint8 *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_Solve___(int model_proto_size, uint8 *jarg1)
#define SWIGEXPORT
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 char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SatHelper_ValidateModel___(int model_proto_size, uint8 *jarg1)
SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_operations_research_sat(SWIG_CSharpStringHelperCallback callback)
SWIG_CSharpExceptionCallback_t callback
SWIG_CSharpExceptionArgumentCallback_t callback