Exemplo n.º 1
0
        /// <summary></summary>
        static void printTable(TextWriter tw, string title, Dictionary <string, dictI2D> data, IEnumerable <int> rows, string[] columns, Dictionary <int, string> algoNames)
        {
            tw.WriteLine(title);

            List <string> fields = new List <string>();

            fields.Add("");
            fields.AddRange(columns);
            tw.printFields(fields);

            foreach (int r in rows)
            {
                fields.Clear();
                fields.Add(algoNames[r.algo()]);
                foreach (string c in columns)
                {
                    dictI2D dataColumn = data[c];
                    double  val;
                    if (dataColumn.TryGetValue(r, out val))
                    {
                        fields.Add(val.ToString());
                    }
                    else
                    {
                        fields.Add(string.Empty);
                    }
                }
                tw.printFields(fields);
            }
        }
Exemplo n.º 2
0
        static void calcRel(dictI2D column, eTest test, int algo)
        {
            int[]  keys = column.Keys.ToArray();
            double rel  = column[key(test, algo)];

            foreach (int k in keys)
            {
                if (k.test() != test)
                {
                    continue;
                }
                column[k] = 100.0 * column[k] / rel;
            }
        }