Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
LocalSearchOperator.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
18public partial class LocalSearchOperator : BaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal LocalSearchOperator(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.LocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LocalSearchOperator 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(LocalSearchOperator 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 LocalSearchOperator() : this(operations_research_constraint_solverPINVOKE.new_LocalSearchOperator(), true) {
56 SwigDirectorConnect();
57 }
58
59 public virtual bool MakeNextNeighbor(Assignment delta, Assignment deltadelta) {
61 return ret;
62 }
63
64 public virtual void EnterSearch() {
66 }
67
68 public virtual void Start(Assignment assignment) {
70 }
71
72 public virtual void Reset() {
74 }
75
76 public virtual bool HasFragments() {
78 return ret;
79 }
80
81 public virtual bool HoldsDelta() {
83 return ret;
84 }
85
86 private void SwigDirectorConnect() {
87 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
88 swigDelegate0 = new SwigDelegateLocalSearchOperator_0(SwigDirectorMethodToString);
89 if (SwigDerivedClassHasMethod("MakeNextNeighbor", swigMethodTypes1))
90 swigDelegate1 = new SwigDelegateLocalSearchOperator_1(SwigDirectorMethodMakeNextNeighbor);
91 if (SwigDerivedClassHasMethod("EnterSearch", swigMethodTypes2))
92 swigDelegate2 = new SwigDelegateLocalSearchOperator_2(SwigDirectorMethodEnterSearch);
93 if (SwigDerivedClassHasMethod("Start", swigMethodTypes3))
94 swigDelegate3 = new SwigDelegateLocalSearchOperator_3(SwigDirectorMethodStart);
95 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes4))
96 swigDelegate4 = new SwigDelegateLocalSearchOperator_4(SwigDirectorMethodReset);
97 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes5))
98 swigDelegate5 = new SwigDelegateLocalSearchOperator_5(SwigDirectorMethodHasFragments);
99 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes6))
100 swigDelegate6 = new SwigDelegateLocalSearchOperator_6(SwigDirectorMethodHoldsDelta);
101 operations_research_constraint_solverPINVOKE.LocalSearchOperator_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6);
102 }
103
104 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
105 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
106 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
107 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
108 if (methodInfo.DeclaringType == null)
109 continue;
110
111 if (methodInfo.Name != methodName)
112 continue;
113
114 var parameters = methodInfo.GetParameters();
115 if (parameters.Length != methodTypes.Length)
116 continue;
117
118 bool parametersMatch = true;
119 for (var i = 0; i < parameters.Length; i++) {
120 if (parameters[i].ParameterType != methodTypes[i]) {
121 parametersMatch = false;
122 break;
123 }
124 }
125
126 if (!parametersMatch)
127 continue;
128
129 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(LocalSearchOperator))) &&
130 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
131 return true;
132 }
133 }
134
135 return false;
136 }
137
138 private string SwigDirectorMethodToString() {
139 return ToString();
140 }
141
142 private bool SwigDirectorMethodMakeNextNeighbor(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
143 return MakeNextNeighbor((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false));
144 }
145
146 private void SwigDirectorMethodEnterSearch() {
147 EnterSearch();
148 }
149
150 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
151 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
152 }
153
154 private void SwigDirectorMethodReset() {
155 Reset();
156 }
157
158 private bool SwigDirectorMethodHasFragments() {
159 return HasFragments();
160 }
161
162 private bool SwigDirectorMethodHoldsDelta() {
163 return HoldsDelta();
164 }
165
166 public delegate string SwigDelegateLocalSearchOperator_0();
167 public delegate bool SwigDelegateLocalSearchOperator_1(global::System.IntPtr delta, global::System.IntPtr deltadelta);
168 public delegate void SwigDelegateLocalSearchOperator_2();
169 public delegate void SwigDelegateLocalSearchOperator_3(global::System.IntPtr assignment);
170 public delegate void SwigDelegateLocalSearchOperator_4();
171 public delegate bool SwigDelegateLocalSearchOperator_5();
172 public delegate bool SwigDelegateLocalSearchOperator_6();
175 private SwigDelegateLocalSearchOperator_1 swigDelegate1;
176 private SwigDelegateLocalSearchOperator_2 swigDelegate2;
177 private SwigDelegateLocalSearchOperator_3 swigDelegate3;
178 private SwigDelegateLocalSearchOperator_4 swigDelegate4;
179 private SwigDelegateLocalSearchOperator_5 swigDelegate5;
180 private SwigDelegateLocalSearchOperator_6 swigDelegate6;
181
182 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
183 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
184 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
185 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { typeof(Assignment) };
186 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
187 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
188 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
189}
190
191}
virtual bool MakeNextNeighbor(Assignment delta, Assignment deltadelta)
delegate bool SwigDelegateLocalSearchOperator_1(global::System.IntPtr delta, global::System.IntPtr deltadelta)
delegate void SwigDelegateLocalSearchOperator_3(global::System.IntPtr assignment)
static bool LocalSearchOperator_MakeNextNeighbor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static bool LocalSearchOperator_HasFragments(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchOperator_Reset(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchOperator_EnterSearch(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool LocalSearchOperator_HasFragmentsSwigExplicitLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchOperator_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LocalSearchOperator.SwigDelegateLocalSearchOperator_0 delegate0, LocalSearchOperator.SwigDelegateLocalSearchOperator_1 delegate1, LocalSearchOperator.SwigDelegateLocalSearchOperator_2 delegate2, LocalSearchOperator.SwigDelegateLocalSearchOperator_3 delegate3, LocalSearchOperator.SwigDelegateLocalSearchOperator_4 delegate4, LocalSearchOperator.SwigDelegateLocalSearchOperator_5 delegate5, LocalSearchOperator.SwigDelegateLocalSearchOperator_6 delegate6)
static void LocalSearchOperator_EnterSearchSwigExplicitLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchOperator_ResetSwigExplicitLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool LocalSearchOperator_HoldsDeltaSwigExplicitLocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_LocalSearchOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchOperator_Start(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool LocalSearchOperator_HoldsDelta(global::System.Runtime.InteropServices.HandleRef jarg1)