RandomLib  1.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Functions
RandomThread.cpp File Reference

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[])
 

Detailed Description

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.nosp@m.es@k.nosp@m.arney.nosp@m..com and licensed under the MIT/X11 License. For more information, see http://randomlib.sourceforge.net/

Definition in file RandomThread.cpp.

Function Documentation

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().