SSJ
V. labo.

umontreal.iro.lecuyer.discrepancy
Class Discrepancy

java.lang.Object
  extended by umontreal.iro.lecuyer.discrepancy.Discrepancy
Direct Known Subclasses:
BigDiscrepancy, DiscL2Hickernell, DiscL2Star, DiscL2Symmetric, DiscL2Unanchored, DiscShift1, DiscShift2, DiscShiftBaker1, Palpha

public abstract class Discrepancy
extends Object

This abstract class is the base class of all discrepancy classes. All derived classes must implement the abstract method compute(points, n, s).


Constructor Summary
Discrepancy()
          Empty constructor.
Discrepancy(double[][] points, int n, int s)
          Constructor with the n points points[i] in s dimensions.
Discrepancy(double[][] points, int n, int s, double[] gamma)
          Constructor with the n points points[i] in s dimensions and the s weight factors gamma[j], j = 0, 1,…,(s - 1).
Discrepancy(int n, int s, double[] gamma)
          The number of points is n, the dimension s, and the s weight factors are gamma[j], j = 0, 1,…,(s - 1).
Discrepancy(PointSet set)
          Constructor with the point set set.
 
Method Summary
 double compute()
          Computes the discrepancy of all the points in maximal dimension (dimension of the points).
 double compute(double[] T)
          Computes the discrepancy of all the points of T in 1 dimension.
 double compute(double[][] points)
          Computes the discrepancy of all the points of points in maximum dimension.
abstract  double compute(double[][] points, int n, int s)
          Computes the discrepancy of the first n points of points in dimension s with weights = 1.
 double compute(double[][] points, int n, int s, double[] gamma)
          Computes the discrepancy of the first n points of points in dimension s with weights gamma.
 double compute(double[] T, int n)
          Computes the discrepancy of the first n points of T in 1 dimension.
 double compute(double[] T, int n, double gamma)
          Computes the discrepancy of the first n points of T in 1 dimension with weight gamma.
 double compute(int s)
          Computes the discrepancy of all the points in dimension s.
 double compute(PointSet set)
          Computes the discrepancy of all the points in set in the same dimension as the point set.
 double compute(PointSet set, double[] gamma)
          Computes the discrepancy of all the points in set in the same dimension as the point set and with weights gamma.
 String formatPoints()
          Returns all the points of this class.
 int getDimension()
          Returns the dimension of the points s.
 double[] getGamma()
          Returns the weight factors gamma for each dimension up to s.
 String getName()
          Returns the name of the Discrepancy.
 int getNumPoints()
          Returns the number of points n.
 void setGamma(double[] gam, int s)
          Sets the weight factors to gam for each dimension up to s.
 void setPoints(double[][] points)
          Sets the points to points.
 void setPoints(double[][] points, int n, int s)
          Sets the points to points and the dimension to s.
static DoubleArrayList sort(double[] T, int n)
          Sorts the first n points of T.
static double[][] toArray(PointSet set)
          Returns all the n points (s-dimensional) of PointSet set as an array points[n][s].
 String toString()
          Returns the parameters of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Discrepancy

public Discrepancy(double[][] points,
                   int n,
                   int s)
Constructor with the n points points[i] in s dimensions. points[i][j] is the j-th coordinate of point i. Both i and j start at 0. One may also choose points = null in which case, the points must be set later.


Discrepancy

public Discrepancy(double[][] points,
                   int n,
                   int s,
                   double[] gamma)
Constructor with the n points points[i] in s dimensions and the s weight factors gamma[j], j = 0, 1,…,(s - 1). points[i][j] is the j-th coordinate of point i. Both i and j start at 0. One may also choose points = null in which case, the points must be set later.


Discrepancy

public Discrepancy(int n,
                   int s,
                   double[] gamma)
The number of points is n, the dimension s, and the s weight factors are gamma[j], j = 0, 1,…,(s - 1). The n points will be chosen later.


Discrepancy

public Discrepancy(PointSet set)
Constructor with the point set set. All the points are copied in an internal array.


Discrepancy

public Discrepancy()
Empty constructor. The points and parameters must be defined before calling methods of this or derived classes.

Method Detail

compute

public double compute()
Computes the discrepancy of all the points in maximal dimension (dimension of the points).


compute

public double compute(int s)
Computes the discrepancy of all the points in dimension s.


compute

public double compute(double[][] points,
                      int n,
                      int s,
                      double[] gamma)
Computes the discrepancy of the first n points of points in dimension s with weights gamma.


compute

public abstract double compute(double[][] points,
                               int n,
                               int s)
Computes the discrepancy of the first n points of points in dimension s with weights = 1.


compute

public double compute(double[][] points)
Computes the discrepancy of all the points of points in maximum dimension. Calls method compute(points, points.length, points[0].length, gamma).


compute

public double compute(double[] T,
                      int n)
Computes the discrepancy of the first n points of T in 1 dimension. Copies the points in an array of arrays and calls method compute(double[][], n, 1). It should be reimplemented in subclasses for better efficiency.


compute

public double compute(double[] T)
Computes the discrepancy of all the points of T in 1 dimension. Calls method compute(T, T.length, gamma[0]).


compute

public double compute(double[] T,
                      int n,
                      double gamma)
Computes the discrepancy of the first n points of T in 1 dimension with weight gamma.


compute

public double compute(PointSet set,
                      double[] gamma)
Computes the discrepancy of all the points in set in the same dimension as the point set and with weights gamma.


compute

public double compute(PointSet set)
Computes the discrepancy of all the points in set in the same dimension as the point set. All the weights = 1.


getNumPoints

public int getNumPoints()
Returns the number of points n.


getDimension

public int getDimension()
Returns the dimension of the points s.


setPoints

public void setPoints(double[][] points,
                      int n,
                      int s)
Sets the points to points and the dimension to s. The number of points is n.


setPoints

public void setPoints(double[][] points)
Sets the points to points. The number of points and the dimension are the same as in points.


setGamma

public void setGamma(double[] gam,
                     int s)
Sets the weight factors to gam for each dimension up to s.


getGamma

public double[] getGamma()
Returns the weight factors gamma for each dimension up to s.


toArray

public static double[][] toArray(PointSet set)
Returns all the n points (s-dimensional) of PointSet set as an array points[n][s].


sort

public static DoubleArrayList sort(double[] T,
                                   int n)
Sorts the first n points of T. Returns the sorted points. Warning: T is sorted also.


toString

public String toString()
Returns the parameters of this class.

Overrides:
toString in class Object

formatPoints

public String formatPoints()
Returns all the points of this class.


getName

public String getName()
Returns the name of the Discrepancy.


SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.