Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

RandomFun Class Reference

#include <RandomFuns.h>

Inheritance diagram for RandomFun:

Inheritance graph
[legend]
Collaboration diagram for RandomFun:

Collaboration graph
[legend]
List of all members.

Detailed Description

A FloatFun that returns a Random value, taking an intfun as seed.

Use different index values for different objects to get different results for the same seed

Definition at line 39 of file RandomFuns.h.

Public Member Functions

 RandomFun (const IntFun &seed_, int index_, const char *name_=0)
 RandomFun (const IntFun &seed_, int index_, const std::string &name_)
 Constructor from a C++ string.

 RandomFun (const IntFun &seed1_, const IntFun &seed2_, int index_, const char *name_=0)
 RandomFun (const IntFun &seed1_, const IntFun &seed2_, int index_, const std::string &name_)
virtual Float_FF operator() () const
 Returns a random number that depends on seed() and index.

virtual const FillIteratorgetIterator () const
 Returns pointer to iterator, if any.


Static Public Member Functions

long long iterate (long long i)
long long toInt (Float_FF d)
Float_FF toDouble (long long i)
Float_FF generateNext (Float_FF d)

Protected Member Functions

virtual ~RandomFun ()
 Protected destructor ensures creation on the heap.


Protected Attributes

const IntFunseed
 The seed function object.

int index
 The index.

bool cleanup

Static Private Attributes

const long long a = 16807LL
const long long c = 0LL
const long long m = 2147483647LL


Constructor & Destructor Documentation

RandomFun::RandomFun const IntFun seed_,
int  index_,
const char *  name_ = 0
[explicit]
 

Parameters:
seed_  The seed function object
index_  The index
name_  The object's name

Definition at line 40 of file RandomFuns.C.

RandomFun::RandomFun const IntFun seed_,
int  index_,
const std::string &  name_
 

Constructor from a C++ string.

Parameters:
seed_  The seed function object
index_  The index
name_  The object's name

Definition at line 48 of file RandomFuns.C.

RandomFun::RandomFun const IntFun seed1_,
const IntFun seed2_,
int  index_,
const char *  name_ = 0
 

Parameters:
seed1_  The 1st seed function object
seed2_  The 2nd seed function object
index_  The index
name_  The object's name

Definition at line 58 of file RandomFuns.C.

RandomFun::RandomFun const IntFun seed1_,
const IntFun seed2_,
int  index_,
const std::string &  name_
 

Parameters:
seed1_  The 1st seed function object
seed2_  The 2nd seed function object
index_  The index
name_  The object's name

Definition at line 66 of file RandomFuns.C.


Member Data Documentation

bool RandomFun::cleanup [protected]
 

Flag for clsen up

Definition at line 83 of file RandomFuns.h.

Referenced by ~RandomFun().


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 12:55:02 2006 for SFH by doxygen 1.3.2