Package org.antlr.runtime.misc
Class Stats
- java.lang.Object
-
- org.antlr.runtime.misc.Stats
-
public class Stats extends Object
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
Fields Modifier and Type Field Description static String
ANTLRWORKS_DIR
-
Constructor Summary
Constructors Constructor Description Stats()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
avg(int[] X)
Compute the sample meanstatic double
avg(List<Integer> X)
Compute the sample meanstatic String
getAbsoluteFileName(String filename)
static int
max(int[] X)
static int
max(List<Integer> X)
static int
min(int[] X)
static int
min(List<Integer> X)
static double
stddev(int[] X)
Compute the sample (unbiased estimator) standard deviation following: Computing Deviations: Standard Accuracy Tony F.static int
sum(int[] X)
static void
writeReport(String filename, String data)
-
-
-
Field Detail
-
ANTLRWORKS_DIR
public static final String ANTLRWORKS_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
stddev
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.
-
avg
public static double avg(int[] X)
Compute the sample mean
-
min
public static int min(int[] X)
-
max
public static int max(int[] X)
-
sum
public static int sum(int[] X)
-
writeReport
public static void writeReport(String filename, String data) throws IOException
- Throws:
IOException
-
-