Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ChangeValue.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 ChangeValue : IntVarLocalSearchOperator {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal ChangeValue(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.ChangeValue_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ChangeValue 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(ChangeValue 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 ChangeValue(IntVarVector vars) : this(operations_research_constraint_solverPINVOKE.new_ChangeValue(IntVarVector.getCPtr(vars)), true) {
56 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
57 SwigDirectorConnect();
58 }
59
60 public virtual long ModifyValue(long index, long value) {
62 return ret;
63 }
64
65 protected virtual new bool MakeOneNeighbor() {
67 return ret;
68 }
69
70 private void SwigDirectorConnect() {
71 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
72 swigDelegate0 = new SwigDelegateChangeValue_0(SwigDirectorMethodToString);
73 if (SwigDerivedClassHasMethod("EnterSearch", swigMethodTypes1))
74 swigDelegate1 = new SwigDelegateChangeValue_1(SwigDirectorMethodEnterSearch);
75 if (SwigDerivedClassHasMethod("Start", swigMethodTypes2))
76 swigDelegate2 = new SwigDelegateChangeValue_2(SwigDirectorMethodStart);
77 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes3))
78 swigDelegate3 = new SwigDelegateChangeValue_3(SwigDirectorMethodReset);
79 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes4))
80 swigDelegate4 = new SwigDelegateChangeValue_4(SwigDirectorMethodHasFragments);
81 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes5))
82 swigDelegate5 = new SwigDelegateChangeValue_5(SwigDirectorMethodHoldsDelta);
83 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes6))
84 swigDelegate6 = new SwigDelegateChangeValue_6(SwigDirectorMethodIsIncremental);
85 if (SwigDerivedClassHasMethod("SkipUnchanged", swigMethodTypes7))
86 swigDelegate7 = new SwigDelegateChangeValue_7(SwigDirectorMethodSkipUnchanged);
87 if (SwigDerivedClassHasMethod("OnStart", swigMethodTypes8))
88 swigDelegate8 = new SwigDelegateChangeValue_8(SwigDirectorMethodOnStart);
89 if (SwigDerivedClassHasMethod("MakeOneNeighbor", swigMethodTypes9))
90 swigDelegate9 = new SwigDelegateChangeValue_9(SwigDirectorMethodMakeOneNeighbor);
91 if (SwigDerivedClassHasMethod("ModifyValue", swigMethodTypes10))
92 swigDelegate10 = new SwigDelegateChangeValue_10(SwigDirectorMethodModifyValue);
93 operations_research_constraint_solverPINVOKE.ChangeValue_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10);
94 }
95
96 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
97 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
98 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
99 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
100 if (methodInfo.DeclaringType == null)
101 continue;
102
103 if (methodInfo.Name != methodName)
104 continue;
105
106 var parameters = methodInfo.GetParameters();
107 if (parameters.Length != methodTypes.Length)
108 continue;
109
110 bool parametersMatch = true;
111 for (var i = 0; i < parameters.Length; i++) {
112 if (parameters[i].ParameterType != methodTypes[i]) {
113 parametersMatch = false;
114 break;
115 }
116 }
117
118 if (!parametersMatch)
119 continue;
120
121 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(ChangeValue))) &&
122 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
123 return true;
124 }
125 }
126
127 return false;
128 }
129
130 private string SwigDirectorMethodToString() {
131 return ToString();
132 }
133
134 private void SwigDirectorMethodEnterSearch() {
135 EnterSearch();
136 }
137
138 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
139 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
140 }
141
142 private void SwigDirectorMethodReset() {
143 Reset();
144 }
145
146 private bool SwigDirectorMethodHasFragments() {
147 return HasFragments();
148 }
149
150 private bool SwigDirectorMethodHoldsDelta() {
151 return HoldsDelta();
152 }
153
154 private bool SwigDirectorMethodIsIncremental() {
155 return IsIncremental();
156 }
157
158 private bool SwigDirectorMethodSkipUnchanged(int arg0) {
159 return SkipUnchanged(arg0);
160 }
161
162 private void SwigDirectorMethodOnStart() {
163 OnStart();
164 }
165
166 private bool SwigDirectorMethodMakeOneNeighbor() {
167 return MakeOneNeighbor();
168 }
169
170 private long SwigDirectorMethodModifyValue(long index, long value) {
171 return ModifyValue(index, value);
172 }
173
174 public delegate string SwigDelegateChangeValue_0();
175 public delegate void SwigDelegateChangeValue_1();
176 public delegate void SwigDelegateChangeValue_2(global::System.IntPtr assignment);
177 public delegate void SwigDelegateChangeValue_3();
178 public delegate bool SwigDelegateChangeValue_4();
179 public delegate bool SwigDelegateChangeValue_5();
180 public delegate bool SwigDelegateChangeValue_6();
181 public delegate bool SwigDelegateChangeValue_7(int arg0);
182 public delegate void SwigDelegateChangeValue_8();
183 public delegate bool SwigDelegateChangeValue_9();
184 public delegate long SwigDelegateChangeValue_10(long index, long value);
186 private SwigDelegateChangeValue_0 swigDelegate0;
187 private SwigDelegateChangeValue_1 swigDelegate1;
188 private SwigDelegateChangeValue_2 swigDelegate2;
189 private SwigDelegateChangeValue_3 swigDelegate3;
190 private SwigDelegateChangeValue_4 swigDelegate4;
191 private SwigDelegateChangeValue_5 swigDelegate5;
192 private SwigDelegateChangeValue_6 swigDelegate6;
193 private SwigDelegateChangeValue_7 swigDelegate7;
194 private SwigDelegateChangeValue_8 swigDelegate8;
195 private SwigDelegateChangeValue_9 swigDelegate9;
196 private SwigDelegateChangeValue_10 swigDelegate10;
197
198 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
199 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
200 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment) };
201 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
202 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
203 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
204 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
205 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { typeof(int) };
206 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
207 private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { };
208 private static global::System.Type[] swigMethodTypes10 = new global::System.Type[] { typeof(long), typeof(long) };
209}
210
211}
delegate long SwigDelegateChangeValue_10(long index, long value)
delegate void SwigDelegateChangeValue_2(global::System.IntPtr assignment)
virtual long ModifyValue(long index, long value)
delegate bool SwigDelegateChangeValue_7(int arg0)
static void ChangeValue_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, ChangeValue.SwigDelegateChangeValue_0 delegate0, ChangeValue.SwigDelegateChangeValue_1 delegate1, ChangeValue.SwigDelegateChangeValue_2 delegate2, ChangeValue.SwigDelegateChangeValue_3 delegate3, ChangeValue.SwigDelegateChangeValue_4 delegate4, ChangeValue.SwigDelegateChangeValue_5 delegate5, ChangeValue.SwigDelegateChangeValue_6 delegate6, ChangeValue.SwigDelegateChangeValue_7 delegate7, ChangeValue.SwigDelegateChangeValue_8 delegate8, ChangeValue.SwigDelegateChangeValue_9 delegate9, ChangeValue.SwigDelegateChangeValue_10 delegate10)
static long ChangeValue_ModifyValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3)
static void delete_ChangeValue(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool ChangeValue_MakeOneNeighbor(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool ChangeValue_MakeOneNeighborSwigExplicitChangeValue(global::System.Runtime.InteropServices.HandleRef jarg1)