SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Package Attributes | List of all members
Discrepancy Class Referenceabstract

This abstract class is the base class of all discrepancy classes. More...

Inheritance diagram for Discrepancy:
[legend]

Public Member Functions

 Discrepancy (double[][] points, int n, int s)
 Constructor with the \(n\) points points[i] in \(s\) dimensions. More...
 
 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)\). More...
 
 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)\). More...
 
 Discrepancy (PointSet set)
 Constructor with the point set set. More...
 
 Discrepancy ()
 Empty constructor. More...
 
double compute ()
 Computes the discrepancy of all the points in maximal dimension (dimension of the points).
 
double compute (int s)
 Computes the discrepancy of all the points in dimension \(s\).
 
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.
 
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)
 Computes the discrepancy of all the points of points in maximum dimension. More...
 
double compute (double[] T, int n)
 Computes the discrepancy of the first n points of T in 1 dimension. More...
 
double compute (double[] T)
 Computes the discrepancy of all the points of T in 1 dimension. More...
 
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 (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.
 
double compute (PointSet set)
 Computes the discrepancy of all the points in set in the same dimension as the point set. More...
 
int getNumPoints ()
 Returns the number of points \(n\).
 
int getDimension ()
 Returns the dimension of the points \(s\).
 
void setPoints (double[][] points, int n, int s)
 Sets the points to points and the dimension to \(s\). More...
 
void setPoints (double[][] points)
 Sets the points to points. More...
 
void setGamma (double[] gam, int s)
 Sets the weight factors to gam for each dimension up to \(s\).
 
double [] getGamma ()
 Returns the weight factors gamma for each dimension up to \(s\).
 
String toString ()
 Returns the parameters of this class.
 
String formatPoints ()
 Returns all the points of this class.
 
String getName ()
 Returns the name of the Discrepancy.
 

Static Public Member Functions

static double [][] toArray (PointSet set)
 Returns all the \(n\) points ( \(s\)-dimensional) of umontreal.ssj.hups.PointSet set as an array points[ \(n\)][ \(s\)].
 
static DoubleArrayList sort (double[] T, int n)
 Sorts the first \(n\) points of \(T\). More...
 

Protected Member Functions

void appendGamma (StringBuffer sb, double[] gamma, int s)
 

Static Protected Member Functions

static void setONES (int s)
 

Protected Attributes

double [] gamma
 
double [][] Points
 
int dim
 
int numPoints
 

Static Protected Attributes

static double [] ONES = { 1 }
 

Static Package Attributes

static final double UNSIX = 1.0/6.0
 
static final double QUARAN = 1.0/42.0
 
static final double UNTRENTE = 1.0 / 30.0
 
static final double DTIERS = 2.0 / 3.0
 
static final double STIERS = 7.0 / 3.0
 
static final double QTIERS = 14.0 / 3.0
 

Detailed Description

This abstract class is the base class of all discrepancy classes.

All derived classes must implement the abstract method compute(points, n, s).

Constructor & Destructor Documentation

◆ Discrepancy() [1/5]

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() [2/5]

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() [3/5]

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() [4/5]

Constructor with the point set set.

All the points are copied in an internal array.

◆ Discrepancy() [5/5]

Empty constructor.

The points and parameters must be defined before calling methods of this or derived classes.

Member Function Documentation

◆ compute() [1/4]

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() [2/4]

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() [3/4]

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() [4/4]

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\).

◆ setPoints() [1/2]

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() [2/2]

void setPoints ( double  points[][])

Sets the points to points.

The number of points and the dimension are the same as in points.

◆ sort()

static DoubleArrayList sort ( double []  T,
int  n 
)
static

Sorts the first \(n\) points of \(T\).

Returns the sorted points. Warning: \(T\) is sorted also.


The documentation for this class was generated from the following file: