public DVectorArray3(int nCount = 0) { vector = new DVector <T>(); if (nCount > 0) { vector.resize(nCount * 3); } }
public DVector(DVector <T> copy) { nBlockSize = copy.nBlockSize; iCurBlock = copy.iCurBlock; iCurBlockUsed = copy.iCurBlockUsed; Blocks = new List <T[]>(); for (int i = 0; i < copy.Blocks.Count; ++i) { Blocks.Add(new T[nBlockSize]); Array.Copy(copy.Blocks[i], Blocks[i], copy.Blocks[i].Length); } }
public static unsafe void FastGetBuffer(DVector <int> v, int *pBuffer) { IntPtr pCur = new IntPtr(pBuffer); int N = v.Blocks.Count; for (int k = 0; k < N - 1; k++) { System.Runtime.InteropServices.Marshal.Copy(v.Blocks[k], 0, pCur, v.nBlockSize); pCur = new IntPtr( pCur.ToInt64() + v.nBlockSize * sizeof(int)); } System.Runtime.InteropServices.Marshal.Copy(v.Blocks[N - 1], 0, pCur, v.iCurBlockUsed); }
public DVectorArray3(T[] data) { vector = new DVector <T>(data); }
public DVectorArray2(int nCount = 0) { vector = new DVector <T>(); vector.resize(nCount * 2); }