Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Int64VectorVector.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
11namespace Google.OrTools.Util {
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16
17public partial class Int64VectorVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerable<Int64Vector>
18 {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
21
22 internal Int64VectorVector(global::System.IntPtr cPtr, bool cMemoryOwn) {
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25 }
26
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Int64VectorVector obj) {
28 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 }
30
31 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(Int64VectorVector obj) {
32 if (obj != null) {
33 if (!obj.swigCMemOwn)
34 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
35 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
36 obj.swigCMemOwn = false;
37 obj.Dispose();
38 return ptr;
39 } else {
40 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 }
42 }
43
44 ~Int64VectorVector() {
45 Dispose(false);
46 }
47
48 public void Dispose() {
49 Dispose(true);
50 global::System.GC.SuppressFinalize(this);
51 }
52
53 protected virtual void Dispose(bool disposing) {
54 lock(this) {
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56 if (swigCMemOwn) {
57 swigCMemOwn = false;
59 }
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 }
62 }
63 }
64
65 public Int64VectorVector(global::System.Collections.IEnumerable c) : this() {
66 if (c == null)
67 throw new global::System.ArgumentNullException("c");
68 foreach (Int64Vector element in c) {
69 this.Add(element);
70 }
71 }
72
73 public Int64VectorVector(global::System.Collections.Generic.IEnumerable<Int64Vector> c) : this() {
74 if (c == null)
75 throw new global::System.ArgumentNullException("c");
76 foreach (Int64Vector element in c) {
77 this.Add(element);
78 }
79 }
80
81 public bool IsFixedSize {
82 get {
83 return false;
84 }
85 }
86
87 public bool IsReadOnly {
88 get {
89 return false;
90 }
91 }
92
93 public Int64Vector this[int index] {
94 get {
95 return getitem(index);
96 }
97 set {
98 setitem(index, value);
99 }
100 }
101
102 public int Capacity {
103 get {
104 return (int)capacity();
105 }
106 set {
107 if (value < 0 || (uint)value < size())
108 throw new global::System.ArgumentOutOfRangeException("Capacity");
109 reserve((uint)value);
110 }
111 }
112
113 public bool IsEmpty {
114 get {
115 return empty();
116 }
117 }
118
119 public int Count {
120 get {
121 return (int)size();
122 }
123 }
124
125 public bool IsSynchronized {
126 get {
127 return false;
128 }
129 }
130
131 public void CopyTo(Int64Vector[] array)
132 {
133 CopyTo(0, array, 0, this.Count);
134 }
135
136 public void CopyTo(Int64Vector[] array, int arrayIndex)
137 {
138 CopyTo(0, array, arrayIndex, this.Count);
139 }
140
141 public void CopyTo(int index, Int64Vector[] array, int arrayIndex, int count)
142 {
143 if (array == null)
144 throw new global::System.ArgumentNullException("array");
145 if (index < 0)
146 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
147 if (arrayIndex < 0)
148 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
149 if (count < 0)
150 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
151 if (array.Rank > 1)
152 throw new global::System.ArgumentException("Multi dimensional array.", "array");
153 if (index+count > this.Count || arrayIndex+count > array.Length)
154 throw new global::System.ArgumentException("Number of elements to copy is too large.");
155 for (int i=0; i<count; i++)
156 array.SetValue(getitemcopy(index+i), arrayIndex+i);
157 }
158
159 public Int64Vector[] ToArray() {
160 Int64Vector[] array = new Int64Vector[this.Count];
161 this.CopyTo(array);
162 return array;
163 }
164
165 global::System.Collections.Generic.IEnumerator<Int64Vector> global::System.Collections.Generic.IEnumerable<Int64Vector>.GetEnumerator() {
166 return new Int64VectorVectorEnumerator(this);
167 }
168
169 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
170 return new Int64VectorVectorEnumerator(this);
171 }
172
173 public Int64VectorVectorEnumerator GetEnumerator() {
174 return new Int64VectorVectorEnumerator(this);
176
177 // Type-safe enumerator
182 public sealed class Int64VectorVectorEnumerator : global::System.Collections.IEnumerator
183 , global::System.Collections.Generic.IEnumerator<Int64Vector>
185 private Int64VectorVector collectionRef;
186 private int currentIndex;
187 private object currentObject;
188 private int currentSize;
189
191 collectionRef = collection;
192 currentIndex = -1;
193 currentObject = null;
194 currentSize = collectionRef.Count;
195 }
196
197 // Type-safe iterator Current
198 public Int64Vector Current {
199 get {
200 if (currentIndex == -1)
201 throw new global::System.InvalidOperationException("Enumeration not started.");
202 if (currentIndex > currentSize - 1)
203 throw new global::System.InvalidOperationException("Enumeration finished.");
204 if (currentObject == null)
205 throw new global::System.InvalidOperationException("Collection modified.");
206 return (Int64Vector)currentObject;
207 }
208 }
209
210 // Type-unsafe IEnumerator.Current
211 object global::System.Collections.IEnumerator.Current {
212 get {
213 return Current;
214 }
215 }
216
217 public bool MoveNext() {
218 int size = collectionRef.Count;
219 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
220 if (moveOkay) {
221 currentIndex++;
222 currentObject = collectionRef[currentIndex];
223 } else {
224 currentObject = null;
225 }
226 return moveOkay;
227 }
228
229 public void Reset() {
230 currentIndex = -1;
231 currentObject = null;
232 if (collectionRef.Count != currentSize) {
233 throw new global::System.InvalidOperationException("Collection modified.");
234 }
235 }
236
237 public void Dispose() {
238 currentIndex = -1;
239 currentObject = null;
240 }
241 }
242
243 public Int64VectorVector() : this(operations_research_utilPINVOKE.new_Int64VectorVector__SWIG_0(), true) {
244 }
246 public Int64VectorVector(Int64VectorVector other) : this(operations_research_utilPINVOKE.new_Int64VectorVector__SWIG_1(Int64VectorVector.getCPtr(other)), true) {
249
250 public void Clear() {
253
254 public void Add(Int64Vector x) {
261 return ret;
262 }
263
264 private bool empty() {
265 bool ret = operations_research_utilPINVOKE.Int64VectorVector_empty(swigCPtr);
266 return ret;
267 }
268
269 private uint capacity() {
270 uint ret = operations_research_utilPINVOKE.Int64VectorVector_capacity(swigCPtr);
271 return ret;
272 }
273
274 private void reserve(uint n) {
275 operations_research_utilPINVOKE.Int64VectorVector_reserve(swigCPtr, n);
276 }
277
278 public Int64VectorVector(int capacity) : this(operations_research_utilPINVOKE.new_Int64VectorVector__SWIG_2(capacity), true) {
279 if (operations_research_utilPINVOKE.SWIGPendingException.Pending) throw operations_research_utilPINVOKE.SWIGPendingException.Retrieve();
281
282 private Int64Vector getitemcopy(int index) {
285 return ret;
286 }
287
288 private Int64Vector getitem(int index) {
289 Int64Vector ret = new Int64Vector(operations_research_utilPINVOKE.Int64VectorVector_getitem(swigCPtr, index), false);
290 if (operations_research_utilPINVOKE.SWIGPendingException.Pending) throw operations_research_utilPINVOKE.SWIGPendingException.Retrieve();
291 return ret;
292 }
293
294 private void setitem(int index, Int64Vector val) {
295 operations_research_utilPINVOKE.Int64VectorVector_setitem(swigCPtr, index, Int64Vector.getCPtr(val));
296 if (operations_research_utilPINVOKE.SWIGPendingException.Pending) throw operations_research_utilPINVOKE.SWIGPendingException.Retrieve();
297 }
298
299 public void AddRange(Int64VectorVector values) {
300 operations_research_utilPINVOKE.Int64VectorVector_AddRange(swigCPtr, Int64VectorVector.getCPtr(values));
305 global::System.IntPtr cPtr = operations_research_utilPINVOKE.Int64VectorVector_GetRange(swigCPtr, index, count);
306 Int64VectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new Int64VectorVector(cPtr, true);
308 return ret;
309 }
310
311 public void Insert(int index, Int64Vector x) {
332 global::System.IntPtr cPtr = operations_research_utilPINVOKE.Int64VectorVector_Repeat(Int64Vector.getCPtr(value), count);
333 Int64VectorVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new Int64VectorVector(cPtr, true);
335 return ret;
336 }
337
338 public void Reverse() {
341
342 public void Reverse(int index, int count) {
353
354}
static Int64VectorVector Repeat(Int64Vector value, int count)
void CopyTo(Int64Vector[] array, int arrayIndex)
void InsertRange(int index, Int64VectorVector values)
Int64VectorVector GetRange(int index, int count)
void AddRange(Int64VectorVector values)
void RemoveRange(int index, int count)
void SetRange(int index, Int64VectorVector values)
void Insert(int index, Int64Vector x)
static global::System.IntPtr Int64VectorVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Int64VectorVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void Int64VectorVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static uint Int64VectorVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Int64VectorVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void Int64VectorVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void Int64VectorVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Int64VectorVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static global::System.IntPtr Int64VectorVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Int64VectorVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void Int64VectorVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Int64VectorVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void delete_Int64VectorVector(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Int64VectorVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)