20 template<
typename T>
class SwigValueWrapper {
21 struct SwigMovePointer {
23 SwigMovePointer(T *p) : ptr(p) { }
24 ~SwigMovePointer() {
delete ptr; }
25 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0;
delete oldptr; ptr = rhs.ptr; rhs.ptr = 0;
return *
this; }
27 SwigValueWrapper& operator=(
const SwigValueWrapper<T>& rhs);
28 SwigValueWrapper(
const SwigValueWrapper<T>& rhs);
30 SwigValueWrapper() : pointer(0) { }
31 SwigValueWrapper& operator=(
const T& t) { SwigMovePointer tmp(
new T(t)); pointer = tmp;
return *
this; }
32 operator T&()
const {
return *pointer.ptr; }
33 T *operator&() {
return pointer.ptr; }
36 template <
typename T> T SwigValueInit() {
47 #ifndef SWIGTEMPLATEDISAMBIGUATOR
48 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
49 # define SWIGTEMPLATEDISAMBIGUATOR template
50 # elif defined(__HP_aCC)
53 # define SWIGTEMPLATEDISAMBIGUATOR template
55 # define SWIGTEMPLATEDISAMBIGUATOR
61 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
62 # define SWIGINLINE inline
70 # if defined(__GNUC__)
71 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
72 # define SWIGUNUSED __attribute__ ((__unused__))
77 # define SWIGUNUSED __attribute__ ((__unused__))
83 #ifndef SWIG_MSC_UNSUPPRESS_4505
84 # if defined(_MSC_VER)
85 # pragma warning(disable : 4505)
89 #ifndef SWIGUNUSEDPARM
91 # define SWIGUNUSEDPARM(p)
93 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
99 # define SWIGINTERN static SWIGUNUSED
103 #ifndef SWIGINTERNINLINE
104 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
108 #if defined(__GNUC__)
109 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
110 # ifndef GCC_HASCLASSVISIBILITY
111 # define GCC_HASCLASSVISIBILITY
117 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
118 # if defined(STATIC_LINKED)
121 # define SWIGEXPORT __declspec(dllexport)
124 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
125 # define SWIGEXPORT __attribute__ ((visibility("default")))
134 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
135 # define SWIGSTDCALL __stdcall
142 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
143 # define _CRT_SECURE_NO_DEPRECATE
147 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
148 # define _SCL_SECURE_NO_DEPRECATE
152 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
153 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
161 #ifdef __INTEL_COMPILER
162 # pragma warning disable 592
167 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
168 typedef long long __int64;
172 #if defined(__x86_64)
199 const char *java_exception;
220 while (except_ptr->
code != code && except_ptr->
code)
223 jenv->ExceptionClear();
226 jenv->ThrowNew(excep, msg);
232 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
245 #define SWIGWORDSIZE64
249 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
250 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
289 arg1 = (int64_t)jarg1;
304 arg1 = (int64_t)jarg1;
305 arg2 = (int64_t)jarg2;
326 std::vector< int64_t > arg1 ;
333 const int size = jenv->GetArrayLength(jarg1);
335 (&arg1)->reserve(size);
336 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
337 for (
int i = 0; i < size; ++i) {
338 (&arg1)->emplace_back(values[i]);
340 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
355 std::vector< std::vector< int64_t > > *arg1 = 0 ;
356 std::vector< std::vector< int64_t > > result1 ;
363 const int size = jenv->GetArrayLength(jarg1);
365 result1.resize(size);
366 for (
int index1 = 0; index1 < size; ++index1) {
367 jlongArray inner_array =
368 (jlongArray)jenv->GetObjectArrayElement(jarg1, index1);
369 const int inner_size = jenv->GetArrayLength(inner_array);
370 result1[index1].reserve(inner_size);
371 jlong *
const values =
372 jenv->GetLongArrayElements((jlongArray)inner_array, NULL);
373 for (
int index2 = 0; index2 < inner_size; ++index2) {
374 result1[index1].emplace_back(values[index2]);
376 jenv->ReleaseLongArrayElements((jlongArray)inner_array, values, JNI_ABORT);
377 jenv->DeleteLocalRef(inner_array);
394 std::vector< int64_t > *arg1 = 0 ;
401 arg1 =
new std::vector<int64_t>;
402 const int size = jenv->GetArrayLength(jarg1);
404 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
405 for (
int i = 0; i < size; ++i) {
406 arg1->emplace_back(values[i]);
408 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
425 jlongArray jresult = 0 ;
427 std::vector< int64_t > result;
435 const std::vector<int64_t>& vec = result;
436 jresult = jenv->NewLongArray(vec.size());
437 jenv->SetLongArrayRegion(jresult, 0, vec.size(),
reinterpret_cast<const jlong*
>(vec.data()));
444 jboolean jresult = 0 ;
453 jresult = (jboolean)result;
468 jresult = (jlong)result;
483 jresult = (jlong)result;
498 jresult = (jlong)result;
504 jboolean jresult = 0 ;
513 arg2 = (int64_t)jarg2;
515 jresult = (jboolean)result;
617 jstring jresult = 0 ;
626 jresult = jenv->NewStringUTF((&result)->c_str());
655 std::vector< int64_t > *arg1 = 0 ;
656 std::vector< int64_t > *arg2 = 0 ;
663 arg1 =
new std::vector<int64_t>;
664 const int size = jenv->GetArrayLength(jarg1);
666 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
667 for (
int i = 0; i < size; ++i) {
668 arg1->emplace_back(values[i]);
670 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
679 arg2 =
new std::vector<int64_t>;
680 const int size = jenv->GetArrayLength(jarg2);
682 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg2, NULL);
683 for (
int i = 0; i < size; ++i) {
684 arg2->emplace_back(values[i]);
686 jenv->ReleaseLongArrayElements((jlongArray)jarg2, values, JNI_ABORT);
707 std::vector< int > *arg1 = 0 ;
708 std::vector< int > *arg2 = 0 ;
715 arg1 =
new std::vector<int>;
716 const int size = jenv->GetArrayLength(jarg1);
718 jint *values = jenv->GetIntArrayElements((jintArray)jarg1, NULL);
719 for (
int i = 0; i < size; ++i) {
720 arg1->emplace_back(values[i]);
722 jenv->ReleaseIntArrayElements((jintArray)jarg1, values, JNI_ABORT);
731 arg2 =
new std::vector<int>;
732 const int size = jenv->GetArrayLength(jarg2);
734 jint *values = jenv->GetIntArrayElements((jintArray)jarg2, NULL);
735 for (
int i = 0; i < size; ++i) {
736 arg2->emplace_back(values[i]);
738 jenv->ReleaseIntArrayElements((jintArray)jarg2, values, JNI_ABORT);
768 arg2 = (int64_t)jarg2;
769 arg3 = (int64_t)jarg3;
770 result = (arg1)->BuildComplementOnInterval(arg2,arg3);
781 SwigValueWrapper< std::set< operations_research::ClosedInterval,operations_research::SortedDisjointIntervalList::IntervalComparator >::iterator > result;
787 arg2 = (int64_t)jarg2;
788 arg3 = (int64_t)jarg3;
789 result = (arg1)->InsertInterval(arg2,arg3);
797 std::vector< int64_t > *arg2 = 0 ;
798 std::vector< int64_t > *arg3 = 0 ;
806 arg2 =
new std::vector<int64_t>;
807 const int size = jenv->GetArrayLength(jarg2);
809 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg2, NULL);
810 for (
int i = 0; i < size; ++i) {
811 arg2->emplace_back(values[i]);
813 jenv->ReleaseLongArrayElements((jlongArray)jarg2, values, JNI_ABORT);
822 arg3 =
new std::vector<int64_t>;
823 const int size = jenv->GetArrayLength(jarg3);
825 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg3, NULL);
826 for (
int i = 0; i < size; ++i) {
827 arg3->emplace_back(values[i]);
829 jenv->ReleaseLongArrayElements((jlongArray)jarg3, values, JNI_ABORT);
836 (arg1)->InsertIntervals((std::vector< int64_t >
const &)*arg2,(std::vector< int64_t >
const &)*arg3);
848 std::vector< int > *arg2 = 0 ;
849 std::vector< int > *arg3 = 0 ;
857 arg2 =
new std::vector<int>;
858 const int size = jenv->GetArrayLength(jarg2);
860 jint *values = jenv->GetIntArrayElements((jintArray)jarg2, NULL);
861 for (
int i = 0; i < size; ++i) {
862 arg2->emplace_back(values[i]);
864 jenv->ReleaseIntArrayElements((jintArray)jarg2, values, JNI_ABORT);
873 arg3 =
new std::vector<int>;
874 const int size = jenv->GetArrayLength(jarg3);
876 jint *values = jenv->GetIntArrayElements((jintArray)jarg3, NULL);
877 for (
int i = 0; i < size; ++i) {
878 arg3->emplace_back(values[i]);
880 jenv->ReleaseIntArrayElements((jintArray)jarg3, values, JNI_ABORT);
887 (arg1)->InsertIntervals((std::vector< int >
const &)*arg2,(std::vector< int >
const &)*arg3);
907 jresult = (jint)result;
913 jstring jresult = 0 ;
922 jresult = jenv->NewStringUTF((&result)->c_str());
We call domain any subset of Int64 = [kint64min, kint64max].
static Domain AllValues()
Returns the full domain Int64.
std::string ToString() const
Returns a compact string of a vector of intervals like "[1,4][6][10,20]".
Domain Negation() const
Returns {x ∈ Int64, ∃ e ∈ D, x = -e}.
Domain Complement() const
Returns the set Int64 ∖ D.
Domain AdditionWith(const Domain &domain) const
Returns {x ∈ Int64, ∃ a ∈ D, ∃ b ∈ domain, x = a + b}.
Domain UnionWith(const Domain &domain) const
Returns the union of D and domain.
static Domain FromFlatIntervals(const std::vector< int64_t > &flat_intervals)
This method is available in Python, Java and .NET.
std::vector< int64_t > FlattenedIntervals() const
This method returns the flattened list of interval bounds of the domain.
Domain IntersectionWith(const Domain &domain) const
Returns the intersection of D and domain.
static Domain FromVectorIntervals(const std::vector< std::vector< int64_t > > &intervals)
This method is available in Python, Java and .NET.
static Domain FromValues(std::vector< int64_t > values)
Creates a domain from the union of an unsorted list of integer values.
This class represents a sorted list of disjoint, closed intervals.
std::string DebugString() const
IntervalSet::iterator Iterator
const char * java_exception
SWIG_JavaExceptionCodes code
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1SortedDisjointIntervalList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlongArray jarg1, jlongArray jarg2)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1SortedDisjointIntervalList_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jintArray jarg1, jintArray jarg2)
SWIGEXPORT jlongArray JNICALL Java_com_google_ortools_util_mainJNI_Domain_1flattenedIntervals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1insertInterval(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3)
SWIGEXPORT void JNICALL Java_com_google_ortools_util_mainJNI_delete_1SortedDisjointIntervalList(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1negation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1fromValues(JNIEnv *jenv, jclass jcls, jlongArray jarg1)
SWIGEXPORT jstring JNICALL Java_com_google_ortools_util_mainJNI_Domain_1toString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1unionWith(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1min(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1numIntervals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1fromIntervals(JNIEnv *jenv, jclass jcls, jobjectArray jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1fromFlatIntervals(JNIEnv *jenv, jclass jcls, jlongArray jarg1)
SWIGEXPORT void JNICALL Java_com_google_ortools_util_mainJNI_delete_1Domain(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1intersectionWith(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1additionWith(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_)
SWIGEXPORT void JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1insertIntervals_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlongArray jarg2, jlongArray jarg3)
SWIGEXPORT jboolean JNICALL Java_com_google_ortools_util_mainJNI_Domain_1contains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2)
static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg)
@ SWIG_JavaArithmeticException
@ SWIG_JavaRuntimeException
@ SWIG_JavaNullPointerException
@ SWIG_JavaDirectorPureVirtual
@ SWIG_JavaOutOfMemoryError
@ SWIG_JavaIllegalStateException
@ SWIG_JavaIllegalArgumentException
@ SWIG_JavaIndexOutOfBoundsException
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1SortedDisjointIntervalList_1_1SWIG_10(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1complement(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1Domain_1_1SWIG_10(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1Domain_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jstring JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1toString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1max(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_Domain_1allValues(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jboolean JNICALL Java_com_google_ortools_util_mainJNI_Domain_1isEmpty(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT void JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1insertIntervals_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jintArray jarg2, jintArray jarg3)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_SortedDisjointIntervalList_1buildComplementOnInterval(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_util_mainJNI_new_1Domain_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2)