Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVectorVector.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 IntVectorVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerable<IntVector>
19 {
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 protected bool swigCMemOwn;
22
23 internal IntVectorVector(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(IntVectorVector 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(IntVectorVector 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 ~IntVectorVector() {
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 IntVectorVector(global::System.Collections.IEnumerable c) : this() {
67 if (c == null)
68 throw new global::System.ArgumentNullException("c");
69 foreach (IntVector element in c) {
70 this.Add(element);
71 }
72 }
73
74 public IntVectorVector(global::System.Collections.Generic.IEnumerable<IntVector> c) : this() {
75 if (c == null)
76 throw new global::System.ArgumentNullException("c");
77 foreach (IntVector 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 IntVector 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(IntVector[] array)
133 {
134 CopyTo(0, array, 0, this.Count);
135 }
136
137 public void CopyTo(IntVector[] array, int arrayIndex)
138 {
139 CopyTo(0, array, arrayIndex, this.Count);
140 }
141
142 public void CopyTo(int index, IntVector[] 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 IntVector[] ToArray() {
161 IntVector[] array = new IntVector[this.Count];
162 this.CopyTo(array);
163 return array;
164 }
165
166 global::System.Collections.Generic.IEnumerator<IntVector> global::System.Collections.Generic.IEnumerable<IntVector>.GetEnumerator() {
167 return new IntVectorVectorEnumerator(this);
168 }
169
170 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
171 return new IntVectorVectorEnumerator(this);
172 }
173
174 public IntVectorVectorEnumerator GetEnumerator() {
175 return new IntVectorVectorEnumerator(this);
177
178 // Type-safe enumerator
183 public sealed class IntVectorVectorEnumerator : global::System.Collections.IEnumerator
184 , global::System.Collections.Generic.IEnumerator<IntVector>
186 private IntVectorVector collectionRef;
187 private int currentIndex;
188 private object currentObject;
189 private int currentSize;
190
191 public IntVectorVectorEnumerator(IntVectorVector collection) {
192 collectionRef = collection;
193 currentIndex = -1;
194 currentObject = null;
195 currentSize = collectionRef.Count;
196 }
197
198 // Type-safe iterator Current
199 public IntVector 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 (IntVector)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 IntVectorVector() : this(operations_research_constraint_solverPINVOKE.new_IntVectorVector__SWIG_0(), true) {
245 }
247 public IntVectorVector(IntVectorVector other) : this(operations_research_constraint_solverPINVOKE.new_IntVectorVector__SWIG_1(IntVectorVector.getCPtr(other)), true) {
250
251 public void Clear() {
254
255 public void Add(IntVector x) {
262 return ret;
263 }
264
265 private bool empty() {
266 bool ret = operations_research_constraint_solverPINVOKE.IntVectorVector_empty(swigCPtr);
267 return ret;
268 }
269
270 private uint capacity() {
271 uint ret = operations_research_constraint_solverPINVOKE.IntVectorVector_capacity(swigCPtr);
272 return ret;
273 }
274
275 private void reserve(uint n) {
276 operations_research_constraint_solverPINVOKE.IntVectorVector_reserve(swigCPtr, n);
277 }
278
279 public IntVectorVector(int capacity) : this(operations_research_constraint_solverPINVOKE.new_IntVectorVector__SWIG_2(capacity), true) {
280 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
282
283 private IntVector getitemcopy(int index) {
286 return ret;
287 }
288
289 private IntVector getitem(int index) {
290 IntVector ret = new IntVector(operations_research_constraint_solverPINVOKE.IntVectorVector_getitem(swigCPtr, index), false);
291 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
292 return ret;
293 }
294
295 private void setitem(int index, IntVector val) {
296 operations_research_constraint_solverPINVOKE.IntVectorVector_setitem(swigCPtr, index, IntVector.getCPtr(val));
297 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
298 }
299
300 public void AddRange(IntVectorVector values) {
301 operations_research_constraint_solverPINVOKE.IntVectorVector_AddRange(swigCPtr, IntVectorVector.getCPtr(values));
306 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVectorVector_GetRange(swigCPtr, index, count);
307 IntVectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVectorVector(cPtr, true);
309 return ret;
310 }
311
312 public void Insert(int index, IntVector x) {
333 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVectorVector_Repeat(IntVector.getCPtr(value), count);
334 IntVectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVectorVector(cPtr, true);
336 return ret;
337 }
338
339 public void Reverse() {
342
343 public void Reverse(int index, int count) {
354
355}
void CopyTo(IntVector[] array, int arrayIndex)
void SetRange(int index, IntVectorVector values)
IntVectorVector GetRange(int index, int count)
void InsertRange(int index, IntVectorVector values)
static IntVectorVector Repeat(IntVector value, int count)
static void IntVectorVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static global::System.IntPtr IntVectorVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void IntVectorVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void IntVectorVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static global::System.IntPtr IntVectorVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static uint IntVectorVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVectorVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr IntVectorVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void IntVectorVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void IntVectorVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void IntVectorVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_IntVectorVector(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVectorVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntVectorVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)