Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntTupleSet.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.1
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.constraintsolver;
10
11public class IntTupleSet {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
14
15 protected IntTupleSet(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
17 swigCPtr = cPtr;
18 }
19
20 protected static long getCPtr(IntTupleSet obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
22 }
23
24 protected static long swigRelease(IntTupleSet obj) {
25 long ptr = 0;
26 if (obj != null) {
27 if (!obj.swigCMemOwn)
28 throw new RuntimeException("Cannot release ownership as memory is not owned");
29 ptr = obj.swigCPtr;
30 obj.swigCMemOwn = false;
31 obj.delete();
32 }
33 return ptr;
34 }
35
36 @SuppressWarnings({"deprecation", "removal"})
37 protected void finalize() {
38 delete();
39 }
40
41 public synchronized void delete() {
42 if (swigCPtr != 0) {
43 if (swigCMemOwn) {
44 swigCMemOwn = false;
45 mainJNI.delete_IntTupleSet(swigCPtr);
46 }
47 swigCPtr = 0;
48 }
49 }
50
51 public IntTupleSet(int arity) {
52 this(mainJNI.new_IntTupleSet__SWIG_0(arity), true);
53 }
54
56 this(mainJNI.new_IntTupleSet__SWIG_1(IntTupleSet.getCPtr(set), set), true);
57 }
58
59 public void clear() {
60 mainJNI.IntTupleSet_clear(swigCPtr, this);
61 }
62
63 public int insert(int[] tuple) {
64 return mainJNI.IntTupleSet_insert__SWIG_0(swigCPtr, this, tuple);
65 }
66
67 public int insert(long[] tuple) {
68 return mainJNI.IntTupleSet_insert__SWIG_1(swigCPtr, this, tuple);
69 }
70
71 public int insert2(long v0, long v1) {
72 return mainJNI.IntTupleSet_insert2(swigCPtr, this, v0, v1);
73 }
74
75 public int insert3(long v0, long v1, long v2) {
76 return mainJNI.IntTupleSet_insert3(swigCPtr, this, v0, v1, v2);
77 }
78
79 public int insert4(long v0, long v1, long v2, long v3) {
80 return mainJNI.IntTupleSet_insert4(swigCPtr, this, v0, v1, v2, v3);
81 }
82
83 public void insertAll(long[][] tuples) {
84 mainJNI.IntTupleSet_insertAll__SWIG_0(swigCPtr, this, tuples);
85 }
86
87 public void insertAll(int[][] tuples) {
88 mainJNI.IntTupleSet_insertAll__SWIG_1(swigCPtr, this, tuples);
89 }
90
91 public boolean contains(int[] tuple) {
92 return mainJNI.IntTupleSet_contains__SWIG_0(swigCPtr, this, tuple);
93 }
94
95 public boolean contains(long[] tuple) {
96 return mainJNI.IntTupleSet_contains__SWIG_1(swigCPtr, this, tuple);
97 }
98
99 public int numTuples() {
100 return mainJNI.IntTupleSet_numTuples(swigCPtr, this);
101 }
102
103 public long value(int tuple_index, int pos_in_tuple) {
104 return mainJNI.IntTupleSet_value(swigCPtr, this, tuple_index, pos_in_tuple);
105 }
106
107 public int arity() {
108 return mainJNI.IntTupleSet_arity(swigCPtr, this);
109 }
110
111 public int numDifferentValuesInColumn(int col) {
112 return mainJNI.IntTupleSet_numDifferentValuesInColumn(swigCPtr, this, col);
113 }
114
115 public IntTupleSet sortedByColumn(int col) {
116 return new IntTupleSet(mainJNI.IntTupleSet_sortedByColumn(swigCPtr, this, col), true);
117 }
118
120 return new IntTupleSet(mainJNI.IntTupleSet_sortedLexicographically(swigCPtr, this), true);
121 }
122
123}
long value(int tuple_index, int pos_in_tuple)
int insert4(long v0, long v1, long v2, long v3)
IntTupleSet(long cPtr, boolean cMemoryOwn)