25package umontreal.ssj.hups;
27import cern.colt.list.*;
52 double invn = 1.0 / (double) n;
56 boolean stateVisited[] =
new boolean[n];
58 for (i = 0; i < n; i++)
59 stateVisited[i] =
false;
62 while (startState < n) {
63 stateVisited[startState] =
true;
64 c =
new DoubleArrayList();
65 c.add(startState * invn);
67 currentState = (startState * (long) a) % (
long) n;
68 while (currentState != startState) {
69 stateVisited[(int) currentState] =
true;
70 c.add(currentState * invn);
71 currentState = (currentState * (long) a) % (
long) n;
74 for (i = startState + 1; i < n; i++)
75 if (stateVisited[i] ==
false)
86 this(computeModulus(b, e, c), a);
89 private static int computeModulus(
int b,
int e,
int c) {
95 for (i = 1, n = b; i < e; i++)
103 StringBuffer sb =
new StringBuffer(
"LCGPointSet with multiplier a = ");
105 return sb.toString();
This abstract class provides the basic structures for storing and manipulating a point set defined by...
void addCycle(AbstractList c)
Adds the cycle c to the list of all cycles.
String toString()
Formats a string that contains information about the point set.
LCGPointSet(int b, int e, int c, int a)
Constructs and stores the set of cycles for an LCG with modulus and multiplier .
int geta()
Returns the value of the multiplier .
LCGPointSet(int n, int a)
Constructs and stores the set of cycles for an LCG with modulus.
int numPoints
Number of points.