|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.discrepancy.DiscrepancyContainer
public class DiscrepancyContainer
This class is used to compute, store and display discrepancies.
The method add computes the discrepancy of a given array
of points for the selected discrepancies and associates them
with a given index. One can assign a parameter value to this index (using
setParam) so that a graph or a data file is
created showing the discrepancies as functions of the parameter.
One can also scale the discrepancies of an index with a given
scale factor or take the logarithm of the discrepancies.
The discrepancies are computed, assuming that the theoretical distribution of the points is over the unit hypercube [0, 1]s; thus all the coordinates of the points must be in [0, 1].
| Constructor Summary | |
|---|---|
DiscrepancyContainer(Discrepancy[] discrepancies)
Creates a DiscrepancyContainer for the given
discrepancies. |
|
| Method Summary | |
|---|---|
void |
add(int i,
double[][] points,
int n,
int s)
Computes the discrepancies of the first n values contained in points using the first s coordinates, and adds the values at index i. |
void |
add(int i,
double[] points,
int n)
Computes the discrepancies of the first n values contained in points, and adds the values at index i. |
void |
addSquare(int i,
double[][] points,
int n,
int s)
Computes the square discrepancies of the first n values contained in points using the first s coordinates, and adds the values at index i. |
void |
addSquare(int i,
double[] points,
int n)
Computes the square of the discrepancies of the first n values contained in points, and adds the values at index i. |
void |
compute(int i,
double[][] points,
int n,
int s)
Computes the discrepancies of the first n values contained in points using the first s coordinates and sets the values at index i. |
void |
compute(int i,
double[] points,
int n)
Computes the discrepancies of the first n values contained in points and sets the values at index i. |
void |
init(int n)
Calls init(n,"","Parameter", "Discrepancy"). |
void |
init(int n,
String title,
String xLabel,
String yLabel)
Initialize the container with enough space for n values of the parameter and sets the values to 0. |
void |
log2(int i)
Takes the logarithm in base 2 of the discrepancy values at index i. |
String |
regressionToString()
Formats and returns a String containing the linear regression slopes for the discrepancies as function of the parameter. |
void |
reset()
Calls reset(i) for all indices i. |
void |
reset(int i)
Resets the values of the discrepancies at index i to 0. |
void |
scale(double scale)
Calls scale(i,scale) for all indices i. |
void |
scale(int i,
double scale)
Multiplies all the discrepancies at index i by scale; |
void |
setParam(int i,
double paramValue)
Sets the parameter value at index i to parmValue. |
void |
square(int i)
Squares the discrepancy values at index i. |
void |
toDatFile(String filename,
String header)
Creates a file named filename.dat and writes in it the given header, a table showing the discrepancies for the different values of the parameter and the linear regression slopes. |
String |
toString()
Returns a String containing a table showing the discrepancies for the different values of the parameter. |
void |
toTexFile(String filename)
Creates a file named filename.tex containing LATEX code that can be compiled by pdfLaTeX to a graph of the discrepancies as function of the parameter. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DiscrepancyContainer(Discrepancy[] discrepancies)
DiscrepancyContainer for the given
discrepancies.
discrepancies - array containing the discrepancies to be used| Method Detail |
|---|
public void init(int n,
String title,
String xLabel,
String yLabel)
n - number of values the parameter will taketitle - titlexLabel - label name for the parameteryLabel - label name for the discrepancypublic void init(int n)
init(n,"","Parameter", "Discrepancy").
n - Number of values the parameter will take.public void reset(int i)
i - index to resetpublic void reset()
reset(i) for all indices i.
public void compute(int i,
double[] points,
int n)
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to use
public void compute(int i,
double[][] points,
int n,
int s)
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to uses - number of coordinates to use for each point
public void add(int i,
double[] points,
int n)
scale to calculate an average discrepancy over
more than one point set.
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to use
public void addSquare(int i,
double[] points,
int n)
scale to calculate an
average square discrepancy over more than one point set.
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to use
public void add(int i,
double[][] points,
int n,
int s)
scale to calculate an average discrepancy over
more than one point set.
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to uses - number of coordinates to use for each point
public void addSquare(int i,
double[][] points,
int n,
int s)
scale to calculate an average square discrepancy over
more than one point set.
i - index where to add the discrepanciespoints - values for which to compute the discrepanciesn - number of points to uses - number of coordinates to use for each point
public void scale(int i,
double scale)
i - index where to scalescale - scale factorpublic void scale(double scale)
scale(i,scale) for all indices i.
scale - scale factorpublic void log2(int i)
i - index where to take the logarithmpublic void square(int i)
i - index where to take the logarithm
public void setParam(int i,
double paramValue)
i - index where to set the parameter valueparamValue - value to set the parameterpublic String regressionToString()
public void toTexFile(String filename)
filename - name of the LaTeX file to be created (without the .tex extension)
public void toDatFile(String filename,
String header)
filename - name of the output file (without any extension)header - header of the file (can be empty)public String toString()
toString in class Object
|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||