SSJ  3.2.1
Stochastic Simulation in Java
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PointSet.DefaultPointSetIterator Class Reference
Inheritance diagram for PointSet.DefaultPointSetIterator:
[legend]
Collaboration diagram for PointSet.DefaultPointSetIterator:
[legend]

Public Member Functions

void setCurCoordIndex (int j)
 Sets the current coordinate index to \(j\), so that the next calls to nextCoordinate or #nextCoordinates will return the values \(u_{i,j}, u_{i,j+1}, …\), where \(i\) is the index of the current point. More...
 
void resetCurCoordIndex ()
 Equivalent to setCurCoordIndex(0).
 
int getCurCoordIndex ()
 Returns the index \(j\) of the current coordinate. More...
 
boolean hasNextCoordinate ()
 Returns true if the current point has another coordinate. More...
 
double nextCoordinate ()
 Returns the current coordinate \(u_{i,j}\) and advances to the next one. More...
 
void nextCoordinates (double p[], int d)
 
void setCurPointIndex (int i)
 Resets the current point index to \(i\) and the current coordinate index to zero. More...
 
void resetCurPointIndex ()
 Equivalent to setCurPointIndex(0).
 
int resetToNextPoint ()
 Increases the current point index by 1 and returns its new value. More...
 
int getCurPointIndex ()
 Returns the index \(i\) of the current point. More...
 
boolean hasNextPoint ()
 Returns true if there is a next point. More...
 
int nextPoint (double p[], int fromDim, int d)
 
int nextPoint (double p[], int d)
 
void resetStartStream ()
 Reinitializes the stream to its initial state \(I_g\): \(C_g\) and \(B_g\) are set to \(I_g\).
 
void resetStartSubstream ()
 Reinitializes the stream to the beginning of its current substream: \(C_g\) is set to \(B_g\).
 
void resetNextSubstream ()
 Reinitializes the stream to the beginning of its next substream: \(N_g\) is computed, and \(C_g\) and \(B_g\) are set to \(N_g\).
 
void setAntithetic (boolean b)
 
double nextDouble ()
 Returns a (pseudo)random number from the uniform distribution over the interval \((0,1)\), using this stream, after advancing its state by one step. More...
 
void nextArrayOfDouble (double[] u, int start, int n)
 Generates n (pseudo)random numbers from the uniform distribution and stores them into the array u starting at index start. More...
 
int nextInt (int i, int j)
 Returns a (pseudo)random number from the discrete uniform distribution over the integers \(\{i,i+1,…,j\}\), using this stream. More...
 
void nextArrayOfInt (int i, int j, int[] u, int start, int n)
 Generates n (pseudo)random numbers from the discrete uniform distribution over the integers \(\{i,i+1,…,j\}\), using this stream and stores the result in the array u starting at index start. More...
 
String formatState ()
 
- Public Member Functions inherited from PointSetIterator
void nextCoordinates (double[] p, int d)
 Returns the next d coordinates of the current point in p and advances the current coordinate index by d. More...
 
int nextPoint (double[] p, int fromDim, int d)
 Returns in p the next d coordinates of the current point, starting at coordinate fromDim (i.e., after skipping fromDim coordinates), then advances to the next point and returns the index of the new current point. More...
 
int nextPoint (double[] p, int d)
 Same as nextPoint(p, 0, d).
 
- Public Member Functions inherited from RandomStream
String toString ()
 Returns a string containing the current state of this stream. More...
 

Protected Member Functions

void outOfBounds ()
 

Protected Attributes

int curPointIndex = 0
 
int curCoordIndex = 0
 
double EpsilonHalf = 1.0 / Num.TWOEXP[55]
 

Member Function Documentation

◆ getCurCoordIndex()

int getCurCoordIndex ( )

Returns the index \(j\) of the current coordinate.

This may be useful, e.g., for testing if enough coordinates are still available.

Returns
index of the current coordinate

Implements PointSetIterator.

◆ getCurPointIndex()

int getCurPointIndex ( )

Returns the index \(i\) of the current point.

This can be useful, e.g., for caching point sets.

Returns
index of the current point

Implements PointSetIterator.

◆ hasNextCoordinate()

boolean hasNextCoordinate ( )

Returns true if the current point has another coordinate.

This can be useful for testing if coordinates are still available.

Returns
true if the current point has another coordinate

Implements PointSetIterator.

◆ hasNextPoint()

boolean hasNextPoint ( )

Returns true if there is a next point.

This can be useful for testing if points are still available.

Returns
true if a next point is available from the iterated point set

Implements PointSetIterator.

◆ nextArrayOfDouble()

void nextArrayOfDouble ( double []  u,
int  start,
int  n 
)

Generates n (pseudo)random numbers from the uniform distribution and stores them into the array u starting at index start.

Parameters
uarray that will contain the generated uniforms
startstarting index, in the array u, to write uniforms from
nnumber of uniforms to generate

Implements RandomStream.

◆ nextArrayOfInt()

void nextArrayOfInt ( int  i,
int  j,
int []  u,
int  start,
int  n 
)

Generates n (pseudo)random numbers from the discrete uniform distribution over the integers \(\{i,i+1,…,j\}\), using this stream and stores the result in the array u starting at index start.

(Calls nextInt n times.)

Parameters
ismallest integer that can be generated
jgreatest integer that can be generated
uarray that will contain the generated values
startstarting index, in the array u, to write integers from
nnumber of values being generated

Implements RandomStream.

◆ nextCoordinate()

double nextCoordinate ( )

Returns the current coordinate \(u_{i,j}\) and advances to the next one.

If no current coordinate is available (either because the current point index has reached the number of points or because the current coordinate index has reached the number of dimensions), it throws a NoSuchElementException.

Returns
value of the current coordinate
Exceptions
NoSuchElementExceptionif no such coordinate is available

Implements PointSetIterator.

◆ nextDouble()

double nextDouble ( )

Returns a (pseudo)random number from the uniform distribution over the interval \((0,1)\), using this stream, after advancing its state by one step.

The generators programmed in SSJ never return the values 0 or 1.

Returns
the next generated uniform

Implements RandomStream.

◆ nextInt()

int nextInt ( int  i,
int  j 
)

Returns a (pseudo)random number from the discrete uniform distribution over the integers \(\{i,i+1,…,j\}\), using this stream.

(Calls nextDouble once.)

Parameters
ismallest integer that can be generated
jgreatest integer that can be generated
Returns
the generated integer

Implements RandomStream.

◆ resetToNextPoint()

int resetToNextPoint ( )

Increases the current point index by 1 and returns its new value.

If there is no more point, an exception will be raised only if we ask for a new coordinate or point later on.

Returns
index of the new current point

Implements PointSetIterator.

◆ setCurCoordIndex()

void setCurCoordIndex ( int  j)

Sets the current coordinate index to \(j\), so that the next calls to nextCoordinate or #nextCoordinates will return the values \(u_{i,j}, u_{i,j+1}, …\), where \(i\) is the index of the current point.

This can be useful to skip certain coordinates for each point, for example.

Parameters
jindex of the new current coordinate

Implements PointSetIterator.

◆ setCurPointIndex()

void setCurPointIndex ( int  i)

Resets the current point index to \(i\) and the current coordinate index to zero.

If i is larger or equal to the number of points, an exception will not be raised here, but only later if we ask for a new coordinate or point.

Parameters
inew index of the current point

Implements PointSetIterator.


The documentation for this class was generated from the following file: