bb.util
Class Benchmark.Stats

java.lang.Object
  extended by bb.util.Benchmark.Stats
Enclosing class:
Benchmark

public static class Benchmark.Stats
extends Object

Holds execution time statistics.

Every time field has these features:

  1. Units: seconds
  2. Contract: passes checkTimeValue


Field Summary
protected  double mean
          Arithmetic mean of the execution time.
protected  double meanLower
          Lower bound for mean's confidence interval.
protected  double meanUpper
          Upper bound for the mean's confidence interval.
protected  double sd
          Standard deviation of the execution time.
protected  String sdIssues
          Records any issues with the standard deviation.
protected  double sdLower
          Lower bound for the standard deviation's confidence interval.
protected  double sdUpper
          Upper bound for the standard deviation's confidence interval.
 
Constructor Summary
Benchmark.Stats(double mean, double meanLower, double meanUpper, double sd, double sdLower, double sdUpper, String sdIssues)
          Constructor.
 
Method Summary
protected  void checkTimeValue(double t, String name)
          Checks that t is a valid time value.
protected  long cMaxSolver(double a, double muB, double sigmaB, double muA, double sigmaG, double x)
          See the "Computer algorithm" subsection of the article supplement for more details.
protected  String diagnoseSdOfActions(double a)
          See the "Standard deviation outlier model" section of the article supplement for more details.
 Benchmark.Stats forActions(long a)
          Calculates action statistics from block statistics.
 double getMean()
          Accessor for mean.
 double getMeanLower()
          Accessor for meanLower.
 double getMeanUpper()
          Accessor for meanUpper.
 double getSd()
          Accessor for sd.
 String getSdIssues()
          Accessor for sdIssues.
 double getSdLower()
          Accessor for sdLower.
 double getSdUpper()
          Accessor for sdUpper.
 String toString()
           
protected  String toStringCi(double d, double lower, double upper)
          Returns a String description of the confidence interval specified by the parameters.
protected  double varianceOutliers(double a, double sigmaB, double sigmaG, double c)
          See the Equation (45) of the article supplement for more details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mean

protected double mean
Arithmetic mean of the execution time.


meanLower

protected double meanLower
Lower bound for mean's confidence interval.


meanUpper

protected double meanUpper
Upper bound for the mean's confidence interval.


sd

protected double sd
Standard deviation of the execution time.


sdLower

protected double sdLower
Lower bound for the standard deviation's confidence interval.


sdUpper

protected double sdUpper
Upper bound for the standard deviation's confidence interval.


sdIssues

protected String sdIssues
Records any issues with the standard deviation.

Contract: either null else is nonblank.

Constructor Detail

Benchmark.Stats

public Benchmark.Stats(double mean,
                       double meanLower,
                       double meanUpper,
                       double sd,
                       double sdLower,
                       double sdUpper,
                       String sdIssues)
                throws IllegalStateException
Constructor.

Throws:
IllegalStateException - if any parameter violates the contract of the field it is assigned to
Method Detail

checkTimeValue

protected void checkTimeValue(double t,
                              String name)
                       throws IllegalStateException
Checks that t is a valid time value.

Throws:
IllegalStateException - if t is NaN, infinite, or < 0

getMean

public double getMean()
Accessor for mean.


getMeanLower

public double getMeanLower()
Accessor for meanLower.


getMeanUpper

public double getMeanUpper()
Accessor for meanUpper.


getSd

public double getSd()
Accessor for sd.


getSdLower

public double getSdLower()
Accessor for sdLower.


getSdUpper

public double getSdUpper()
Accessor for sdUpper.


getSdIssues

public String getSdIssues()
Accessor for sdIssues.


forActions

public Benchmark.Stats forActions(long a)
                           throws IllegalArgumentException
Calculates action statistics from block statistics. This method should only be called if this instance does, in fact, represent block statistics.

See the "Block statistics versus action statistics" section of the article supplement for more details.

Throws:
IllegalArgumentException - if a <= 0

diagnoseSdOfActions

protected String diagnoseSdOfActions(double a)
See the "Standard deviation outlier model" section of the article supplement for more details.


cMaxSolver

protected long cMaxSolver(double a,
                          double muB,
                          double sigmaB,
                          double muA,
                          double sigmaG,
                          double x)
See the "Computer algorithm" subsection of the article supplement for more details.


varianceOutliers

protected double varianceOutliers(double a,
                                  double sigmaB,
                                  double sigmaG,
                                  double c)
See the Equation (45) of the article supplement for more details.


toString

public String toString()
Overrides:
toString in class Object

toStringCi

protected String toStringCi(double d,
                            double lower,
                            double upper)
Returns a String description of the confidence interval specified by the parameters.