Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SymmetryBreakerVector.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 SymmetryBreakerVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<SymmetryBreaker>
19 {
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 protected bool swigCMemOwn;
22
23 internal SymmetryBreakerVector(global::System.IntPtr cPtr, bool cMemoryOwn) {
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26 }
27
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SymmetryBreakerVector obj) {
29 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30 }
31
32 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(SymmetryBreakerVector obj) {
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
36 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.Dispose();
39 return ptr;
40 } else {
41 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
42 }
43 }
44
45 ~SymmetryBreakerVector() {
46 Dispose(false);
47 }
48
49 public void Dispose() {
50 Dispose(true);
51 global::System.GC.SuppressFinalize(this);
52 }
53
54 protected virtual void Dispose(bool disposing) {
55 lock(this) {
56 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
57 if (swigCMemOwn) {
58 swigCMemOwn = false;
60 }
61 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 }
63 }
64 }
65
66 public SymmetryBreakerVector(global::System.Collections.IEnumerable c) : this() {
67 if (c == null)
68 throw new global::System.ArgumentNullException("c");
69 foreach (SymmetryBreaker element in c) {
70 this.Add(element);
71 }
72 }
73
74 public SymmetryBreakerVector(global::System.Collections.Generic.IEnumerable<SymmetryBreaker> c) : this() {
75 if (c == null)
76 throw new global::System.ArgumentNullException("c");
77 foreach (SymmetryBreaker element in c) {
78 this.Add(element);
79 }
80 }
81
82 public bool IsFixedSize {
83 get {
84 return false;
85 }
86 }
87
88 public bool IsReadOnly {
89 get {
90 return false;
91 }
92 }
93
94 public SymmetryBreaker this[int index] {
95 get {
96 return getitem(index);
97 }
98 set {
99 setitem(index, value);
100 }
101 }
102
103 public int Capacity {
104 get {
105 return (int)capacity();
106 }
107 set {
108 if (value < 0 || (uint)value < size())
109 throw new global::System.ArgumentOutOfRangeException("Capacity");
110 reserve((uint)value);
111 }
112 }
113
114 public bool IsEmpty {
115 get {
116 return empty();
117 }
118 }
119
120 public int Count {
121 get {
122 return (int)size();
123 }
124 }
125
126 public bool IsSynchronized {
127 get {
128 return false;
129 }
130 }
131
132 public void CopyTo(SymmetryBreaker[] array)
133 {
134 CopyTo(0, array, 0, this.Count);
135 }
136
137 public void CopyTo(SymmetryBreaker[] array, int arrayIndex)
138 {
139 CopyTo(0, array, arrayIndex, this.Count);
140 }
141
142 public void CopyTo(int index, SymmetryBreaker[] array, int arrayIndex, int count)
143 {
144 if (array == null)
145 throw new global::System.ArgumentNullException("array");
146 if (index < 0)
147 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
148 if (arrayIndex < 0)
149 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
150 if (count < 0)
151 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
152 if (array.Rank > 1)
153 throw new global::System.ArgumentException("Multi dimensional array.", "array");
154 if (index+count > this.Count || arrayIndex+count > array.Length)
155 throw new global::System.ArgumentException("Number of elements to copy is too large.");
156 for (int i=0; i<count; i++)
157 array.SetValue(getitemcopy(index+i), arrayIndex+i);
158 }
159
160 public SymmetryBreaker[] ToArray() {
161 SymmetryBreaker[] array = new SymmetryBreaker[this.Count];
162 this.CopyTo(array);
163 return array;
164 }
165
166 global::System.Collections.Generic.IEnumerator<SymmetryBreaker> global::System.Collections.Generic.IEnumerable<SymmetryBreaker>.GetEnumerator() {
167 return new SymmetryBreakerVectorEnumerator(this);
168 }
169
170 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
171 return new SymmetryBreakerVectorEnumerator(this);
172 }
173
174 public SymmetryBreakerVectorEnumerator GetEnumerator() {
175 return new SymmetryBreakerVectorEnumerator(this);
177
178 // Type-safe enumerator
183 public sealed class SymmetryBreakerVectorEnumerator : global::System.Collections.IEnumerator
184 , global::System.Collections.Generic.IEnumerator<SymmetryBreaker>
186 private SymmetryBreakerVector collectionRef;
187 private int currentIndex;
188 private object currentObject;
189 private int currentSize;
190
192 collectionRef = collection;
193 currentIndex = -1;
194 currentObject = null;
195 currentSize = collectionRef.Count;
196 }
197
198 // Type-safe iterator Current
199 public SymmetryBreaker Current {
200 get {
201 if (currentIndex == -1)
202 throw new global::System.InvalidOperationException("Enumeration not started.");
203 if (currentIndex > currentSize - 1)
204 throw new global::System.InvalidOperationException("Enumeration finished.");
205 if (currentObject == null)
206 throw new global::System.InvalidOperationException("Collection modified.");
207 return (SymmetryBreaker)currentObject;
208 }
209 }
210
211 // Type-unsafe IEnumerator.Current
212 object global::System.Collections.IEnumerator.Current {
213 get {
214 return Current;
215 }
216 }
217
218 public bool MoveNext() {
219 int size = collectionRef.Count;
220 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
221 if (moveOkay) {
222 currentIndex++;
223 currentObject = collectionRef[currentIndex];
224 } else {
225 currentObject = null;
226 }
227 return moveOkay;
228 }
229
230 public void Reset() {
231 currentIndex = -1;
232 currentObject = null;
233 if (collectionRef.Count != currentSize) {
234 throw new global::System.InvalidOperationException("Collection modified.");
235 }
236 }
237
238 public void Dispose() {
239 currentIndex = -1;
240 currentObject = null;
241 }
242 }
243
244 public SymmetryBreakerVector() : this(operations_research_constraint_solverPINVOKE.new_SymmetryBreakerVector__SWIG_0(), true) {
245 }
247 public SymmetryBreakerVector(SymmetryBreakerVector other) : this(operations_research_constraint_solverPINVOKE.new_SymmetryBreakerVector__SWIG_1(SymmetryBreakerVector.getCPtr(other)), true) {
250
251 public void Clear() {
254
255 public void Add(SymmetryBreaker x) {
258
259 private uint size() {
261 return ret;
262 }
263
264 private bool empty() {
265 bool ret = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_empty(swigCPtr);
266 return ret;
267 }
268
269 private uint capacity() {
270 uint ret = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_capacity(swigCPtr);
271 return ret;
272 }
273
274 private void reserve(uint n) {
275 operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_reserve(swigCPtr, n);
276 }
277
278 public SymmetryBreakerVector(int capacity) : this(operations_research_constraint_solverPINVOKE.new_SymmetryBreakerVector__SWIG_2(capacity), true) {
279 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
281
282 private SymmetryBreaker getitemcopy(int index) {
283 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_getitemcopy(swigCPtr, index);
284 SymmetryBreaker ret = (cPtr == global::System.IntPtr.Zero) ? null : new SymmetryBreaker(cPtr, false);
286 return ret;
287 }
288
289 private SymmetryBreaker getitem(int index) {
290 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_getitem(swigCPtr, index);
291 SymmetryBreaker ret = (cPtr == global::System.IntPtr.Zero) ? null : new SymmetryBreaker(cPtr, false);
292 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
293 return ret;
294 }
295
296 private void setitem(int index, SymmetryBreaker val) {
297 operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_setitem(swigCPtr, index, SymmetryBreaker.getCPtr(val));
298 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
299 }
300
301 public void AddRange(SymmetryBreakerVector values) {
302 operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_AddRange(swigCPtr, SymmetryBreakerVector.getCPtr(values));
307 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_GetRange(swigCPtr, index, count);
308 SymmetryBreakerVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SymmetryBreakerVector(cPtr, true);
310 return ret;
311 }
312
313 public void Insert(int index, SymmetryBreaker x) {
334 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SymmetryBreakerVector_Repeat(SymmetryBreaker.getCPtr(value), count);
335 SymmetryBreakerVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new SymmetryBreakerVector(cPtr, true);
337 return ret;
338 }
339
340 public void Reverse() {
343
344 public void Reverse(int index, int count) {
356 return ret;
357 }
358
359 public int IndexOf(SymmetryBreaker value) {
361 return ret;
362 }
363
364 public int LastIndexOf(SymmetryBreaker value) {
366 return ret;
367 }
368
369 public bool Remove(SymmetryBreaker value) {
371 return ret;
372 }
373
374}
375
376}
void InsertRange(int index, SymmetryBreakerVector values)
void CopyTo(SymmetryBreaker[] array, int arrayIndex)
void SetRange(int index, SymmetryBreakerVector values)
SymmetryBreakerVector GetRange(int index, int count)
static SymmetryBreakerVector Repeat(SymmetryBreaker value, int count)
static global::System.IntPtr SymmetryBreakerVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void SymmetryBreakerVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void SymmetryBreakerVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void SymmetryBreakerVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static int SymmetryBreakerVector_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void SymmetryBreakerVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool SymmetryBreakerVector_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static uint SymmetryBreakerVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void SymmetryBreakerVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr SymmetryBreakerVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr SymmetryBreakerVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void SymmetryBreakerVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static int SymmetryBreakerVector_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void delete_SymmetryBreakerVector(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool SymmetryBreakerVector_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void SymmetryBreakerVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void SymmetryBreakerVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void SymmetryBreakerVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)