SSJ
V. labo.

umontreal.iro.lecuyer.hups
Class Rank1Lattice

java.lang.Object
  extended by umontreal.iro.lecuyer.hups.PointSet
      extended by umontreal.iro.lecuyer.hups.Rank1Lattice
Direct Known Subclasses:
KorobovLattice

public class Rank1Lattice
extends PointSet

This class implements point sets specified by integration lattices of rank 1. They are defined as follows. One selects an arbitrary positive integer n and a s-dimensional integer vector (a0,..., as-1). [Usually, a0 = 1 and 0 <= aj < n for each j; when the aj are outside the interval [0, n), then we replace aj by ( aj mod n) in all calculations.] The points are defined by

ui = (i/n)(a0, a1,…, as-1) mod 1

for i = 0,..., n - 1. These n points are distinct provided that n and the aj's have no common factor.


Constructor Summary
Rank1Lattice(int n, int[] a, int s)
          Instantiates a Rank1Lattice with n points and lattice vector a of dimension s.
 
Method Summary
 void addRandomShift(int d1, int d2, RandomStream stream)
          Adds a random shift to all the points of the point set, using stream stream to generate the random numbers.
 void clearRandomShift()
          Clears the random shift.
 int[] getAs()
          Returns the generator aj of the lattice.
 double getCoordinate(int i, int j)
          .
 PointSetIterator iterator()
          .
 void setNumPoints(int n)
          Resets the number of points of the lattice to n.
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
addRandomShift, addRandomShift, addRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getNumPoints, getStream, randomize, randomize, randomize, randomize, randomize, setStream, unrandomize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rank1Lattice

public Rank1Lattice(int n,
                    int[] a,
                    int s)
Instantiates a Rank1Lattice with n points and lattice vector a of dimension s.

Parameters:
n - there are n points
a - the lattice vector
s - dimension of the lattice vector a
Method Detail

setNumPoints

public void setNumPoints(int n)
Resets the number of points of the lattice to n. The dimension s and the aj are unchanged.


getAs

public int[] getAs()
Returns the generator aj of the lattice. (The original ones before they are reset to aj mod n). Its components are returned as a[j], for j = 0, 1,…,(s - 1).


addRandomShift

public void addRandomShift(int d1,
                           int d2,
                           RandomStream stream)
Adds a random shift to all the points of the point set, using stream stream to generate the random numbers. For each coordinate j from d1 to d2-1, the shift dj is generated uniformly over [0, 1) and added modulo 1 to all the coordinates of all the points.

Overrides:
addRandomShift in class PointSet
Parameters:
d1 - lower dimension of shift
d2 - upper dimension of shift is d2 - 1
stream - random number stream used to generate uniforms

clearRandomShift

public void clearRandomShift()
Clears the random shift.

Overrides:
clearRandomShift in class PointSet

toString

public String toString()
Description copied from class: PointSet
. \begin{tabb}
 Formats a string that contains information about the point set.
 \end{tabb}
string representation of the point set information

Overrides:
toString in class PointSet

getCoordinate

public double getCoordinate(int i,
                            int j)
Description copied from class: PointSet
. \begin{tabb}
 Returns $u_{i,j}$, the coordinate $j$\ of the point $i$.
 \richard{...
 ...xttt{getCoordinate} impl\'ementent le random shift
 quand il existe?}
 \end{tabb}
iindex of the point to look for jindex of the coordinate to look for the value of ui, j

Specified by:
getCoordinate in class PointSet

iterator

public PointSetIterator iterator()
Description copied from class: PointSet
. \begin{tabb}
 Constructs and returns a point set iterator.
 The default implemen...
 ...oordinates, but subclasses can reimplement it
 for better efficiency.
 \end{tabb}
point set iterator for the point set

Overrides:
iterator in class PointSet

SSJ
V. labo.

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