Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
LocalSearchFilter.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 LocalSearchFilter : BaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal LocalSearchFilter(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.LocalSearchFilter_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LocalSearchFilter 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(LocalSearchFilter 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 virtual void Relax(Assignment delta, Assignment deltadelta) {
56 if (SwigDerivedClassHasMethod("Relax", swigMethodTypes1)) operations_research_constraint_solverPINVOKE.LocalSearchFilter_RelaxSwigExplicitLocalSearchFilter(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta)); else operations_research_constraint_solverPINVOKE.LocalSearchFilter_Relax(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta));
57 }
58
59 public virtual void Commit(Assignment delta, Assignment deltadelta) {
60 if (SwigDerivedClassHasMethod("Commit", swigMethodTypes2)) operations_research_constraint_solverPINVOKE.LocalSearchFilter_CommitSwigExplicitLocalSearchFilter(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta)); else operations_research_constraint_solverPINVOKE.LocalSearchFilter_Commit(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta));
61 }
62
63 public virtual bool Accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max) {
64 bool ret = operations_research_constraint_solverPINVOKE.LocalSearchFilter_Accept(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta), objective_min, objective_max);
65 return ret;
66 }
67
68 public virtual bool IsIncremental() {
70 return ret;
71 }
72
73 public virtual void Synchronize(Assignment assignment, Assignment delta) {
75 }
76
77 public virtual void Revert() {
79 }
80
81 public virtual void Reset() {
83 }
84
85 public virtual long GetSynchronizedObjectiveValue() {
87 return ret;
88 }
89
90 public virtual long GetAcceptedObjectiveValue() {
92 return ret;
93 }
94
95 public LocalSearchFilter() : this(operations_research_constraint_solverPINVOKE.new_LocalSearchFilter(), true) {
96 SwigDirectorConnect();
97 }
98
99 private void SwigDirectorConnect() {
100 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
101 swigDelegate0 = new SwigDelegateLocalSearchFilter_0(SwigDirectorMethodToString);
102 if (SwigDerivedClassHasMethod("Relax", swigMethodTypes1))
103 swigDelegate1 = new SwigDelegateLocalSearchFilter_1(SwigDirectorMethodRelax);
104 if (SwigDerivedClassHasMethod("Commit", swigMethodTypes2))
105 swigDelegate2 = new SwigDelegateLocalSearchFilter_2(SwigDirectorMethodCommit);
106 if (SwigDerivedClassHasMethod("Accept", swigMethodTypes3))
107 swigDelegate3 = new SwigDelegateLocalSearchFilter_3(SwigDirectorMethodAccept);
108 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes4))
109 swigDelegate4 = new SwigDelegateLocalSearchFilter_4(SwigDirectorMethodIsIncremental);
110 if (SwigDerivedClassHasMethod("Synchronize", swigMethodTypes5))
111 swigDelegate5 = new SwigDelegateLocalSearchFilter_5(SwigDirectorMethodSynchronize);
112 if (SwigDerivedClassHasMethod("Revert", swigMethodTypes6))
113 swigDelegate6 = new SwigDelegateLocalSearchFilter_6(SwigDirectorMethodRevert);
114 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes7))
115 swigDelegate7 = new SwigDelegateLocalSearchFilter_7(SwigDirectorMethodReset);
116 if (SwigDerivedClassHasMethod("GetSynchronizedObjectiveValue", swigMethodTypes8))
117 swigDelegate8 = new SwigDelegateLocalSearchFilter_8(SwigDirectorMethodGetSynchronizedObjectiveValue);
118 if (SwigDerivedClassHasMethod("GetAcceptedObjectiveValue", swigMethodTypes9))
119 swigDelegate9 = new SwigDelegateLocalSearchFilter_9(SwigDirectorMethodGetAcceptedObjectiveValue);
120 operations_research_constraint_solverPINVOKE.LocalSearchFilter_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9);
121 }
122
123 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
124 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
125 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
126 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
127 if (methodInfo.DeclaringType == null)
128 continue;
129
130 if (methodInfo.Name != methodName)
131 continue;
132
133 var parameters = methodInfo.GetParameters();
134 if (parameters.Length != methodTypes.Length)
135 continue;
136
137 bool parametersMatch = true;
138 for (var i = 0; i < parameters.Length; i++) {
139 if (parameters[i].ParameterType != methodTypes[i]) {
140 parametersMatch = false;
141 break;
142 }
143 }
144
145 if (!parametersMatch)
146 continue;
147
148 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(LocalSearchFilter))) &&
149 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
150 return true;
151 }
152 }
153
154 return false;
155 }
156
157 private string SwigDirectorMethodToString() {
158 return ToString();
159 }
160
161 private void SwigDirectorMethodRelax(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
162 Relax((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false));
163 }
164
165 private void SwigDirectorMethodCommit(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
166 Commit((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false));
167 }
168
169 private bool SwigDirectorMethodAccept(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max) {
170 return Accept((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false), objective_min, objective_max);
171 }
172
173 private bool SwigDirectorMethodIsIncremental() {
174 return IsIncremental();
175 }
176
177 private void SwigDirectorMethodSynchronize(global::System.IntPtr assignment, global::System.IntPtr delta) {
178 Synchronize((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false), (delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false));
179 }
180
181 private void SwigDirectorMethodRevert() {
182 Revert();
183 }
184
185 private void SwigDirectorMethodReset() {
186 Reset();
187 }
188
189 private long SwigDirectorMethodGetSynchronizedObjectiveValue() {
191 }
192
193 private long SwigDirectorMethodGetAcceptedObjectiveValue() {
195 }
196
197 public delegate string SwigDelegateLocalSearchFilter_0();
198 public delegate void SwigDelegateLocalSearchFilter_1(global::System.IntPtr delta, global::System.IntPtr deltadelta);
199 public delegate void SwigDelegateLocalSearchFilter_2(global::System.IntPtr delta, global::System.IntPtr deltadelta);
200 public delegate bool SwigDelegateLocalSearchFilter_3(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max);
201 public delegate bool SwigDelegateLocalSearchFilter_4();
202 public delegate void SwigDelegateLocalSearchFilter_5(global::System.IntPtr assignment, global::System.IntPtr delta);
203 public delegate void SwigDelegateLocalSearchFilter_6();
204 public delegate void SwigDelegateLocalSearchFilter_7();
205 public delegate long SwigDelegateLocalSearchFilter_8();
206 public delegate long SwigDelegateLocalSearchFilter_9();
208 private SwigDelegateLocalSearchFilter_0 swigDelegate0;
209 private SwigDelegateLocalSearchFilter_1 swigDelegate1;
210 private SwigDelegateLocalSearchFilter_2 swigDelegate2;
211 private SwigDelegateLocalSearchFilter_3 swigDelegate3;
212 private SwigDelegateLocalSearchFilter_4 swigDelegate4;
213 private SwigDelegateLocalSearchFilter_5 swigDelegate5;
214 private SwigDelegateLocalSearchFilter_6 swigDelegate6;
215 private SwigDelegateLocalSearchFilter_7 swigDelegate7;
216 private SwigDelegateLocalSearchFilter_8 swigDelegate8;
217 private SwigDelegateLocalSearchFilter_9 swigDelegate9;
218
219 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
220 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
221 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
222 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { typeof(Assignment), typeof(Assignment), typeof(long), typeof(long) };
223 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
224 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
225 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
226 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
227 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
228 private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { };
229}
230
231}
virtual void Synchronize(Assignment assignment, Assignment delta)
delegate void SwigDelegateLocalSearchFilter_5(global::System.IntPtr assignment, global::System.IntPtr delta)
virtual void Commit(Assignment delta, Assignment deltadelta)
delegate void SwigDelegateLocalSearchFilter_2(global::System.IntPtr delta, global::System.IntPtr deltadelta)
delegate void SwigDelegateLocalSearchFilter_1(global::System.IntPtr delta, global::System.IntPtr deltadelta)
virtual bool Accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
delegate bool SwigDelegateLocalSearchFilter_3(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max)
virtual void Relax(Assignment delta, Assignment deltadelta)
static void LocalSearchFilter_ResetSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilter_Revert(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool LocalSearchFilter_IsIncrementalSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool LocalSearchFilter_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, long jarg4, long jarg5)
static long LocalSearchFilter_GetSynchronizedObjectiveValueSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilter_RevertSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilter_Synchronize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static long LocalSearchFilter_GetAcceptedObjectiveValueSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
static long LocalSearchFilter_GetAcceptedObjectiveValue(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool LocalSearchFilter_IsIncremental(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilter_Commit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void LocalSearchFilter_Reset(global::System.Runtime.InteropServices.HandleRef jarg1)
static long LocalSearchFilter_GetSynchronizedObjectiveValue(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilter_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LocalSearchFilter.SwigDelegateLocalSearchFilter_0 delegate0, LocalSearchFilter.SwigDelegateLocalSearchFilter_1 delegate1, LocalSearchFilter.SwigDelegateLocalSearchFilter_2 delegate2, LocalSearchFilter.SwigDelegateLocalSearchFilter_3 delegate3, LocalSearchFilter.SwigDelegateLocalSearchFilter_4 delegate4, LocalSearchFilter.SwigDelegateLocalSearchFilter_5 delegate5, LocalSearchFilter.SwigDelegateLocalSearchFilter_6 delegate6, LocalSearchFilter.SwigDelegateLocalSearchFilter_7 delegate7, LocalSearchFilter.SwigDelegateLocalSearchFilter_8 delegate8, LocalSearchFilter.SwigDelegateLocalSearchFilter_9 delegate9)
static void LocalSearchFilter_CommitSwigExplicitLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void delete_LocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)