22 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
OptimizeVar obj) {
26 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(OptimizeVar obj) {
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;
38 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
42 protected override void Dispose(
bool disposing) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
49 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
51 base.Dispose(disposing);
55 public OptimizeVar(Solver
solver,
bool maximize, IntVar var,
long step) : this(operations_research_constraint_solverPINVOKE.new_OptimizeVar__SWIG_0(Solver.getCPtr(
solver), maximize, IntVar.getCPtr(var), step), true) {
56 SwigDirectorConnect();
61 SwigDirectorConnect();
71 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
93 public virtual string Name() {
107 private void SwigDirectorConnect() {
108 if (SwigDerivedClassHasMethod(
"ToString", swigMethodTypes0))
110 if (SwigDerivedClassHasMethod(
"EnterSearch", swigMethodTypes1))
112 if (SwigDerivedClassHasMethod(
"RestartSearch", swigMethodTypes2))
114 if (SwigDerivedClassHasMethod(
"ExitSearch", swigMethodTypes3))
116 if (SwigDerivedClassHasMethod(
"BeginNextDecision", swigMethodTypes4))
118 if (SwigDerivedClassHasMethod(
"EndNextDecision", swigMethodTypes5))
120 if (SwigDerivedClassHasMethod(
"ApplyDecision", swigMethodTypes6))
122 if (SwigDerivedClassHasMethod(
"RefuteDecision", swigMethodTypes7))
124 if (SwigDerivedClassHasMethod(
"AfterDecision", swigMethodTypes8))
126 if (SwigDerivedClassHasMethod(
"BeginFail", swigMethodTypes9))
128 if (SwigDerivedClassHasMethod(
"EndFail", swigMethodTypes10))
130 if (SwigDerivedClassHasMethod(
"BeginInitialPropagation", swigMethodTypes11))
132 if (SwigDerivedClassHasMethod(
"EndInitialPropagation", swigMethodTypes12))
134 if (SwigDerivedClassHasMethod(
"AcceptSolution", swigMethodTypes13))
136 if (SwigDerivedClassHasMethod(
"AtSolution", swigMethodTypes14))
138 if (SwigDerivedClassHasMethod(
"NoMoreSolutions", swigMethodTypes15))
140 if (SwigDerivedClassHasMethod(
"LocalOptimum", swigMethodTypes16))
142 if (SwigDerivedClassHasMethod(
"AcceptDelta", swigMethodTypes17))
144 if (SwigDerivedClassHasMethod(
"AcceptNeighbor", swigMethodTypes18))
146 if (SwigDerivedClassHasMethod(
"AcceptUncheckedNeighbor", swigMethodTypes19))
148 if (SwigDerivedClassHasMethod(
"IsUncheckedSolutionLimitReached", swigMethodTypes20))
150 if (SwigDerivedClassHasMethod(
"PeriodicCheck", swigMethodTypes21))
152 if (SwigDerivedClassHasMethod(
"ProgressPercent", swigMethodTypes22))
154 if (SwigDerivedClassHasMethod(
"Accept", swigMethodTypes23))
156 if (SwigDerivedClassHasMethod(
"Install", swigMethodTypes24))
158 if (SwigDerivedClassHasMethod(
"Name", swigMethodTypes25))
160 operations_research_constraint_solverPINVOKE.
OptimizeVar_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15, swigDelegate16, swigDelegate17, swigDelegate18, swigDelegate19, swigDelegate20, swigDelegate21, swigDelegate22, swigDelegate23, swigDelegate24, swigDelegate25);
163 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
164 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
165 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
166 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
167 if (methodInfo.DeclaringType ==
null)
170 if (methodInfo.Name != methodName)
173 var parameters = methodInfo.GetParameters();
174 if (parameters.Length != methodTypes.Length)
177 bool parametersMatch =
true;
178 for (var i = 0; i < parameters.Length; i++) {
179 if (parameters[i].ParameterType != methodTypes[i]) {
180 parametersMatch =
false;
185 if (!parametersMatch)
188 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(OptimizeVar))) &&
189 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
197 private string SwigDirectorMethodToString() {
201 private void SwigDirectorMethodEnterSearch() {
205 private void SwigDirectorMethodRestartSearch() {
209 private void SwigDirectorMethodExitSearch() {
213 private void SwigDirectorMethodBeginNextDecision(global::System.IntPtr db) {
214 BeginNextDecision((db == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(db,
false));
217 private void SwigDirectorMethodEndNextDecision(global::System.IntPtr b, global::System.IntPtr d) {
218 EndNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false), (d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
221 private void SwigDirectorMethodApplyDecision(global::System.IntPtr d) {
222 ApplyDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
225 private void SwigDirectorMethodRefuteDecision(global::System.IntPtr d) {
226 RefuteDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
229 private void SwigDirectorMethodAfterDecision(global::System.IntPtr d,
bool apply) {
230 AfterDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false), apply);
233 private void SwigDirectorMethodBeginFail() {
237 private void SwigDirectorMethodEndFail() {
241 private void SwigDirectorMethodBeginInitialPropagation() {
245 private void SwigDirectorMethodEndInitialPropagation() {
249 private bool SwigDirectorMethodAcceptSolution() {
253 private bool SwigDirectorMethodAtSolution() {
257 private void SwigDirectorMethodNoMoreSolutions() {
261 private bool SwigDirectorMethodLocalOptimum() {
265 private bool SwigDirectorMethodAcceptDelta(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
266 return AcceptDelta((delta == global::System.IntPtr.Zero) ?
null :
new Assignment(delta,
false), (deltadelta == global::System.IntPtr.Zero) ?
null :
new Assignment(deltadelta,
false));
269 private void SwigDirectorMethodAcceptNeighbor() {
273 private void SwigDirectorMethodAcceptUncheckedNeighbor() {
277 private bool SwigDirectorMethodIsUncheckedSolutionLimitReached() {
281 private void SwigDirectorMethodPeriodicCheck() {
285 private int SwigDirectorMethodProgressPercent() {
289 private void SwigDirectorMethodAccept(global::System.IntPtr visitor) {
290 Accept((visitor == global::System.IntPtr.Zero) ?
null :
new ModelVisitor(visitor,
false));
293 private void SwigDirectorMethodInstall() {
297 private string SwigDirectorMethodName() {
355 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };
356 private static global::System.Type[] swigMethodTypes1 =
new global::System.Type[] { };
357 private static global::System.Type[] swigMethodTypes2 =
new global::System.Type[] { };
358 private static global::System.Type[] swigMethodTypes3 =
new global::System.Type[] { };
359 private static global::System.Type[] swigMethodTypes4 =
new global::System.Type[] { typeof(DecisionBuilder) };
360 private static global::System.Type[] swigMethodTypes5 =
new global::System.Type[] { typeof(DecisionBuilder), typeof(Decision) };
361 private static global::System.Type[] swigMethodTypes6 =
new global::System.Type[] { typeof(Decision) };
362 private static global::System.Type[] swigMethodTypes7 =
new global::System.Type[] { typeof(Decision) };
363 private static global::System.Type[] swigMethodTypes8 =
new global::System.Type[] { typeof(Decision), typeof(
bool) };
364 private static global::System.Type[] swigMethodTypes9 =
new global::System.Type[] { };
365 private static global::System.Type[] swigMethodTypes10 =
new global::System.Type[] { };
366 private static global::System.Type[] swigMethodTypes11 =
new global::System.Type[] { };
367 private static global::System.Type[] swigMethodTypes12 =
new global::System.Type[] { };
368 private static global::System.Type[] swigMethodTypes13 =
new global::System.Type[] { };
369 private static global::System.Type[] swigMethodTypes14 =
new global::System.Type[] { };
370 private static global::System.Type[] swigMethodTypes15 =
new global::System.Type[] { };
371 private static global::System.Type[] swigMethodTypes16 =
new global::System.Type[] { };
372 private static global::System.Type[] swigMethodTypes17 =
new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
373 private static global::System.Type[] swigMethodTypes18 =
new global::System.Type[] { };
374 private static global::System.Type[] swigMethodTypes19 =
new global::System.Type[] { };
375 private static global::System.Type[] swigMethodTypes20 =
new global::System.Type[] { };
376 private static global::System.Type[] swigMethodTypes21 =
new global::System.Type[] { };
377 private static global::System.Type[] swigMethodTypes22 =
new global::System.Type[] { };
378 private static global::System.Type[] swigMethodTypes23 =
new global::System.Type[] { typeof(ModelVisitor) };
379 private static global::System.Type[] swigMethodTypes24 =
new global::System.Type[] { };
380 private static global::System.Type[] swigMethodTypes25 =
new global::System.Type[] { };