Beispiel #1
0
        public void AddDistribution(StatisticalFloat Samples)
        {
            if (MyCount == 0)
            {
                AddSamples(Samples);
            }
            else if (Samples.MyCount > 0)
            {
                MyMin          = MyMin + Samples.MyMin;
                MyMax          = MyMax + Samples.MyMax;
                MySum          = Average + Samples.Average;
                MySumOfSquares = MySum * MySum;
                MyCount        = 1;

                if (MySamples != null)
                {
                    MySamples.Clear();
                    MySamples.Add(MySum);
                }
            }
        }
Beispiel #2
0
        public void AddSamples(StatisticalFloat Samples)
        {
            if (MyCount == 0)
            {
                MySum          = Samples.MySum;
                MySumOfSquares = Samples.MySumOfSquares;
                MyMin          = Samples.MyMin;
                MyMax          = Samples.MyMax;
                MyCount        = Samples.MyCount;
            }
            else
            {
                MySum          += Samples.MySum;
                MySumOfSquares += Samples.MySumOfSquares;
                MyMin           = Math.Min(MyMin, Samples.MyMin);
                MyMax           = Math.Max(MyMax, Samples.MyMax);
                MyCount        += Samples.MyCount;
            }

            if (MySamples != null)
            {
                MySamples.AddRange(Samples.MySamples);
            }
        }
Beispiel #3
0
        public void AddSample(double InValue)
        {
            if (MyCount == 0)
            {
                MySum          = InValue;
                MySumOfSquares = InValue * InValue;
                MyMin          = InValue;
                MyMax          = InValue;
            }
            else
            {
                MySum          += InValue;
                MySumOfSquares += InValue * InValue;
                MyMin           = Math.Min(MyMin, InValue);
                MyMax           = Math.Max(MyMax, InValue);
            }

            if (MySamples != null)
            {
                MySamples.Add(InValue);
            }

            MyCount++;
        }