Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glentner/parallelmt
The ParallelMT class creates a family of MT19937 objects seeded independently allowing for simultaneous access and generation from within a parallel environment.
https://github.com/glentner/parallelmt
Last synced: 6 days ago
JSON representation
The ParallelMT class creates a family of MT19937 objects seeded independently allowing for simultaneous access and generation from within a parallel environment.
- Host: GitHub
- URL: https://github.com/glentner/parallelmt
- Owner: glentner
- License: gpl-3.0
- Created: 2014-11-14T18:40:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-28T20:57:03.000Z (over 9 years ago)
- Last Synced: 2024-05-01T15:27:01.751Z (7 months ago)
- Language: C++
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#ParallelMT
####A Parallel Pseudo Random Number Generator for Monte Carlo Applications.
The ParallelMT class is an extension to the MT19937 class, both contained within a single MT
namespace. MT19937 is adapted from the original 64-bit pseudo random number generator
(Nishimura and Matsumoto, 2004). Here we have a class constructed with either a single seed or
an array seed. Methods include RandomInteger and RandomReal. The ParallelMT class creates a
family of MT19937 objects seeded independently allowing for simultaneous access and generation
from within a parallel environment.### Example usage:
```c++
#include
#include#define threads 4
int main(){
// std::vector of length two designates `limits`
double init[] = {1, 6};
std::vector limits(init, sizeof(init)/sizeof(double));// construct using default seed
ParallelMT pmt1();// construct using specified seed
ParallelMT pmt2(0x1234ULL);// generate a random real numbers
for (int i = 0; i < 1e6; i++)
...
return 0;
}
```