umontreal.iro.lecuyer.hups
Class HaltonSequence
- java.lang.Object
-
- umontreal.iro.lecuyer.hups.PointSet
-
- umontreal.iro.lecuyer.hups.HaltonSequence
-
public class HaltonSequence extends PointSet
This class implements the sequence of Halton, which is essentially a modification of Hammersley nets for producing an infinite sequence of points having low discrepancy. The ith point in s dimensions isfor i = 0, 1, 2,..., where ψb is the radical inverse function in base b, defined in class
i = (ψb1(i), ψb2(i),..., ψbs(i)),
RadicalInverse, and where 2 = b1 < ... < bs are the s smallest prime numbers in increasing order.A fast method is implemented to generate randomized Halton sequences, starting from an arbitrary points x0.
The points can be ``scrambled'' by applying a permutation to the digits of i before computing each coordinate, in the same way as for the class
HammersleyPointSet, for all coordinates j >= 0.
-
-
Constructor Summary
Constructors Constructor and Description HaltonSequence(int dim)Constructs a new Halton sequence in dim dimensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddFaurePermutations()Permutes the digits using Faure permutations for all coordinates.voidErasePermutations()Erases the Faure permutations: from now on, the digits will not be Faure permuted.doublegetCoordinate(int i, int j)Returns ui, j, the coordinate j of the point i.intgetNumPoints()Returns the number of points.voidinit(double[] x0)Initializes the Halton sequence starting at point x0.-
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
addRandomShift, addRandomShift, addRandomShift, addRandomShift, clearRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getStream, iterator, randomize, randomize, randomize, randomize, randomize, setStream, toString, unrandomize
-
-
-
-
Constructor Detail
-
HaltonSequence
public HaltonSequence(int dim)
Constructs a new Halton sequence in dim dimensions.- Parameters:
dim- dimension
-
-
Method Detail
-
init
public void init(double[] x0)
Initializes the Halton sequence starting at point x0. The dimension of x0 must be at least as large as the dimension of this object.- Parameters:
x0- starting point of the Halton sequence
-
addFaurePermutations
public void addFaurePermutations()
Permutes the digits using Faure permutations for all coordinates. After the method is called, the coordinates ui, j are generated viaui, j = ∑r=0k-1πj[ar]bj-r-1,for j = 0,..., s - 1, where πj is the Faure permutation of {0,..., bj -1}.
-
ErasePermutations
public void ErasePermutations()
Erases the Faure permutations: from now on, the digits will not be Faure permuted.
-
getNumPoints
public int getNumPoints()
Description copied from class:PointSetReturns the number of points. If this number is actually infinite, Integer.MAX_VALUE is returned.- Overrides:
getNumPointsin classPointSet- Returns:
- the number of points in the point set or Integer.MAX_VALUE if the point set has an infinity of points.
-
getCoordinate
public double getCoordinate(int i, int j)Description copied from class:PointSetReturns ui, j, the coordinate j of the point i.- Specified by:
getCoordinatein classPointSet- Parameters:
i- index of the point to look forj- index of the coordinate to look for- Returns:
- the value of ui, j
-
-
DMelt 3.0 © DataMelt by jWork.ORG