Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SymmetryBreaker.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.1
6//
7// Do not make changes to this file unless you know what you are doing - modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class SymmetryBreaker : DecisionVisitor {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal SymmetryBreaker(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.SymmetryBreaker_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SymmetryBreaker obj) {
26 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27 }
28
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(SymmetryBreaker obj) {
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
33 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.Dispose();
36 return ptr;
37 } else {
38 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
39 }
40 }
41
42 protected override void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 base.Dispose(disposing);
52 }
53 }
54
55 public SymmetryBreaker() : this(operations_research_constraint_solverPINVOKE.new_SymmetryBreaker(), true) {
56 SwigDirectorConnect();
57 }
58
59 public void AddIntegerVariableEqualValueClause(IntVar var, long value) {
61 }
62
63 public void AddIntegerVariableGreaterOrEqualValueClause(IntVar var, long value) {
65 }
66
67 public void AddIntegerVariableLessOrEqualValueClause(IntVar var, long value) {
69 }
70
71 private void SwigDirectorConnect() {
72 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
73 swigDelegate0 = new SwigDelegateSymmetryBreaker_0(SwigDirectorMethodToString);
74 if (SwigDerivedClassHasMethod("VisitSetVariableValue", swigMethodTypes1))
75 swigDelegate1 = new SwigDelegateSymmetryBreaker_1(SwigDirectorMethodVisitSetVariableValue);
76 if (SwigDerivedClassHasMethod("VisitSplitVariableDomain", swigMethodTypes2))
77 swigDelegate2 = new SwigDelegateSymmetryBreaker_2(SwigDirectorMethodVisitSplitVariableDomain);
78 if (SwigDerivedClassHasMethod("VisitScheduleOrPostpone", swigMethodTypes3))
79 swigDelegate3 = new SwigDelegateSymmetryBreaker_3(SwigDirectorMethodVisitScheduleOrPostpone);
80 if (SwigDerivedClassHasMethod("VisitScheduleOrExpedite", swigMethodTypes4))
81 swigDelegate4 = new SwigDelegateSymmetryBreaker_4(SwigDirectorMethodVisitScheduleOrExpedite);
82 if (SwigDerivedClassHasMethod("VisitRankFirstInterval", swigMethodTypes5))
83 swigDelegate5 = new SwigDelegateSymmetryBreaker_5(SwigDirectorMethodVisitRankFirstInterval);
84 if (SwigDerivedClassHasMethod("VisitRankLastInterval", swigMethodTypes6))
85 swigDelegate6 = new SwigDelegateSymmetryBreaker_6(SwigDirectorMethodVisitRankLastInterval);
86 if (SwigDerivedClassHasMethod("VisitUnknownDecision", swigMethodTypes7))
87 swigDelegate7 = new SwigDelegateSymmetryBreaker_7(SwigDirectorMethodVisitUnknownDecision);
88 operations_research_constraint_solverPINVOKE.SymmetryBreaker_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7);
89 }
90
91 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
92 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
93 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
94 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
95 if (methodInfo.DeclaringType == null)
96 continue;
97
98 if (methodInfo.Name != methodName)
99 continue;
100
101 var parameters = methodInfo.GetParameters();
102 if (parameters.Length != methodTypes.Length)
103 continue;
104
105 bool parametersMatch = true;
106 for (var i = 0; i < parameters.Length; i++) {
107 if (parameters[i].ParameterType != methodTypes[i]) {
108 parametersMatch = false;
109 break;
110 }
111 }
112
113 if (!parametersMatch)
114 continue;
115
116 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(SymmetryBreaker))) &&
117 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
118 return true;
119 }
120 }
121
122 return false;
123 }
124
125 private string SwigDirectorMethodToString() {
126 return ToString();
127 }
128
129 private void SwigDirectorMethodVisitSetVariableValue(global::System.IntPtr var, long value) {
130 VisitSetVariableValue((var == global::System.IntPtr.Zero) ? null : new IntVar(var, false), value);
131 }
132
133 private void SwigDirectorMethodVisitSplitVariableDomain(global::System.IntPtr var, long value, bool start_with_lower_half) {
134 VisitSplitVariableDomain((var == global::System.IntPtr.Zero) ? null : new IntVar(var, false), value, start_with_lower_half);
135 }
136
137 private void SwigDirectorMethodVisitScheduleOrPostpone(global::System.IntPtr var, long est) {
138 VisitScheduleOrPostpone((var == global::System.IntPtr.Zero) ? null : new IntervalVar(var, false), est);
139 }
140
141 private void SwigDirectorMethodVisitScheduleOrExpedite(global::System.IntPtr var, long est) {
142 VisitScheduleOrExpedite((var == global::System.IntPtr.Zero) ? null : new IntervalVar(var, false), est);
143 }
144
145 private void SwigDirectorMethodVisitRankFirstInterval(global::System.IntPtr sequence, int index) {
146 VisitRankFirstInterval((sequence == global::System.IntPtr.Zero) ? null : new SequenceVar(sequence, false), index);
147 }
148
149 private void SwigDirectorMethodVisitRankLastInterval(global::System.IntPtr sequence, int index) {
150 VisitRankLastInterval((sequence == global::System.IntPtr.Zero) ? null : new SequenceVar(sequence, false), index);
151 }
152
153 private void SwigDirectorMethodVisitUnknownDecision() {
155 }
156
157 public delegate string SwigDelegateSymmetryBreaker_0();
158 public delegate void SwigDelegateSymmetryBreaker_1(global::System.IntPtr var, long value);
159 public delegate void SwigDelegateSymmetryBreaker_2(global::System.IntPtr var, long value, bool start_with_lower_half);
160 public delegate void SwigDelegateSymmetryBreaker_3(global::System.IntPtr var, long est);
161 public delegate void SwigDelegateSymmetryBreaker_4(global::System.IntPtr var, long est);
162 public delegate void SwigDelegateSymmetryBreaker_5(global::System.IntPtr sequence, int index);
163 public delegate void SwigDelegateSymmetryBreaker_6(global::System.IntPtr sequence, int index);
164 public delegate void SwigDelegateSymmetryBreaker_7();
166 private SwigDelegateSymmetryBreaker_0 swigDelegate0;
167 private SwigDelegateSymmetryBreaker_1 swigDelegate1;
168 private SwigDelegateSymmetryBreaker_2 swigDelegate2;
169 private SwigDelegateSymmetryBreaker_3 swigDelegate3;
170 private SwigDelegateSymmetryBreaker_4 swigDelegate4;
171 private SwigDelegateSymmetryBreaker_5 swigDelegate5;
172 private SwigDelegateSymmetryBreaker_6 swigDelegate6;
173 private SwigDelegateSymmetryBreaker_7 swigDelegate7;
174
175 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
176 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(IntVar), typeof(long) };
177 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(IntVar), typeof(long), typeof(bool) };
178 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { typeof(IntervalVar), typeof(long) };
179 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { typeof(IntervalVar), typeof(long) };
180 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { typeof(SequenceVar), typeof(int) };
181 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { typeof(SequenceVar), typeof(int) };
182 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
183}
184
185}
virtual void VisitSplitVariableDomain(IntVar var, long value, bool start_with_lower_half)
virtual void VisitSetVariableValue(IntVar var, long value)
virtual void VisitScheduleOrPostpone(IntervalVar var, long est)
virtual void VisitRankLastInterval(SequenceVar sequence, int index)
virtual void VisitScheduleOrExpedite(IntervalVar var, long est)
virtual void VisitRankFirstInterval(SequenceVar sequence, int index)
delegate void SwigDelegateSymmetryBreaker_5(global::System.IntPtr sequence, int index)
delegate void SwigDelegateSymmetryBreaker_6(global::System.IntPtr sequence, int index)
delegate void SwigDelegateSymmetryBreaker_4(global::System.IntPtr var, long est)
delegate void SwigDelegateSymmetryBreaker_2(global::System.IntPtr var, long value, bool start_with_lower_half)
void AddIntegerVariableEqualValueClause(IntVar var, long value)
void AddIntegerVariableGreaterOrEqualValueClause(IntVar var, long value)
delegate void SwigDelegateSymmetryBreaker_3(global::System.IntPtr var, long est)
delegate void SwigDelegateSymmetryBreaker_1(global::System.IntPtr var, long value)
void AddIntegerVariableLessOrEqualValueClause(IntVar var, long value)
static void SymmetryBreaker_AddIntegerVariableGreaterOrEqualValueClause(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, long jarg3)
static void SymmetryBreaker_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, SymmetryBreaker.SwigDelegateSymmetryBreaker_0 delegate0, SymmetryBreaker.SwigDelegateSymmetryBreaker_1 delegate1, SymmetryBreaker.SwigDelegateSymmetryBreaker_2 delegate2, SymmetryBreaker.SwigDelegateSymmetryBreaker_3 delegate3, SymmetryBreaker.SwigDelegateSymmetryBreaker_4 delegate4, SymmetryBreaker.SwigDelegateSymmetryBreaker_5 delegate5, SymmetryBreaker.SwigDelegateSymmetryBreaker_6 delegate6, SymmetryBreaker.SwigDelegateSymmetryBreaker_7 delegate7)
static void delete_SymmetryBreaker(global::System.Runtime.InteropServices.HandleRef jarg1)
static void SymmetryBreaker_AddIntegerVariableLessOrEqualValueClause(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, long jarg3)
static void SymmetryBreaker_AddIntegerVariableEqualValueClause(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, long jarg3)