Mercator
Classes | Public Types | Public Member Functions | Private Attributes
RandCache Class Reference

A cache of random values. More...

#include <RandCache.h>

List of all members.

Classes

struct  Ordering
 Interface to define the ordering of the random number cache. More...

Public Types

typedef WFMath::MTRand::uint32 uint32
 Unsigned 32bit integer.
typedef std::vector< uint32 >
::size_type 
size_type
 Size type of std::vector.

Public Member Functions

 RandCache (uint32 seed, Ordering *o)
 Constructor.
 RandCache (uint32 *seed, uint32 seed_len, Ordering *o)
 Constructor.
double operator() (int x, int y)
 Retrieve a random value associated with parameters.

Private Attributes

WFMath::MTRand m_rand
 Source random number generator.
std::vector< uint32m_cache
 Store for the cache of values.
Orderingm_ordering
 Ordering object that defines the ordering of the cache.

Detailed Description

A cache of random values.


Constructor & Destructor Documentation

RandCache::RandCache ( uint32  seed,
Ordering o 
) [inline]

Constructor.

Parameters:
seedthe random seed value for generated numbers.
othe ordering object that defines the sequence generated.
RandCache::RandCache ( uint32 seed,
uint32  seed_len,
Ordering o 
) [inline]

Constructor.

Parameters:
seedthe random seed block for generated numbers.
seed_lenthe length of the seed block.
othe ordering object that defines the sequence generated.

Member Function Documentation

double RandCache::operator() ( int  x,
int  y 
) [inline]

Retrieve a random value associated with parameters.

Parameters:
xcoordinate associated with value to be retrieved.
ycoordinate associated with value to be retrieved.

References m_cache, and m_rand.


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