25package umontreal.ssj.hups;
27import umontreal.ssj.util.PrintfFormat;
28import umontreal.ssj.rng.*;
48 protected double[] shift;
67 throw new IllegalArgumentException(
"Cannot construct RandShiftedPointSet with dimShift <= 0");
90 throw new IllegalArgumentException(
PrintfFormat.
NEWLINE +
" Calling addRandomShift with null stream");
111 if (d1 < 0 || d1 > d2)
112 throw new IllegalArgumentException(
"illegal parameter d1 or d2");
117 double[] temp =
new double[d3];
119 for (
int i = 0; i < d1; i++)
124 for (
int i = d1; i < d2; i++)
147 double u = P.getCoordinate(i, j) + shift[j];
163 return new RandShiftedMod1PointSetIterator();
172 private class RandShiftedMod1PointSetIterator
extends ContainerPointSetIterator {
This acts as a generic base class for all container classes that contain a point set and apply a spec...
void init(PointSet p0)
Initializes this container point set so that it will contain the point set p0.
double EpsilonHalf
Default constant epsilon/2 added to the points after a random shift.
This abstract class represents a general point set.
int dimShift
Current dimension of the shift.
double EpsilonHalf
To avoid 0 for nextCoordinate when random shifting, we add this to each coordinate.
double[] shift
This is the shift vector as a double[] array, which contains the current random shift in case we appl...
int capacityShift
Number of array elements in the shift vector, always >= dimShift.
RandomStream shiftStream
Stream used to generate the random shifts.
void addRandomShift(int d1, int d2, RandomStream stream)
Changes the stream used for the random shifts to stream, then refreshes the shift for coordinates d1 ...
double getCoordinate(int i, int j)
Returns the shifted coordinate .
RandShiftedMod1PointSet(PointSet p, int dimShift, RandomStream stream)
Constructs a structure to contain a randomly shifted version of p.
String toString()
Formats a string that contains information about the point set.
PointSetIterator iterator()
Returns a RandShiftedMod1PointSetIterator for this point set.
void addRandomShift(int d1, int d2)
Refreshes the random shift (generates new uniform values for the random shift coordinates) for coordi...
void addRandomShift(RandomStream stream)
Changes the stream used for the random shifts to stream, then refreshes all coordinates of the random...
int getShiftDimension()
Returns the number of dimensions of the current random shift.
void addRandomShift()
Refreshes all coordinates of the random shift, up to its current dimension.
This is the interface for iterators that permit one to go through the points of a PointSet and the su...
int getCurCoordIndex()
Returns the index of the current coordinate.
double nextCoordinate()
Returns the current coordinate and advances to the next one.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...