MTRand Class Reference
#include <random.h>
Public Types | |
enum | { N = 624 } |
enum | { SAVE = N + 1 } |
typedef unsigned long | uint32 |
Public Member Functions | |
MTRand (const uint32 &oneSeed) | |
MTRand (uint32 *const bigSeed, uint32 const seedLength=N) | |
MTRand () | |
double | rand () |
double | rand (const double &n) |
double | randExc () |
double | randExc (const double &n) |
double | randDblExc () |
double | randDblExc (const double &n) |
uint32 | randInt () |
uint32 | randInt (const uint32 &n) |
double | operator() () |
double | rand53 () |
double | randNorm (const double &mean=0.0, const double &variance=0.0) |
double | randNorm (const double &mean, const double &variance, const double &min, const double &max) |
void | seed (const uint32 oneSeed) |
void | seed (uint32 *const bigSeed, const uint32 seedLength=N) |
void | seed () |
void | save (uint32 *saveArray) const |
void | load (uint32 *const loadArray) |
Protected Types | |
enum | { M = 397 } |
Protected Member Functions | |
void | initialize (const uint32 oneSeed) |
void | reload () |
uint32 | hiBit (const uint32 &u) const |
uint32 | loBit (const uint32 &u) const |
uint32 | loBits (const uint32 &u) const |
uint32 | mixBits (const uint32 &u, const uint32 &v) const |
uint32 | twist (const uint32 &m, const uint32 &s0, const uint32 &s1) const |
Static Protected Member Functions | |
static uint32 | hash (time_t t, clock_t c) |
Protected Attributes | |
uint32 | state [N] |
uint32 * | pNext |
int | left |
Friends | |
std::ostream & | operator<< (std::ostream &os, const MTRand &mtrand) |
std::istream & | operator>> (std::istream &is, MTRand &mtrand) |
Member Typedef Documentation
typedef unsigned long MTRand::uint32 |
Member Enumeration Documentation
Constructor & Destructor Documentation
MTRand::MTRand | ( | const uint32 & | oneSeed | ) | [inline] |
MTRand::MTRand | ( | ) | [inline] |
Member Function Documentation
MTRand::uint32 MTRand::hash | ( | time_t | t, | |
clock_t | c | |||
) | [inline, static, protected] |
Referenced by seed().
void MTRand::initialize | ( | const uint32 | oneSeed | ) | [inline, protected] |
double MTRand::operator() | ( | ) | [inline] |
double MTRand::rand | ( | const double & | n | ) | [inline] |
double MTRand::rand | ( | ) | [inline] |
References randInt().
Referenced by FSMSADF::RandomGraph::assignInitialTokensToChannels(), FSMSADF::RandomGraph::assignThroughputConstraint(), createGraph(), FSMSADF::RandomGraph::createScenarioGraph(), distributeInitialTokens(), generateMessagesHotspots(), generateSDFgraphProperties(), operator()(), RandomNoCScheduler::putMessagesInRandomOrder(), RandomNoCScheduler::putRoutesInRandomOrder(), rand(), FSMSADF::RandomGraph::randomProcessorTypes(), randomThroughputConstraint(), and FSMSADF::RandomGraph::selectInitialTokenChannels().
double MTRand::rand53 | ( | ) | [inline] |
double MTRand::randDblExc | ( | ) | [inline] |
References randInt().
Referenced by randDblExc(), and randNorm().
double MTRand::randDblExc | ( | const double & | n | ) | [inline] |
double MTRand::randExc | ( | const double & | n | ) | [inline] |
double MTRand::randExc | ( | ) | [inline] |
References randInt().
Referenced by randExc(), and randNorm().
MTRand::uint32 MTRand::randInt | ( | const uint32 & | n | ) | [inline] |
MTRand::uint32 MTRand::randInt | ( | ) | [inline] |
References left, pNext, and reload().
Referenced by assignConsistentRates(), distributeExecutionTimeOverPeriod(), distributeInitialTokensInComponent(), distributeRateOverPeriod(), RandomNoCScheduler::findScheduleEntityForMessageUsingRandom(), generateMessagesHotspots(), generateMessagesUniform(), getRandomActorFromActorReadyList(), rand(), rand53(), randDblExc(), randExc(), randInt(), randomActor(), randomChannel(), FSMSADF::RandomGraph::randomChannel(), randomChannelBufferSizes(), randomPort(), FSMSADF::RandomGraph::randomPort(), FSMSADF::RandomGraph::randomScenarioGraph(), FSMSADF::RandomGraph::randomState(), selectDstNode(), and selectSrcNode().
double MTRand::randNorm | ( | const double & | mean = 0.0 , |
|
const double & | variance = 0.0 | |||
) | [inline] |
References randDblExc(), and randExc().
Referenced by FSMSADF::RandomGraph::assignActorProperties(), FSMSADF::RandomGraph::assignChannelProperties(), FSMSADF::RandomGraph::assignRatesAndInitialTokens(), FSMSADF::RandomGraph::createActor(), createAcyclicGraph(), createGraph(), createPort(), generateStream(), randNorm(), randomActorExecTime(), randomActorStateSize(), randomBandwidthRequirement(), randomChannelTokenSize(), randomLatencyRequirement(), selectDstNode(), and selectSrcNode().
double MTRand::randNorm | ( | const double & | mean, | |
const double & | variance, | |||
const double & | min, | |||
const double & | max | |||
) | [inline] |
void MTRand::reload | ( | ) | [inline, protected] |
void MTRand::seed | ( | const uint32 | oneSeed | ) | [inline] |
void MTRand::seed | ( | ) | [inline] |
Friends And Related Function Documentation
std::ostream& operator<< | ( | std::ostream & | os, | |
const MTRand & | mtrand | |||
) | [friend] |
std::istream& operator>> | ( | std::istream & | is, | |
MTRand & | mtrand | |||
) | [friend] |
Member Data Documentation
int MTRand::left [protected] |
Referenced by load(), operator<<(), operator>>(), randInt(), reload(), and save().
uint32* MTRand::pNext [protected] |
Referenced by load(), operator>>(), randInt(), and reload().
uint32 MTRand::state[N] [protected] |
Referenced by initialize(), load(), operator<<(), operator>>(), reload(), save(), and seed().
The documentation for this class was generated from the following file: