25package umontreal.ssj.hups;
27import java.io.Serializable;
28import java.io.ObjectInputStream;
29import java.io.InputStream;
30import java.io.FileNotFoundException;
31import java.io.IOException;
32import umontreal.ssj.util.PrintfFormat;
44 private static final int MAXDIM = 32;
45 private static final int NUMCOLS = 30;
46 private static final boolean isTrans =
true;
68 sb.append(super.toString());
72 private void init(
int k,
int r,
int w,
int dim) {
73 if ((
dim < 1) || (
dim > MAXDIM))
74 throw new IllegalArgumentException(
"Dimension for NiedXingSequenceBase2 must be > 1 and <= " + MAXDIM);
76 throw new IllegalArgumentException(
"One must have k < 31 and k <= r <= w <= 31 for NiedXingSequenceBase2");
83 normFactor = 1.0 / ((double) (1L << (outDigits)));
84 genMat =
new int[
dim * numCols];
89 init(k, numRows, outDigits,
dim);
93 private void initGenMat() {
111 start = ((
dim * (
dim - 1) / 2) - 6) * NUMCOLS;
115 for (
int j = 0; j <
dim; j++)
116 for (
int c = 0; c < numCols; c++) {
117 x = NiedXingMatTrans[start + j * NUMCOLS + c];
119 genMat[j * numCols + c] = (int) (x >> (
MAXBITS - outDigits));
122 for (
int j = 0; j <
dim; j++)
123 for (
int c = 0; c < numCols; c++) {
124 x = NiedXingMat[start + j * NUMCOLS + c];
126 genMat[j * numCols + c] = (int) (x >> (
MAXBITS - outDigits));
148 private static int[] NiedXingMat;
149 private static int[] NiedXingMatTrans;
150 private static final int MAXN = 15660;
154 NiedXingMatTrans =
new int[MAXN];
166 .getResourceAsStream(
"umontreal/ssj/hups/dataSer/Nieder/NiedXingSequenceBase2Trans.ser");
168 throw new FileNotFoundException(
"Cannot find NiedXingSequenceBase2Trans.ser");
169 ObjectInputStream ois =
new ObjectInputStream(is);
170 NiedXingMatTrans = (
int[]) ois.readObject();
173 }
catch (FileNotFoundException e) {
177 }
catch (IOException e) {
181 }
catch (ClassNotFoundException e) {
This abstract class describes methods specific to digital sequences in base.
String toString()
Formats a string that contains information on this digital net.
NiedXingSequenceBase2(int k, int w, int dim)
Constructs a new Niederreiter-Xing digital sequence in base 2 with.
void extendSequence(int k)
Increases the number of points to from now on.
static final int MAXBITS
Since Java has no unsigned type, the 32nd bit cannot be used efficiently, so we have only 31 bits.
int numPoints
Number of points.
int dim
Dimension of the points.