Esempio n. 1
0
        public static TwoByTwo GetInstance(int[] fisherCounts)
        {
            SpecialFunctions.CheckCondition(fisherCounts.Length == 4);
            TwoByTwoCounts twoByTwo = new TwoByTwoCounts();

            twoByTwo.Var1    = null;
            twoByTwo.Var2    = null;
            twoByTwo._counts = new int[2, 2]; //C# init's to 0's

            twoByTwo.Counts[1, 1] = fisherCounts[(int)TwoByTwo.ParameterIndex.TT];
            twoByTwo.Counts[1, 0] = fisherCounts[(int)TwoByTwo.ParameterIndex.TF];
            twoByTwo.Counts[0, 1] = fisherCounts[(int)TwoByTwo.ParameterIndex.FT];
            twoByTwo.Counts[0, 0] = fisherCounts[(int)TwoByTwo.ParameterIndex.FF];

            return(twoByTwo);
        }
Esempio n. 2
0
 public static TwoByTwo GetInstance(string var1, string var2, bool rememberCases)
 {
     if (rememberCases)
     {
         TwoByTwoCases twoByTwo = new TwoByTwoCases();
         twoByTwo.Var1  = var1;
         twoByTwo.Var2  = var2;
         twoByTwo.Cases = new List <string>[2, 2] {
             { new List <string>(), new List <string>() }, { new List <string>(), new List <string>() }
         };
         return(twoByTwo);
     }
     else
     {
         TwoByTwoCounts twoByTwo = new TwoByTwoCounts();
         twoByTwo.Var1    = var1;
         twoByTwo.Var2    = var2;
         twoByTwo._counts = new int[2, 2]; //C# init's to 0's
         return(twoByTwo);
     }
 }