OR-Tools  8.0
sat_java_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 SWIGJAVA
13 #define SWIGJAVA
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 /* Fix for jlong on some versions of gcc on Windows */
168 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
169  typedef long long __int64;
170 #endif
171 
172 /* Fix for jlong on 64-bit x86 Solaris */
173 #if defined(__x86_64)
174 # ifdef _LP64
175 # undef _LP64
176 # endif
177 #endif
178 
179 #include <jni.h>
180 #include <stdlib.h>
181 #include <string.h>
182 
183 
184 /* Support for throwing Java exceptions */
185 typedef enum {
197 
198 typedef struct {
200  const char *java_exception;
202 
203 
204 static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
205  jclass excep;
206  static const SWIG_JavaExceptions_t java_exceptions[] = {
207  { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
208  { SWIG_JavaIOException, "java/io/IOException" },
209  { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
210  { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
211  { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
212  { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
213  { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
214  { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
215  { SWIG_JavaUnknownError, "java/lang/UnknownError" },
216  { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" },
217  { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
218  };
219  const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
220 
221  while (except_ptr->code != code && except_ptr->code)
222  except_ptr++;
223 
224  jenv->ExceptionClear();
225  excep = jenv->FindClass(except_ptr->java_exception);
226  if (excep)
227  jenv->ThrowNew(excep, msg);
228 }
229 
230 
231 /* Contract support */
232 
233 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
234 
235 /* -----------------------------------------------------------------------------
236  * director_common.swg
237  *
238  * This file contains support for director classes which is common between
239  * languages.
240  * ----------------------------------------------------------------------------- */
241 
242 /*
243  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
244  'Swig' namespace. This could be useful for multi-modules projects.
245 */
246 #ifdef SWIG_DIRECTOR_STATIC
247 /* Force anonymous (static) namespace */
248 #define Swig
249 #endif
250 /* -----------------------------------------------------------------------------
251  * director.swg
252  *
253  * This file contains support for director classes so that Java proxy
254  * methods can be called from C++.
255  * ----------------------------------------------------------------------------- */
256 
257 #if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) || defined(DEBUG_DIRECTOR_THREAD_NAME)
258 #include <iostream>
259 #endif
260 
261 #include <exception>
262 
263 #if defined(SWIG_JAVA_USE_THREAD_NAME)
264 
265 #if !defined(SWIG_JAVA_GET_THREAD_NAME)
266 namespace Swig {
267  SWIGINTERN int GetThreadName(char *name, size_t len);
268 }
269 
270 #if defined(__linux__)
271 
272 #include <sys/prctl.h>
273 SWIGINTERN int Swig::GetThreadName(char *name, size_t len) {
274  (void)len;
275 #if defined(PR_GET_NAME)
276  return prctl(PR_GET_NAME, (unsigned long)name, 0, 0, 0);
277 #else
278  (void)name;
279  return 1;
280 #endif
281 }
282 
283 #elif defined(__unix__) || defined(__APPLE__)
284 
285 #include <pthread.h>
286 SWIGINTERN int Swig::GetThreadName(char *name, size_t len) {
287  return pthread_getname_np(pthread_self(), name, len);
288 }
289 
290 #else
291 
292 SWIGINTERN int Swig::GetThreadName(char *name, size_t len) {
293  (void)len;
294  (void)name;
295  return 1;
296 }
297 #endif
298 
299 #endif
300 
301 #endif
302 
303 namespace Swig {
304 
305  /* Java object wrapper */
306  class JObjectWrapper {
307  public:
308  JObjectWrapper() : jthis_(NULL), weak_global_(true) {
309  }
310 
312  jthis_ = NULL;
313  weak_global_ = true;
314  }
315 
316  bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) {
317  if (!jthis_) {
318  weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned
319  if (jobj)
320  jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj);
321 #if defined(DEBUG_DIRECTOR_OWNED)
322  std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl;
323 #endif
324  return true;
325  } else {
326 #if defined(DEBUG_DIRECTOR_OWNED)
327  std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl;
328 #endif
329  return false;
330  }
331  }
332 
333  jobject get(JNIEnv *jenv) const {
334 #if defined(DEBUG_DIRECTOR_OWNED)
335  std::cout << "JObjectWrapper::get(";
336  if (jthis_)
337  std::cout << jthis_;
338  else
339  std::cout << "null";
340  std::cout << ") -> return new local ref" << std::endl;
341 #endif
342  return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_);
343  }
344 
345  void release(JNIEnv *jenv) {
346 #if defined(DEBUG_DIRECTOR_OWNED)
347  std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl;
348 #endif
349  if (jthis_) {
350  if (weak_global_) {
351  if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE)
352  jenv->DeleteWeakGlobalRef((jweak)jthis_);
353  } else
354  jenv->DeleteGlobalRef(jthis_);
355  }
356 
357  jthis_ = NULL;
358  weak_global_ = true;
359  }
360 
361  /* Only call peek if you know what you are doing wrt to weak/global references */
362  jobject peek() {
363  return jthis_;
364  }
365 
366  /* Java proxy releases ownership of C++ object, C++ object is now
367  responsible for destruction (creates NewGlobalRef to pin Java proxy) */
368  void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
369  if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */
370  if (!weak_global_) {
371  jenv->DeleteGlobalRef(jthis_);
372  jthis_ = jenv->NewWeakGlobalRef(jself);
373  weak_global_ = true;
374  }
375  } else {
376  /* Java releases ownership of C++ object's lifetime */
377  if (weak_global_) {
378  jenv->DeleteWeakGlobalRef((jweak)jthis_);
379  jthis_ = jenv->NewGlobalRef(jself);
380  weak_global_ = false;
381  }
382  }
383  }
384 
385  private:
386  /* pointer to Java object */
387  jobject jthis_;
388  /* Local or global reference flag */
389  bool weak_global_;
390  };
391 
392  /* Local JNI reference deleter */
393  class LocalRefGuard {
394  JNIEnv *jenv_;
395  jobject jobj_;
396 
397  // non-copyable
398  LocalRefGuard(const LocalRefGuard &);
399  LocalRefGuard &operator=(const LocalRefGuard &);
400  public:
401  LocalRefGuard(JNIEnv *jenv, jobject jobj): jenv_(jenv), jobj_(jobj) {}
403  if (jobj_)
404  jenv_->DeleteLocalRef(jobj_);
405  }
406  };
407 
408  /* director base class */
409  class Director {
410  /* pointer to Java virtual machine */
411  JavaVM *swig_jvm_;
412 
413  protected:
414 #if defined (_MSC_VER) && (_MSC_VER<1300)
415  class JNIEnvWrapper;
416  friend class JNIEnvWrapper;
417 #endif
418  /* Utility class for managing the JNI environment */
419  class JNIEnvWrapper {
420  const Director *director_;
421  JNIEnv *jenv_;
422  int env_status;
423  public:
424  JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) {
425 #if defined(__ANDROID__)
426  JNIEnv **jenv = &jenv_;
427 #else
428  void **jenv = (void **)&jenv_;
429 #endif
430  env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2);
431  JavaVMAttachArgs args;
432  args.version = JNI_VERSION_1_2;
433  args.group = NULL;
434  args.name = NULL;
435 #if defined(SWIG_JAVA_USE_THREAD_NAME)
436  char thread_name[64]; // MAX_TASK_COMM_LEN=16 is hard-coded in the Linux kernel and MacOS has MAXTHREADNAMESIZE=64.
437  if (Swig::GetThreadName(thread_name, sizeof(thread_name)) == 0) {
438  args.name = thread_name;
439 #if defined(DEBUG_DIRECTOR_THREAD_NAME)
440  std::cout << "JNIEnvWrapper: thread name: " << thread_name << std::endl;
441  } else {
442  std::cout << "JNIEnvWrapper: Couldn't set Java thread name" << std::endl;
443 #endif
444  }
445 #endif
446 #if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON)
447  // Attach a daemon thread to the JVM. Useful when the JVM should not wait for
448  // the thread to exit upon shutdown. Only for jdk-1.4 and later.
449  director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, &args);
450 #else
451  director_->swig_jvm_->AttachCurrentThread(jenv, &args);
452 #endif
453  }
455 #if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD)
456  // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
457  // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
458  if (env_status == JNI_EDETACHED)
459  director_->swig_jvm_->DetachCurrentThread();
460 #endif
461  }
462  JNIEnv *getJNIEnv() const {
463  return jenv_;
464  }
465  };
466 
467  /* Java object wrapper */
469 
470  /* Disconnect director from Java object */
471  void swig_disconnect_director_self(const char *disconn_method) {
472  JNIEnvWrapper jnienv(this) ;
473  JNIEnv *jenv = jnienv.getJNIEnv() ;
474  jobject jobj = swig_self_.get(jenv);
475  LocalRefGuard ref_deleter(jenv, jobj);
476 #if defined(DEBUG_DIRECTOR_OWNED)
477  std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl;
478 #endif
479  if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) {
480  jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V");
481  if (disconn_meth) {
482 #if defined(DEBUG_DIRECTOR_OWNED)
483  std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl;
484 #endif
485  jenv->CallVoidMethod(jobj, disconn_meth);
486  }
487  }
488  }
489 
490  public:
491  Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() {
492  /* Acquire the Java VM pointer */
493  jenv->GetJavaVM(&swig_jvm_);
494  }
495 
496  virtual ~Director() {
497  JNIEnvWrapper jnienv(this) ;
498  JNIEnv *jenv = jnienv.getJNIEnv() ;
499  swig_self_.release(jenv);
500  }
501 
502  bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) {
503  return swig_self_.set(jenv, jself, mem_own, weak_global);
504  }
505 
506  jobject swig_get_self(JNIEnv *jenv) const {
507  return swig_self_.get(jenv);
508  }
509 
510  // Change C++ object's ownership, relative to Java
511  void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
512  swig_self_.java_change_ownership(jenv, jself, take_or_release);
513  }
514  };
515 
516  // Zero initialized bool array
517  template<size_t N> class BoolArray {
518  bool array_[N];
519  public:
521  memset(array_, 0, sizeof(array_));
522  }
523  bool& operator[](size_t n) {
524  return array_[n];
525  }
526  bool operator[](size_t n) const {
527  return array_[n];
528  }
529  };
530 
531  // Utility classes and functions for exception handling.
532 
533  // Simple holder for a Java string during exception handling, providing access to a c-style string
534  class JavaString {
535  public:
536  JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(0) {
537  if (jenv_ && jstr_)
538  cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, NULL);
539  }
540 
542  if (jenv_ && jstr_ && cstr_)
543  jenv_->ReleaseStringUTFChars(jstr_, cstr_);
544  }
545 
546  const char *c_str(const char *null_string = "null JavaString") const {
547  return cstr_ ? cstr_ : null_string;
548  }
549 
550  private:
551  // non-copyable
552  JavaString(const JavaString &);
553  JavaString &operator=(const JavaString &);
554 
555  JNIEnv *jenv_;
556  jstring jstr_;
557  const char *cstr_;
558  };
559 
560  // Helper class to extract the exception message from a Java throwable
561  class JavaExceptionMessage {
562  public:
563  JavaExceptionMessage(JNIEnv *jenv, jthrowable throwable) : message_(jenv, exceptionMessageFromThrowable(jenv, throwable)) {
564  }
565 
566  // Return a C string of the exception message in the jthrowable passed in the constructor
567  // If no message is available, null_string is return instead
568  const char *message(const char *null_string = "Could not get exception message in JavaExceptionMessage") const {
569  return message_.c_str(null_string);
570  }
571 
572  private:
573  // non-copyable
575  JavaExceptionMessage &operator=(const JavaExceptionMessage &);
576 
577  // Get exception message by calling Java method Throwable.getMessage()
578  static jstring exceptionMessageFromThrowable(JNIEnv *jenv, jthrowable throwable) {
579  jstring jmsg = NULL;
580  if (jenv && throwable) {
581  jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions
582  jclass throwclz = jenv->GetObjectClass(throwable);
583  if (throwclz) {
584  // All Throwable classes have a getMessage() method, so call it to extract the exception message
585  jmethodID getMessageMethodID = jenv->GetMethodID(throwclz, "getMessage", "()Ljava/lang/String;");
586  if (getMessageMethodID)
587  jmsg = (jstring)jenv->CallObjectMethod(throwable, getMessageMethodID);
588  }
589  if (jmsg == NULL && jenv->ExceptionCheck())
590  jenv->ExceptionClear();
591  }
592  return jmsg;
593  }
594 
595  JavaString message_;
596  };
597 
598  // C++ Exception class for handling Java exceptions thrown during a director method Java upcall
599  class DirectorException : public std::exception {
600  public:
601 
602  // Construct exception from a Java throwable
603  DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(0), msg_(0) {
604 
605  // Call Java method Object.getClass().getName() to obtain the throwable's class name (delimited by '/')
606  if (jenv && throwable) {
607  jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions
608  jclass throwclz = jenv->GetObjectClass(throwable);
609  if (throwclz) {
610  jclass clzclz = jenv->GetObjectClass(throwclz);
611  if (clzclz) {
612  jmethodID getNameMethodID = jenv->GetMethodID(clzclz, "getName", "()Ljava/lang/String;");
613  if (getNameMethodID) {
614  jstring jstr_classname = (jstring)(jenv->CallObjectMethod(throwclz, getNameMethodID));
615  // Copy strings, since there is no guarantee that jenv will be active when handled
616  if (jstr_classname) {
617  JavaString jsclassname(jenv, jstr_classname);
618  const char *classname = jsclassname.c_str(0);
619  if (classname)
620  classname_ = copypath(classname);
621  }
622  }
623  }
624  }
625  }
626 
627  JavaExceptionMessage exceptionmsg(jenv, throwable);
628  msg_ = copystr(exceptionmsg.message(0));
629  }
630 
631  // More general constructor for handling as a java.lang.RuntimeException
632  DirectorException(const char *msg) : jenv_(0), throwable_(0), classname_(0), msg_(msg ? copystr(msg) : 0) {
633  }
634 
635  ~DirectorException() throw() {
636  delete[] classname_;
637  delete[] msg_;
638  }
639 
640  const char *what() const throw() {
641  return msg_ ? msg_ : "Unspecified DirectorException message";
642  }
643 
644  // Reconstruct and raise/throw the Java Exception that caused the DirectorException
645  // Note that any error in the JNI exception handling results in a Java RuntimeException
646  void throwException(JNIEnv *jenv) const {
647  if (jenv) {
648  if (jenv == jenv_ && throwable_) {
649  // Throw original exception if not already pending
650  jthrowable throwable = jenv->ExceptionOccurred();
651  if (throwable && jenv->IsSameObject(throwable, throwable_) == JNI_FALSE) {
652  jenv->ExceptionClear();
653  throwable = 0;
654  }
655  if (!throwable)
656  jenv->Throw(throwable_);
657  } else {
658  // Try and reconstruct original exception, but original stacktrace is not reconstructed
659  jenv->ExceptionClear();
660 
661  jmethodID ctorMethodID = 0;
662  jclass throwableclass = 0;
663  if (classname_) {
664  throwableclass = jenv->FindClass(classname_);
665  if (throwableclass)
666  ctorMethodID = jenv->GetMethodID(throwableclass, "<init>", "(Ljava/lang/String;)V");
667  }
668 
669  if (ctorMethodID) {
670  jenv->ThrowNew(throwableclass, what());
671  } else {
673  }
674  }
675  }
676  }
677 
678  // Deprecated - use throwException
679  void raiseJavaException(JNIEnv *jenv) const {
680  throwException(jenv);
681  }
682 
683  // Create and throw the DirectorException
684  static void raise(JNIEnv *jenv, jthrowable throwable) {
685  throw DirectorException(jenv, throwable);
686  }
687 
688  private:
689  static char *copypath(const char *srcmsg) {
690  char *target = copystr(srcmsg);
691  for (char *c=target; *c; ++c) {
692  if ('.' == *c)
693  *c = '/';
694  }
695  return target;
696  }
697 
698  static char *copystr(const char *srcmsg) {
699  char *target = 0;
700  if (srcmsg) {
701  size_t msglen = strlen(srcmsg) + 1;
702  target = new char[msglen];
703  strncpy(target, srcmsg, msglen);
704  }
705  return target;
706  }
707 
708  JNIEnv *jenv_;
709  jthrowable throwable_;
710  const char *classname_;
711  const char *msg_;
712  };
713 
714  // Helper method to determine if a Java throwable matches a particular Java class type
715  // Note side effect of clearing any pending exceptions
716  SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) {
717  bool matches = false;
718 
719  if (throwable && jenv && classname) {
720  // Exceptions need to be cleared for correct behavior.
721  // The caller of ExceptionMatches should restore pending exceptions if desired -
722  // the caller already has the throwable.
723  jenv->ExceptionClear();
724 
725  jclass clz = jenv->FindClass(classname);
726  if (clz) {
727  jclass classclz = jenv->GetObjectClass(clz);
728  jmethodID isInstanceMethodID = jenv->GetMethodID(classclz, "isInstance", "(Ljava/lang/Object;)Z");
729  if (isInstanceMethodID) {
730  matches = jenv->CallBooleanMethod(clz, isInstanceMethodID, throwable) != 0;
731  }
732  }
733 
734 #if defined(DEBUG_DIRECTOR_EXCEPTION)
735  if (jenv->ExceptionCheck()) {
736  // Typically occurs when an invalid classname argument is passed resulting in a ClassNotFoundException
737  JavaExceptionMessage exc(jenv, jenv->ExceptionOccurred());
738  std::cout << "Error: ExceptionMatches: class '" << classname << "' : " << exc.message() << std::endl;
739  }
740 #endif
741  }
742  return matches;
743  }
744 }
745 
746 namespace Swig {
747  namespace {
748  jclass jclass_mainJNI = NULL;
749  jmethodID director_method_ids[1];
750  }
751 }
752 
753 #include <stdint.h> // Use the C99 official header
754 
755 
756 #define SWIGWORDSIZE64
757 #ifndef LONG_MAX
758 #include <limits.h>
759 #endif
760 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
761 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
762 #endif
763 
764 
765 #include <cstdint>
766 #include <string>
767 #include <vector>
768 
769 #include "ortools/base/basictypes.h"
770 
771 
772 #include <string>
773 
774 
776 
777 
778 #include "ortools/base/jniutil.h"
779 
780 
781 #include "ortools/sat/cp_model.pb.h"
783 #include "ortools/sat/swig_helper.h"
785 
786 
787 
788 /* ---------------------------------------------------
789  * C++ director class methods
790  * --------------------------------------------------- */
791 
792 #include "sat_java_wrap.h"
793 
794 SwigDirector_SolutionCallback::SwigDirector_SolutionCallback(JNIEnv *jenv) : operations_research::sat::SolutionCallback(), Swig::Director(jenv) {
795 }
796 
798  swig_disconnect_director_self("swigDirectorDisconnect");
799 }
800 
801 
803  JNIEnvWrapper swigjnienv(this) ;
804  JNIEnv * jenv = swigjnienv.getJNIEnv() ;
805  jobject swigjobj = (jobject) NULL ;
806 
807  if (!swig_override[0]) {
808  SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method operations_research::sat::SolutionCallback::OnSolutionCallback.");
809  return;
810  }
811  swigjobj = swig_get_self(jenv);
812  if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
813  jenv->CallStaticVoidMethod(Swig::jclass_mainJNI, Swig::director_method_ids[0], swigjobj);
814  jthrowable swigerror = jenv->ExceptionOccurred();
815  if (swigerror) {
816  Swig::DirectorException::raise(jenv, swigerror);
817  }
818 
819  } else {
820  SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object in operations_research::sat::SolutionCallback::OnSolutionCallback ");
821  }
822  if (swigjobj) jenv->DeleteLocalRef(swigjobj);
823 }
824 
825 void SwigDirector_SolutionCallback::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
826  static struct {
827  const char *mname;
828  const char *mdesc;
829  jmethodID base_methid;
830  } methods[] = {
831  {
832  "onSolutionCallback", "()V", NULL
833  }
834  };
835 
836  static jclass baseclass = 0 ;
837 
838  if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
839  if (!baseclass) {
840  baseclass = jenv->FindClass("com/google/ortools/sat/SolutionCallback");
841  if (!baseclass) return;
842  baseclass = (jclass) jenv->NewGlobalRef(baseclass);
843  }
844  bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
845  for (int i = 0; i < 1; ++i) {
846  if (!methods[i].base_methid) {
847  methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
848  if (!methods[i].base_methid) return;
849  }
850  swig_override[i] = false;
851  if (derived) {
852  jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
853  swig_override[i] = (methid != methods[i].base_methid);
854  jenv->ExceptionClear();
855  }
856  }
857  }
858 }
859 
860 
861 
862 #ifdef __cplusplus
863 extern "C" {
864 #endif
865 
866 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_delete_1SolutionCallback(JNIEnv *jenv, jclass jcls, jlong jarg1) {
867  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
868 
869  (void)jenv;
870  (void)jcls;
871  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
872  delete arg1;
873 }
874 
875 
876 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1onSolutionCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
877  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
878 
879  (void)jenv;
880  (void)jcls;
881  (void)jarg1_;
882  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
883  ((operations_research::sat::SolutionCallback const *)arg1)->OnSolutionCallback();
884 }
885 
886 
887 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBooleans(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
888  jlong jresult = 0 ;
889  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
890  int64 result;
891 
892  (void)jenv;
893  (void)jcls;
894  (void)jarg1_;
895  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
896  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBooleans();
897  jresult = (jlong)result;
898  return jresult;
899 }
900 
901 
902 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBranches(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
903  jlong jresult = 0 ;
904  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
905  int64 result;
906 
907  (void)jenv;
908  (void)jcls;
909  (void)jarg1_;
910  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
911  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBranches();
912  jresult = (jlong)result;
913  return jresult;
914 }
915 
916 
917 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numConflicts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
918  jlong jresult = 0 ;
919  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
920  int64 result;
921 
922  (void)jenv;
923  (void)jcls;
924  (void)jarg1_;
925  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
926  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumConflicts();
927  jresult = (jlong)result;
928  return jresult;
929 }
930 
931 
932 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBinaryPropagations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
933  jlong jresult = 0 ;
934  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
935  int64 result;
936 
937  (void)jenv;
938  (void)jcls;
939  (void)jarg1_;
940  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
941  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumBinaryPropagations();
942  jresult = (jlong)result;
943  return jresult;
944 }
945 
946 
947 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numIntegerPropagations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
948  jlong jresult = 0 ;
949  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
950  int64 result;
951 
952  (void)jenv;
953  (void)jcls;
954  (void)jarg1_;
955  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
956  result = (int64)((operations_research::sat::SolutionCallback const *)arg1)->NumIntegerPropagations();
957  jresult = (jlong)result;
958  return jresult;
959 }
960 
961 
962 SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1wallTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
963  jdouble jresult = 0 ;
964  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
965  double result;
966 
967  (void)jenv;
968  (void)jcls;
969  (void)jarg1_;
970  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
971  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->WallTime();
972  jresult = (jdouble)result;
973  return jresult;
974 }
975 
976 
977 SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1userTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
978  jdouble jresult = 0 ;
979  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
980  double result;
981 
982  (void)jenv;
983  (void)jcls;
984  (void)jarg1_;
985  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
986  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->UserTime();
987  jresult = (jdouble)result;
988  return jresult;
989 }
990 
991 
992 SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1objectiveValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
993  jdouble jresult = 0 ;
994  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
995  double result;
996 
997  (void)jenv;
998  (void)jcls;
999  (void)jarg1_;
1000  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
1001  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->ObjectiveValue();
1002  jresult = (jdouble)result;
1003  return jresult;
1004 }
1005 
1006 
1007 SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1bestObjectiveBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
1008  jdouble jresult = 0 ;
1009  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
1010  double result;
1011 
1012  (void)jenv;
1013  (void)jcls;
1014  (void)jarg1_;
1015  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
1016  result = (double)((operations_research::sat::SolutionCallback const *)arg1)->BestObjectiveBound();
1017  jresult = (jdouble)result;
1018  return jresult;
1019 }
1020 
1021 
1022 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionIntegerValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
1023  jlong jresult = 0 ;
1024  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
1025  int arg2 ;
1026  int64 result;
1027 
1028  (void)jenv;
1029  (void)jcls;
1030  (void)jarg1_;
1031  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
1032  arg2 = (int)jarg2;
1033  result = (int64)(arg1)->SolutionIntegerValue(arg2);
1034  jresult = (jlong)result;
1035  return jresult;
1036 }
1037 
1038 
1039 SWIGEXPORT jboolean JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionBooleanValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
1040  jboolean jresult = 0 ;
1041  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
1042  int arg2 ;
1043  bool result;
1044 
1045  (void)jenv;
1046  (void)jcls;
1047  (void)jarg1_;
1048  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
1049  arg2 = (int)jarg2;
1050  result = (bool)(arg1)->SolutionBooleanValue(arg2);
1051  jresult = (jboolean)result;
1052  return jresult;
1053 }
1054 
1055 
1056 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1stopSearch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
1057  operations_research::sat::SolutionCallback *arg1 = (operations_research::sat::SolutionCallback *) 0 ;
1058 
1059  (void)jenv;
1060  (void)jcls;
1061  (void)jarg1_;
1062  arg1 = *(operations_research::sat::SolutionCallback **)&jarg1;
1063  (arg1)->StopSearch();
1064 }
1065 
1066 
1068  jlong jresult = 0 ;
1069  operations_research::sat::SolutionCallback *result = 0 ;
1070 
1071  (void)jenv;
1072  (void)jcls;
1073  result = (operations_research::sat::SolutionCallback *)new SwigDirector_SolutionCallback(jenv);
1074  *(operations_research::sat::SolutionCallback **)&jresult = result;
1075  return jresult;
1076 }
1077 
1078 
1079 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
1080  operations_research::sat::SolutionCallback *obj = *((operations_research::sat::SolutionCallback **)&objarg);
1081  (void)jcls;
1082  SwigDirector_SolutionCallback *director = static_cast<SwigDirector_SolutionCallback *>(obj);
1083  director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
1084 }
1085 
1086 
1087 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
1088  operations_research::sat::SolutionCallback *obj = *((operations_research::sat::SolutionCallback **)&objarg);
1089  SwigDirector_SolutionCallback *director = dynamic_cast<SwigDirector_SolutionCallback *>(obj);
1090  (void)jcls;
1091  if (director) {
1092  director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
1093  }
1094 }
1095 
1096 
1097 SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solve(JNIEnv *jenv, jclass jcls, jbyteArray jarg1) {
1098  jbyteArray jresult = 0 ;
1102 
1103  (void)jenv;
1104  (void)jcls;
1105  {
1106  int proto_size = 0;
1107  std::unique_ptr<char[]> proto_buffer(
1108  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1109  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1110  if (!parsed_ok) {
1113  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1114  }
1115  arg1 = &temp1;
1116  }
1118  {
1119  const long size = (&result)->ByteSizeLong();
1120  std::unique_ptr<char[]> buf(new char[size]);
1121  (&result)->SerializeWithCachedSizesToArray(reinterpret_cast<uint8*>(buf.get()));
1122  jresult = JNIUtil::MakeJByteArray(jenv, buf.get(), size);
1123  }
1124  return jresult;
1125 }
1126 
1127 
1128 SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParameters(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jbyteArray jarg2) {
1129  jbyteArray jresult = 0 ;
1135 
1136  (void)jenv;
1137  (void)jcls;
1138  {
1139  int proto_size = 0;
1140  std::unique_ptr<char[]> proto_buffer(
1141  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1142  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1143  if (!parsed_ok) {
1146  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1147  }
1148  arg1 = &temp1;
1149  }
1150  {
1151  int proto_size = 0;
1152  std::unique_ptr<char[]> proto_buffer(
1153  JNIUtil::MakeCharArray(jenv, jarg2, &proto_size));
1154  bool parsed_ok = temp2.ParseFromArray(proto_buffer.get(), proto_size);
1155  if (!parsed_ok) {
1158  "Unable to parse operations_research::sat::SatParameters protocol message.");
1159  }
1160  arg2 = &temp2;
1161  }
1163  {
1164  const long size = (&result)->ByteSizeLong();
1165  std::unique_ptr<char[]> buf(new char[size]);
1166  (&result)->SerializeWithCachedSizesToArray(reinterpret_cast<uint8*>(buf.get()));
1167  jresult = JNIUtil::MakeJByteArray(jenv, buf.get(), size);
1168  }
1169  return jresult;
1170 }
1171 
1172 
1173 SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParametersAndSolutionCallback(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jbyteArray jarg2, jlong jarg3, jobject jarg3_) {
1174  jbyteArray jresult = 0 ;
1177  operations_research::sat::SolutionCallback *arg3 = 0 ;
1181 
1182  (void)jenv;
1183  (void)jcls;
1184  (void)jarg3_;
1185  {
1186  int proto_size = 0;
1187  std::unique_ptr<char[]> proto_buffer(
1188  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1189  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1190  if (!parsed_ok) {
1193  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1194  }
1195  arg1 = &temp1;
1196  }
1197  {
1198  int proto_size = 0;
1199  std::unique_ptr<char[]> proto_buffer(
1200  JNIUtil::MakeCharArray(jenv, jarg2, &proto_size));
1201  bool parsed_ok = temp2.ParseFromArray(proto_buffer.get(), proto_size);
1202  if (!parsed_ok) {
1205  "Unable to parse operations_research::sat::SatParameters protocol message.");
1206  }
1207  arg2 = &temp2;
1208  }
1209  arg3 = *(operations_research::sat::SolutionCallback **)&jarg3;
1210  if (!arg3) {
1211  SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "operations_research::sat::SolutionCallback const & reference is null");
1212  return 0;
1213  }
1214  result = operations_research::sat::SatHelper::SolveWithParametersAndSolutionCallback((operations_research::sat::CpModelProto const &)*arg1,(operations_research::sat::SatParameters const &)*arg2,(operations_research::sat::SolutionCallback const &)*arg3);
1215  {
1216  const long size = (&result)->ByteSizeLong();
1217  std::unique_ptr<char[]> buf(new char[size]);
1218  (&result)->SerializeWithCachedSizesToArray(reinterpret_cast<uint8*>(buf.get()));
1219  jresult = JNIUtil::MakeJByteArray(jenv, buf.get(), size);
1220  }
1221  return jresult;
1222 }
1223 
1224 
1225 SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1modelStats(JNIEnv *jenv, jclass jcls, jbyteArray jarg1) {
1226  jstring jresult = 0 ;
1229  std::string result;
1230 
1231  (void)jenv;
1232  (void)jcls;
1233  {
1234  int proto_size = 0;
1235  std::unique_ptr<char[]> proto_buffer(
1236  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1237  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1238  if (!parsed_ok) {
1241  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1242  }
1243  arg1 = &temp1;
1244  }
1245  result = operations_research::sat::SatHelper::ModelStats((operations_research::sat::CpModelProto const &)*arg1);
1246  jresult = jenv->NewStringUTF((&result)->c_str());
1247  return jresult;
1248 }
1249 
1250 
1251 SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solverResponseStats(JNIEnv *jenv, jclass jcls, jbyteArray jarg1) {
1252  jstring jresult = 0 ;
1255  std::string result;
1256 
1257  (void)jenv;
1258  (void)jcls;
1259  {
1260  int proto_size = 0;
1261  std::unique_ptr<char[]> proto_buffer(
1262  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1263  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1264  if (!parsed_ok) {
1267  "Unable to parse operations_research::sat::CpSolverResponse protocol message.");
1268  }
1269  arg1 = &temp1;
1270  }
1271  result = operations_research::sat::SatHelper::SolverResponseStats((operations_research::sat::CpSolverResponse const &)*arg1);
1272  jresult = jenv->NewStringUTF((&result)->c_str());
1273  return jresult;
1274 }
1275 
1276 
1277 SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1validateModel(JNIEnv *jenv, jclass jcls, jbyteArray jarg1) {
1278  jstring jresult = 0 ;
1281  std::string result;
1282 
1283  (void)jenv;
1284  (void)jcls;
1285  {
1286  int proto_size = 0;
1287  std::unique_ptr<char[]> proto_buffer(
1288  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1289  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1290  if (!parsed_ok) {
1293  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1294  }
1295  arg1 = &temp1;
1296  }
1297  result = operations_research::sat::SatHelper::ValidateModel((operations_research::sat::CpModelProto const &)*arg1);
1298  jresult = jenv->NewStringUTF((&result)->c_str());
1299  return jresult;
1300 }
1301 
1302 
1303 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1variableDomain(JNIEnv *jenv, jclass jcls, jbyteArray jarg1) {
1304  jlong jresult = 0 ;
1308 
1309  (void)jenv;
1310  (void)jcls;
1311  {
1312  int proto_size = 0;
1313  std::unique_ptr<char[]> proto_buffer(
1314  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1315  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1316  if (!parsed_ok) {
1319  "Unable to parse operations_research::sat::IntegerVariableProto protocol message.");
1320  }
1321  arg1 = &temp1;
1322  }
1323  result = operations_research::sat::SatHelper::VariableDomain((operations_research::sat::IntegerVariableProto const &)*arg1);
1325  return jresult;
1326 }
1327 
1328 
1329 SWIGEXPORT jboolean JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1writeModelToFile(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jstring jarg2) {
1330  jboolean jresult = 0 ;
1332  std::string *arg2 = 0 ;
1334  bool result;
1335 
1336  (void)jenv;
1337  (void)jcls;
1338  {
1339  int proto_size = 0;
1340  std::unique_ptr<char[]> proto_buffer(
1341  JNIUtil::MakeCharArray(jenv, jarg1, &proto_size));
1342  bool parsed_ok = temp1.ParseFromArray(proto_buffer.get(), proto_size);
1343  if (!parsed_ok) {
1346  "Unable to parse operations_research::sat::CpModelProto protocol message.");
1347  }
1348  arg1 = &temp1;
1349  }
1350  if(!jarg2) {
1352  return 0;
1353  }
1354  const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0);
1355  if (!arg2_pstr) return 0;
1356  std::string arg2_str(arg2_pstr);
1357  arg2 = &arg2_str;
1358  jenv->ReleaseStringUTFChars(jarg2, arg2_pstr);
1359  result = (bool)operations_research::sat::SatHelper::WriteModelToFile((operations_research::sat::CpModelProto const &)*arg1,(std::string const &)*arg2);
1360  jresult = (jboolean)result;
1361  return jresult;
1362 }
1363 
1364 
1365 SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_new_1SatHelper(JNIEnv *jenv, jclass jcls) {
1366  jlong jresult = 0 ;
1367  operations_research::sat::SatHelper *result = 0 ;
1368 
1369  (void)jenv;
1370  (void)jcls;
1371  result = (operations_research::sat::SatHelper *)new operations_research::sat::SatHelper();
1372  *(operations_research::sat::SatHelper **)&jresult = result;
1373  return jresult;
1374 }
1375 
1376 
1377 SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_delete_1SatHelper(JNIEnv *jenv, jclass jcls, jlong jarg1) {
1378  operations_research::sat::SatHelper *arg1 = (operations_research::sat::SatHelper *) 0 ;
1379 
1380  (void)jenv;
1381  (void)jcls;
1382  arg1 = *(operations_research::sat::SatHelper **)&jarg1;
1383  delete arg1;
1384 }
1385 
1386 
1388  int i;
1389 
1390  static struct {
1391  const char *method;
1392  const char *signature;
1393  } methods[1] = {
1394  {
1395  "SwigDirector_SolutionCallback_onSolutionCallback", "(Lcom/google/ortools/sat/SolutionCallback;)V"
1396  }
1397  };
1398  Swig::jclass_mainJNI = (jclass) jenv->NewGlobalRef(jcls);
1399  if (!Swig::jclass_mainJNI) return;
1400  for (i = 0; i < (int) (sizeof(methods)/sizeof(methods[0])); ++i) {
1401  Swig::director_method_ids[i] = jenv->GetStaticMethodID(jcls, methods[i].method, methods[i].signature);
1402  if (!Swig::director_method_ids[i]) return;
1403  }
1404 }
1405 
1406 
1407 #ifdef __cplusplus
1408 }
1409 #endif
1410 
Swig::Director::JNIEnvWrapper::getJNIEnv
JNIEnv * getJNIEnv() const
Definition: sat_java_wrap.cc:462
Swig::LocalRefGuard::LocalRefGuard
LocalRefGuard(JNIEnv *jenv, jobject jobj)
Definition: sat_java_wrap.cc:401
SWIG_JavaNullPointerException
@ SWIG_JavaNullPointerException
Definition: sat_java_wrap.cc:192
Swig::JavaExceptionMessage::JavaExceptionMessage
JavaExceptionMessage(JNIEnv *jenv, jthrowable throwable)
Definition: sat_java_wrap.cc:563
integral_types.h
Swig::JavaString::~JavaString
~JavaString()
Definition: sat_java_wrap.cc:541
Swig::JavaString::c_str
const char * c_str(const char *null_string="null JavaString") const
Definition: sat_java_wrap.cc:546
cp_model.pb.h
SWIG_JavaUnknownError
@ SWIG_JavaUnknownError
Definition: sat_java_wrap.cc:194
Java_com_google_ortools_sat_mainJNI_delete_1SolutionCallback
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_delete_1SolutionCallback(JNIEnv *jenv, jclass jcls, jlong jarg1)
Definition: sat_java_wrap.cc:866
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numConflicts
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numConflicts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:917
Swig::JObjectWrapper::JObjectWrapper
JObjectWrapper()
Definition: sat_java_wrap.cc:308
Java_com_google_ortools_sat_mainJNI_SatHelper_1variableDomain
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1variableDomain(JNIEnv *jenv, jclass jcls, jbyteArray jarg1)
Definition: sat_java_wrap.cc:1303
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1userTime
SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1userTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:977
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1objectiveValue
SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1objectiveValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:992
Java_com_google_ortools_sat_mainJNI_delete_1SatHelper
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_delete_1SatHelper(JNIEnv *jenv, jclass jcls, jlong jarg1)
Definition: sat_java_wrap.cc:1377
Swig::LocalRefGuard
Definition: constraint_solver_java_wrap.cc:410
Swig::JObjectWrapper::release
void release(JNIEnv *jenv)
Definition: sat_java_wrap.cc:345
Swig::JObjectWrapper
Definition: constraint_solver_java_wrap.cc:323
SwigDirector_SolutionCallback
Definition: sat_csharp_wrap.h:14
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionBooleanValue
SWIGEXPORT jboolean JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionBooleanValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
Definition: sat_java_wrap.cc:1039
SWIG_JavaIllegalArgumentException
@ SWIG_JavaIllegalArgumentException
Definition: sat_java_wrap.cc:191
Swig
Definition: constraint_solver_csharp_wrap.cc:347
Swig::Director::swig_get_self
PyObject * swig_get_self() const
Definition: constraint_solver_python_wrap.cc:3008
SWIG_JavaDirectorPureVirtual
@ SWIG_JavaDirectorPureVirtual
Definition: sat_java_wrap.cc:193
Java_com_google_ortools_sat_mainJNI_SatHelper_1solve
SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solve(JNIEnv *jenv, jclass jcls, jbyteArray jarg1)
Definition: sat_java_wrap.cc:1097
Java_com_google_ortools_sat_mainJNI_new_1SolutionCallback
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_new_1SolutionCallback(JNIEnv *jenv, jclass jcls)
Definition: sat_java_wrap.cc:1067
SWIG_JavaExceptionCodes
SWIG_JavaExceptionCodes
Definition: knapsack_solver_java_wrap.cc:184
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1director_1connect
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global)
Definition: sat_java_wrap.cc:1079
SwigDirector_SolutionCallback::swig_connect_director
void swig_connect_director(SWIG_Callback0_t callbackOnSolutionCallback)
Definition: sat_csharp_wrap.cc:424
Swig::LocalRefGuard::~LocalRefGuard
~LocalRefGuard()
Definition: sat_java_wrap.cc:402
operations_research
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
Definition: dense_doubly_linked_list.h:21
Swig::BoolArray::operator[]
bool operator[](size_t n) const
Definition: sat_java_wrap.cc:526
Swig::Director::JNIEnvWrapper::JNIEnvWrapper
JNIEnvWrapper(const Director *director)
Definition: sat_java_wrap.cc:424
Swig::Director::swig_get_self
jobject swig_get_self(JNIEnv *jenv) const
Definition: sat_java_wrap.cc:506
Swig::JavaExceptionMessage::message
const char * message(const char *null_string="Could not get exception message in JavaExceptionMessage") const
Definition: sat_java_wrap.cc:568
Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParametersAndSolutionCallback
SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParametersAndSolutionCallback(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jbyteArray jarg2, jlong jarg3, jobject jarg3_)
Definition: sat_java_wrap.cc:1173
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1wallTime
SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1wallTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:962
SWIG_JavaExceptions_t::java_exception
const char * java_exception
Definition: knapsack_solver_java_wrap.cc:199
Java_com_google_ortools_sat_mainJNI_swig_1module_1init
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls)
Definition: sat_java_wrap.cc:1387
operations_research::Domain
We call domain any subset of Int64 = [kint64min, kint64max].
Definition: sorted_interval_list.h:81
int64
int64_t int64
Definition: integral_types.h:34
Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParameters
SWIGEXPORT jbyteArray JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solveWithParameters(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jbyteArray jarg2)
Definition: sat_java_wrap.cc:1128
JNIUtil::MakeCharArray
static char * MakeCharArray(JNIEnv *env, jbyteArray a, int *size)
Definition: jniutil.h:47
jniutil.h
SWIGINTERN
#define SWIGINTERN
Definition: sat_java_wrap.cc:100
Swig::JObjectWrapper::get
jobject get(JNIEnv *jenv) const
Definition: sat_java_wrap.cc:333
Swig::JavaString
Definition: constraint_solver_java_wrap.cc:551
Java_com_google_ortools_sat_mainJNI_new_1SatHelper
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_new_1SatHelper(JNIEnv *jenv, jclass jcls)
Definition: sat_java_wrap.cc:1365
Swig::DirectorException::raise
static void raise(JNIEnv *jenv, jthrowable throwable)
Definition: constraint_solver_java_wrap.cc:701
SwigDirector_SolutionCallback::OnSolutionCallback
virtual void OnSolutionCallback() const
Definition: sat_csharp_wrap.cc:415
Swig::Director::Director
Director(JNIEnv *jenv)
Definition: constraint_solver_java_wrap.cc:508
Java_com_google_ortools_sat_mainJNI_SatHelper_1writeModelToFile
SWIGEXPORT jboolean JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1writeModelToFile(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jstring jarg2)
Definition: sat_java_wrap.cc:1329
Swig::JavaString::JavaString
JavaString(JNIEnv *jenv, jstring jstr)
Definition: sat_java_wrap.cc:536
SWIG_JavaRuntimeException
@ SWIG_JavaRuntimeException
Definition: sat_java_wrap.cc:188
sat_parameters.pb.h
Swig::Director::JNIEnvWrapper
Definition: constraint_solver_java_wrap.cc:436
SwigDirector_SolutionCallback::SwigDirector_SolutionCallback
SwigDirector_SolutionCallback()
Definition: sat_csharp_wrap.cc:406
SWIG_JavaIllegalStateException
@ SWIG_JavaIllegalStateException
Definition: sat_java_wrap.cc:195
SWIG_JavaExceptions_t::code
SWIG_JavaExceptionCodes code
Definition: knapsack_solver_java_wrap.cc:198
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBinaryPropagations
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBinaryPropagations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:932
SWIG_JavaArithmeticException
@ SWIG_JavaArithmeticException
Definition: sat_java_wrap.cc:190
Swig::Director
Definition: constraint_solver_csharp_wrap.cc:349
SWIG_JavaOutOfMemoryError
@ SWIG_JavaOutOfMemoryError
Definition: sat_java_wrap.cc:186
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBranches
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBranches(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:902
operations_research::sat::IntegerVariableProto
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1change_1ownership
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release)
Definition: sat_java_wrap.cc:1087
Swig::BoolArray::BoolArray
BoolArray()
Definition: sat_java_wrap.cc:520
Swig::BoolArray::operator[]
bool & operator[](size_t n)
Definition: sat_java_wrap.cc:523
Swig::Director::swig_disconnect_director_self
void swig_disconnect_director_self(const char *disconn_method)
Definition: sat_java_wrap.cc:471
basictypes.h
operations_research::sat::CpSolverResponse
Java_com_google_ortools_sat_mainJNI_SatHelper_1validateModel
SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1validateModel(JNIEnv *jenv, jclass jcls, jbyteArray jarg1)
Definition: sat_java_wrap.cc:1277
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1onSolutionCallback
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1onSolutionCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:876
SwigDirector_SolutionCallback::~SwigDirector_SolutionCallback
virtual ~SwigDirector_SolutionCallback()
Definition: sat_csharp_wrap.cc:410
SwigDirector_SolutionCallback::swig_override
Swig::BoolArray< 1 > swig_override
Definition: sat_java_wrap.h:26
Swig::DirectorException::~DirectorException
~DirectorException()
Definition: sat_java_wrap.cc:635
Swig::JavaExceptionMessage
Definition: constraint_solver_java_wrap.cc:578
Swig::DirectorException::throwException
void throwException(JNIEnv *jenv) const
Definition: sat_java_wrap.cc:646
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionIntegerValue
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1solutionIntegerValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
Definition: sat_java_wrap.cc:1022
sorted_interval_list.h
SWIG_JavaThrowException
static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg)
Definition: sat_java_wrap.cc:204
JNIUtil::MakeJByteArray
static jbyteArray MakeJByteArray(JNIEnv *env, const char *a, int size)
Definition: jniutil.h:59
operations_research::sat::CpModelProto
SWIG_JavaIOException
@ SWIG_JavaIOException
Definition: sat_java_wrap.cc:187
Swig::DirectorException::DirectorException
DirectorException(const char *msg)
Definition: sat_java_wrap.cc:632
Swig::Director::swig_self_
JObjectWrapper swig_self_
Definition: constraint_solver_java_wrap.cc:485
SWIGEXPORT
#define SWIGEXPORT
Definition: sat_java_wrap.cc:128
Swig::JObjectWrapper::peek
jobject peek()
Definition: sat_java_wrap.cc:362
Swig::JObjectWrapper::~JObjectWrapper
~JObjectWrapper()
Definition: sat_java_wrap.cc:311
Swig::Director::swig_java_change_ownership
void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release)
Definition: sat_java_wrap.cc:511
operations_research::sat::SatParameters
uint8
unsigned char uint8
Definition: integral_types.h:36
operations_research::sat::Solve
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
Definition: cp_model_solver.cc:3161
Java_com_google_ortools_sat_mainJNI_SatHelper_1solverResponseStats
SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1solverResponseStats(JNIEnv *jenv, jclass jcls, jbyteArray jarg1)
Definition: sat_java_wrap.cc:1251
Swig::JObjectWrapper::java_change_ownership
void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release)
Definition: sat_java_wrap.cc:368
SWIG_JavaExceptions_t
Definition: knapsack_solver_java_wrap.cc:197
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1stopSearch
SWIGEXPORT void JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1stopSearch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:1056
Swig::ExceptionMatches
SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname)
Definition: constraint_solver_java_wrap.cc:733
Swig::DirectorException::what
const char * what() const
Definition: sat_java_wrap.cc:640
Java_com_google_ortools_sat_mainJNI_SatHelper_1modelStats
SWIGEXPORT jstring JNICALL Java_com_google_ortools_sat_mainJNI_SatHelper_1modelStats(JNIEnv *jenv, jclass jcls, jbyteArray jarg1)
Definition: sat_java_wrap.cc:1225
SWIG_JavaExceptionCodes
SWIG_JavaExceptionCodes
Definition: sat_java_wrap.cc:185
sat_java_wrap.h
Swig::DirectorException::raiseJavaException
void raiseJavaException(JNIEnv *jenv) const
Definition: sat_java_wrap.cc:679
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numIntegerPropagations
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numIntegerPropagations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:947
Swig::DirectorException::DirectorException
DirectorException(JNIEnv *jenv, jthrowable throwable)
Definition: sat_java_wrap.cc:603
Swig::Director::swig_set_self
bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global)
Definition: sat_java_wrap.cc:502
Swig::Director::JNIEnvWrapper::~JNIEnvWrapper
~JNIEnvWrapper()
Definition: sat_java_wrap.cc:454
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBooleans
SWIGEXPORT jlong JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1numBooleans(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:887
operations_research::sat::SolveWithParameters
CpSolverResponse SolveWithParameters(const CpModelProto &model_proto, const SatParameters &params)
Solves the given CpModelProto with the given parameters.
Definition: cp_model_solver.cc:3166
Swig::Director::~Director
virtual ~Director()
Definition: sat_java_wrap.cc:496
name
const std::string name
Definition: default_search.cc:807
Java_com_google_ortools_sat_mainJNI_SolutionCallback_1bestObjectiveBound
SWIGEXPORT jdouble JNICALL Java_com_google_ortools_sat_mainJNI_SolutionCallback_1bestObjectiveBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
Definition: sat_java_wrap.cc:1007
SWIGUNUSED
#define SWIGUNUSED
Definition: sat_java_wrap.cc:80
Swig::JObjectWrapper::set
bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global)
Definition: sat_java_wrap.cc:316
SWIG_JavaIndexOutOfBoundsException
@ SWIG_JavaIndexOutOfBoundsException
Definition: sat_java_wrap.cc:189