Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVarLocalSearchOperator.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.3.0
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
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal IntVarLocalSearchOperator(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.IntVarLocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IntVarLocalSearchOperator 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(IntVarLocalSearchOperator 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 IntVarLocalSearchOperator(IntVarVector vars, bool keep_inverse_values) : this(operations_research_constraint_solverPINVOKE.new_IntVarLocalSearchOperator__SWIG_0(IntVarVector.getCPtr(vars), keep_inverse_values), true) {
56 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
57 SwigDirectorConnect();
58 }
59
60 public IntVarLocalSearchOperator(IntVarVector vars) : this(operations_research_constraint_solverPINVOKE.new_IntVarLocalSearchOperator__SWIG_1(IntVarVector.getCPtr(vars)), true) {
62 SwigDirectorConnect();
63 }
64
65 public override bool HoldsDelta() {
67 return ret;
68 }
69
70 public override void Start(Assignment assignment) {
72 }
73
74 public virtual bool IsIncremental() {
76 return ret;
77 }
78
79 public int Size() {
81 return ret;
82 }
83
84 public long Value(long index) {
86 return ret;
87 }
88
89 public IntVar Var(long index) {
90 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVarLocalSearchOperator_Var(swigCPtr, index);
91 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
92 return ret;
93 }
94
95 public virtual bool SkipUnchanged(int arg0) {
97 return ret;
98 }
99
100 public long OldValue(long index) {
102 return ret;
103 }
104
105 public long PrevValue(long index) {
107 return ret;
108 }
109
110 public void SetValue(long index, long value) {
113
114 public bool Activated(long index) {
116 return ret;
117 }
118
119 public void Activate(long index) {
122
123 public void Deactivate(long index) {
126
127 public bool ApplyChanges(Assignment delta, Assignment deltadelta) {
129 return ret;
130 }
131
132 public void RevertChanges(bool change_was_incremental) {
135
136 public void AddVars(IntVarVector vars) {
144
145 protected virtual bool MakeOneNeighbor() {
147 return ret;
148 }
149
150 private void SwigDirectorConnect() {
151 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
152 swigDelegate0 = new SwigDelegateIntVarLocalSearchOperator_0(SwigDirectorMethodToString);
153 if (SwigDerivedClassHasMethod("EnterSearch", swigMethodTypes1))
154 swigDelegate1 = new SwigDelegateIntVarLocalSearchOperator_1(SwigDirectorMethodEnterSearch);
155 if (SwigDerivedClassHasMethod("Start", swigMethodTypes2))
156 swigDelegate2 = new SwigDelegateIntVarLocalSearchOperator_2(SwigDirectorMethodStart);
157 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes3))
158 swigDelegate3 = new SwigDelegateIntVarLocalSearchOperator_3(SwigDirectorMethodReset);
159 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes4))
160 swigDelegate4 = new SwigDelegateIntVarLocalSearchOperator_4(SwigDirectorMethodHasFragments);
161 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes5))
162 swigDelegate5 = new SwigDelegateIntVarLocalSearchOperator_5(SwigDirectorMethodHoldsDelta);
163 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes6))
164 swigDelegate6 = new SwigDelegateIntVarLocalSearchOperator_6(SwigDirectorMethodIsIncremental);
165 if (SwigDerivedClassHasMethod("SkipUnchanged", swigMethodTypes7))
166 swigDelegate7 = new SwigDelegateIntVarLocalSearchOperator_7(SwigDirectorMethodSkipUnchanged);
167 if (SwigDerivedClassHasMethod("OnStart", swigMethodTypes8))
168 swigDelegate8 = new SwigDelegateIntVarLocalSearchOperator_8(SwigDirectorMethodOnStart);
169 if (SwigDerivedClassHasMethod("MakeOneNeighbor", swigMethodTypes9))
170 swigDelegate9 = new SwigDelegateIntVarLocalSearchOperator_9(SwigDirectorMethodMakeOneNeighbor);
171 operations_research_constraint_solverPINVOKE.IntVarLocalSearchOperator_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9);
172 }
173
174 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
175 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
176 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
177 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
178 if (methodInfo.DeclaringType == null)
179 continue;
180
181 if (methodInfo.Name != methodName)
182 continue;
183
184 var parameters = methodInfo.GetParameters();
185 if (parameters.Length != methodTypes.Length)
186 continue;
187
188 bool parametersMatch = true;
189 for (var i = 0; i < parameters.Length; i++) {
190 if (parameters[i].ParameterType != methodTypes[i]) {
191 parametersMatch = false;
192 break;
193 }
194 }
195
196 if (!parametersMatch)
197 continue;
198
199 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(IntVarLocalSearchOperator))) &&
200 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
201 return true;
202 }
203 }
204
205 return false;
206 }
207
208 private string SwigDirectorMethodToString() {
209 return ToString();
210 }
211
212 private void SwigDirectorMethodEnterSearch() {
213 EnterSearch();
214 }
215
216 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
217 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
218 }
219
220 private void SwigDirectorMethodReset() {
221 Reset();
222 }
223
224 private bool SwigDirectorMethodHasFragments() {
225 return HasFragments();
226 }
227
228 private bool SwigDirectorMethodHoldsDelta() {
229 return HoldsDelta();
230 }
231
232 private bool SwigDirectorMethodIsIncremental() {
233 return IsIncremental();
234 }
235
236 private bool SwigDirectorMethodSkipUnchanged(int arg0) {
237 return SkipUnchanged(arg0);
238 }
239
240 private void SwigDirectorMethodOnStart() {
241 OnStart();
242 }
243
244 private bool SwigDirectorMethodMakeOneNeighbor() {
245 return MakeOneNeighbor();
246 }
247
248 public delegate string SwigDelegateIntVarLocalSearchOperator_0();
249 public delegate void SwigDelegateIntVarLocalSearchOperator_1();
250 public delegate void SwigDelegateIntVarLocalSearchOperator_2(global::System.IntPtr assignment);
255 public delegate bool SwigDelegateIntVarLocalSearchOperator_7(int arg0);
260 private SwigDelegateIntVarLocalSearchOperator_1 swigDelegate1;
261 private SwigDelegateIntVarLocalSearchOperator_2 swigDelegate2;
262 private SwigDelegateIntVarLocalSearchOperator_3 swigDelegate3;
263 private SwigDelegateIntVarLocalSearchOperator_4 swigDelegate4;
264 private SwigDelegateIntVarLocalSearchOperator_5 swigDelegate5;
265 private SwigDelegateIntVarLocalSearchOperator_6 swigDelegate6;
266 private SwigDelegateIntVarLocalSearchOperator_7 swigDelegate7;
267 private SwigDelegateIntVarLocalSearchOperator_8 swigDelegate8;
268 private SwigDelegateIntVarLocalSearchOperator_9 swigDelegate9;
269
270 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
271 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
272 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment) };
273 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
274 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
275 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
276 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
277 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { typeof(int) };
278 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
279 private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { };
280}
281
282}
bool ApplyChanges(Assignment delta, Assignment deltadelta)
delegate void SwigDelegateIntVarLocalSearchOperator_2(global::System.IntPtr assignment)
static bool IntVarLocalSearchOperator_MakeOneNeighbor(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool IntVarLocalSearchOperator_SkipUnchanged(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void delete_IntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static long IntVarLocalSearchOperator_PrevValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool IntVarLocalSearchOperator_HoldsDelta(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool IntVarLocalSearchOperator_Activated(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntVarLocalSearchOperator_SetValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3)
static bool IntVarLocalSearchOperator_MakeOneNeighborSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVarLocalSearchOperator_OnStartSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool IntVarLocalSearchOperator_IsIncremental(global::System.Runtime.InteropServices.HandleRef jarg1)
static int IntVarLocalSearchOperator_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool IntVarLocalSearchOperator_IsIncrementalSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVarLocalSearchOperator_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_0 delegate0, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_1 delegate1, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_2 delegate2, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_3 delegate3, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_4 delegate4, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_5 delegate5, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_6 delegate6, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_7 delegate7, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_8 delegate8, IntVarLocalSearchOperator.SwigDelegateIntVarLocalSearchOperator_9 delegate9)
static global::System.IntPtr IntVarLocalSearchOperator_Var(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntVarLocalSearchOperator_OnStart(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVarLocalSearchOperator_StartSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void IntVarLocalSearchOperator_AddVars(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void IntVarLocalSearchOperator_Start(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static long IntVarLocalSearchOperator_Value(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool IntVarLocalSearchOperator_SkipUnchangedSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void IntVarLocalSearchOperator_Deactivate(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static long IntVarLocalSearchOperator_OldValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool IntVarLocalSearchOperator_HoldsDeltaSwigExplicitIntVarLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVarLocalSearchOperator_Activate(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntVarLocalSearchOperator_RevertChanges(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static bool IntVarLocalSearchOperator_ApplyChanges(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)