ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters
Class StatUtil

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.StatUtil

public class StatUtil
extends Object

Provides methods to add ratios into lists and matrices of statistical probes as well as a method to trim arrays of observations in statistical probes in order to save memory.


Method Summary
static void addRatio(ListOfTallies<?> mt, double[] x, double[] y)
          Equivalent to add (mt, x, y, 1.0).
static void addRatio(ListOfTallies<?> at, double[] x, double[] y, double mult)
          For each tally i in the list of tallies at, adds the ratio mult*x[i]/y[i].
static void addRatio(MatrixOfTallies<?> mt, DoubleMatrix2D x, DoubleMatrix2D y)
          Equivalent to add (mt, x, y, 1.0, Double.NaN).
static void addRatio(MatrixOfTallies<?> mt, DoubleMatrix2D x, DoubleMatrix2D y, double mult)
          Equivalent to add (mt, x, y, mult, Double.NaN).
static void addRatio(MatrixOfTallies<?> mt, DoubleMatrix2D x, DoubleMatrix2D y, double mult, double zeroOverZero)
          For each tally (r, c) in the matrix of tallies mt, adds the ratio mult*x.get (r, c)/y.get (r, c).
static void compactProbes(Iterable<?> probes)
          Trims the internal arrays of statistical probes listed in probes to minimize memory utilization.
static MatrixOfFunctionOfMultipleMeansTallies<FunctionOfMultipleMeansTally> createMatrixOfRatioTallies(MatrixOfTallies<?> upper, MatrixOfTallies<?> lower)
          Creates a matrix of ratio tallies from two matrices of tallies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addRatio

public static void addRatio(MatrixOfTallies<?> mt,
                            DoubleMatrix2D x,
                            DoubleMatrix2D y)
Equivalent to add (mt, x, y, 1.0, Double.NaN).


addRatio

public static void addRatio(MatrixOfTallies<?> mt,
                            DoubleMatrix2D x,
                            DoubleMatrix2D y,
                            double mult)
Equivalent to add (mt, x, y, mult, Double.NaN).


addRatio

public static void addRatio(MatrixOfTallies<?> mt,
                            DoubleMatrix2D x,
                            DoubleMatrix2D y,
                            double mult,
                            double zeroOverZero)
For each tally (r, c) in the matrix of tallies mt, adds the ratio mult*x.get (r, c)/y.get (r, c). If a 0/0 ratio must be added, the value zeroOverZero is used instead of Double.NaN.

Parameters:
mt - the target matrix of tallies.
x - the numerator matrix.
y - the denominator matrix.
mult - the multiplier of the ratio.
zeroOverZero - the value for 0/0.
Throws:
IllegalArgumentException - if the dimensions of x or y do not correspond to the dimensions of the matrix of tallies.

addRatio

public static void addRatio(ListOfTallies<?> mt,
                            double[] x,
                            double[] y)
Equivalent to add (mt, x, y, 1.0).


addRatio

public static void addRatio(ListOfTallies<?> at,
                            double[] x,
                            double[] y,
                            double mult)
For each tally i in the list of tallies at, adds the ratio mult*x[i]/y[i].

Parameters:
at - the target list of tallies.
x - the numerator array.
y - the denominator array.
mult - the multiplier of the ratio.
Throws:
IllegalArgumentException - if the length of x or y do not correspond to the length of the list of tallies.

createMatrixOfRatioTallies

public static MatrixOfFunctionOfMultipleMeansTallies<FunctionOfMultipleMeansTally> createMatrixOfRatioTallies(MatrixOfTallies<?> upper,
                                                                                                              MatrixOfTallies<?> lower)
Creates a matrix of ratio tallies from two matrices of tallies. This method takes two matrices which must have the same dimensions. The ratio tally for row r and column c is constructed by taking the tallies at corresponding row and column in upper and lower.

Parameters:
upper - the matrix of upper parts of ratios.
lower - the matrix of lower parts of ratios.
Returns:
the new matrix of ratio tallies.

compactProbes

public static void compactProbes(Iterable<?> probes)
Trims the internal arrays of statistical probes listed in probes to minimize memory utilization. For each TallyStore object in probes or in an array or matrix added to probes, calls TallyStore.getArray().trimToSize().

Parameters:
probes - the list of statistical probes to process.

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.