24package umontreal.ssj.discrepancy;
26import umontreal.ssj.hups.PointSet;
67 public double compute(
double[][] points,
int n,
int s,
double[] gamma) {
114 public double compute(
double[][] points,
int n,
int s) {
116 final double RAC3 = 1.73205080756887729352;
118 for (
int i = 0; i < N; ++i) {
120 for (
int j = 0; j < s; ++j) {
121 double u = points[i][j];
122 prod *= (RAC3 - u) * (RAC3 + u);
126 double disc = -Math.pow(0.5, (
double) (s - 1)) * sum / N;
129 for (
int i = 0; i < N; ++i) {
131 for (
int j = 0; j < s; ++j)
132 prod *= 2.0 - points[i][j];
137 for (
int i = 0; i < N - 1; ++i) {
138 for (
int j = i + 1; j < N; ++j) {
140 for (
int k = 0; k < s; ++k)
141 prod *= 2.0 - Math.max(points[i][k], points[j][k]);
146 disc += (sum + 2.0 * sum2) / ((
long) N * N);
147 disc += Math.pow(4.0 / 3.0, s);
150 return Math.sqrt(disc);
165 for (
int i = 0; i < n; ++i)
167 double disc = sum / n;
170 for (
int i = 0; i < n; ++i)
174 for (
int i = 0; i < n - 1; ++i) {
175 for (
int j = i + 1; j < n; ++j)
176 sum2 += Math.max(T[i], T[j]);
179 disc -= (sum + 2.0 * sum2) / ((
long) n * n);
183 return Math.sqrt(disc);
DiscL2Hickernell(int n, int s)
Constructor with points in dimension .
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 Hickernell.
DiscL2Hickernell(double[][] points, int n, int s)
Constructor with the points points[i] in dimension.
double compute(double[][] points, int n, int s)
Computes the Hickernell.
DiscL2Hickernell()
Empty constructor.
DiscL2Hickernell(PointSet set)
Constructor with the point set set.
Discrepancy(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions.
double compute()
Computes the discrepancy of all the points in maximal dimension (dimension of the points).
This abstract class represents a general point set.