Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RandomDistribution< RD > Class Template Reference

Random distribution wrapper. More...

#include <Random.h>

Inheritance diagram for RandomDistribution< RD >:

RandomDistributionInterface RandomInterface List of all members.

Public Types

typedef Ref< _State > State
typedef unsigned long int SeedType

Public Methods

double sample ()
 Sample the distribution.

virtual void setSeed (SeedType seed)
 Reseed the random number generator.

virtual State getState () const
 Save the current state of the generator.

virtual void setState (State const &)
 Restore the generator to a specific state saved with getState().

virtual std::string getName () const
 Get the name of this generator.

RD * operator-> ()
 Direct access to the underlying distribution.

virtual void setSeed (SeedType seed)=0
 Set the generator seed.

virtual void setState (State const &state)=0
 Set the generator state.


Detailed Description

template<class RD>
class RandomDistribution< RD >

Random distribution wrapper.

Random distribution wrapper, implementing the random distribution interface. These generics provide a uniform interface to the underlying distributions and distribution (generator) state data.


Member Typedef Documentation

typedef unsigned long int RandomInterface::SeedType [inherited]
 

typedef Ref<_State> RandomInterface::State [inherited]
 


Member Function Documentation

template<class RD>
std::string RandomDistribution< RD >::getName   [virtual]
 

Get the name of this generator.

Implements RandomInterface.

template<class RD>
RandomInterface::State RandomDistribution< RD >::getState   [virtual]
 

Save the current state of the generator.

The state can be restored at any time with setState().

Implements RandomInterface.

template<class RD>
RD* RandomDistribution< RD >::operator->   [inline]
 

Direct access to the underlying distribution.

Using the distribution directly provides slightly faster access and distribution-specific methods.

template<class RD>
double RandomDistribution< RD >::sample   [virtual]
 

Sample the distribution.

Implements RandomDistributionInterface.

virtual void RandomInterface::setSeed SeedType    seed [pure virtual, inherited]
 

Set the generator seed.

Implemented in RandomNumberGenerator< rng::Taus2 >.

template<class RD>
void RandomDistribution< RD >::setSeed SeedType    seed [virtual]
 

Reseed the random number generator.

Parameters:
seed  the new seed.

virtual void RandomInterface::setState State const &    state [pure virtual, inherited]
 

Set the generator state.

Implemented in RandomNumberGenerator< rng::Taus2 >.

template<class RD>
void RandomDistribution< RD >::setState State const &    [virtual]
 

Restore the generator to a specific state saved with getState().

The subsequent random numbers will be identical to the sequence following the corresponding getState() call.


The documentation for this class was generated from the following file:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18.

[SF.net]