Top Description Fields Constructors Methods
org.antlr.runtime.misc

public Class Stats

extends Object
Class Inheritance
Imports
java.io.*, java.util.List

Stats routines needed by profiler etc... // note that these routines return 0.0 if no values exist in the X[] // which is not "correct", but it is useful so I don't generate NaN // in my output

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static double
avg(int[] X)

Compute the sample mean

public static double
avg(List<Integer> X)

Compute the sample mean

public static String
public static int
max(int[] X)

public static int
public static int
min(int[] X)

public static int
public static double
stddev(int[] X)

Compute the sample (unbiased estimator) standard deviation following: Computing Deviations: Standard Accuracy Tony F. Chan and John Gregg Lewis Stanford University Communications of ACM September 1979 of Volume 22 the ACM Number 9 The "two-pass" method from the paper; supposed to have better numerical properties than the textbook summation/sqrt.

public static int
sum(int[] X)

public static void
writeReport(String filename, String data)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANTLRWORKS_DIRback to summary
public static final String ANTLRWORKS_DIR

Constructor Detail

Statsback to summary
public Stats()

Method Detail

avgback to summary
public static double avg(int[] X)

Compute the sample mean

avgback to summary
public static double avg(List<Integer> X)

Compute the sample mean

getAbsoluteFileNameback to summary
public static String getAbsoluteFileName(String filename)
maxback to summary
public static int max(int[] X)
maxback to summary
public static int max(List<Integer> X)
minback to summary
public static int min(int[] X)
minback to summary
public static int min(List<Integer> X)
stddevback to summary
public static double stddev(int[] X)

Compute the sample (unbiased estimator) standard deviation following: Computing Deviations: Standard Accuracy Tony F. Chan and John Gregg Lewis Stanford University Communications of ACM September 1979 of Volume 22 the ACM Number 9 The "two-pass" method from the paper; supposed to have better numerical properties than the textbook summation/sqrt. To me this looks like the textbook method, but I ain't no numerical methods guy.

sumback to summary
public static int sum(int[] X)
writeReportback to summary
public static void writeReport(String filename, String data) throws IOException