25package umontreal.ssj.discrepancy;
27import umontreal.ssj.hups.Rank1Lattice;
62 static final double TRENTEUN24 = 31.0 / 24.0;
63 static final double SEPT24 = 7.0 / 24.0;
65 private static double computeFactor(
double x,
double C1,
double C2,
double C3) {
77 pol1 = -0.5625 + x * (3.0 - x * (4.5 - 2.0 * x));
78 pol2 = -TRENTEUN24 + x * (6.0 - x * (4.0 + x * (6.0 - 5.0 * x)));
79 temp = 1.0 + x * (-6.0 + 4.0 * x);
80 pol3 = 0.046875 * temp * temp * (4.0 * x - 3.0);
83 pol1 = -0.0625 + x * x * (1.5 - 2.0 * x);
84 pol2 = -SEPT24 + x * x * (8.0 - x * (14.0 - 5.0 * x));
85 temp = 1.0 + x * (2.0 - 4.0 * x);
86 pol3 = -0.046875 * temp * temp * (4.0 * x - 1.0);
89 temp = C1 * pol1 + C2 * pol2 + C3 * pol3;
108 super(points, n, s, gamma);
142 public double compute(
double[][] points,
int n,
int s) {
144 return compute(points, n, s, ONES);
153 public double compute(
double[][] points,
int n,
int s,
double[] gamma) {
154 double[] C1 =
new double[s];
155 double[] C2 =
new double[s];
156 double[] C3 =
new double[s];
157 setC(C1, C2, C3, gamma, s);
162 for (
int i = 0; i < n; ++i) {
164 for (r = 0; r < s; ++r) {
165 fact = computeFactor(points[i][r], C1[r], C2[r], C3[r]);
170 double disc = sum / n - 1.0;
173 return Math.sqrt(disc);
192 public double compute(
double[] T,
int n,
double gamma) {
193 double[] C = setC(gamma);
199 for (
int i = 0; i < n; ++i) {
201 double pol1 = ((h - 2.0) * h + 1.0) * h * h - UNTRENTE;
205 double pol2 = ((v - 2.0) * v + 1.0) * v * v - UNTRENTE;
206 double temp = C1 * (pol1 - pol2) + C2 * (7.0 * pol1 - 2.0 * pol2);
209 pol1 = (((h - 3.0) * h + 2.5) * h * h - 0.5) * h * h + QUARAN;
210 pol2 = (((v - 3.0) * v + 2.5) * v * v - 0.5) * v * v + QUARAN;
211 temp += C3 * (pol1 - pol2);
215 double disc = sum / n;
218 return Math.sqrt(disc);
DiscShiftBaker1Lattice(int n, int s, double[] gamma)
The number of points is , the dimension , and the.
double compute(double[][] points, int n, int s, double[] gamma)
Computes the discrepancy ( shiftBaker1lat ) for the -dimensional points of lattice points,...
DiscShiftBaker1Lattice(double[][] points, int n, int s, double[] gamma)
Constructor with the points points[i] in dimensions, with weights gamma[r-1].
double compute(double[] T, int n)
Computes the discrepancy ( shiftBaker1latdim1 ) with weight for the 1-dimensional lattice of points...
double compute(double[][] points, int n, int s)
Computes the discrepancy ( shiftBaker1lat ) for the -dimensional points of lattice points,...
double compute(double[] T, int n, double gamma)
Computes the discrepancy ( shiftBaker1latdim1 ) for the 1-dimensional lattice of points ,...
DiscShiftBaker1Lattice(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions, and with all weights .
DiscShiftBaker1Lattice()
Empty constructor.
DiscShiftBaker1Lattice(Rank1Lattice set)
Constructor with the point set set.
DiscShiftBaker1(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions, with all the weights .
double compute()
Computes the discrepancy of all the points in maximal dimension (dimension of the points).
This class implements point sets specified by integration lattices of rank 1.