RandomLib
1.10
|
Example of parallelization with RandomLib using threads. More...
#include <iostream>
#include <iomanip>
#include <limits>
#include <vector>
#include <string>
#include <sstream>
#include <numeric>
#include <RandomLib/Random.hpp>
Go to the source code of this file.
Functions | |
double | dotrials (Random &r, int d, long long n) |
double | result (int d, long long n, double w) |
int | usage (const std::string &name, int retval) |
int | main (int argc, char *argv[]) |
Example of parallelization with RandomLib using threads.
Compile/link with, e.g.,
g++ -I../include -O2 -funroll-loops -fopenmp -o RandomThread RandomThread.cpp ../src/Random.cpp
./RandomThread
See Parallelization, for a description of this example.
Copyright (c) Charles Karney (2011) charl and licensed under the MIT/X11 License. For more information, see es@k arney .comhttp://randomlib.sourceforge.net/
Definition in file RandomThread.cpp.
double dotrials | ( | Random & | r, |
int | d, | ||
long long | n | ||
) |
Definition at line 32 of file RandomThread.cpp.
Referenced by main().
double result | ( | int | d, |
long long | n, | ||
double | w | ||
) |
Definition at line 49 of file RandomThread.cpp.
Referenced by main().
int usage | ( | const std::string & | name, |
int | retval | ||
) |
Definition at line 55 of file RandomThread.cpp.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 63 of file RandomThread.cpp.
References dotrials(), result(), and usage().