コード例 #1
0
 public void AddAlgorithms(List <Algorithm> algos)
 {
     foreach (var algo in algos)
     {
         var    algoID         = algo.AlgorithmStringID;
         double secondarySpeed = 0;
         if (algo is DualAlgorithm dualAlgo)
         {
             secondarySpeed = dualAlgo.SecondaryBenchmarkSpeed;
         }
         if (BenchmarkSums.ContainsKey(algoID) == false)
         {
             var ssc = new SpeedSumCount
             {
                 Count          = 1,
                 Speed          = algo.BenchmarkSpeed,
                 SecondarySpeed = secondarySpeed
             };
             BenchmarkSums[algoID] = ssc;
         }
         else
         {
             BenchmarkSums[algoID].Count++;
             BenchmarkSums[algoID].Speed          += algo.BenchmarkSpeed;
             BenchmarkSums[algoID].SecondarySpeed += secondarySpeed;
         }
     }
 }
コード例 #2
0
        public Dictionary <string, double> CalculateAvarages()
        {
            Dictionary <string, double> ret = new Dictionary <string, double>();

            foreach (var kvp in this.BenchmarkSums)
            {
                string        algo_id = kvp.Key;
                SpeedSumCount ssc     = kvp.Value;
                ret[algo_id] = ssc.GetAvarage();
            }
            return(ret);
        }
コード例 #3
0
        public Dictionary <string, List <double> > CalculateAvarages()
        {
            Dictionary <string, List <double> > ret = new Dictionary <string, List <double> >();

            foreach (var kvp in this.BenchmarkSums)
            {
                string        algo_id = kvp.Key;
                SpeedSumCount ssc     = kvp.Value;
                ret[algo_id] = new List <double> {
                    ssc.GetAvarage(), ssc.GetSecondaryAverage()
                };
            }
            return(ret);
        }
コード例 #4
0
 public void AddAlgorithms(List <Algorithm> algos)
 {
     foreach (var algo in algos)
     {
         var algo_id = algo.AlgorithmStringID;
         if (BenchmarkSums.ContainsKey(algo_id) == false)
         {
             var ssc = new SpeedSumCount();
             ssc.count = 1;
             ssc.speed = algo.BenchmarkSpeed;
             BenchmarkSums[algo_id] = ssc;
         }
         else
         {
             BenchmarkSums[algo_id].count++;
             BenchmarkSums[algo_id].speed += algo.BenchmarkSpeed;
         }
     }
 }