Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SymmetryBreaker.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
16public class SymmetryBreaker extends DecisionVisitor {
17 private transient long swigCPtr;
18
19 protected SymmetryBreaker(long cPtr, boolean cMemoryOwn) {
20 super(mainJNI.SymmetryBreaker_SWIGUpcast(cPtr), cMemoryOwn);
21 swigCPtr = cPtr;
22 }
23
24 protected static long getCPtr(SymmetryBreaker obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
26 }
27
28 protected static long swigRelease(SymmetryBreaker obj) {
29 long ptr = 0;
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new RuntimeException("Cannot release ownership as memory is not owned");
33 ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.delete();
36 }
37 return ptr;
38 }
39
40 @SuppressWarnings({"deprecation", "removal"})
41 protected void finalize() {
42 delete();
43 }
44
45 public synchronized void delete() {
46 if (swigCPtr != 0) {
47 if (swigCMemOwn) {
48 swigCMemOwn = false;
49 mainJNI.delete_SymmetryBreaker(swigCPtr);
50 }
51 swigCPtr = 0;
52 }
53 super.delete();
54 }
55
56 protected void swigDirectorDisconnect() {
57 swigCMemOwn = false;
58 delete();
59 }
60
61 public void swigReleaseOwnership() {
62 swigCMemOwn = false;
63 mainJNI.SymmetryBreaker_change_ownership(this, swigCPtr, false);
64 }
65
66 public void swigTakeOwnership() {
67 swigCMemOwn = true;
68 mainJNI.SymmetryBreaker_change_ownership(this, swigCPtr, true);
69 }
70
71 public SymmetryBreaker() {
72 this(mainJNI.new_SymmetryBreaker(), true);
73 mainJNI.SymmetryBreaker_director_connect(this, swigCPtr, true, true);
74 }
75
76 public void addIntegerVariableEqualValueClause(IntVar var, long value) {
77 mainJNI.SymmetryBreaker_addIntegerVariableEqualValueClause(swigCPtr, this, IntVar.getCPtr(var), var, value);
78 }
79
81 mainJNI.SymmetryBreaker_addIntegerVariableGreaterOrEqualValueClause(swigCPtr, this, IntVar.getCPtr(var), var, value);
82 }
83
84 public void addIntegerVariableLessOrEqualValueClause(IntVar var, long value) {
85 mainJNI.SymmetryBreaker_addIntegerVariableLessOrEqualValueClause(swigCPtr, this, IntVar.getCPtr(var), var, value);
86 }
87
88}
void addIntegerVariableGreaterOrEqualValueClause(IntVar var, long value)
void addIntegerVariableLessOrEqualValueClause(IntVar var, long value)
void addIntegerVariableEqualValueClause(IntVar var, long value)