public static ClusteringRow[] clusteringToRows(HashSet <HashSet <AST.Address> > clustering, Dictionary <HashSet <AST.Address>, int> ids) { var rows = new LinkedList <ClusteringRow>(); foreach (HashSet <AST.Address> cluster in clustering) { foreach (AST.Address addr in cluster) { var row = new ClusteringRow(); row.Path = addr.A1Path(); row.Workbook = addr.A1Workbook(); row.Worksheet = addr.A1Worksheet(); row.Address = addr.A1Local(); row.Cluster = ids[cluster]; rows.AddLast(row); } } var sorted_rows = rows.OrderBy(row => new Tuple <string, string, string, string>(row.Path, row.Workbook, row.Worksheet, row.Address)); return(sorted_rows.ToArray()); }
public void WriteRow(ClusteringRow row) { _cw.WriteRecord(row); }