Google OR-Tools v9.11
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.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 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 Start(Assignment assignment) {
66 }
67
68 public virtual void Reset() {
70 }
71
72 public virtual bool HasFragments() {
74 return ret;
75 }
76
77 public virtual bool HoldsDelta() {
79 return ret;
80 }
81
82 private void SwigDirectorConnect() {
83 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
84 swigDelegate0 = new SwigDelegateLocalSearchOperator_0(SwigDirectorMethodToString);
85 if (SwigDerivedClassHasMethod("MakeNextNeighbor", swigMethodTypes1))
86 swigDelegate1 = new SwigDelegateLocalSearchOperator_1(SwigDirectorMethodMakeNextNeighbor);
87 if (SwigDerivedClassHasMethod("Start", swigMethodTypes2))
88 swigDelegate2 = new SwigDelegateLocalSearchOperator_2(SwigDirectorMethodStart);
89 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes3))
90 swigDelegate3 = new SwigDelegateLocalSearchOperator_3(SwigDirectorMethodReset);
91 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes4))
92 swigDelegate4 = new SwigDelegateLocalSearchOperator_4(SwigDirectorMethodHasFragments);
93 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes5))
94 swigDelegate5 = new SwigDelegateLocalSearchOperator_5(SwigDirectorMethodHoldsDelta);
95 operations_research_constraint_solverPINVOKE.LocalSearchOperator_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5);
96 }
97
98 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
99 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
100 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
101 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
102 if (methodInfo.DeclaringType == null)
103 continue;
104
105 if (methodInfo.Name != methodName)
106 continue;
107
108 var parameters = methodInfo.GetParameters();
109 if (parameters.Length != methodTypes.Length)
110 continue;
111
112 bool parametersMatch = true;
113 for (var i = 0; i < parameters.Length; i++) {
114 if (parameters[i].ParameterType != methodTypes[i]) {
115 parametersMatch = false;
116 break;
117 }
118 }
119
120 if (!parametersMatch)
121 continue;
122
123 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(LocalSearchOperator))) &&
124 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
125 return true;
126 }
127 }
128
129 return false;
130 }
131
132 private string SwigDirectorMethodToString() {
133 return ToString();
134 }
135
136 private bool SwigDirectorMethodMakeNextNeighbor(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
137 return MakeNextNeighbor((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false));
138 }
139
140 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
141 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
142 }
143
144 private void SwigDirectorMethodReset() {
145 Reset();
146 }
147
148 private bool SwigDirectorMethodHasFragments() {
149 return HasFragments();
150 }
151
152 private bool SwigDirectorMethodHoldsDelta() {
153 return HoldsDelta();
154 }
155
156 public delegate string SwigDelegateLocalSearchOperator_0();
157 public delegate bool SwigDelegateLocalSearchOperator_1(global::System.IntPtr delta, global::System.IntPtr deltadelta);
158 public delegate void SwigDelegateLocalSearchOperator_2(global::System.IntPtr assignment);
159 public delegate void SwigDelegateLocalSearchOperator_3();
160 public delegate bool SwigDelegateLocalSearchOperator_4();
161 public delegate bool SwigDelegateLocalSearchOperator_5();
164 private SwigDelegateLocalSearchOperator_1 swigDelegate1;
165 private SwigDelegateLocalSearchOperator_2 swigDelegate2;
166 private SwigDelegateLocalSearchOperator_3 swigDelegate3;
167 private SwigDelegateLocalSearchOperator_4 swigDelegate4;
168 private SwigDelegateLocalSearchOperator_5 swigDelegate5;
169
170 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
171 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
172 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment) };
173 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
174 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
175 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
176}
177
178}
virtual bool MakeNextNeighbor(Assignment delta, Assignment deltadelta)
delegate bool SwigDelegateLocalSearchOperator_1(global::System.IntPtr delta, global::System.IntPtr deltadelta)
delegate void SwigDelegateLocalSearchOperator_2(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 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)
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)