Google OR-Tools v9.9
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.2.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", swigMethodTypes6)) 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", swigMethodTypes3) ? 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("Start", swigMethodTypes1))
87 swigDelegate1 = new SwigDelegateBaseLns_1(SwigDirectorMethodStart);
88 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes2))
89 swigDelegate2 = new SwigDelegateBaseLns_2(SwigDirectorMethodReset);
90 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes3))
91 swigDelegate3 = new SwigDelegateBaseLns_3(SwigDirectorMethodHasFragments);
92 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes4))
93 swigDelegate4 = new SwigDelegateBaseLns_4(SwigDirectorMethodHoldsDelta);
94 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes5))
95 swigDelegate5 = new SwigDelegateBaseLns_5(SwigDirectorMethodIsIncremental);
96 if (SwigDerivedClassHasMethod("InitFragments", swigMethodTypes6))
97 swigDelegate6 = new SwigDelegateBaseLns_6(SwigDirectorMethodInitFragments);
98 if (SwigDerivedClassHasMethod("NextFragment", swigMethodTypes7))
99 swigDelegate7 = new SwigDelegateBaseLns_7(SwigDirectorMethodNextFragment);
100 operations_research_constraint_solverPINVOKE.BaseLns_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7);
101 }
102
103 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
104 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
105 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
106 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
107 if (methodInfo.DeclaringType == null)
108 continue;
109
110 if (methodInfo.Name != methodName)
111 continue;
112
113 var parameters = methodInfo.GetParameters();
114 if (parameters.Length != methodTypes.Length)
115 continue;
116
117 bool parametersMatch = true;
118 for (var i = 0; i < parameters.Length; i++) {
119 if (parameters[i].ParameterType != methodTypes[i]) {
120 parametersMatch = false;
121 break;
122 }
123 }
124
125 if (!parametersMatch)
126 continue;
127
128 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(BaseLns))) &&
129 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
130 return true;
131 }
132 }
133
134 return false;
135 }
136
137 private string SwigDirectorMethodToString() {
138 return ToString();
139 }
140
141 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
142 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
143 }
144
145 private void SwigDirectorMethodReset() {
146 Reset();
147 }
148
149 private bool SwigDirectorMethodHasFragments() {
150 return HasFragments();
151 }
152
153 private bool SwigDirectorMethodHoldsDelta() {
154 return HoldsDelta();
155 }
156
157 private bool SwigDirectorMethodIsIncremental() {
158 return IsIncremental();
159 }
160
161 private void SwigDirectorMethodInitFragments() {
163 }
164
165 private bool SwigDirectorMethodNextFragment() {
166 return NextFragment();
167 }
168
169 public delegate string SwigDelegateBaseLns_0();
170 public delegate void SwigDelegateBaseLns_1(global::System.IntPtr assignment);
171 public delegate void SwigDelegateBaseLns_2();
172 public delegate bool SwigDelegateBaseLns_3();
173 public delegate bool SwigDelegateBaseLns_4();
174 public delegate bool SwigDelegateBaseLns_5();
175 public delegate void SwigDelegateBaseLns_6();
176 public delegate bool SwigDelegateBaseLns_7();
178 private SwigDelegateBaseLns_0 swigDelegate0;
179 private SwigDelegateBaseLns_1 swigDelegate1;
180 private SwigDelegateBaseLns_2 swigDelegate2;
181 private SwigDelegateBaseLns_3 swigDelegate3;
182 private SwigDelegateBaseLns_4 swigDelegate4;
183 private SwigDelegateBaseLns_5 swigDelegate5;
184 private SwigDelegateBaseLns_6 swigDelegate6;
185 private SwigDelegateBaseLns_7 swigDelegate7;
186
187 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
188 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment) };
189 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
190 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
191 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
192 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
193 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
194 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
195}
196
197}
delegate void SwigDelegateBaseLns_1(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)
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)