13 public partial class MpDoubleVector : global::System.IDisposable, global::System.Collections.IEnumerable
14 , global::System.Collections.Generic.IList<double>
16 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 internal MpDoubleVector(global::System.IntPtr cPtr,
bool cMemoryOwn) {
21 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
MpDoubleVector obj) {
25 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
39 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(
this);
47 throw new global::System.ArgumentNullException(
"c");
48 foreach (
double element
in c) {
65 public double this[
int index] {
67 return getitem(index);
70 setitem(index, value);
76 return (
int)capacity();
80 throw new global::System.ArgumentOutOfRangeException(
"Capacity");
102 public void CopyTo(
double[] array,
int arrayIndex)
107 public void CopyTo(
int index,
double[] array,
int arrayIndex,
int count)
110 throw new global::System.ArgumentNullException(
"array");
112 throw new global::System.ArgumentOutOfRangeException(
"index",
"Value is less than zero");
114 throw new global::System.ArgumentOutOfRangeException(
"arrayIndex",
"Value is less than zero");
116 throw new global::System.ArgumentOutOfRangeException(
"count",
"Value is less than zero");
118 throw new global::System.ArgumentException(
"Multi dimensional array.",
"array");
119 if (index+count > this.
Count || arrayIndex+count > array.Length)
120 throw new global::System.ArgumentException(
"Number of elements to copy is too large.");
121 for (
int i=0; i<count; i++)
122 array.SetValue(getitemcopy(index+i), arrayIndex+i);
125 global::System.Collections.Generic.IEnumerator<
double> global::System.Collections.Generic.IEnumerable<
double>.GetEnumerator() {
126 return new MpDoubleVectorEnumerator(
this);
129 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
130 return new MpDoubleVectorEnumerator(
this);
143 , global::System.Collections.Generic.IEnumerator<double>
146 private int currentIndex;
147 private object currentObject;
148 private int currentSize;
151 collectionRef = collection;
153 currentObject =
null;
154 currentSize = collectionRef.
Count;
160 if (currentIndex == -1)
161 throw new global::System.InvalidOperationException(
"Enumeration not started.");
162 if (currentIndex > currentSize - 1)
163 throw new global::System.InvalidOperationException(
"Enumeration finished.");
164 if (currentObject ==
null)
165 throw new global::System.InvalidOperationException(
"Collection modified.");
166 return (
double)currentObject;
171 object global::System.Collections.IEnumerator.Current {
178 int size = collectionRef.Count;
179 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
182 currentObject = collectionRef[currentIndex];
184 currentObject =
null;
191 currentObject =
null;
192 if (collectionRef.Count != currentSize) {
193 throw new global::System.InvalidOperationException(
"Collection modified.");
199 currentObject =
null;
207 public void Add(
double x) {
211 private uint size() {
216 private uint capacity() {
217 uint ret = operations_research_linear_solverPINVOKE.MpDoubleVector_capacity(swigCPtr);
221 private void reserve(uint n) {
222 operations_research_linear_solverPINVOKE.MpDoubleVector_reserve(swigCPtr, n);
236 private double getitemcopy(
int index) {
242 private double getitem(
int index) {
243 double ret = operations_research_linear_solverPINVOKE.MpDoubleVector_getitem(swigCPtr, index);
244 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
248 private void setitem(
int index,
double val) {
249 operations_research_linear_solverPINVOKE.MpDoubleVector_setitem(swigCPtr, index, val);
250 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
265 public void Insert(
int index,
double x) {