|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjphase.generator.GeneratorUtils
public class GeneratorUtils
This class contains a set of methods to make some usual calculations for the PhaseGenerator classes
| Constructor Summary | |
|---|---|
GeneratorUtils()
|
|
| Method Summary | |
|---|---|
static double |
algorKS(double[] data,
PhaseVar var)
This method implements the KS algorithm proposed by Gonz�lez, Sahni and Franta in "An efficient algorithm for the Kolmogorov-Smirnov and Lilliefors Tests" in ACM Transactions on Mathematical Software, Vol 3, No. |
static void |
aliasCut(double[] dist,
int[] alias,
double[] cutoff)
This method generates the aliases and cutoff values according to the distribution especified. |
static void |
aliasCut(no.uib.cipr.matrix.Vector dist,
int[] alias,
double[] cutoff)
This method generates the aliases and cutoff values according to the distribution especified. |
static int |
argmax(double[] data)
Returns the index of the maximum value in the data |
static int |
argmin(double[] data)
Returns the index of the minimum value in the data |
static double |
erlang(double lambda,
int r,
java.util.Random rand)
Returns a random number with Erlang(lambda, r) distribution. |
static int |
getNumber(double[] dist,
int[] alias,
double[] cutoff,
java.util.Random rand)
Returns a random number with discrete distribution dist in {0,...,n} |
static double |
sum(double[] data)
Returns the sum of the elements of the data array |
static double |
sumAbs(double[] data)
Returns the sum of the absolut values of the elements of the data array |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneratorUtils()
| Method Detail |
|---|
public static int argmin(double[] data)
data - array of data
public static int argmax(double[] data)
data - array of data
public static double sum(double[] data)
data - array of data
public static double sumAbs(double[] data)
data - array of data
public static void aliasCut(no.uib.cipr.matrix.Vector dist,
int[] alias,
double[] cutoff)
dist - Distribution from which the aliases and cutoff vectors
must be generated. Represented by a MTJ Vector.alias - vector of the distributioncutoff - values of the distribution
public static void aliasCut(double[] dist,
int[] alias,
double[] cutoff)
dist - Distribution from which the aliases and cutoff vectors
must be generated. Represented by array of doubles.alias - vector of the distributioncutoff - values of the distribution
public static int getNumber(double[] dist,
int[] alias,
double[] cutoff,
java.util.Random rand)
dist - Discrete distribution in {0,...,n}alias - Aliases of the distributions pointscutoff - Cutoff values to generate the random numbersrand - Random type object to use as generator of random numbers
public static double erlang(double lambda,
int r,
java.util.Random rand)
lambda - Erlang rater - number of phases in the Erlang Distributionrand - Random number source
public static double algorKS(double[] data,
PhaseVar var)
data - data trace to be testedvar - theoretical phase variable to be compared against the trace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||