protected string Subdir(ComparableResult row) { string suffix = Suffix(row); int subdir_inx = suffix.IndexOf("/"); string subdir = suffix == "" ? "" : (subdir_inx < 0 ? suffix : suffix.Substring(0, subdir_inx)); if (subdir.Length > 0) { if (!_statistics.subdirs.ContainsKey(subdir)) { _statistics.subdirs.Add(subdir, new ComparisonStatistics()); } } return(subdir); }
protected string Suffix(ComparableResult row) { int liobs = row.Filename.LastIndexOf("/"); if (liobs <= _prefixLength) { return(""); } string prefix = row.Filename.Substring(0, liobs); string suffix = row.Filename.Substring(_prefixLength, liobs - _prefixLength); if (suffix.Length > 0 && !_statistics.postfixes.ContainsKey(suffix)) { _statistics.postfixes.Add(suffix, new ComparisonStatistics()); } return(suffix); }
protected void AddStatisticsY(ComparableResult row) { _statistics.y_files++; if (row.Status == ResultStatus.Success) { double results = (row.SAT + row.UNSAT + row.UNKNOWN); double y_ratio_sat = (results == 0) ? 0 : row.SAT / results; double y_ratio_unsat = (results == 0) ? 0 : row.UNSAT / results; double y_ratio_unknown = (results == 0) ? 0 : row.UNKNOWN / results; _statistics.y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.y_countSAT += row.SAT; _statistics.y_countUNSAT += row.UNSAT; _statistics.y_countUNKNOWN += row.UNKNOWN; string suffix = Suffix(row); string subdir = Subdir(row); if (suffix.Length > 0) { _statistics.postfixes[suffix].y_files++; _statistics.postfixes[suffix].y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.postfixes[suffix].y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.postfixes[suffix].y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.postfixes[suffix].y_countSAT += row.SAT; _statistics.postfixes[suffix].y_countUNSAT += row.UNSAT; _statistics.postfixes[suffix].y_countUNKNOWN += row.UNKNOWN; } if (subdir.Length > 0) { _statistics.subdirs[subdir].y_files++; _statistics.subdirs[subdir].y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.subdirs[subdir].y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.subdirs[subdir].y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.subdirs[subdir].y_countSAT += row.SAT; _statistics.subdirs[subdir].y_countUNSAT += row.UNSAT; _statistics.subdirs[subdir].y_countUNKNOWN += row.UNKNOWN; } } }
protected void AddDataPoint(ComparableResult xr, ComparableResult yr) { double xrt = (xr.Runtime < _minX) ? _minX : xr.Runtime; double yrt = (yr.Runtime < _minY) ? _minY : yr.Runtime; Comparison.Point p = new Point(); p.tooltip = xr.Filename; switch (xr.Status) { case ResultStatus.OutOfMemory: p.x = _memX; break; case ResultStatus.Timeout: p.x = _tmeX; break; case ResultStatus.Success: p.x = xrt; break; default: p.x = _errX; break; } switch (yr.Status) { case ResultStatus.OutOfMemory: p.y = _memY; break; case ResultStatus.Timeout: p.y = _tmeY; break; case ResultStatus.Success: p.y = yrt; break; default: p.y = _errY; break; } if (xr.SAT > yr.SAT || xr.UNSAT > yr.UNSAT) { p.type = PointType.WORSE; } else if (xr.SAT < yr.SAT || xr.UNSAT < yr.UNSAT) { p.type = PointType.BETTER; } _datapoints.Add(p); }
protected void AddStatisticsXY(ComparableResult xr, ComparableResult yr) { string suffix = Suffix(xr); string subdir = Subdir(xr); _statistics.Count += 1.0; if (xr.Status == ResultStatus.Success || yr.Status == ResultStatus.Success) { double delta; if (xr.Status == ResultStatus.Success && yr.Status == ResultStatus.Success) { delta = yr.Runtime - xr.Runtime; } else if (xr.Status == ResultStatus.Success && yr.Status != ResultStatus.Success) { delta = -_tmeY; } else { delta = _tmeX; } _statistics.deltas.Add(delta); _statistics.deltas_sorted = false; if (suffix.Length > 0) { _statistics.postfixes[suffix].deltas.Add(delta); _statistics.postfixes[suffix].deltas_sorted = false; } if (subdir.Length > 0) { _statistics.subdirs[subdir].deltas.Add(delta); _statistics.subdirs[subdir].deltas_sorted = false; } } }
protected static int csvrow_lt(ComparableResult x, ComparableResult y) { return(x.Filename.CompareTo(y.Filename)); }