SST/macro
|
Updated Mersenne twister. More...
#include <mersenne_twister.h>
Public Member Functions | |
virtual std::string | to_string () const |
virtual | ~mersenne_twister () |
Cleanup. More... | |
virtual rngint_t | value () |
Get a value in the interval [0,numeric_limits<rngint_t>::max()]. More... | |
virtual void | vec_reseed (const std::vector< rngint_t > &seeds) |
Reseed the generator. This is an expensive operation. More... | |
virtual int | nseed () |
The number of seeds employed by this generator. More... | |
Public Member Functions inherited from RNG::UniformInteger | |
virtual | ~UniformInteger () |
rngint_t | value_in_range (rngint_t range) |
virtual double | realvalue (bool include_zero=true, bool include_one=true) |
Return a random value in the interval [0,1], (0,1], [0,1), or (0,1) More... | |
void | reseed () |
void | reseed (rngint_t) |
void | reseed (rngint_t, rngint_t) |
void | reseed (rngint_t, rngint_t, rngint_t) |
void | reseed (rngint_t, rngint_t, rngint_t, rngint_t) |
Static Public Member Functions | |
static mersenne_twister * | construct (uint64_t seed) |
Create a new twister. More... | |
Private Member Functions | |
void | reseed (uint64_t seed) |
mersenne_twister (uint64_t seed) | |
Like normally for SST/macro types, constructor is private. More... | |
Private Attributes | |
std::vector< uint64_t > | mt_ |
The array for the state vector. Of length 'state_vector_length_'. More... | |
size_t | mti_ |
The current position in the state vector ('mti' in original code). More... | |
Static Private Attributes | |
static const int | state_vector_length_ |
State vector length defaults to 312 entries ('NN' in original code). More... | |
static const int | mask_length_ |
I believe this is a mask length, defaults to 156 ('MM' in original). More... | |
Updated Mersenne twister.
Copyright (C) 2004, Makoto Matsumoto and Takuji Nishimura, All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Modified to fit into the SST/macroscale code structure and to eliminate global (static) state.
Definition at line 106 of file mersenne_twister.h.
|
private |
Like normally for SST/macro types, constructor is private.
|
virtual |
Cleanup.
Referenced by to_string().
|
static |
Create a new twister.
Referenced by to_string().
|
inlinevirtual |
The number of seeds employed by this generator.
The generator will accept any value up to state_vector_length_.
Implements RNG::UniformInteger.
Definition at line 142 of file mersenne_twister.h.
References state_vector_length_.
|
private |
|
inlinevirtual |
Definition at line 124 of file mersenne_twister.h.
References construct(), value(), vec_reseed(), and ~mersenne_twister().
|
virtual |
Get a value in the interval [0,numeric_limits<rngint_t>::max()].
Implements RNG::UniformInteger.
Referenced by to_string().
|
virtual |
Reseed the generator. This is an expensive operation.
Implements RNG::UniformInteger.
Referenced by to_string().
|
staticprivate |
I believe this is a mask length, defaults to 156 ('MM' in original).
Definition at line 111 of file mersenne_twister.h.
|
private |
The array for the state vector. Of length 'state_vector_length_'.
Definition at line 113 of file mersenne_twister.h.
|
private |
The current position in the state vector ('mti' in original code).
Definition at line 115 of file mersenne_twister.h.
|
staticprivate |
State vector length defaults to 312 entries ('NN' in original code).
Definition at line 109 of file mersenne_twister.h.
Referenced by nseed().