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 byui = (i/n)(a0, a1,…, as-1) mod 1for i = 0,..., n - 1. These n points are distinct provided that n and the aj's have no common factor.
-
-
Constructor Summary
Constructors Constructor and Description Rank1Lattice(int n, int[] a, int s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddRandomShift(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.voidclearRandomShift()Clears the random shift.int[]getAs()Returns the generator aj of the lattice.doublegetCoordinate(int i, int j)Returns ui, j, the coordinate j of the point i.PointSetIteratoriterator()Constructs and returns a point set iterator.java.lang.StringtoString()Formats a string that contains information about the point set.-
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
-
-
-
-
Constructor Detail
-
Rank1Lattice
public Rank1Lattice(int n, int[] a, int s)- Parameters:
n- there are n pointsa- the lattice vectors- dimension of the lattice vector a
-
-
Method Detail
-
getAs
public int[] getAs()
Returns the generator aj of the lattice. 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:
addRandomShiftin classPointSet- Parameters:
d1- lower dimension of shiftd2- upper dimension of shift is d2 - 1stream- random number stream used to generate uniforms
-
clearRandomShift
public void clearRandomShift()
Clears the random shift.- Overrides:
clearRandomShiftin classPointSet
-
toString
public java.lang.String toString()
Description copied from class:PointSetFormats a string that contains information about the point set.
-
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
-
iterator
public PointSetIterator iterator()
Description copied from class:PointSetConstructs and returns a point set iterator. The default implementation returns an iterator that uses the methodgetCoordinate(i,j) to iterate over the points and coordinates, but subclasses can reimplement it for better efficiency.
-
-
DMelt 3.0 © DataMelt by jWork.ORG