Esempio n. 1
0
    public static double[,] get_2x3_table(SNPFeatures pos, SNPFeatures neg)
    {
        IntPtr ptr = modshogunPINVOKE.SNPFeatures_get_2x3_table(SNPFeatures.getCPtr(pos), SNPFeatures.getCPtr(neg));

        if (modshogunPINVOKE.SWIGPendingException.Pending)
        {
            throw modshogunPINVOKE.SWIGPendingException.Retrieve();
        }
        int[] ranks = new int[2];
        Marshal.Copy(ptr, ranks, 0, 2);

        int rows = ranks[0];
        int cols = ranks[1];
        int len  = rows * cols;

        double[] ret = new double[len];

        Marshal.Copy(new IntPtr(ptr.ToInt64() + 2 * Marshal.SizeOf(typeof(int))), ret, 0, len);

        double[,] result = new double[rows, cols];
        for (int i = 0; i < rows; i++)
        {
            for (int j = 0; j < cols; j++)
            {
                result[i, j] = ret[i * cols + j];
            }
        }
        return(result);
    }
Esempio n. 2
0
 public void obtain_base_strings(SNPFeatures snp)
 {
     modshogunPINVOKE.SNPFeatures_obtain_base_strings__SWIG_0(swigCPtr, SNPFeatures.getCPtr(snp));
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 3
0
 public SNPFeatures(SNPFeatures orig) : this(modshogunPINVOKE.new_SNPFeatures__SWIG_2(SNPFeatures.getCPtr(orig)), true)
 {
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }