RiRandomStrategy

The strategy for creating a set of random numbers.

This is an abstract class and cannot be directly instanced.


[ Math | Source | Search | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION
IMPLEMENTATION
PATTERN

Class Summary

class RiRandomStrategy
{
public:
// Constructors and assignment
~RiRandomStrategy() ;
RiRandomStrategy *Clone(); // pure virtual
// Members
void SetSeed(long seed ); // pure virtual
void Generate(RiReal *data, int num ); // pure virtual
protected:
}; // RiRandomStrategy


DESCRIPTION

Generates pseudo-random numbers for use by RiRandom. This class allows RiRandom to amortize the function calls and any extra overhead of generating random numbers over many individual numbers.


IMPLEMENTATION

Must have a constructor that takes an int seed value.


PATTERN

Prototype Strategy

~RiRandomStrategy() ;

ual ~RiRandomStrategy() {} GROUP: Constructors and assignment

    virtual ~RiRandomStrategy()   
;

Function is currently defined inline.


RiRandomStrategy *Clone();

Clone me, returning a RNG with the same state.

    virtual  RiRandomStrategy  *Clone();    

void SetSeed(long seed );

Seed the Strategy

    virtual void SetSeed(long seed = 0);  

void Generate(RiReal *data, int num );

Fill an array with RI_RANDOM_ARRAY_SIZE random numbers

    virtual void Generate(RiReal *data, int num = RI_RANDOM_ARRAY_SIZE);  

All Members

public:
// Constructors and assignment
RiRandomStrategy *Clone(); // pure virtual
// Members
void SetSeed(long seed ); // pure virtual
void Generate(RiReal *data, int num ); // pure virtual
protected:

Ancestors

Class does not inherit from any other class.


Descendants

Class is not inherited by any others.


Generated from source by the Cocoon utilities on Fri Feb 25 15:15:35 2000 .