public static TwoByTwo GetInstance(int tt, int tf, int ft, int ff) { 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] = tt; twoByTwo.Counts[1, 0] = tf; twoByTwo.Counts[0, 1] = ft; twoByTwo.Counts[0, 0] = ff; twoByTwo.Invalidate(); return(twoByTwo); }
public static TwoByTwo GetInstance(int[] fisherCounts) { Helper.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]; twoByTwo.Invalidate(); return(twoByTwo); }
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>() } }; twoByTwo.Invalidate(); 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 twoByTwo.Invalidate(); return(twoByTwo); } }