OR-Tools  9.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 */
21template<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);
30public:
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
37template <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. */
174typedef enum {
187
188typedef enum {
193
194typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);
195typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);
196
197typedef struct {
201
202typedef 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
235static 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
245extern "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
273extern "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 */
286typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);
288
289
290#ifdef __cplusplus
291extern "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
330namespace 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) {
363 }
364 };
365}
366
367
368#include <stdint.h> // Use the C99 official header
369
370
371#include <cstdint>
372#include <string>
373#include <vector>
374
376
377
378#include <string>
379
380
381#include <vector>
383
384
387#include "ortools/sat/swig_helper.h"
388
389
390
391/* ---------------------------------------------------
392 * C++ director class methods
393 * --------------------------------------------------- */
394
395#include "sat_csharp_wrap.h"
396
398 swig_init_callbacks();
399}
400
402
403}
404
405
407 if (!swig_callbackOnSolutionCallback) {
408 Swig::DirectorPureVirtualException::raise("operations_research::sat::SolutionCallback::OnSolutionCallback");
409 return;
410 } else {
411 swig_callbackOnSolutionCallback();
412 }
413}
414
415void SwigDirector_SolutionCallback::swig_connect_director(SWIG_Callback0_t callbackOnSolutionCallback) {
416 swig_callbackOnSolutionCallback = callbackOnSolutionCallback;
417}
418
419void SwigDirector_SolutionCallback::swig_init_callbacks() {
420 swig_callbackOnSolutionCallback = 0;
421}
422
424 swig_init_callbacks();
425}
426
428
429}
430
431
433 char * jmessage = 0 ;
434
435 if (!swig_callbackNewMessage) {
436 Swig::DirectorPureVirtualException::raise("operations_research::sat::LogCallback::NewMessage");
437 return;
438 } else {
439 jmessage = SWIG_csharp_string_callback((&message)->c_str());
440 swig_callbackNewMessage(jmessage);
441 }
442}
443
444void SwigDirector_LogCallback::swig_connect_director(SWIG_Callback0_t callbackNewMessage) {
445 swig_callbackNewMessage = callbackNewMessage;
446}
447
448void SwigDirector_LogCallback::swig_init_callbacks() {
449 swig_callbackNewMessage = 0;
450}
451
452
453#ifdef __cplusplus
454extern "C" {
455#endif
456
458 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
459
460 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
461 delete arg1;
462}
463
464
466 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
467
468 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
469 ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
470}
471
472
474 long long jresult ;
475 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
476 int64_t result;
477
478 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
479 result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
480 jresult = result;
481 return jresult;
482}
483
484
486 long long jresult ;
487 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
488 int64_t result;
489
490 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
491 result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
492 jresult = result;
493 return jresult;
494}
495
496
498 long long jresult ;
499 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
500 int64_t result;
501
502 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
503 result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
504 jresult = result;
505 return jresult;
506}
507
508
510 long long jresult ;
511 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
512 int64_t result;
513
514 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
515 result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
516 jresult = result;
517 return jresult;
518}
519
520
522 long long jresult ;
523 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
524 int64_t result;
525
526 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
527 result = (int64_t)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
528 jresult = result;
529 return jresult;
530}
531
532
534 double jresult ;
535 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
536 double result;
537
538 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
539 result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
540 jresult = result;
541 return jresult;
542}
543
544
546 double jresult ;
547 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
548 double result;
549
550 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
551 result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
552 jresult = result;
553 return jresult;
554}
555
556
558 double jresult ;
559 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
560 double result;
561
562 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
563 result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
564 jresult = result;
565 return jresult;
566}
567
568
570 double jresult ;
571 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
572 double result;
573
574 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
575 result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
576 jresult = result;
577 return jresult;
578}
579
580
582 long long jresult ;
583 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
584 int arg2 ;
585 int64_t result;
586
587 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
588 arg2 = (int)jarg2;
589 result = (int64_t)(arg1)->SolutionIntegerValue(arg2);
590 jresult = result;
591 return jresult;
592}
593
594
596 unsigned int jresult ;
597 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
598 int arg2 ;
599 bool result;
600
601 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
602 arg2 = (int)jarg2;
603 result = (bool)(arg1)->SolutionBooleanValue(arg2);
604 jresult = result;
605 return jresult;
606}
607
608
610 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
611
612 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
613 (arg1)->StopSearch();
614}
615
616
618 uint8_t* jresult ;
619 operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
621
622 arg1 = (operations_research::sat::SolutionCallback *)jarg1;
623 result = ((operations_research::sat::SolutionCallback const *)arg1)->Response();
624 {
625 const long size = (&result)->ByteSizeLong();
626 jresult = new uint8_t[size + 4];
627 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
628 jresult[0] = size & 0xFF;
629 jresult[1] = (size >> 8) & 0xFF;
630 jresult[2] = (size >> 16) & 0xFF;
631 jresult[3] = (size >> 24) & 0xFF;
632 }
633 return jresult;
634}
635
636
638 void * jresult ;
639 operations_research::sat::SolutionCallback *result = 0 ;
640
641 result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback();
642 jresult = (void *)result;
643 return jresult;
644}
645
646
648 operations_research::sat::SolutionCallback *obj = (operations_research::sat::SolutionCallback *)objarg;
649 SwigDirector_SolutionCallback *director = static_cast<SwigDirector_SolutionCallback *>(obj);
650 director->swig_connect_director(callback0);
651}
652
653
655 operations_research::sat::LogCallback *arg1 = (operations_research::sat::LogCallback *) 0 ;
656
657 arg1 = (operations_research::sat::LogCallback *)jarg1;
658 delete arg1;
659}
660
661
663 operations_research::sat::LogCallback *arg1 = (operations_research::sat::LogCallback *) 0 ;
664 std::string *arg2 = 0 ;
665
666 arg1 = (operations_research::sat::LogCallback *)jarg1;
667 if (!jarg2) {
669 return ;
670 }
671 std::string arg2_str(jarg2);
672 arg2 = &arg2_str;
673 (arg1)->NewMessage((std::string const &)*arg2);
674}
675
676
678 void * jresult ;
679 operations_research::sat::LogCallback *result = 0 ;
680
681 result = (operations_research::sat::LogCallback *)new SwigDirector_LogCallback();
682 jresult = (void *)result;
683 return jresult;
684}
685
686
688 operations_research::sat::LogCallback *obj = (operations_research::sat::LogCallback *)objarg;
689 SwigDirector_LogCallback *director = static_cast<SwigDirector_LogCallback *>(obj);
690 director->swig_connect_director(callback0);
691}
692
693
695 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
696 std::string *arg2 = 0 ;
697
698 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
699 if (!jarg2) {
701 return ;
702 }
703 std::string arg2_str(jarg2);
704 arg2 = &arg2_str;
705 (arg1)->SetStringParameters((std::string const &)*arg2);
706}
707
708
710 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
711 operations_research::sat::SolutionCallback *arg2 = 0 ;
712
713 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
714 arg2 = (operations_research::sat::SolutionCallback *)jarg2;
715 if (!arg2) {
716 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "operations_research::sat::SolutionCallback const & type is null", 0);
717 return ;
718 }
719 (arg1)->AddSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
720}
721
722
724 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
725 operations_research::sat::SolutionCallback *arg2 = 0 ;
726
727 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
728 arg2 = (operations_research::sat::SolutionCallback *)jarg2;
729 if (!arg2) {
730 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "operations_research::sat::SolutionCallback const & type is null", 0);
731 return ;
732 }
733 (arg1)->ClearSolutionCallback((operations_research::sat::SolutionCallback const &)*arg2);
734}
735
736
738 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
739 operations_research::sat::LogCallback *arg2 = (operations_research::sat::LogCallback *) 0 ;
740
741 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
742 arg2 = (operations_research::sat::LogCallback *)jarg2;
743 (arg1)->AddLogCallbackFromClass(arg2);
744}
745
746
747SWIGEXPORT uint8_t* SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_Solve___(void * jarg1, int model_proto_size, uint8_t* jarg2) {
748 uint8_t* jresult ;
749 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
752
753 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
754 {
756 bool parsed_ok = arg2->ParseFromArray(jarg2, model_proto_size);
757 if (!parsed_ok) {
760 "Unable to parse operations_research::sat::CpModelProto protocol message.");
761 }
762 }
763 result = (arg1)->Solve((operations_research::sat::CpModelProto const &)*arg2);
764 {
765 const long size = (&result)->ByteSizeLong();
766 jresult = new uint8_t[size + 4];
767 (&result)->SerializeWithCachedSizesToArray(jresult + 4);
768 jresult[0] = size & 0xFF;
769 jresult[1] = (size >> 8) & 0xFF;
770 jresult[2] = (size >> 16) & 0xFF;
771 jresult[3] = (size >> 24) & 0xFF;
772 }
773 {
774 delete arg2;
775 }
776 return jresult;
777}
778
779
781 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
782
783 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
784 (arg1)->StopSearch();
785}
786
787
789 void * jresult ;
790 operations_research::sat::SolveWrapper *result = 0 ;
791
792 result = (operations_research::sat::SolveWrapper *)new operations_research::sat::SolveWrapper();
793 jresult = (void *)result;
794 return jresult;
795}
796
797
799 operations_research::sat::SolveWrapper *arg1 = (operations_research::sat::SolveWrapper *) 0 ;
800
801 arg1 = (operations_research::sat::SolveWrapper *)jarg1;
802 delete arg1;
803}
804
805
807 char * jresult ;
809 std::string result;
810
811 {
813 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
814 if (!parsed_ok) {
817 "Unable to parse operations_research::sat::CpModelProto protocol message.");
818 }
819 }
820 result = operations_research::sat::CpSatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
821 jresult = SWIG_csharp_string_callback((&result)->c_str());
822 {
823 delete arg1;
824 }
825 return jresult;
826}
827
828
830 char * jresult ;
832 std::string result;
833
834 {
836 bool parsed_ok = arg1->ParseFromArray(jarg1, response_size);
837 if (!parsed_ok) {
840 "Unable to parse operations_research::sat::CpSolverResponse protocol message.");
841 }
842 }
843 result = operations_research::sat::CpSatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
844 jresult = SWIG_csharp_string_callback((&result)->c_str());
845 {
846 delete arg1;
847 }
848 return jresult;
849}
850
851
853 char * jresult ;
855 std::string result;
856
857 {
859 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
860 if (!parsed_ok) {
863 "Unable to parse operations_research::sat::CpModelProto protocol message.");
864 }
865 }
867 jresult = SWIG_csharp_string_callback((&result)->c_str());
868 {
869 delete arg1;
870 }
871 return jresult;
872}
873
874
876 void * jresult ;
879
880 {
882 bool parsed_ok = arg1->ParseFromArray(jarg1, variable_proto_size);
883 if (!parsed_ok) {
886 "Unable to parse operations_research::sat::IntegerVariableProto protocol message.");
887 }
888 }
889 result = operations_research::sat::CpSatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
890 jresult = new operations_research::Domain((const operations_research::Domain &)result);
891 {
892 delete arg1;
893 }
894 return jresult;
895}
896
897
898SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_WriteModelToFile___(int model_proto_size, uint8_t* jarg1, char * jarg2) {
899 unsigned int jresult ;
901 std::string *arg2 = 0 ;
902 bool result;
903
904 {
906 bool parsed_ok = arg1->ParseFromArray(jarg1, model_proto_size);
907 if (!parsed_ok) {
910 "Unable to parse operations_research::sat::CpModelProto protocol message.");
911 }
912 }
913 if (!jarg2) {
915 return 0;
916 }
917 std::string arg2_str(jarg2);
918 arg2 = &arg2_str;
919 result = (bool)operations_research::sat::CpSatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
920 jresult = result;
921 {
922 delete arg1;
923 }
924 return jresult;
925}
926
927
929 void * jresult ;
930 operations_research::sat::CpSatHelper *result = 0 ;
931
932 result = (operations_research::sat::CpSatHelper *)new operations_research::sat::CpSatHelper();
933 jresult = (void *)result;
934 return jresult;
935}
936
937
939 operations_research::sat::CpSatHelper *arg1 = (operations_research::sat::CpSatHelper *) 0 ;
940
941 arg1 = (operations_research::sat::CpSatHelper *)jarg1;
942 delete arg1;
943}
944
945
946#ifdef __cplusplus
947}
948#endif
949
DirectorException(const std::string &msg)
DirectorException(const char *msg)
const char * what() const
static void raise(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::StatusOr< SolveResult > Solve(const Model &model, const SolverType solver_type, const SolveArguments &solve_args, const SolverInitArguments &init_args)
Definition: solve.cc:155
absl::Status ValidateModel(const ModelProto &model, const bool check_names)
Collection of objects used to extend the Constraint Solver library.
STL namespace.
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_new_CpSatHelper___()
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 void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_LogCallback___(void *jarg1)
void(SWIGSTDCALL * SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_ValidateModel___(int model_proto_size, uint8_t *jarg1)
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 char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_ModelStats___(int model_proto_size, uint8_t *jarg1)
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_new_SolveWrapper___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBinaryPropagations___(void *jarg1)
SWIGEXPORT void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_SolutionCallback___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumBooleans___(void *jarg1)
static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback
#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_SolveWrapper_AddSolutionCallback___(void *jarg1, void *jarg2)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumIntegerPropagations___(void *jarg1)
SWIGEXPORT char *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_SolverResponseStats___(int response_size, uint8_t *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 void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_CpSatHelper_VariableDomain___(int variable_proto_size, uint8_t *jarg1)
SWIGEXPORT double SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_UserTime___(void *jarg1)
SWIG_CSharpExceptionArgumentCodes
@ SWIG_CSharpArgumentException
@ SWIG_CSharpArgumentOutOfRangeException
@ SWIG_CSharpArgumentNullException
char *(SWIGSTDCALL * SWIG_CSharpStringHelperCallback)(const char *)
SWIGEXPORT uint8_t *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolveWrapper_Solve___(void *jarg1, int model_proto_size, uint8_t *jarg2)
SWIGEXPORT void SWIGSTDCALL CSharp_GooglefOrToolsfSat_delete_SolutionCallback___(void *jarg1)
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_NumConflicts___(void *jarg1)
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_SolutionBooleanValue___(void *jarg1, int jarg2)
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)
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 void *SWIGSTDCALL CSharp_GooglefOrToolsfSat_new_LogCallback___()
SWIGEXPORT long long SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_SolutionIntegerValue___(void *jarg1, int jarg2)
SWIGEXPORT uint8_t *SWIGSTDCALL CSharp_GooglefOrToolsfSat_SolutionCallback_Response___(void *jarg1)
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