Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ShuffledRandom< T > Class Template Reference

#include <shuffledrand.h>

Collaboration diagram for ShuffledRandom< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class ShuffledRandom< T >

Routine inspired by examples in "Numerical Recipes" with an extra shuffling of random numbers to avoid sequential correlations.

Used e.g. in generating inputs to avoid potential artifacts. Returns value in open-ended range [0.0, 1.0).

There is technically no reason why this routine would need to be a template, since only type double and (possibly) float are likely to be useful. (It relies on drand48, which uses only 48 bits and thus wouldn't be sufficient for a 64-bit type.) However, the Cray T3E compiler (as of PE3.2) got confused in certain obscure cases when this routine was coded as a regular function in a .c file.

Definition at line 36 of file shuffledrand.h.

Static Public Methods

void reset ()
 Optional; may be called to reset the internal state.

next ()
 Returns the next number in the series.

plain_rand ()
 Simple random value 0..1.0, on which shuffledrandom is built.

void plain_rand_seed (long int seedval)
 Set seed for plain_rand().


Static Public Attributes

int default_seed = 87654321
 Default seed for shuffled_reset.


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:23 2003 for RF-LISSOM by doxygen1.3-rc2