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

vgen.h File Reference

ValueGen class and improved random number generators; these are often used together but may be used separately. More...

#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>
#include "genericalgs.h"

Include dependency graph for vgen.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class  ValueGen
class  ValueGenContainer

Functions

template<classT> T shuffled_rand ( bool initialize, T=0.0)
 Routine inspired by examples in "Numerical Recipes" with an extra shuffling of random numbers to avoid sequential correlations. More...

double shuffled_rand ( bool initialize=false)
 Shortcut for typical usage of shuffled_rand. More...

void shuffled_rand_reset (long int new_seed)
 Reset the stream of values returned by shuffled_rand. More...


Detailed Description

ValueGen class and improved random number generators; these are often used together but may be used separately.

Header:
/u/nn/cvsroot/lissom/src/vgen.h,v 1.4 2000/04/21 20:48:12 jbednar Exp

Definition in file vgen.h.


Function Documentation

double shuffled_rand ( bool initialize = false ) [inline]
 

Shortcut for typical usage of shuffled_rand.

Definition at line 103 of file vgen.h.

Referenced by compute_responses(), init_weights(), normal_distribution(), shuffled_rand_reset(), and uniform_distribution().

template<classT>
T shuffled_rand ( bool initialize,
T = 0.0 )
 

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 80 of file vgen.h.

void shuffled_rand_reset ( long int new_seed ) [inline]
 

Reset the stream of values returned by shuffled_rand.

Definition at line 109 of file vgen.h.

Referenced by init_weights(), and WorldViews::reset().


Generated at Mon Aug 21 00:31:13 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000