Beispiel #1
0
        public virtual IDictionary <ParentSiblingListKey, SiblingListStats> getListStats(IDictionary <ParentSiblingListKey, IList <int> > map)
        {
            IDictionary <ParentSiblingListKey, SiblingListStats> listSizes = new Dictionary <ParentSiblingListKey, SiblingListStats>();

            foreach (ParentSiblingListKey pair in map.Keys)
            {
                IList <int> lens     = map[pair];
                var         new_lens = lens.OrderBy(i => i).ToList();
                lens = new_lens;
                int    n      = lens.Count;
                int?   min    = lens[0];
                int?   median = lens[n / 2];
                int?   max    = lens[n - 1];
                double @var   = BuffUtils.variance(lens);
                listSizes[pair] = new SiblingListStats(n, min.Value, median.Value, @var, max.Value);
            }
            return(listSizes);
        }