DotNet Reference

.Net Reference

MPConstraintVector.cs
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 4.0.2
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 
13 public partial class MPConstraintVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<Constraint>
14  {
15  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
16  protected bool swigCMemOwn;
17 
18  internal MPConstraintVector(global::System.IntPtr cPtr, bool cMemoryOwn) {
19  swigCMemOwn = cMemoryOwn;
20  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
21  }
22 
23  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MPConstraintVector obj) {
24  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
25  }
26 
28  Dispose(false);
29  }
30 
31  public void Dispose() {
32  Dispose(true);
33  global::System.GC.SuppressFinalize(this);
34  }
35 
36  protected virtual void Dispose(bool disposing) {
37  lock(this) {
38  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
39  if (swigCMemOwn) {
40  swigCMemOwn = false;
42  }
43  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
44  }
45  }
46  }
47 
48  public MPConstraintVector(global::System.Collections.IEnumerable c) : this() {
49  if (c == null)
50  throw new global::System.ArgumentNullException("c");
51  foreach (Constraint element in c) {
52  this.Add(element);
53  }
54  }
55 
56  public MPConstraintVector(global::System.Collections.Generic.IEnumerable<Constraint> c) : this() {
57  if (c == null)
58  throw new global::System.ArgumentNullException("c");
59  foreach (Constraint element in c) {
60  this.Add(element);
61  }
62  }
63 
64  public bool IsFixedSize {
65  get {
66  return false;
67  }
68  }
69 
70  public bool IsReadOnly {
71  get {
72  return false;
73  }
74  }
75 
76  public Constraint this[int index] {
77  get {
78  return getitem(index);
79  }
80  set {
81  setitem(index, value);
82  }
83  }
84 
85  public int Capacity {
86  get {
87  return (int)capacity();
88  }
89  set {
90  if (value < size())
91  throw new global::System.ArgumentOutOfRangeException("Capacity");
92  reserve((uint)value);
93  }
94  }
95 
96  public int Count {
97  get {
98  return (int)size();
99  }
100  }
101 
102  public bool IsSynchronized {
103  get {
104  return false;
105  }
106  }
107 
108  public void CopyTo(Constraint[] array)
109  {
110  CopyTo(0, array, 0, this.Count);
111  }
112 
113  public void CopyTo(Constraint[] array, int arrayIndex)
114  {
115  CopyTo(0, array, arrayIndex, this.Count);
116  }
117 
118  public void CopyTo(int index, Constraint[] array, int arrayIndex, int count)
119  {
120  if (array == null)
121  throw new global::System.ArgumentNullException("array");
122  if (index < 0)
123  throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
124  if (arrayIndex < 0)
125  throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
126  if (count < 0)
127  throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
128  if (array.Rank > 1)
129  throw new global::System.ArgumentException("Multi dimensional array.", "array");
130  if (index+count > this.Count || arrayIndex+count > array.Length)
131  throw new global::System.ArgumentException("Number of elements to copy is too large.");
132  for (int i=0; i<count; i++)
133  array.SetValue(getitemcopy(index+i), arrayIndex+i);
134  }
135 
136  public Constraint[] ToArray() {
137  Constraint[] array = new Constraint[this.Count];
138  this.CopyTo(array);
139  return array;
140  }
141 
142  global::System.Collections.Generic.IEnumerator<Constraint> global::System.Collections.Generic.IEnumerable<Constraint>.GetEnumerator() {
143  return new MPConstraintVectorEnumerator(this);
144  }
145 
146  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
147  return new MPConstraintVectorEnumerator(this);
148  }
149 
151  return new MPConstraintVectorEnumerator(this);
152  }
153 
154  // Type-safe enumerator
159  public sealed class MPConstraintVectorEnumerator : global::System.Collections.IEnumerator
160  , global::System.Collections.Generic.IEnumerator<Constraint>
161  {
162  private MPConstraintVector collectionRef;
163  private int currentIndex;
164  private object currentObject;
165  private int currentSize;
166 
168  collectionRef = collection;
169  currentIndex = -1;
170  currentObject = null;
171  currentSize = collectionRef.Count;
172  }
173 
174  // Type-safe iterator Current
176  get {
177  if (currentIndex == -1)
178  throw new global::System.InvalidOperationException("Enumeration not started.");
179  if (currentIndex > currentSize - 1)
180  throw new global::System.InvalidOperationException("Enumeration finished.");
181  if (currentObject == null)
182  throw new global::System.InvalidOperationException("Collection modified.");
183  return (Constraint)currentObject;
184  }
185  }
186 
187  // Type-unsafe IEnumerator.Current
188  object global::System.Collections.IEnumerator.Current {
189  get {
190  return Current;
191  }
192  }
193 
194  public bool MoveNext() {
195  int size = collectionRef.Count;
196  bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
197  if (moveOkay) {
198  currentIndex++;
199  currentObject = collectionRef[currentIndex];
200  } else {
201  currentObject = null;
202  }
203  return moveOkay;
204  }
205 
206  public void Reset() {
207  currentIndex = -1;
208  currentObject = null;
209  if (collectionRef.Count != currentSize) {
210  throw new global::System.InvalidOperationException("Collection modified.");
211  }
212  }
213 
214  public void Dispose() {
215  currentIndex = -1;
216  currentObject = null;
217  }
218  }
219 
220  public void Clear() {
222  }
223 
224  public void Add(Constraint x) {
226  }
227 
228  private uint size() {
230  return ret;
231  }
232 
233  private uint capacity() {
234  uint ret = operations_research_linear_solverPINVOKE.MPConstraintVector_capacity(swigCPtr);
235  return ret;
236  }
237 
238  private void reserve(uint n) {
239  operations_research_linear_solverPINVOKE.MPConstraintVector_reserve(swigCPtr, n);
240  }
241 
242  public MPConstraintVector() : this(operations_research_linear_solverPINVOKE.new_MPConstraintVector__SWIG_0(), true) {
243  }
244 
245  public MPConstraintVector(MPConstraintVector other) : this(operations_research_linear_solverPINVOKE.new_MPConstraintVector__SWIG_1(MPConstraintVector.getCPtr(other)), true) {
247  }
248 
249  public MPConstraintVector(int capacity) : this(operations_research_linear_solverPINVOKE.new_MPConstraintVector__SWIG_2(capacity), true) {
251  }
252 
253  private Constraint getitemcopy(int index) {
255  Constraint ret = (cPtr == global::System.IntPtr.Zero) ? null : new Constraint(cPtr, false);
257  return ret;
258  }
259 
260  private Constraint getitem(int index) {
261  global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.MPConstraintVector_getitem(swigCPtr, index);
262  Constraint ret = (cPtr == global::System.IntPtr.Zero) ? null : new Constraint(cPtr, false);
263  if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
264  return ret;
265  }
266 
267  private void setitem(int index, Constraint val) {
268  operations_research_linear_solverPINVOKE.MPConstraintVector_setitem(swigCPtr, index, Constraint.getCPtr(val));
269  if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
270  }
271 
272  public void AddRange(MPConstraintVector values) {
275  }
276 
277  public MPConstraintVector GetRange(int index, int count) {
279  MPConstraintVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new MPConstraintVector(cPtr, true);
281  return ret;
282  }
283 
284  public void Insert(int index, Constraint x) {
287  }
288 
289  public void InsertRange(int index, MPConstraintVector values) {
292  }
293 
294  public void RemoveAt(int index) {
297  }
298 
299  public void RemoveRange(int index, int count) {
302  }
303 
304  public static MPConstraintVector Repeat(Constraint value, int count) {
306  MPConstraintVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new MPConstraintVector(cPtr, true);
308  return ret;
309  }
310 
311  public void Reverse() {
313  }
314 
315  public void Reverse(int index, int count) {
318  }
319 
320  public void SetRange(int index, MPConstraintVector values) {
323  }
324 
325  public bool Contains(Constraint value) {
327  return ret;
328  }
329 
330  public int IndexOf(Constraint value) {
332  return ret;
333  }
334 
335  public int LastIndexOf(Constraint value) {
337  return ret;
338  }
339 
340  public bool Remove(Constraint value) {
342  return ret;
343  }
344 
345 }
346 
347 }
void Add(Constraint x)
void Dispose()
virtual void Dispose(bool disposing)
MPConstraintVectorEnumerator(MPConstraintVector collection)
static int MPConstraintVector_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
MPConstraintVector(global::System.Collections.Generic.IEnumerable< Constraint > c)
Constraint Current
MPConstraintVector(int capacity)
bool MoveNext()
void AddRange(MPConstraintVector values)
static void MPConstraintVector_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
Constraint[] ToArray()
MPConstraintVectorEnumerator GetEnumerator()
static void MPConstraintVector_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
MPConstraintVector(MPConstraintVector other)
void Reset()
static global::System.IntPtr MPConstraintVector_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
MPConstraintVector(global::System.Collections.IEnumerable c)
static bool Pending
void Clear()
static void MPConstraintVector_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static global::System.IntPtr MPConstraintVector_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
using System
Definition: Program.cs:14
static void MPConstraintVector_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
bool swigCMemOwn
int Capacity
int Count
void SetRange(int index, MPConstraintVector values)
static bool MPConstraintVector_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void MPConstraintVector_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static MPConstraintVector Repeat(Constraint value, int count)
bool Remove(Constraint value)
void CopyTo(Constraint[] array, int arrayIndex)
MPConstraintVector GetRange(int index, int count)
int IndexOf(Constraint value)
static bool MPConstraintVector_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
void RemoveRange(int index, int count)
bool IsSynchronized
static void delete_MPConstraintVector(global::System.Runtime.InteropServices.HandleRef jarg1)
void Insert(int index, Constraint x)
bool IsFixedSize
static uint MPConstraintVector_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static int MPConstraintVector_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void MPConstraintVector_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
void Dispose()
Note that the IEnumerator documentation requires an InvalidOperationException to be thrown whenever t...
void CopyTo(Constraint[] array)
void CopyTo(int index, Constraint[] array, int arrayIndex, int count)
void RemoveAt(int index)
static global::System.Exception Retrieve()
void Reverse(int index, int count)
static global::System.IntPtr MPConstraintVector_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
MPConstraintVector()
bool IsReadOnly
static void MPConstraintVector_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
void InsertRange(int index, MPConstraintVector values)
void Reverse()
int LastIndexOf(Constraint value)
static void MPConstraintVector_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void MPConstraintVector_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
bool Contains(Constraint value)
static void MPConstraintVector_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)