13 public partial class MPVariableVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<Variable>
15 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
23 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
MPVariableVector obj) {
24 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
33 global::System.GC.SuppressFinalize(
this);
36 protected virtual void Dispose(
bool disposing) {
38 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
43 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
50 throw new global::System.ArgumentNullException(
"c");
58 throw new global::System.ArgumentNullException(
"c");
78 return getitem(index);
81 setitem(index, value);
87 return (
int)capacity();
91 throw new global::System.ArgumentOutOfRangeException(
"Capacity");
121 throw new global::System.ArgumentNullException(
"array");
123 throw new global::System.ArgumentOutOfRangeException(
"index",
"Value is less than zero");
125 throw new global::System.ArgumentOutOfRangeException(
"arrayIndex",
"Value is less than zero");
127 throw new global::System.ArgumentOutOfRangeException(
"count",
"Value is less than zero");
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);
142 global::System.Collections.Generic.IEnumerator<
Variable> global::System.Collections.Generic.IEnumerable<
Variable>.GetEnumerator() {
143 return new MPVariableVectorEnumerator(
this);
146 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
147 return new MPVariableVectorEnumerator(
this);
160 , global::System.Collections.Generic.IEnumerator<Variable>
163 private int currentIndex;
164 private object currentObject;
165 private int currentSize;
168 collectionRef = collection;
170 currentObject =
null;
171 currentSize = collectionRef.
Count;
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.");
188 object global::System.Collections.IEnumerator.Current {
195 int size = collectionRef.Count;
196 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
199 currentObject = collectionRef[currentIndex];
201 currentObject =
null;
208 currentObject =
null;
209 if (collectionRef.Count != currentSize) {
210 throw new global::System.InvalidOperationException(
"Collection modified.");
216 currentObject =
null;
228 private uint size() {
233 private uint capacity() {
234 uint ret = operations_research_linear_solverPINVOKE.MPVariableVector_capacity(swigCPtr);
238 private void reserve(uint n) {
239 operations_research_linear_solverPINVOKE.MPVariableVector_reserve(swigCPtr, n);
253 private Variable getitemcopy(
int index) {
255 Variable ret = (cPtr == global::System.IntPtr.Zero) ?
null :
new Variable(cPtr,
false);
260 private Variable getitem(
int index) {
261 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.MPVariableVector_getitem(swigCPtr, index);
262 Variable ret = (cPtr == global::System.IntPtr.Zero) ?
null :
new Variable(cPtr,
false);
263 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
267 private void setitem(
int index, Variable val) {
268 operations_research_linear_solverPINVOKE.MPVariableVector_setitem(swigCPtr, index, Variable.getCPtr(val));
269 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();