protected void ComputeStatistics() { _datapoints = new List <Point>(); _statistics = new ComparisonStatistics(); _statistics.postfixes = new Dictionary <string, ComparisonStatistics>(); _statistics.subdirs = new Dictionary <string, ComparisonStatistics>(); if (_jX == null || _jY == null) { return; } if (_jX.Rows.Count == 0 || _jY.Rows.Count == 0) { return; } _jX.Rows.Sort(csvrow_lt); _jY.Rows.Sort(csvrow_lt); List <CSVRow> .Enumerator yit = _jY.Rows.GetEnumerator(); yit.MoveNext(); CSVRow yr = yit.Current; if (yr.Filename.StartsWith(_prefix)) { AddStatisticsY(yr); } string last_x = null, last_y = null; foreach (CSVRow xr in _jX.Rows) { if (!xr.Filename.StartsWith(_prefix) || (last_x != null && last_x.CompareTo(xr.Filename) == 0)) // ignore duplicates. { continue; } do { if (yr.Filename.CompareTo(xr.Filename) >= 0) { break; } last_y = yr.Filename; while (yit.Current.Filename == last_y) // ignore duplicates. { if (!yit.MoveNext()) { yr = null; break; } else { yr = yit.Current; } } if (yr != null && yr.Filename.StartsWith(_prefix)) { AddStatisticsY(yr); } }while (yr != null); if (yr == null) { continue; } AddStatisticsX(xr); if (yr.Filename.CompareTo(xr.Filename) == 0) { AddStatisticsXY(xr, yr); AddDataPoint(xr, yr); } last_x = xr.Filename; } }
protected void ComputeStatistics() { _datapoints = new List<Point>(); _statistics = new ComparisonStatistics(); _statistics.postfixes = new Dictionary<string, ComparisonStatistics>(); _statistics.subdirs = new Dictionary<string, ComparisonStatistics>(); if (_jX == null || _jY == null) return; if (_jX.Rows.Count == 0 || _jY.Rows.Count == 0) return; _jX.Rows.Sort(csvrow_lt); _jY.Rows.Sort(csvrow_lt); List<CSVRow>.Enumerator yit = _jY.Rows.GetEnumerator(); yit.MoveNext(); CSVRow yr = yit.Current; if (yr.Filename.StartsWith(_prefix)) AddStatisticsY(yr); string last_x = null, last_y = null; foreach (CSVRow xr in _jX.Rows) { if (!xr.Filename.StartsWith(_prefix) || (last_x != null && last_x.CompareTo(xr.Filename) == 0)) // ignore duplicates. continue; do { if (yr.Filename.CompareTo(xr.Filename) >= 0) break; last_y = yr.Filename; while (yit.Current.Filename == last_y) // ignore duplicates. { if (!yit.MoveNext()) { yr = null; break; } else yr = yit.Current; } if (yr != null && yr.Filename.StartsWith(_prefix)) AddStatisticsY(yr); } while (yr != null); if (yr == null) continue; AddStatisticsX(xr); if (yr.Filename.CompareTo(xr.Filename) == 0) { AddStatisticsXY(xr, yr); AddDataPoint(xr, yr); } last_x = xr.Filename; } }