Google OR-Tools v9.11
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.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 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("Start", swigMethodTypes1))
74 swigDelegate1 = new SwigDelegateChangeValue_1(SwigDirectorMethodStart);
75 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes2))
76 swigDelegate2 = new SwigDelegateChangeValue_2(SwigDirectorMethodReset);
77 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes3))
78 swigDelegate3 = new SwigDelegateChangeValue_3(SwigDirectorMethodHasFragments);
79 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes4))
80 swigDelegate4 = new SwigDelegateChangeValue_4(SwigDirectorMethodHoldsDelta);
81 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes5))
82 swigDelegate5 = new SwigDelegateChangeValue_5(SwigDirectorMethodIsIncremental);
83 if (SwigDerivedClassHasMethod("SkipUnchanged", swigMethodTypes6))
84 swigDelegate6 = new SwigDelegateChangeValue_6(SwigDirectorMethodSkipUnchanged);
85 if (SwigDerivedClassHasMethod("OnStart", swigMethodTypes7))
86 swigDelegate7 = new SwigDelegateChangeValue_7(SwigDirectorMethodOnStart);
87 if (SwigDerivedClassHasMethod("MakeOneNeighbor", swigMethodTypes8))
88 swigDelegate8 = new SwigDelegateChangeValue_8(SwigDirectorMethodMakeOneNeighbor);
89 if (SwigDerivedClassHasMethod("ModifyValue", swigMethodTypes9))
90 swigDelegate9 = new SwigDelegateChangeValue_9(SwigDirectorMethodModifyValue);
91 operations_research_constraint_solverPINVOKE.ChangeValue_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9);
92 }
93
94 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
95 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
96 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
97 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
98 if (methodInfo.DeclaringType == null)
99 continue;
100
101 if (methodInfo.Name != methodName)
102 continue;
103
104 var parameters = methodInfo.GetParameters();
105 if (parameters.Length != methodTypes.Length)
106 continue;
107
108 bool parametersMatch = true;
109 for (var i = 0; i < parameters.Length; i++) {
110 if (parameters[i].ParameterType != methodTypes[i]) {
111 parametersMatch = false;
112 break;
113 }
114 }
115
116 if (!parametersMatch)
117 continue;
118
119 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(ChangeValue))) &&
120 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
121 return true;
122 }
123 }
124
125 return false;
126 }
127
128 private string SwigDirectorMethodToString() {
129 return ToString();
130 }
131
132 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
133 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
134 }
135
136 private void SwigDirectorMethodReset() {
137 Reset();
138 }
139
140 private bool SwigDirectorMethodHasFragments() {
141 return HasFragments();
142 }
143
144 private bool SwigDirectorMethodHoldsDelta() {
145 return HoldsDelta();
146 }
147
148 private bool SwigDirectorMethodIsIncremental() {
149 return IsIncremental();
150 }
151
152 private bool SwigDirectorMethodSkipUnchanged(int index) {
153 return SkipUnchanged(index);
154 }
155
156 private void SwigDirectorMethodOnStart() {
157 OnStart();
158 }
159
160 private bool SwigDirectorMethodMakeOneNeighbor() {
161 return MakeOneNeighbor();
162 }
163
164 private long SwigDirectorMethodModifyValue(long index, long value) {
165 return ModifyValue(index, value);
166 }
167
168 public delegate string SwigDelegateChangeValue_0();
169 public delegate void SwigDelegateChangeValue_1(global::System.IntPtr assignment);
170 public delegate void SwigDelegateChangeValue_2();
171 public delegate bool SwigDelegateChangeValue_3();
172 public delegate bool SwigDelegateChangeValue_4();
173 public delegate bool SwigDelegateChangeValue_5();
174 public delegate bool SwigDelegateChangeValue_6(int index);
175 public delegate void SwigDelegateChangeValue_7();
176 public delegate bool SwigDelegateChangeValue_8();
177 public delegate long SwigDelegateChangeValue_9(long index, long value);
179 private SwigDelegateChangeValue_0 swigDelegate0;
180 private SwigDelegateChangeValue_1 swigDelegate1;
181 private SwigDelegateChangeValue_2 swigDelegate2;
182 private SwigDelegateChangeValue_3 swigDelegate3;
183 private SwigDelegateChangeValue_4 swigDelegate4;
184 private SwigDelegateChangeValue_5 swigDelegate5;
185 private SwigDelegateChangeValue_6 swigDelegate6;
186 private SwigDelegateChangeValue_7 swigDelegate7;
187 private SwigDelegateChangeValue_8 swigDelegate8;
188 private SwigDelegateChangeValue_9 swigDelegate9;
189
190 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
191 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment) };
192 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
193 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
194 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
195 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
196 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { typeof(int) };
197 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
198 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
199 private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { typeof(long), typeof(long) };
200}
201
202}
delegate long SwigDelegateChangeValue_9(long index, long value)
delegate void SwigDelegateChangeValue_1(global::System.IntPtr assignment)
delegate bool SwigDelegateChangeValue_6(int index)
virtual long ModifyValue(long index, long value)
static long ChangeValue_ModifyValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3)
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)
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)