Documentation Set for Swarm 2.2
Prev | Reference V. Random Library | Next

# SplitGenerator

## Name

SplitGenerator -- Internal

## Protocols adopted by SplitGenerator

None

## Methods

### Phase: Creating

- + create: (id <Zone>)aZone setA: (unsigned)A setV: (unsigned)v setW: (unsigned)w setStateFromSeeds: (unsigned *)seeds

- + create: (id <Zone>)aZone setA: (unsigned)A setV: (unsigned)v setW: (unsigned)w setStateFromSeed: (unsigned)seed

### Phase: Setting

- - initAll
  The initAll method resets the state of all the virtual generators to the start of segment #0.

- - initGenerator: (unsigned)vGen
  The initGenerator method resets the state of a virtual generator to the start of segment #0.

### Phase: Using

- - (unsigned long long int)getCurrentCount: (unsigned)vGen
  The getCurrentCount method returns the current count of the specified virtual generator (i.e. the number of variates delivered).

- - (unsigned long long int)getCurrentSegment: (unsigned)vGen
  The getCurrentSegment method returns the number of the current segment of the specified virtual generator.

- - (long double)getLongDoubleSample: (unsigned)vGen
  The getLongDoubleSample method returns a random floating-point number of size long double, uniformly distributed in the range [0.0,1.0), from virtual generator (data stream) vGen. This method uses 2 calls to -getUnsignedSample to fill the mantissa. Warning: use of this method is not portable between architectures.

- - (double)getDoubleSample: (unsigned)vGen
  The getDoubleSample method returns a random floating-point number of size double, uniformly distributed in the range [0.0,1.0), from virtual generator (data stream) vGen. This method uses 2 calls to -getUnsignedSample to fill the mantissa.

- - (double)getThinDoubleSample: (unsigned)vGen
  The getThinDoubleSample method returns a random floating-point number of size double, uniformly distributed in the range [0.0,1.0), from virtual generator (data stream) vGen. This method uses 1 call to -getUnsignedSample to fill the mantissa.

- - (float)getFloatSample: (unsigned)vGen
  The getFloatSample method returns a random floating-point number of size float, uniformly distributed in the range [0.0,1.0), from virtual generator (data stream) vGen. This method uses 1 call to -getUnsignedSample to fill the mantissa.

- - (unsigned)getUnsignedSample: (unsigned)vGen
  The getUnsignedSample method returns a random unsigned integer uniformly distributed over the interval [0,unsignedMax] from virtual generator (data stream) vGen.

- - jumpAllToSegment: (unsigned long long int)seg
  The jumpAlltoSegment: method resets the state of all the virtual generators to the start of the specified segment.

- - advanceAll
  The advanceAll method resets the state of all the virtual generators to the start of their next segment.

- - restartAll
  The restartAll method resets the state of all the virtual generators to the start of their current segment.

- - jumpGenerator: (unsigned)vGen toSegment: (unsigned long long int)seg
  The jumpGenerator:toSegment: method resets the state of a virtual generator to the start of the specified segment.

- - advanceGenerator: (unsigned)vGen
  The advanceGenerator method resets the state of a virtual generator to the start of the next segment.

- - restartGenerator: (unsigned)vGen
  The restartGenerator method resets the state of a virtual generator to the start of the current segment.

- - (unsigned)getSegmentLength
  The getSegmentLength method returns log2(the current segment length) = w.

- - (unsigned)getNumSegments
  The getNumSegments method returns log2(the current number of segments) = v.

- - (unsigned)getNumGenerators
  The getNumGenerators method returns the current number of virtual generators (A).

Prev | Home | Next
SimpleRandomGenerator | Up | SplitRandomGenerator