コード例 #1
0
ファイル: LinearProgramming.cs プロジェクト: Swipes13/Gomory
 public Equation(Digit[] digs, Digit digit)
 {
     IntPtr[] ptrs = new IntPtr[digs.Count()];
       for(int i=0;i<digs.Count();i++) ptrs[i] = digs[i].IntPtr();
       unsafe {
     fixed (IntPtr* pArray = ptrs) {
       IntPtr digitsPtr = new IntPtr((void*)pArray);
       equation = LP_DLL.Equation(digs.Count(), digitsPtr, digit.IntPtr());
     }
       }
 }
コード例 #2
0
        public Equation(Digit[] digs, Digit digit)
        {
            IntPtr[] ptrs = new IntPtr[digs.Count()];
            for (int i = 0; i < digs.Count(); i++)
            {
                ptrs[i] = digs[i].IntPtr();
            }
            unsafe
            {
                fixed(IntPtr *pArray = ptrs)
                {
                    IntPtr digitsPtr = new IntPtr((void *)pArray);

                    equation = LP_DLL.Equation(digs.Count(), digitsPtr, digit.IntPtr());
                }
            }
        }