Google OR-Tools v9.11
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.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 IntVarLocalSearchOperator : LocalSearchOperator {
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 index) {
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("Start", swigMethodTypes1))
154 swigDelegate1 = new SwigDelegateIntVarLocalSearchOperator_1(SwigDirectorMethodStart);
155 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes2))
156 swigDelegate2 = new SwigDelegateIntVarLocalSearchOperator_2(SwigDirectorMethodReset);
157 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes3))
158 swigDelegate3 = new SwigDelegateIntVarLocalSearchOperator_3(SwigDirectorMethodHasFragments);
159 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes4))
160 swigDelegate4 = new SwigDelegateIntVarLocalSearchOperator_4(SwigDirectorMethodHoldsDelta);
161 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes5))
162 swigDelegate5 = new SwigDelegateIntVarLocalSearchOperator_5(SwigDirectorMethodIsIncremental);
163 if (SwigDerivedClassHasMethod("SkipUnchanged", swigMethodTypes6))
164 swigDelegate6 = new SwigDelegateIntVarLocalSearchOperator_6(SwigDirectorMethodSkipUnchanged);
165 if (SwigDerivedClassHasMethod("OnStart", swigMethodTypes7))
166 swigDelegate7 = new SwigDelegateIntVarLocalSearchOperator_7(SwigDirectorMethodOnStart);
167 if (SwigDerivedClassHasMethod("MakeOneNeighbor", swigMethodTypes8))
168 swigDelegate8 = new SwigDelegateIntVarLocalSearchOperator_8(SwigDirectorMethodMakeOneNeighbor);
169 operations_research_constraint_solverPINVOKE.IntVarLocalSearchOperator_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8);
170 }
171
172 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
173 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
174 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
175 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
176 if (methodInfo.DeclaringType == null)
177 continue;
178
179 if (methodInfo.Name != methodName)
180 continue;
181
182 var parameters = methodInfo.GetParameters();
183 if (parameters.Length != methodTypes.Length)
184 continue;
185
186 bool parametersMatch = true;
187 for (var i = 0; i < parameters.Length; i++) {
188 if (parameters[i].ParameterType != methodTypes[i]) {
189 parametersMatch = false;
190 break;
191 }
192 }
193
194 if (!parametersMatch)
195 continue;
196
197 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(IntVarLocalSearchOperator))) &&
198 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
199 return true;
200 }
201 }
202
203 return false;
204 }
205
206 private string SwigDirectorMethodToString() {
207 return ToString();
208 }
209
210 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
211 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
212 }
213
214 private void SwigDirectorMethodReset() {
215 Reset();
216 }
217
218 private bool SwigDirectorMethodHasFragments() {
219 return HasFragments();
220 }
221
222 private bool SwigDirectorMethodHoldsDelta() {
223 return HoldsDelta();
224 }
225
226 private bool SwigDirectorMethodIsIncremental() {
227 return IsIncremental();
228 }
229
230 private bool SwigDirectorMethodSkipUnchanged(int index) {
231 return SkipUnchanged(index);
232 }
233
234 private void SwigDirectorMethodOnStart() {
235 OnStart();
236 }
237
238 private bool SwigDirectorMethodMakeOneNeighbor() {
239 return MakeOneNeighbor();
240 }
241
242 public delegate string SwigDelegateIntVarLocalSearchOperator_0();
243 public delegate void SwigDelegateIntVarLocalSearchOperator_1(global::System.IntPtr assignment);
248 public delegate bool SwigDelegateIntVarLocalSearchOperator_6(int index);
253 private SwigDelegateIntVarLocalSearchOperator_1 swigDelegate1;
254 private SwigDelegateIntVarLocalSearchOperator_2 swigDelegate2;
255 private SwigDelegateIntVarLocalSearchOperator_3 swigDelegate3;
256 private SwigDelegateIntVarLocalSearchOperator_4 swigDelegate4;
257 private SwigDelegateIntVarLocalSearchOperator_5 swigDelegate5;
258 private SwigDelegateIntVarLocalSearchOperator_6 swigDelegate6;
259 private SwigDelegateIntVarLocalSearchOperator_7 swigDelegate7;
260 private SwigDelegateIntVarLocalSearchOperator_8 swigDelegate8;
261
262 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
263 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment) };
264 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
265 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
266 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
267 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
268 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { typeof(int) };
269 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
270 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
271}
272
273}
bool ApplyChanges(Assignment delta, Assignment deltadelta)
delegate void SwigDelegateIntVarLocalSearchOperator_1(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 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 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)
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)