SSJ
V. 2.6.

umontreal.iro.lecuyer.hups
Class HaltonSequence

java.lang.Object
  extended by umontreal.iro.lecuyer.hups.PointSet
      extended by 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 is

1#1i = (ψb1(i), ψb2(i),..., ψbs(i)),

for i = 0, 1, 2,..., where ψb is the radical inverse function in base b, defined in class 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 point 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
HaltonSequence(int dim)
          Constructs a new Halton sequence in dim dimensions.
 
Method Summary
 void addFaureLemieuxPermutations()
          Permutes the digits using permutations from for all coordinates.
 void addFaurePermutations()
          Permutes the digits using Faure permutations for all coordinates.
 void ErasePermutations()
          Erases the permutations: from now on, the digits will not be permuted.
 double getCoordinate(int i, int j)
          Returns ui, j, the coordinate j of the point i.
 int getNumPoints()
          Returns the number of points.
 void init(double[] x0)
          Initializes the Halton sequence starting at point x0.
 void setStart(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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HaltonSequence

public HaltonSequence(int dim)
Constructs a new Halton sequence in dim dimensions.

Parameters:
dim - dimension
Method Detail

setStart

public void setStart(double[] x0)
Initializes the Halton sequence starting at point x0. For each coordinate j, the sequence starts at index ij such that x0[j] is the radical inverse of ij. The dimension of x0 must be at least as large as the dimension of this object.

Parameters:
x0 - starting point of the Halton sequence

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

addFaureLemieuxPermutations

public void addFaureLemieuxPermutations()
Permutes the digits using permutations from for all coordinates. After the method is called, the coordinates ui, j are generated via

ui, j = ∑r=0k-1πj[ar]bj-r-1,

for j = 0,..., s - 1, where πj is the Faure-Lemieux (2008) permutation of {0,..., bj -1}.


addFaurePermutations

public void addFaurePermutations()
Permutes the digits using Faure permutations for all coordinates. After the method is called, the coordinates ui, j are generated via

ui, 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 permutations: from now on, the digits will not be permuted.


getNumPoints

public int getNumPoints()
Description copied from class: PointSet
Returns the number of points. If this number is actually infinite, Integer.MAX_VALUE is returned.

Overrides:
getNumPoints in class PointSet
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: PointSet
Returns ui, j, the coordinate j of the point i.

Specified by:
getCoordinate in class PointSet
Parameters:
i - index of the point to look for
j - index of the coordinate to look for
Returns:
the value of ui, j

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.