Esempio n. 1
0
        public static List <TreeStatistics> AvgStdTreeStats(List <TreeStatistics> treeStats)
        {
            var avgStats = new TreeStatistics();
            var stdStats = new TreeStatistics();
            var tmp      = TreeStatistics.AverageStd(treeStats.Select(t => t.Num));

            avgStats.Num = tmp[0]; stdStats.Num = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.NumEdges));
            avgStats.NumEdges = tmp[0]; stdStats.NumEdges = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.AvgSize));
            avgStats.AvgSize = tmp[0]; stdStats.AvgSize = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.AvgWeight));
            avgStats.AvgWeight = tmp[0]; stdStats.AvgWeight = tmp[1];

            tmp            = TreeStatistics.AverageStd(treeStats.Select(t => t.Width));
            avgStats.Width = tmp[0]; stdStats.Width = tmp[1];

            tmp             = TreeStatistics.AverageStd(treeStats.Select(t => t.Height));
            avgStats.Height = tmp[0]; stdStats.Height = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.DegreesVar));
            avgStats.DegreesVar = tmp[0]; stdStats.DegreesVar = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.Diameter));
            avgStats.Diameter = tmp[0]; stdStats.Diameter = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.MaxCliqueDistribution));
            avgStats.MaxCliqueDistribution = tmp[0]; stdStats.MaxCliqueDistribution = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.MaxSize));
            avgStats.MaxSize = tmp[0]; stdStats.MaxSize = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.MinSize));
            avgStats.MinSize = tmp[0]; stdStats.MinSize = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.MaxWeight));
            avgStats.MaxWeight = tmp[0]; stdStats.MaxWeight = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.MinWeight));
            avgStats.MinWeight = tmp[0]; stdStats.MinWeight = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.SumSize));
            avgStats.SumSize = tmp[0]; stdStats.SumSize = tmp[1];

            tmp = TreeStatistics.AverageStd(treeStats.Select(t => t.SumWeight));
            avgStats.SumWeight = tmp[0]; stdStats.SumWeight = tmp[1];


            return(new List <TreeStatistics>()
            {
                avgStats, stdStats
            });
        }
Esempio n. 2
0
 public void Add(TreeStatistics other)
 {
     this.Num                   += other.Num;
     this.NumEdges              += other.NumEdges;
     this.AvgSize               += other.AvgSize;
     this.AvgWeight             += other.AvgWeight;
     this.Width                 += other.Width;
     this.Height                += other.Height;
     this.DegreesVar            += other.DegreesVar;
     this.Diameter              += other.Diameter;
     this.MaxCliqueDistribution += other.MaxCliqueDistribution;
     this.MaxSize               += other.MaxSize;
     this.MinSize               += other.MinSize;
     this.MaxWeight             += other.MaxWeight;
     this.MinWeight             += other.MinWeight;
     this.SumSize               += other.SumSize;
     this.SumWeight             += other.SumWeight;
 }