Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ModelCache.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
17public class ModelCache {
18 private transient long swigCPtr;
19 protected transient boolean swigCMemOwn;
20
21 protected ModelCache(long cPtr, boolean cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = cPtr;
24 }
25
26 protected static long getCPtr(ModelCache obj) {
27 return (obj == null) ? 0 : obj.swigCPtr;
28 }
29
30 protected static long swigRelease(ModelCache obj) {
31 long ptr = 0;
32 if (obj != null) {
33 if (!obj.swigCMemOwn)
34 throw new RuntimeException("Cannot release ownership as memory is not owned");
35 ptr = obj.swigCPtr;
36 obj.swigCMemOwn = false;
37 obj.delete();
38 }
39 return ptr;
40 }
41
42 @SuppressWarnings({"deprecation", "removal"})
43 protected void finalize() {
44 delete();
45 }
46
47 public synchronized void delete() {
48 if (swigCPtr != 0) {
49 if (swigCMemOwn) {
50 swigCMemOwn = false;
51 mainJNI.delete_ModelCache(swigCPtr);
52 }
53 swigCPtr = 0;
54 }
55 }
56
57 public void clear() {
58 mainJNI.ModelCache_clear(swigCPtr, this);
59 }
60
64 public Constraint findVoidConstraint(int type) {
65 long cPtr = mainJNI.ModelCache_findVoidConstraint(swigCPtr, this, type);
66 return (cPtr == 0) ? null : new Constraint(cPtr, false);
67 }
68
69 public void insertVoidConstraint(Constraint ct, int type) {
70 mainJNI.ModelCache_insertVoidConstraint(swigCPtr, this, Constraint.getCPtr(ct), ct, type);
71 }
72
76 public Constraint findVarConstantConstraint(IntVar var, long value, int type) {
77 long cPtr = mainJNI.ModelCache_findVarConstantConstraint(swigCPtr, this, IntVar.getCPtr(var), var, value, type);
78 return (cPtr == 0) ? null : new Constraint(cPtr, false);
79 }
80
81 public void insertVarConstantConstraint(Constraint ct, IntVar var, long value, int type) {
82 mainJNI.ModelCache_insertVarConstantConstraint(swigCPtr, this, Constraint.getCPtr(ct), ct, IntVar.getCPtr(var), var, value, type);
83 }
84
88 public Constraint findVarConstantConstantConstraint(IntVar var, long value1, long value2, int type) {
89 long cPtr = mainJNI.ModelCache_findVarConstantConstantConstraint(swigCPtr, this, IntVar.getCPtr(var), var, value1, value2, type);
90 return (cPtr == 0) ? null : new Constraint(cPtr, false);
91 }
92
93 public void insertVarConstantConstantConstraint(Constraint ct, IntVar var, long value1, long value2, int type) {
94 mainJNI.ModelCache_insertVarConstantConstantConstraint(swigCPtr, this, Constraint.getCPtr(ct), ct, IntVar.getCPtr(var), var, value1, value2, type);
95 }
96
100 public Constraint findExprExprConstraint(IntExpr expr1, IntExpr expr2, int type) {
101 long cPtr = mainJNI.ModelCache_findExprExprConstraint(swigCPtr, this, IntExpr.getCPtr(expr1), expr1, IntExpr.getCPtr(expr2), expr2, type);
102 return (cPtr == 0) ? null : new Constraint(cPtr, false);
103 }
104
105 public void insertExprExprConstraint(Constraint ct, IntExpr expr1, IntExpr expr2, int type) {
106 mainJNI.ModelCache_insertExprExprConstraint(swigCPtr, this, Constraint.getCPtr(ct), ct, IntExpr.getCPtr(expr1), expr1, IntExpr.getCPtr(expr2), expr2, type);
107 }
108
112 public IntExpr findExprExpression(IntExpr expr, int type) {
113 long cPtr = mainJNI.ModelCache_findExprExpression(swigCPtr, this, IntExpr.getCPtr(expr), expr, type);
114 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
115 }
116
117 public void insertExprExpression(IntExpr expression, IntExpr expr, int type) {
118 mainJNI.ModelCache_insertExprExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntExpr.getCPtr(expr), expr, type);
119 }
120
124 public IntExpr findExprConstantExpression(IntExpr expr, long value, int type) {
125 long cPtr = mainJNI.ModelCache_findExprConstantExpression(swigCPtr, this, IntExpr.getCPtr(expr), expr, value, type);
126 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
127 }
128
129 public void insertExprConstantExpression(IntExpr expression, IntExpr var, long value, int type) {
130 mainJNI.ModelCache_insertExprConstantExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntExpr.getCPtr(var), var, value, type);
131 }
132
136 public IntExpr findExprExprExpression(IntExpr var1, IntExpr var2, int type) {
137 long cPtr = mainJNI.ModelCache_findExprExprExpression(swigCPtr, this, IntExpr.getCPtr(var1), var1, IntExpr.getCPtr(var2), var2, type);
138 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
139 }
140
141 public void insertExprExprExpression(IntExpr expression, IntExpr var1, IntExpr var2, int type) {
142 mainJNI.ModelCache_insertExprExprExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntExpr.getCPtr(var1), var1, IntExpr.getCPtr(var2), var2, type);
143 }
144
148 public IntExpr findExprExprConstantExpression(IntExpr var1, IntExpr var2, long constant, int type) {
149 long cPtr = mainJNI.ModelCache_findExprExprConstantExpression(swigCPtr, this, IntExpr.getCPtr(var1), var1, IntExpr.getCPtr(var2), var2, constant, type);
150 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
151 }
152
153 public void insertExprExprConstantExpression(IntExpr expression, IntExpr var1, IntExpr var2, long constant, int type) {
154 mainJNI.ModelCache_insertExprExprConstantExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntExpr.getCPtr(var1), var1, IntExpr.getCPtr(var2), var2, constant, type);
155 }
156
160 public IntExpr findVarConstantConstantExpression(IntVar var, long value1, long value2, int type) {
161 long cPtr = mainJNI.ModelCache_findVarConstantConstantExpression(swigCPtr, this, IntVar.getCPtr(var), var, value1, value2, type);
162 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
163 }
164
165 public void insertVarConstantConstantExpression(IntExpr expression, IntVar var, long value1, long value2, int type) {
166 mainJNI.ModelCache_insertVarConstantConstantExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntVar.getCPtr(var), var, value1, value2, type);
167 }
168
172 public IntExpr findVarConstantArrayExpression(IntVar var, long[] values, int type) {
173 long cPtr = mainJNI.ModelCache_findVarConstantArrayExpression(swigCPtr, this, IntVar.getCPtr(var), var, values, type);
174 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
175 }
176
177 public void insertVarConstantArrayExpression(IntExpr expression, IntVar var, long[] values, int type) {
178 mainJNI.ModelCache_insertVarConstantArrayExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, IntVar.getCPtr(var), var, values, type);
179 }
180
184 public IntExpr findVarArrayExpression(IntVar[] vars, int type) {
185 long cPtr = mainJNI.ModelCache_findVarArrayExpression(swigCPtr, this, vars, type);
186 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
187 }
188
189 public void insertVarArrayExpression(IntExpr expression, IntVar[] vars, int type) {
190 mainJNI.ModelCache_insertVarArrayExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, vars, type);
191 }
192
196 public IntExpr findVarArrayConstantArrayExpression(IntVar[] vars, long[] values, int type) {
197 long cPtr = mainJNI.ModelCache_findVarArrayConstantArrayExpression(swigCPtr, this, vars, values, type);
198 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
199 }
200
201 public void insertVarArrayConstantArrayExpression(IntExpr expression, IntVar[] var, long[] values, int type) {
202 mainJNI.ModelCache_insertVarArrayConstantArrayExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, var, values, type);
203 }
204
208 public IntExpr findVarArrayConstantExpression(IntVar[] vars, long value, int type) {
209 long cPtr = mainJNI.ModelCache_findVarArrayConstantExpression(swigCPtr, this, vars, value, type);
210 return (cPtr == 0) ? null : new IntExpr(cPtr, false);
211 }
212
213 public void insertVarArrayConstantExpression(IntExpr expression, IntVar[] var, long value, int type) {
214 mainJNI.ModelCache_insertVarArrayConstantExpression(swigCPtr, this, IntExpr.getCPtr(expression), expression, var, value, type);
215 }
216
217 public Solver solver() {
218 long cPtr = mainJNI.ModelCache_solver(swigCPtr, this);
219 return (cPtr == 0) ? null : new Solver(cPtr, false);
220 }
221
222 // VoidConstraintType
223 public final static int VOID_FALSE_CONSTRAINT = mainJNI.ModelCache_VOID_FALSE_CONSTRAINT_get();
224 public final static int VOID_TRUE_CONSTRAINT = mainJNI.ModelCache_VOID_TRUE_CONSTRAINT_get();
225 public final static int VOID_CONSTRAINT_MAX = mainJNI.ModelCache_VOID_CONSTRAINT_MAX_get();
226
227 // VarConstantConstraintType
228 public final static int VAR_CONSTANT_EQUALITY = mainJNI.ModelCache_VAR_CONSTANT_EQUALITY_get();
229 public final static int VAR_CONSTANT_GREATER_OR_EQUAL = mainJNI.ModelCache_VAR_CONSTANT_GREATER_OR_EQUAL_get();
230 public final static int VAR_CONSTANT_LESS_OR_EQUAL = mainJNI.ModelCache_VAR_CONSTANT_LESS_OR_EQUAL_get();
231 public final static int VAR_CONSTANT_NON_EQUALITY = mainJNI.ModelCache_VAR_CONSTANT_NON_EQUALITY_get();
232 public final static int VAR_CONSTANT_CONSTRAINT_MAX = mainJNI.ModelCache_VAR_CONSTANT_CONSTRAINT_MAX_get();
233
234 // VarConstantConstantConstraintType
235 public final static int VAR_CONSTANT_CONSTANT_BETWEEN = mainJNI.ModelCache_VAR_CONSTANT_CONSTANT_BETWEEN_get();
236 public final static int VAR_CONSTANT_CONSTANT_CONSTRAINT_MAX = mainJNI.ModelCache_VAR_CONSTANT_CONSTANT_CONSTRAINT_MAX_get();
237
238 // ExprExprConstraintType
239 public final static int EXPR_EXPR_EQUALITY = mainJNI.ModelCache_EXPR_EXPR_EQUALITY_get();
240 public final static int EXPR_EXPR_GREATER = mainJNI.ModelCache_EXPR_EXPR_GREATER_get();
241 public final static int EXPR_EXPR_GREATER_OR_EQUAL = mainJNI.ModelCache_EXPR_EXPR_GREATER_OR_EQUAL_get();
242 public final static int EXPR_EXPR_LESS = mainJNI.ModelCache_EXPR_EXPR_LESS_get();
243 public final static int EXPR_EXPR_LESS_OR_EQUAL = mainJNI.ModelCache_EXPR_EXPR_LESS_OR_EQUAL_get();
244 public final static int EXPR_EXPR_NON_EQUALITY = mainJNI.ModelCache_EXPR_EXPR_NON_EQUALITY_get();
245 public final static int EXPR_EXPR_CONSTRAINT_MAX = mainJNI.ModelCache_EXPR_EXPR_CONSTRAINT_MAX_get();
246
247 // ExprExpressionType
248 public final static int EXPR_OPPOSITE = mainJNI.ModelCache_EXPR_OPPOSITE_get();
249 public final static int EXPR_ABS = mainJNI.ModelCache_EXPR_ABS_get();
250 public final static int EXPR_SQUARE = mainJNI.ModelCache_EXPR_SQUARE_get();
251 public final static int EXPR_EXPRESSION_MAX = mainJNI.ModelCache_EXPR_EXPRESSION_MAX_get();
252
253 // ExprExprExpressionType
254 public final static int EXPR_EXPR_DIFFERENCE = mainJNI.ModelCache_EXPR_EXPR_DIFFERENCE_get();
255 public final static int EXPR_EXPR_PROD = mainJNI.ModelCache_EXPR_EXPR_PROD_get();
256 public final static int EXPR_EXPR_DIV = mainJNI.ModelCache_EXPR_EXPR_DIV_get();
257 public final static int EXPR_EXPR_MAX = mainJNI.ModelCache_EXPR_EXPR_MAX_get();
258 public final static int EXPR_EXPR_MIN = mainJNI.ModelCache_EXPR_EXPR_MIN_get();
259 public final static int EXPR_EXPR_SUM = mainJNI.ModelCache_EXPR_EXPR_SUM_get();
260 public final static int EXPR_EXPR_IS_LESS = mainJNI.ModelCache_EXPR_EXPR_IS_LESS_get();
261 public final static int EXPR_EXPR_IS_LESS_OR_EQUAL = mainJNI.ModelCache_EXPR_EXPR_IS_LESS_OR_EQUAL_get();
262 public final static int EXPR_EXPR_IS_EQUAL = mainJNI.ModelCache_EXPR_EXPR_IS_EQUAL_get();
263 public final static int EXPR_EXPR_IS_NOT_EQUAL = mainJNI.ModelCache_EXPR_EXPR_IS_NOT_EQUAL_get();
264 public final static int EXPR_EXPR_EXPRESSION_MAX = mainJNI.ModelCache_EXPR_EXPR_EXPRESSION_MAX_get();
265
266 // ExprExprConstantExpressionType
267 public final static int EXPR_EXPR_CONSTANT_CONDITIONAL = mainJNI.ModelCache_EXPR_EXPR_CONSTANT_CONDITIONAL_get();
268 public final static int EXPR_EXPR_CONSTANT_EXPRESSION_MAX = mainJNI.ModelCache_EXPR_EXPR_CONSTANT_EXPRESSION_MAX_get();
269
270 // ExprConstantExpressionType
271 public final static int EXPR_CONSTANT_DIFFERENCE = mainJNI.ModelCache_EXPR_CONSTANT_DIFFERENCE_get();
272 public final static int EXPR_CONSTANT_DIVIDE = mainJNI.ModelCache_EXPR_CONSTANT_DIVIDE_get();
273 public final static int EXPR_CONSTANT_PROD = mainJNI.ModelCache_EXPR_CONSTANT_PROD_get();
274 public final static int EXPR_CONSTANT_MAX = mainJNI.ModelCache_EXPR_CONSTANT_MAX_get();
275 public final static int EXPR_CONSTANT_MIN = mainJNI.ModelCache_EXPR_CONSTANT_MIN_get();
276 public final static int EXPR_CONSTANT_SUM = mainJNI.ModelCache_EXPR_CONSTANT_SUM_get();
277 public final static int EXPR_CONSTANT_IS_EQUAL = mainJNI.ModelCache_EXPR_CONSTANT_IS_EQUAL_get();
278 public final static int EXPR_CONSTANT_IS_NOT_EQUAL = mainJNI.ModelCache_EXPR_CONSTANT_IS_NOT_EQUAL_get();
279 public final static int EXPR_CONSTANT_IS_GREATER_OR_EQUAL = mainJNI.ModelCache_EXPR_CONSTANT_IS_GREATER_OR_EQUAL_get();
280 public final static int EXPR_CONSTANT_IS_LESS_OR_EQUAL = mainJNI.ModelCache_EXPR_CONSTANT_IS_LESS_OR_EQUAL_get();
281 public final static int EXPR_CONSTANT_EXPRESSION_MAX = mainJNI.ModelCache_EXPR_CONSTANT_EXPRESSION_MAX_get();
282
283 // VarConstantConstantExpressionType
284 public final static int VAR_CONSTANT_CONSTANT_SEMI_CONTINUOUS = mainJNI.ModelCache_VAR_CONSTANT_CONSTANT_SEMI_CONTINUOUS_get();
285 public final static int VAR_CONSTANT_CONSTANT_EXPRESSION_MAX = mainJNI.ModelCache_VAR_CONSTANT_CONSTANT_EXPRESSION_MAX_get();
286
287 // VarConstantArrayExpressionType
288 public final static int VAR_CONSTANT_ARRAY_ELEMENT = mainJNI.ModelCache_VAR_CONSTANT_ARRAY_ELEMENT_get();
289 public final static int VAR_CONSTANT_ARRAY_EXPRESSION_MAX = mainJNI.ModelCache_VAR_CONSTANT_ARRAY_EXPRESSION_MAX_get();
290
291 // VarArrayConstantArrayExpressionType
292 public final static int VAR_ARRAY_CONSTANT_ARRAY_SCAL_PROD = mainJNI.ModelCache_VAR_ARRAY_CONSTANT_ARRAY_SCAL_PROD_get();
293 public final static int VAR_ARRAY_CONSTANT_ARRAY_EXPRESSION_MAX = mainJNI.ModelCache_VAR_ARRAY_CONSTANT_ARRAY_EXPRESSION_MAX_get();
294
295 // VarArrayExpressionType
296 public final static int VAR_ARRAY_MAX = mainJNI.ModelCache_VAR_ARRAY_MAX_get();
297 public final static int VAR_ARRAY_MIN = mainJNI.ModelCache_VAR_ARRAY_MIN_get();
298 public final static int VAR_ARRAY_SUM = mainJNI.ModelCache_VAR_ARRAY_SUM_get();
299 public final static int VAR_ARRAY_EXPRESSION_MAX = mainJNI.ModelCache_VAR_ARRAY_EXPRESSION_MAX_get();
300
301 // VarArrayConstantExpressionType
302 public final static int VAR_ARRAY_CONSTANT_INDEX = mainJNI.ModelCache_VAR_ARRAY_CONSTANT_INDEX_get();
303 public final static int VAR_ARRAY_CONSTANT_EXPRESSION_MAX = mainJNI.ModelCache_VAR_ARRAY_CONSTANT_EXPRESSION_MAX_get();
304
305}
void insertExprExprConstantExpression(IntExpr expression, IntExpr var1, IntExpr var2, long constant, int type)
static final int VAR_CONSTANT_ARRAY_ELEMENT
VarConstantArrayExpressionType.
void insertVarConstantArrayExpression(IntExpr expression, IntVar var, long[] values, int type)
Constraint findExprExprConstraint(IntExpr expr1, IntExpr expr2, int type)
void insertVarConstantConstantExpression(IntExpr expression, IntVar var, long value1, long value2, int type)
void insertVoidConstraint(Constraint ct, int type)
void insertVarArrayConstantArrayExpression(IntExpr expression, IntVar[] var, long[] values, int type)
void insertVarArrayExpression(IntExpr expression, IntVar[] vars, int type)
static final int EXPR_EXPR_EQUALITY
ExprExprConstraintType.
static final int VAR_CONSTANT_CONSTANT_BETWEEN
VarConstantConstantConstraintType.
IntExpr findVarArrayExpression(IntVar[] vars, int type)
IntExpr findVarArrayConstantExpression(IntVar[] vars, long value, int type)
static final int VAR_ARRAY_CONSTANT_ARRAY_SCAL_PROD
VarArrayConstantArrayExpressionType.
IntExpr findExprExprExpression(IntExpr var1, IntExpr var2, int type)
IntExpr findExprConstantExpression(IntExpr expr, long value, int type)
void insertExprExpression(IntExpr expression, IntExpr expr, int type)
static final int EXPR_OPPOSITE
ExprExpressionType.
static final int EXPR_CONSTANT_DIFFERENCE
ExprConstantExpressionType.
static final int EXPR_EXPR_DIFFERENCE
ExprExprExpressionType.
void insertVarArrayConstantExpression(IntExpr expression, IntVar[] var, long value, int type)
void insertExprConstantExpression(IntExpr expression, IntExpr var, long value, int type)
void insertExprExprConstraint(Constraint ct, IntExpr expr1, IntExpr expr2, int type)
static final int VAR_CONSTANT_EQUALITY
VarConstantConstraintType.
static final int VOID_FALSE_CONSTRAINT
VoidConstraintType.
static final int VAR_CONSTANT_CONSTANT_SEMI_CONTINUOUS
VarConstantConstantExpressionType.
void insertExprExprExpression(IntExpr expression, IntExpr var1, IntExpr var2, int type)
ModelCache(long cPtr, boolean cMemoryOwn)
Constraint findVarConstantConstantConstraint(IntVar var, long value1, long value2, int type)
IntExpr findVarConstantArrayExpression(IntVar var, long[] values, int type)
void insertVarConstantConstantConstraint(Constraint ct, IntVar var, long value1, long value2, int type)
static final int VAR_ARRAY_CONSTANT_INDEX
VarArrayConstantExpressionType.
void insertVarConstantConstraint(Constraint ct, IntVar var, long value, int type)
Constraint findVarConstantConstraint(IntVar var, long value, int type)
IntExpr findVarArrayConstantArrayExpression(IntVar[] vars, long[] values, int type)
static final int EXPR_EXPR_CONSTANT_CONDITIONAL
ExprExprConstantExpressionType.
IntExpr findExprExprConstantExpression(IntExpr var1, IntExpr var2, long constant, int type)
IntExpr findVarConstantConstantExpression(IntVar var, long value1, long value2, int type)
IntExpr findExprExpression(IntExpr expr, int type)
static final int VAR_ARRAY_MAX
VarArrayExpressionType.