20template<
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; }
36template <
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
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
85# pragma warning(disable : 4505)
91# define SWIGUNUSEDPARM(p)
93# define SWIGUNUSEDPARM(p) p SWIGUNUSED
99# define SWIGINTERN static SWIGUNUSED
103#ifndef SWIGINTERNINLINE
104# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
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;
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
280 arg1 = (int64_t)jarg1;
295 arg1 = (int64_t)jarg1;
296 arg2 = (int64_t)jarg2;
317 std::vector< int64_t > arg1 ;
324 const int size = jenv->GetArrayLength(jarg1);
326 (&arg1)->reserve(size);
327 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
328 for (
int i = 0; i < size; ++i) {
329 (&arg1)->emplace_back(values[i]);
331 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
346 std::vector< std::vector< int64_t > > *arg1 = 0 ;
347 std::vector< std::vector< int64_t > > result1 ;
354 const int size = jenv->GetArrayLength(jarg1);
356 result1.resize(size);
357 for (
int index1 = 0; index1 < size; ++index1) {
358 jlongArray inner_array =
359 (jlongArray)jenv->GetObjectArrayElement(jarg1, index1);
360 const int inner_size = jenv->GetArrayLength(inner_array);
361 result1[index1].reserve(inner_size);
362 jlong *
const values =
363 jenv->GetLongArrayElements((jlongArray)inner_array, NULL);
364 for (
int index2 = 0; index2 < inner_size; ++index2) {
365 result1[index1].emplace_back(values[index2]);
367 jenv->ReleaseLongArrayElements((jlongArray)inner_array, values, JNI_ABORT);
368 jenv->DeleteLocalRef(inner_array);
385 std::vector< int64_t > *arg1 = 0 ;
392 arg1 =
new std::vector<int64_t>;
393 const int size = jenv->GetArrayLength(jarg1);
395 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
396 for (
int i = 0; i < size; ++i) {
397 arg1->emplace_back(values[i]);
399 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
416 jlongArray jresult = 0 ;
418 std::vector< int64_t > result;
426 const std::vector<int64_t>& vec = result;
427 jresult = jenv->NewLongArray(vec.size());
428 jenv->SetLongArrayRegion(jresult, 0, vec.size(),
reinterpret_cast<const jlong*
>(vec.data()));
435 jboolean jresult = 0 ;
444 jresult = (jboolean)result;
459 jresult = (jlong)result;
474 jresult = (jlong)result;
489 jresult = (jlong)result;
495 jboolean jresult = 0 ;
504 arg2 = (int64_t)jarg2;
506 jresult = (jboolean)result;
608 jstring jresult = 0 ;
617 jresult = jenv->NewStringUTF((&result)->c_str());
646 std::vector< int64_t > *arg1 = 0 ;
647 std::vector< int64_t > *arg2 = 0 ;
654 arg1 =
new std::vector<int64_t>;
655 const int size = jenv->GetArrayLength(jarg1);
657 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg1, NULL);
658 for (
int i = 0; i < size; ++i) {
659 arg1->emplace_back(values[i]);
661 jenv->ReleaseLongArrayElements((jlongArray)jarg1, values, JNI_ABORT);
670 arg2 =
new std::vector<int64_t>;
671 const int size = jenv->GetArrayLength(jarg2);
673 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg2, NULL);
674 for (
int i = 0; i < size; ++i) {
675 arg2->emplace_back(values[i]);
677 jenv->ReleaseLongArrayElements((jlongArray)jarg2, values, JNI_ABORT);
698 std::vector< int > *arg1 = 0 ;
699 std::vector< int > *arg2 = 0 ;
706 arg1 =
new std::vector<int>;
707 const int size = jenv->GetArrayLength(jarg1);
709 jint *values = jenv->GetIntArrayElements((jintArray)jarg1, NULL);
710 for (
int i = 0; i < size; ++i) {
711 arg1->emplace_back(values[i]);
713 jenv->ReleaseIntArrayElements((jintArray)jarg1, values, JNI_ABORT);
722 arg2 =
new std::vector<int>;
723 const int size = jenv->GetArrayLength(jarg2);
725 jint *values = jenv->GetIntArrayElements((jintArray)jarg2, NULL);
726 for (
int i = 0; i < size; ++i) {
727 arg2->emplace_back(values[i]);
729 jenv->ReleaseIntArrayElements((jintArray)jarg2, values, JNI_ABORT);
759 arg2 = (int64_t)jarg2;
760 arg3 = (int64_t)jarg3;
761 result = (arg1)->BuildComplementOnInterval(arg2,arg3);
772 SwigValueWrapper< std::set< operations_research::ClosedInterval,operations_research::SortedDisjointIntervalList::IntervalComparator >::iterator > result;
778 arg2 = (int64_t)jarg2;
779 arg3 = (int64_t)jarg3;
780 result = (arg1)->InsertInterval(arg2,arg3);
788 std::vector< int64_t > *arg2 = 0 ;
789 std::vector< int64_t > *arg3 = 0 ;
797 arg2 =
new std::vector<int64_t>;
798 const int size = jenv->GetArrayLength(jarg2);
800 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg2, NULL);
801 for (
int i = 0; i < size; ++i) {
802 arg2->emplace_back(values[i]);
804 jenv->ReleaseLongArrayElements((jlongArray)jarg2, values, JNI_ABORT);
813 arg3 =
new std::vector<int64_t>;
814 const int size = jenv->GetArrayLength(jarg3);
816 jlong *values = jenv->GetLongArrayElements((jlongArray)jarg3, NULL);
817 for (
int i = 0; i < size; ++i) {
818 arg3->emplace_back(values[i]);
820 jenv->ReleaseLongArrayElements((jlongArray)jarg3, values, JNI_ABORT);
827 (arg1)->InsertIntervals((std::vector< int64_t >
const &)*arg2,(std::vector< int64_t >
const &)*arg3);
839 std::vector< int > *arg2 = 0 ;
840 std::vector< int > *arg3 = 0 ;
848 arg2 =
new std::vector<int>;
849 const int size = jenv->GetArrayLength(jarg2);
851 jint *values = jenv->GetIntArrayElements((jintArray)jarg2, NULL);
852 for (
int i = 0; i < size; ++i) {
853 arg2->emplace_back(values[i]);
855 jenv->ReleaseIntArrayElements((jintArray)jarg2, values, JNI_ABORT);
864 arg3 =
new std::vector<int>;
865 const int size = jenv->GetArrayLength(jarg3);
867 jint *values = jenv->GetIntArrayElements((jintArray)jarg3, NULL);
868 for (
int i = 0; i < size; ++i) {
869 arg3->emplace_back(values[i]);
871 jenv->ReleaseIntArrayElements((jintArray)jarg3, values, JNI_ABORT);
878 (arg1)->InsertIntervals((std::vector< int >
const &)*arg2,(std::vector< int >
const &)*arg3);
898 jresult = (jint)result;
904 jstring jresult = 0 ;
913 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)