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(
"ObjectiveVar", swigMethodTypes25))
160 if (SwigDerivedClassHasMethod(
"MinimizationVar", swigMethodTypes26))
162 if (SwigDerivedClassHasMethod(
"Step", swigMethodTypes27))
164 if (SwigDerivedClassHasMethod(
"Maximize", swigMethodTypes28))
166 if (SwigDerivedClassHasMethod(
"BestValue", swigMethodTypes29))
168 if (SwigDerivedClassHasMethod(
"Size", swigMethodTypes30))
170 if (SwigDerivedClassHasMethod(
"Name", swigMethodTypes31))
172 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, swigDelegate26, swigDelegate27, swigDelegate28, swigDelegate29, swigDelegate30, swigDelegate31);
175 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
176 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
177 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
178 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
179 if (methodInfo.DeclaringType ==
null)
182 if (methodInfo.Name != methodName)
185 var parameters = methodInfo.GetParameters();
186 if (parameters.Length != methodTypes.Length)
189 bool parametersMatch =
true;
190 for (var i = 0; i < parameters.Length; i++) {
191 if (parameters[i].ParameterType != methodTypes[i]) {
192 parametersMatch =
false;
197 if (!parametersMatch)
200 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(OptimizeVar))) &&
201 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
209 private string SwigDirectorMethodToString() {
213 private void SwigDirectorMethodEnterSearch() {
217 private void SwigDirectorMethodRestartSearch() {
221 private void SwigDirectorMethodExitSearch() {
225 private void SwigDirectorMethodBeginNextDecision(global::System.IntPtr db) {
226 BeginNextDecision((db == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(db,
false));
229 private void SwigDirectorMethodEndNextDecision(global::System.IntPtr b, global::System.IntPtr d) {
230 EndNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false), (d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
233 private void SwigDirectorMethodApplyDecision(global::System.IntPtr d) {
234 ApplyDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
237 private void SwigDirectorMethodRefuteDecision(global::System.IntPtr d) {
238 RefuteDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
241 private void SwigDirectorMethodAfterDecision(global::System.IntPtr d,
bool apply) {
242 AfterDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false), apply);
245 private void SwigDirectorMethodBeginFail() {
249 private void SwigDirectorMethodEndFail() {
253 private void SwigDirectorMethodBeginInitialPropagation() {
257 private void SwigDirectorMethodEndInitialPropagation() {
261 private bool SwigDirectorMethodAcceptSolution() {
265 private bool SwigDirectorMethodAtSolution() {
269 private void SwigDirectorMethodNoMoreSolutions() {
273 private bool SwigDirectorMethodLocalOptimum() {
277 private bool SwigDirectorMethodAcceptDelta(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
278 return AcceptDelta((delta == global::System.IntPtr.Zero) ?
null :
new Assignment(delta,
false), (deltadelta == global::System.IntPtr.Zero) ?
null :
new Assignment(deltadelta,
false));
281 private void SwigDirectorMethodAcceptNeighbor() {
285 private void SwigDirectorMethodAcceptUncheckedNeighbor() {
289 private bool SwigDirectorMethodIsUncheckedSolutionLimitReached() {
293 private void SwigDirectorMethodPeriodicCheck() {
297 private int SwigDirectorMethodProgressPercent() {
301 private void SwigDirectorMethodAccept(global::System.IntPtr visitor) {
302 Accept((visitor == global::System.IntPtr.Zero) ?
null :
new ModelVisitor(visitor,
false));
305 private void SwigDirectorMethodInstall() {
309 private global::System.IntPtr SwigDirectorMethodObjectiveVar(
int index) {
313 private global::System.IntPtr SwigDirectorMethodMinimizationVar(
int index) {
317 private long SwigDirectorMethodStep(
int index) {
321 private bool SwigDirectorMethodMaximize(
int index) {
325 private long SwigDirectorMethodBestValue(
int index) {
329 private int SwigDirectorMethodSize() {
333 private string SwigDirectorMethodName() {
403 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };
404 private static global::System.Type[] swigMethodTypes1 =
new global::System.Type[] { };
405 private static global::System.Type[] swigMethodTypes2 =
new global::System.Type[] { };
406 private static global::System.Type[] swigMethodTypes3 =
new global::System.Type[] { };
407 private static global::System.Type[] swigMethodTypes4 =
new global::System.Type[] { typeof(DecisionBuilder) };
408 private static global::System.Type[] swigMethodTypes5 =
new global::System.Type[] { typeof(DecisionBuilder), typeof(Decision) };
409 private static global::System.Type[] swigMethodTypes6 =
new global::System.Type[] { typeof(Decision) };
410 private static global::System.Type[] swigMethodTypes7 =
new global::System.Type[] { typeof(Decision) };
411 private static global::System.Type[] swigMethodTypes8 =
new global::System.Type[] { typeof(Decision), typeof(
bool) };
412 private static global::System.Type[] swigMethodTypes9 =
new global::System.Type[] { };
413 private static global::System.Type[] swigMethodTypes10 =
new global::System.Type[] { };
414 private static global::System.Type[] swigMethodTypes11 =
new global::System.Type[] { };
415 private static global::System.Type[] swigMethodTypes12 =
new global::System.Type[] { };
416 private static global::System.Type[] swigMethodTypes13 =
new global::System.Type[] { };
417 private static global::System.Type[] swigMethodTypes14 =
new global::System.Type[] { };
418 private static global::System.Type[] swigMethodTypes15 =
new global::System.Type[] { };
419 private static global::System.Type[] swigMethodTypes16 =
new global::System.Type[] { };
420 private static global::System.Type[] swigMethodTypes17 =
new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
421 private static global::System.Type[] swigMethodTypes18 =
new global::System.Type[] { };
422 private static global::System.Type[] swigMethodTypes19 =
new global::System.Type[] { };
423 private static global::System.Type[] swigMethodTypes20 =
new global::System.Type[] { };
424 private static global::System.Type[] swigMethodTypes21 =
new global::System.Type[] { };
425 private static global::System.Type[] swigMethodTypes22 =
new global::System.Type[] { };
426 private static global::System.Type[] swigMethodTypes23 =
new global::System.Type[] { typeof(ModelVisitor) };
427 private static global::System.Type[] swigMethodTypes24 =
new global::System.Type[] { };
428 private static global::System.Type[] swigMethodTypes25 =
new global::System.Type[] { typeof(
int) };
429 private static global::System.Type[] swigMethodTypes26 =
new global::System.Type[] { typeof(
int) };
430 private static global::System.Type[] swigMethodTypes27 =
new global::System.Type[] { typeof(
int) };
431 private static global::System.Type[] swigMethodTypes28 =
new global::System.Type[] { typeof(
int) };
432 private static global::System.Type[] swigMethodTypes29 =
new global::System.Type[] { typeof(
int) };
433 private static global::System.Type[] swigMethodTypes30 =
new global::System.Type[] { };
434 private static global::System.Type[] swigMethodTypes31 =
new global::System.Type[] { };