Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
BaseLns.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 BaseLns : IntVarLocalSearchOperator {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal BaseLns(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.BaseLns_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseLns 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(BaseLns 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 BaseLns(IntVarVector vars) : this(operations_research_constraint_solverPINVOKE.new_BaseLns(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 void InitFragments() {
61 if (SwigDerivedClassHasMethod("InitFragments", swigMethodTypes7)) operations_research_constraint_solverPINVOKE.BaseLns_InitFragmentsSwigExplicitBaseLns(swigCPtr); else operations_research_constraint_solverPINVOKE.BaseLns_InitFragments(swigCPtr);
62 }
63
64 public virtual bool NextFragment() {
66 return ret;
67 }
68
69 public void AppendToFragment(int index) {
71 }
72
73 public int FragmentSize() {
75 return ret;
76 }
77
78 public override bool HasFragments() {
79 bool ret = (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes4) ? operations_research_constraint_solverPINVOKE.BaseLns_HasFragmentsSwigExplicitBaseLns(swigCPtr) : operations_research_constraint_solverPINVOKE.BaseLns_HasFragments(swigCPtr));
80 return ret;
81 }
82
83 private void SwigDirectorConnect() {
84 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
85 swigDelegate0 = new SwigDelegateBaseLns_0(SwigDirectorMethodToString);
86 if (SwigDerivedClassHasMethod("EnterSearch", swigMethodTypes1))
87 swigDelegate1 = new SwigDelegateBaseLns_1(SwigDirectorMethodEnterSearch);
88 if (SwigDerivedClassHasMethod("Start", swigMethodTypes2))
89 swigDelegate2 = new SwigDelegateBaseLns_2(SwigDirectorMethodStart);
90 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes3))
91 swigDelegate3 = new SwigDelegateBaseLns_3(SwigDirectorMethodReset);
92 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes4))
93 swigDelegate4 = new SwigDelegateBaseLns_4(SwigDirectorMethodHasFragments);
94 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes5))
95 swigDelegate5 = new SwigDelegateBaseLns_5(SwigDirectorMethodHoldsDelta);
96 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes6))
97 swigDelegate6 = new SwigDelegateBaseLns_6(SwigDirectorMethodIsIncremental);
98 if (SwigDerivedClassHasMethod("InitFragments", swigMethodTypes7))
99 swigDelegate7 = new SwigDelegateBaseLns_7(SwigDirectorMethodInitFragments);
100 if (SwigDerivedClassHasMethod("NextFragment", swigMethodTypes8))
101 swigDelegate8 = new SwigDelegateBaseLns_8(SwigDirectorMethodNextFragment);
102 operations_research_constraint_solverPINVOKE.BaseLns_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8);
103 }
104
105 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
106 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
107 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
108 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
109 if (methodInfo.DeclaringType == null)
110 continue;
111
112 if (methodInfo.Name != methodName)
113 continue;
114
115 var parameters = methodInfo.GetParameters();
116 if (parameters.Length != methodTypes.Length)
117 continue;
118
119 bool parametersMatch = true;
120 for (var i = 0; i < parameters.Length; i++) {
121 if (parameters[i].ParameterType != methodTypes[i]) {
122 parametersMatch = false;
123 break;
124 }
125 }
126
127 if (!parametersMatch)
128 continue;
129
130 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(BaseLns))) &&
131 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
132 return true;
133 }
134 }
135
136 return false;
137 }
138
139 private string SwigDirectorMethodToString() {
140 return ToString();
141 }
142
143 private void SwigDirectorMethodEnterSearch() {
144 EnterSearch();
145 }
146
147 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
148 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
149 }
150
151 private void SwigDirectorMethodReset() {
152 Reset();
153 }
154
155 private bool SwigDirectorMethodHasFragments() {
156 return HasFragments();
157 }
158
159 private bool SwigDirectorMethodHoldsDelta() {
160 return HoldsDelta();
161 }
162
163 private bool SwigDirectorMethodIsIncremental() {
164 return IsIncremental();
165 }
166
167 private void SwigDirectorMethodInitFragments() {
169 }
170
171 private bool SwigDirectorMethodNextFragment() {
172 return NextFragment();
173 }
174
175 public delegate string SwigDelegateBaseLns_0();
176 public delegate void SwigDelegateBaseLns_1();
177 public delegate void SwigDelegateBaseLns_2(global::System.IntPtr assignment);
178 public delegate void SwigDelegateBaseLns_3();
179 public delegate bool SwigDelegateBaseLns_4();
180 public delegate bool SwigDelegateBaseLns_5();
181 public delegate bool SwigDelegateBaseLns_6();
182 public delegate void SwigDelegateBaseLns_7();
183 public delegate bool SwigDelegateBaseLns_8();
185 private SwigDelegateBaseLns_0 swigDelegate0;
186 private SwigDelegateBaseLns_1 swigDelegate1;
187 private SwigDelegateBaseLns_2 swigDelegate2;
188 private SwigDelegateBaseLns_3 swigDelegate3;
189 private SwigDelegateBaseLns_4 swigDelegate4;
190 private SwigDelegateBaseLns_5 swigDelegate5;
191 private SwigDelegateBaseLns_6 swigDelegate6;
192 private SwigDelegateBaseLns_7 swigDelegate7;
193 private SwigDelegateBaseLns_8 swigDelegate8;
194
195 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
196 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
197 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment) };
198 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
199 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
200 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
201 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
202 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
203 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
204}
205
206}
delegate void SwigDelegateBaseLns_2(global::System.IntPtr assignment)
static void BaseLns_InitFragmentsSwigExplicitBaseLns(global::System.Runtime.InteropServices.HandleRef jarg1)
static int BaseLns_FragmentSize(global::System.Runtime.InteropServices.HandleRef jarg1)
static void BaseLns_AppendToFragment(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool BaseLns_HasFragmentsSwigExplicitBaseLns(global::System.Runtime.InteropServices.HandleRef jarg1)
static void BaseLns_InitFragments(global::System.Runtime.InteropServices.HandleRef jarg1)
static void BaseLns_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, BaseLns.SwigDelegateBaseLns_0 delegate0, BaseLns.SwigDelegateBaseLns_1 delegate1, BaseLns.SwigDelegateBaseLns_2 delegate2, BaseLns.SwigDelegateBaseLns_3 delegate3, BaseLns.SwigDelegateBaseLns_4 delegate4, BaseLns.SwigDelegateBaseLns_5 delegate5, BaseLns.SwigDelegateBaseLns_6 delegate6, BaseLns.SwigDelegateBaseLns_7 delegate7, BaseLns.SwigDelegateBaseLns_8 delegate8)
static bool BaseLns_NextFragment(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool BaseLns_HasFragments(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_BaseLns(global::System.Runtime.InteropServices.HandleRef jarg1)