Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.hups
Class Rank1Lattice

    java.lang.Object
      umontreal.iro.lecuyer.hups.PointSet
          umontreal.iro.lecuyer.hups.Rank1Lattice

Direct Known Subclasses:
  KorobovLattice

    public class Rank1Lattice

extends PointSet

This class implements point sets defined by integration lattices of rank 1, defined as follows. One selects an arbitrary positive integer n and a s-dimensional integer vector (a0,..., as-1), where 0 <= aj < n for each j. Usually, a0 = 1. 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.
`double` | `getCoordinate(int i, int j)` Returns ui, j, the coordinate j of the point i.
`PointSetIterator` | `iterator()` Constructs and returns a point set iterator.
`String` | `toString()` Formats a string that contains the information about the point set.

Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
`addRandomShift, addRandomShift, addRandomShift, formatPoints, formatPoints, 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

### 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`
  Formats a string that contains the information about the point set.

  Overrides:
    `toString` in class `PointSet`
  Returns:
    string representation of the point set information

### 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

### iterator

    public PointSetIterator iterator()

  Description copied from class: `PointSet`
  Constructs and returns a point set iterator. The default implementation returns an iterator that uses the method `getCoordinate` `(i,j)` to iterate over the points and coordinates, but subclasses can reimplement it for better efficiency.

  Overrides:
    `iterator` in class `PointSet`
  Returns:
    point set iterator for the point set

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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