Пример #1
0
        /// <summary>
        /// Returns a documentary string describing a histogram of multiplexer sizes which are induced by this flow matrix.
        /// </summary>
        /// <returns>textual histogram</returns>
        public string GetMUXHisto()
        {
            var histo = FlowTargets
                        .Select(t => Tuple.Create(t, GetFlowsTo(t).Count()))
                        .GroupBy(tup => tup.Item2)
                        .Select(grp => Tuple.Create(grp.Key, grp.Count()))
                        .OrderBy(tup => tup.Item1)
                        .Select(tup => tup.Item1.ToString() + ";" + tup.Item2.ToString() + ";");

            return(string.Join(Environment.NewLine, histo));
        }
Пример #2
0
        /// <summary>
        /// Returns a documentary report describing the quantities and sizes of multiplexers which are induced by this
        /// flow matrix.
        /// </summary>
        /// <returns>textual report</returns>
        public string GetMUXReport()
        {
            StringBuilder sb    = new StringBuilder();
            var           flows = FlowTargets
                                  .Select(t => Tuple.Create(t, GetFlowsTo(t)))
                                  .OrderBy(tup => tup.Item2.Count());

            foreach (var tup in flows)
            {
                sb.AppendFormat("MUX target {0}, fan-in: {1}\n",
                                tup.Item1.ToString(),
                                tup.Item2.Count());
                foreach (var flow in tup.Item2)
                {
                    sb.AppendFormat("  {0}\n", flow.ToString());
                }
            }
            return(sb.ToString());
        }