25package umontreal.ssj.hups;
55 private int[][] permutation;
56 private boolean permuted;
59 private final static int positiveBitMask = ~Integer.reverse(1);
68 throw new IllegalArgumentException(
"Halton sequence must have positive dimension dim");
73 java.util.Arrays.fill(start, 0);
85 for (
int i = 0; i <
dim; i++)
95 public void init(
double[] x0) {
97 for (
int i = 0; i <
dim; i++)
110 permutation =
new int[
dim][];
111 for (
int i = 0; i <
dim; i++) {
112 permutation[i] =
new int[base[i]];
125 permutation =
new int[
dim][];
126 for (
int i = 0; i <
dim; i++) {
127 permutation[i] =
new int[base[i]];
142 return Integer.MAX_VALUE;
146 if (radinv !=
null) {
148 return radinv[j].nextRadicalInverse();
150 throw new UnsupportedOperationException(
"Fast radical inverse is not implemented in case of permutation");
153 int k = start[j] + i;
157 k = (k & positiveBitMask) + 1;
void ErasePermutations()
Erases the permutations: from now on, the digits will not be permuted.
int getNumPoints()
Returns the number of points.
HaltonSequence(int dim)
Constructs a new Halton sequence in dim dimensions.
void addFaureLemieuxPermutations()
Permutes the digits using permutations from vfau09a for all coordinates.
void init(double[] x0)
Initializes the Halton sequence starting at point x0.
double getCoordinate(int i, int j)
Returns , the coordinate of the point .
void addFaurePermutations()
Permutes the digits using Faure permutations for all coordinates.
void setStart(double[] x0)
Initializes the Halton sequence starting at point x0.
This abstract class represents a general point set.
int numPoints
Number of points.
int dim
Dimension of the points.
This class implements basic methods for working with radical inverses of integers in an arbitrary bas...
static double permutedRadicalInverse(int b, int[] pi, long i)
Computes the radical inverse of in base , where the digits are permuted using the permutation .
static double radicalInverse(int b, long i)
Computes the radical inverse of in base .
static void getFaureLemieuxPermutation(int coordinate, int[] pi)
Computes the permutations as proposed in vfau09a .
static void getFaurePermutation(int b, int[] pi)
Computes the Faure permutation rfau92a of the set and puts it in array pi.
static int radicalInverseInteger(int b, double x)
Computes the radical inverse of in base .
static int[] getPrimes(int n)
Provides an elementary method for obtaining the first prime numbers larger than 1.