Changeset 1548 for trunk/sources/HeuristicLab.StatisticalAnalysis/3.2/MannWhitneyWilcoxonTestControl.cs
- Timestamp:
- 04/10/09 10:45:35 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StatisticalAnalysis/3.2/MannWhitneyWilcoxonTestControl.cs
r1530 r1548 48 48 private double[] ConvertStringToArray(TextBox p) { 49 49 string t = p.Text; 50 string[] s = t.Split(new char[] { ';' }); 51 double[] tmp = new double[s.Length]; 52 try { 53 for (int i = 0; i < s.Length; i++) { 54 tmp[i] = double.Parse(s[i]); 50 string[] s = t.Split(new char[] { ';', ' ', '\t' }); 51 List<double> tmp = new List<double>(); 52 for (int i = 0; i < s.Length; i++) { 53 try { 54 double val = double.Parse(s[i]); 55 tmp.Add(val); 55 56 } 57 catch (FormatException) { } 56 58 } 57 catch (FormatException) { 58 return null; 59 } 60 return tmp; 59 if (tmp.Count > 0) return tmp.ToArray(); 60 else return null; 61 61 } 62 62 … … 81 81 double[] p2 = ConvertStringToArray(p2TextBox); 82 82 if (p1.Length > 20 || p2.Length > 20) { 83 MessageBox.Show("Sample size is too large for exact calculation, do not use more than 20 samples in each population."); 84 return; 83 double[] tmp = new double[Math.Min(20, p1.Length)]; 84 for (int i = 0; i < Math.Min(20, p1.Length); i++) tmp[i] = p1[i]; 85 p1 = tmp; 86 tmp = new double[Math.Min(20, p2.Length)]; 87 for (int i = 0; i < Math.Min(20, p2.Length); i++) tmp[i] = p2[i]; 88 p2 = tmp; 89 MessageBox.Show("Caution: Sample size is too large for exact calculation. Only the first 20 samples are used for the test!"); 85 90 } 86 91 double alpha = Double.Parse(alphaTextBox.Text);
Note: See TracChangeset
for help on using the changeset viewer.