StemLeaf() публичный Метод

Formats the contents of the Histogram into a simple acsii stem-leaf diagram.
If the bin boundaries are b0, b1, b2,...,bn-1, and the counts for these bins are c1, c2,...,cn, respectively, then the this method returns a string with the following format: Number SmallerCount: ***number SmallerCount [b0,b1): *****c1 [b1,b2): **********c2 [b2,b3): ***************c3 . . . [bn-2,bn-1]: *****cn Number LargerCount : *****number LargerCount. Where the number of '*'s is for a particular bin is equal to the count for that bin minus one.
public StemLeaf ( int maxMark ) : string
maxMark int
Результат string
Пример #1
0
        // NOTE: _numbers 를 사용하게 되면, Parallel이 불가능하기 때문에, numbers를 인자로 받고, Thread-Safe 하게 사용할 수 있도록 했다.
        //
        protected static void DisplayDistribution(string name, Histogram histogram) {
            if(log.IsDebugEnabled) {
                log.Debug(@"-------------------------------------------");
                log.Debug(@"{0} Histogram:{1}{2}", name, Environment.NewLine, histogram.StemLeaf(50));

                log.Debug(@"-------------------------------------------");
                log.Debug(string.Empty);
            }
        }
Пример #2
0
        // NOTE: _numbers 를 사용하게 되면, Parallel이 불가능하기 때문에, numbers를 인자로 받고, Thread-Safe 하게 사용할 수 있도록 했다.
        //
        private static void DisplayDistribution(string name, Histogram histogram, double[] numbers) {
            log.Debug(@"-------------------------------------------");
            histogram.ResetData();
            histogram.AddData(numbers);
            log.Debug(@"{0} Histogram:\r\n{1}", name, histogram.StemLeaf(50));

            double avg, stdev;
            numbers.AverageAndStDev(out avg, out stdev);
            log.Debug(@"Avg = {0} ; StDev = {1}", avg, stdev);
            log.Debug(@"-------------------------------------------");
            log.Debug(string.Empty);
        }