Пример #1
0
        public virtual void PopulateWithListChoices()
        {
            this.Clear();

            //xxx is a dummy fieldname just to satisfy the constructor
            DoubleAggregateSummary sum = DoubleAggregateSummary.Empty;// new DoubleAggregateSummary(0, double.MaxValue, double.MinValue, 0d);

            this.Add(new PivotComputationInfo(sum, "Sum", "Sum of {*}", "xxx"));
            this.Add(new PivotComputationInfo(sum, "Average", "Average of {*}", "xxx"));

            DoubleVectorSummary v = DoubleVectorSummary.Empty;// new DoubleVectorSummary(new double[] { 1, 2, 3 }, 3);// any will do

            this.Add(new PivotComputationInfo(v, "Median", "Median of {*}", "xxx"));
            this.Add(new PivotComputationInfo(v, "Percentile25", "25 Percentile of {*}", "xxx"));
            this.Add(new PivotComputationInfo(v, "Percentile75", "75 Percentile of {*}", "xxx"));

            CountSummary c = CountSummary.Empty;// new VectorSummary(null, 0);

            this.Add(new PivotComputationInfo(c, "Count", "Count of {*}", "xxx"));

            DoubleStdDevSummary sd = DoubleStdDevSummary.Empty;

            this.Add(new PivotComputationInfo(sd, "StdDev", "StDev of {*}", "xxx"));
            this.Add(new PivotComputationInfo(sd, "StdDevP", "StDevP of {*}", "xxx"));
            this.Add(new PivotComputationInfo(sd, "Var", "Var of {*}", "xxx"));
            this.Add(new PivotComputationInfo(sd, "VarP", "VarP of {*}", "xxx"));
        }
Пример #2
0
 /// <summary>
 /// Combines the values of this summary with another summary and returns
 /// a new summary object.
 /// </summary>
 /// <param name="other">Another summary object (of the same type).</param>
 /// <returns>A new summary object with combined values of both summaries.</returns>
 public DoubleStdDevSummary Combine(DoubleStdDevSummary other)
 {
     if (other.count == 0)
     {
         return(this);
     }
     else if (this.count == 0)
     {
         return(other);
     }
     else
     {
         return(new DoubleStdDevSummary(
                    this.count + other.count,
                    this.sum + other.sum,
                    this.sumX2 + other.sumX2
                    ));
     }
 }