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 = 318;
45 private static final int NUMCOLS = 30;
63 StringBuffer sb =
new StringBuffer(
"Niederreiter sequence in base 2" +
PrintfFormat.
NEWLINE);
64 sb.append(super.toString());
68 private void init(
int k,
int r,
int w,
int dim) {
69 if ((
dim < 1) || (
dim > MAXDIM))
70 throw new IllegalArgumentException(
"Dimension for NiedSequenceBase2 must be > 1 and <= " + MAXDIM);
72 throw new IllegalArgumentException(
"One must have k < 31 and k <= r <= w <= 31 for NiedSequenceBase2");
78 normFactor = 1.0 / ((double) (1L << (outDigits)));
79 genMat =
new int[
dim * numCols];
84 init(k, numRows, outDigits,
dim);
93 private void initGenMat() {
94 for (
int j = 0; j <
dim; j++)
95 for (
int c = 0; c < numCols; c++) {
96 genMat[j * numCols + c] = NiedMat[j * NUMCOLS + c] << 1;
97 genMat[j * numCols + c] >>=
MAXBITS - outDigits;
116 private static int[] NiedMat;
117 private static final int MAXN = 9540;
120 NiedMat =
new int[MAXN];
124 .getResourceAsStream(
"umontreal/ssj/hups/dataSer/Nieder/NiedSequenceBase2.ser");
126 throw new FileNotFoundException(
"Cannot find NiedSequenceBase2.ser");
127 ObjectInputStream ois =
new ObjectInputStream(is);
128 NiedMat = (
int[]) ois.readObject();
131 }
catch (FileNotFoundException e) {
135 }
catch (IOException e) {
139 }
catch (ClassNotFoundException e) {
This abstract class describes methods specific to digital sequences in base.
NiedSequenceBase2(int k, int w, int dim)
Constructs a new digital sequence in base 2 from the first.
String toString()
Formats a string that contains information on this digital net.
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.