Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPSolverParameters.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.linearsolver;
10
11import java.lang.reflect.*;
12
39public class MPSolverParameters {
40 private transient long swigCPtr;
41 protected transient boolean swigCMemOwn;
42
43 protected MPSolverParameters(long cPtr, boolean cMemoryOwn) {
44 swigCMemOwn = cMemoryOwn;
45 swigCPtr = cPtr;
46 }
47
48 protected static long getCPtr(MPSolverParameters obj) {
49 return (obj == null) ? 0 : obj.swigCPtr;
50 }
51
52 protected static long swigRelease(MPSolverParameters obj) {
53 long ptr = 0;
54 if (obj != null) {
55 if (!obj.swigCMemOwn)
56 throw new RuntimeException("Cannot release ownership as memory is not owned");
57 ptr = obj.swigCPtr;
58 obj.swigCMemOwn = false;
59 obj.delete();
60 }
61 return ptr;
62 }
63
64 @SuppressWarnings({"deprecation", "removal"})
65 protected void finalize() {
66 delete();
67 }
68
69 public synchronized void delete() {
70 if (swigCPtr != 0) {
71 if (swigCMemOwn) {
72 swigCMemOwn = false;
73 mainJNI.delete_MPSolverParameters(swigCPtr);
74 }
75 swigCPtr = 0;
76 }
77 }
78
79 public static double getKDefaultRelativeMipGap() {
80 return mainJNI.MPSolverParameters_kDefaultRelativeMipGap_get();
81 }
82
83 public static double getKDefaultPrimalTolerance() {
84 return mainJNI.MPSolverParameters_kDefaultPrimalTolerance_get();
85 }
86
87 public static double getKDefaultDualTolerance() {
88 return mainJNI.MPSolverParameters_kDefaultDualTolerance_get();
89 }
90
91 public static MPSolverParameters.PresolveValues getKDefaultPresolve() {
92 return MPSolverParameters.PresolveValues.swigToEnum(mainJNI.MPSolverParameters_kDefaultPresolve_get());
93 }
94
95 public static MPSolverParameters.IncrementalityValues getKDefaultIncrementality() {
96 return MPSolverParameters.IncrementalityValues.swigToEnum(mainJNI.MPSolverParameters_kDefaultIncrementality_get());
97 }
98
103 this(mainJNI.new_MPSolverParameters(), true);
104 }
105
109 public void setDoubleParam(MPSolverParameters.DoubleParam param, double value) {
110 mainJNI.MPSolverParameters_setDoubleParam(swigCPtr, this, param.swigValue(), value);
111 }
112
116 public void setIntegerParam(MPSolverParameters.IntegerParam param, int value) {
117 mainJNI.MPSolverParameters_setIntegerParam(swigCPtr, this, param.swigValue(), value);
118 }
119
124 return mainJNI.MPSolverParameters_getDoubleParam(swigCPtr, this, param.swigValue());
125 }
126
131 return mainJNI.MPSolverParameters_getIntegerParam(swigCPtr, this, param.swigValue());
132 }
133
137 public enum DoubleParam {
141 RELATIVE_MIP_GAP(mainJNI.MPSolverParameters_RELATIVE_MIP_GAP_get()),
148 PRIMAL_TOLERANCE(mainJNI.MPSolverParameters_PRIMAL_TOLERANCE_get()),
152 DUAL_TOLERANCE(mainJNI.MPSolverParameters_DUAL_TOLERANCE_get());
153
154 public final int swigValue() {
155 return swigValue;
156 }
157
158 public static DoubleParam swigToEnum(int swigValue) {
159 DoubleParam[] swigValues = DoubleParam.class.getEnumConstants();
160 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
161 return swigValues[swigValue];
162 for (DoubleParam swigEnum : swigValues)
163 if (swigEnum.swigValue == swigValue)
164 return swigEnum;
165 throw new IllegalArgumentException("No enum " + DoubleParam.class + " with value " + swigValue);
166 }
167
168 @SuppressWarnings("unused")
169 private DoubleParam() {
170 this.swigValue = SwigNext.next++;
171 }
172
173 @SuppressWarnings("unused")
174 private DoubleParam(int swigValue) {
175 this.swigValue = swigValue;
176 SwigNext.next = swigValue+1;
177 }
178
179 @SuppressWarnings("unused")
180 private DoubleParam(DoubleParam swigEnum) {
181 this.swigValue = swigEnum.swigValue;
182 SwigNext.next = this.swigValue+1;
183 }
184
185 private final int swigValue;
186
187 private static class SwigNext {
188 private static int next = 0;
189 }
190 }
191
195 public enum IntegerParam {
199 PRESOLVE(mainJNI.MPSolverParameters_PRESOLVE_get()),
203 LP_ALGORITHM(mainJNI.MPSolverParameters_LP_ALGORITHM_get()),
207 INCREMENTALITY(mainJNI.MPSolverParameters_INCREMENTALITY_get()),
211 SCALING(mainJNI.MPSolverParameters_SCALING_get());
212
213 public final int swigValue() {
214 return swigValue;
215 }
216
217 public static IntegerParam swigToEnum(int swigValue) {
218 IntegerParam[] swigValues = IntegerParam.class.getEnumConstants();
219 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
220 return swigValues[swigValue];
221 for (IntegerParam swigEnum : swigValues)
222 if (swigEnum.swigValue == swigValue)
223 return swigEnum;
224 throw new IllegalArgumentException("No enum " + IntegerParam.class + " with value " + swigValue);
225 }
226
227 @SuppressWarnings("unused")
228 private IntegerParam() {
229 this.swigValue = SwigNext.next++;
230 }
231
232 @SuppressWarnings("unused")
233 private IntegerParam(int swigValue) {
234 this.swigValue = swigValue;
235 SwigNext.next = swigValue+1;
236 }
237
238 @SuppressWarnings("unused")
239 private IntegerParam(IntegerParam swigEnum) {
240 this.swigValue = swigEnum.swigValue;
241 SwigNext.next = this.swigValue+1;
242 }
243
244 private final int swigValue;
245
246 private static class SwigNext {
247 private static int next = 0;
248 }
249 }
250
254 public enum PresolveValues {
258 PRESOLVE_OFF(mainJNI.MPSolverParameters_PRESOLVE_OFF_get()),
262 PRESOLVE_ON(mainJNI.MPSolverParameters_PRESOLVE_ON_get());
263
264 public final int swigValue() {
265 return swigValue;
266 }
267
268 public static PresolveValues swigToEnum(int swigValue) {
269 PresolveValues[] swigValues = PresolveValues.class.getEnumConstants();
270 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
271 return swigValues[swigValue];
272 for (PresolveValues swigEnum : swigValues)
273 if (swigEnum.swigValue == swigValue)
274 return swigEnum;
275 throw new IllegalArgumentException("No enum " + PresolveValues.class + " with value " + swigValue);
276 }
277
278 @SuppressWarnings("unused")
279 private PresolveValues() {
280 this.swigValue = SwigNext.next++;
281 }
282
283 @SuppressWarnings("unused")
284 private PresolveValues(int swigValue) {
285 this.swigValue = swigValue;
286 SwigNext.next = swigValue+1;
287 }
288
289 @SuppressWarnings("unused")
290 private PresolveValues(PresolveValues swigEnum) {
291 this.swigValue = swigEnum.swigValue;
292 SwigNext.next = this.swigValue+1;
293 }
294
295 private final int swigValue;
296
297 private static class SwigNext {
298 private static int next = 0;
299 }
300 }
301
305 public enum LpAlgorithmValues {
309 DUAL(mainJNI.MPSolverParameters_DUAL_get()),
313 PRIMAL(mainJNI.MPSolverParameters_PRIMAL_get()),
317 BARRIER(mainJNI.MPSolverParameters_BARRIER_get());
318
319 public final int swigValue() {
320 return swigValue;
321 }
322
323 public static LpAlgorithmValues swigToEnum(int swigValue) {
324 LpAlgorithmValues[] swigValues = LpAlgorithmValues.class.getEnumConstants();
325 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
326 return swigValues[swigValue];
327 for (LpAlgorithmValues swigEnum : swigValues)
328 if (swigEnum.swigValue == swigValue)
329 return swigEnum;
330 throw new IllegalArgumentException("No enum " + LpAlgorithmValues.class + " with value " + swigValue);
331 }
332
333 @SuppressWarnings("unused")
334 private LpAlgorithmValues() {
335 this.swigValue = SwigNext.next++;
336 }
337
338 @SuppressWarnings("unused")
339 private LpAlgorithmValues(int swigValue) {
340 this.swigValue = swigValue;
341 SwigNext.next = swigValue+1;
342 }
343
344 @SuppressWarnings("unused")
345 private LpAlgorithmValues(LpAlgorithmValues swigEnum) {
346 this.swigValue = swigEnum.swigValue;
347 SwigNext.next = this.swigValue+1;
348 }
349
350 private final int swigValue;
351
352 private static class SwigNext {
353 private static int next = 0;
354 }
355 }
356
364 INCREMENTALITY_OFF(mainJNI.MPSolverParameters_INCREMENTALITY_OFF_get()),
369 INCREMENTALITY_ON(mainJNI.MPSolverParameters_INCREMENTALITY_ON_get());
370
371 public final int swigValue() {
372 return swigValue;
373 }
374
375 public static IncrementalityValues swigToEnum(int swigValue) {
376 IncrementalityValues[] swigValues = IncrementalityValues.class.getEnumConstants();
377 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
378 return swigValues[swigValue];
379 for (IncrementalityValues swigEnum : swigValues)
380 if (swigEnum.swigValue == swigValue)
381 return swigEnum;
382 throw new IllegalArgumentException("No enum " + IncrementalityValues.class + " with value " + swigValue);
383 }
384
385 @SuppressWarnings("unused")
386 private IncrementalityValues() {
387 this.swigValue = SwigNext.next++;
388 }
389
390 @SuppressWarnings("unused")
391 private IncrementalityValues(int swigValue) {
392 this.swigValue = swigValue;
393 SwigNext.next = swigValue+1;
394 }
395
396 @SuppressWarnings("unused")
397 private IncrementalityValues(IncrementalityValues swigEnum) {
398 this.swigValue = swigEnum.swigValue;
399 SwigNext.next = this.swigValue+1;
400 }
401
402 private final int swigValue;
403
404 private static class SwigNext {
405 private static int next = 0;
406 }
407 }
408
412 public enum ScalingValues {
416 SCALING_OFF(mainJNI.MPSolverParameters_SCALING_OFF_get()),
420 SCALING_ON(mainJNI.MPSolverParameters_SCALING_ON_get());
421
422 public final int swigValue() {
423 return swigValue;
424 }
425
426 public static ScalingValues swigToEnum(int swigValue) {
427 ScalingValues[] swigValues = ScalingValues.class.getEnumConstants();
428 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
429 return swigValues[swigValue];
430 for (ScalingValues swigEnum : swigValues)
431 if (swigEnum.swigValue == swigValue)
432 return swigEnum;
433 throw new IllegalArgumentException("No enum " + ScalingValues.class + " with value " + swigValue);
434 }
435
436 @SuppressWarnings("unused")
437 private ScalingValues() {
438 this.swigValue = SwigNext.next++;
439 }
440
441 @SuppressWarnings("unused")
442 private ScalingValues(int swigValue) {
443 this.swigValue = swigValue;
444 SwigNext.next = swigValue+1;
445 }
446
447 @SuppressWarnings("unused")
448 private ScalingValues(ScalingValues swigEnum) {
449 this.swigValue = swigEnum.swigValue;
450 SwigNext.next = this.swigValue+1;
451 }
452
453 private final int swigValue;
454
455 private static class SwigNext {
456 private static int next = 0;
457 }
458 }
459
460}
double getDoubleParam(MPSolverParameters.DoubleParam param)
void setIntegerParam(MPSolverParameters.IntegerParam param, int value)
static MPSolverParameters.IncrementalityValues getKDefaultIncrementality()
void setDoubleParam(MPSolverParameters.DoubleParam param, double value)
int getIntegerParam(MPSolverParameters.IntegerParam param)
static MPSolverParameters.PresolveValues getKDefaultPresolve()