# PCG Random Number Generation, C++ Edition
[PCG-Random website]: http://www.pcg-random.org
This code provides an implementation of the PCG family of random number
generators, which are fast, statistically excellent, and offer a number of
useful features.
Full details can be found at the [PCG-Random website]. This version
of the code provides many family members -- if you just want one
simple generator, you may prefer the minimal C version of the library.
There are two kinds of generator, normal generators and extended generators.
Extended generators provide *k* dimensional equidistribution and can perform
party tricks, but generally speaking most people only need the normal
generators.
There are two ways to access the generators, using a convenience typedef
or by using the underlying templates directly (similar to C++11's `std::mt19937` typedef vs its `std::mersenne_twister_engine` template). For most users, the convenience typedef is what you want, and probably you're fine with `pcg32` for 32-bit numbers. If you want 64-bit numbers, either use `pcg64` (or, if you're on a 32-bit system, making 64 bits from two calls to `pcg32_k2` may be faster).
## Documentation and Examples
Visit [PCG-Random website] for information on how to use this library, or look
at the sample code in the `sample` directory -- hopefully it should be fairly
self explanatory.
## Building
The code is written in C++11, as an include-only library (i.e., there is
nothing you need to build). There are some provided demo programs and tests
however. On a Unix-style system (e.g., Linux, Mac OS X) you should be able
to just type
make
To build the demo programs.
## Testing
Run
make test
## Directory Structure
The directories are arranged as follows:
* `include` -- contains `pcg_random.hpp` and supporting include files
* `test-high` -- test code for the high-level API where the functions have
shorter, less scary-looking names.
* `sample` -- sample code, some similar to the code in `test-high` but more
human readable, some other examples too
没有合适的资源?快使用搜索试试~ 我知道了~
PCG — C++ Implementation.zip
共106个文件
cpp:50个
out:40个
gitignore:4个
需积分: 5 0 下载量 44 浏览量
2023-12-31
11:00:49
上传
评论
收藏 111KB ZIP 举报
温馨提示
PCG — C++ Implementation
资源推荐
资源详情
资源评论
收起资源包目录
PCG — C++ Implementation.zip (106个子文件)
pcg-demo.cpp 6KB
pcg-test.cpp 6KB
pcg-test-noadvance.cpp 5KB
make-partytrick.cpp 3KB
use-partytrick.cpp 3KB
cppref-sample.cpp 2KB
spew.cpp 2KB
codebook.cpp 1KB
check-pcg64_c32_oneseq.cpp 118B
check-pcg64_c1024_fast.cpp 118B
check-pcg64_c32_fast.cpp 116B
check-pcg64_c1024.cpp 113B
check-pcg64_c32.cpp 111B
check-pcg64_k32_oneseq.cpp 108B
check-pcg64_k1024_fast.cpp 108B
check-pcg64_k32_fast.cpp 106B
check-pcg64_k1024.cpp 103B
check-pcg64_k32.cpp 101B
check-pcg128_oneseq_once_insecure.cpp 89B
check-pcg16_oneseq_once_insecure.cpp 88B
check-pcg32_c1024_fast.cpp 88B
check-pcg32_c64_oneseq.cpp 88B
check-pcg32_oneseq_once_insecure.cpp 88B
check-pcg64_oneseq_once_insecure.cpp 88B
check-pcg8_oneseq_once_insecure.cpp 87B
check-pcg32_c64_fast.cpp 86B
check-pcg32_unique.cpp 84B
check-pcg64_unique.cpp 84B
check-pcg32_c1024.cpp 83B
check-pcg128_once_insecure.cpp 82B
check-pcg16_once_insecure.cpp 81B
check-pcg32_c64.cpp 81B
check-pcg32_once_insecure.cpp 81B
check-pcg64_once_insecure.cpp 81B
check-pcg8_once_insecure.cpp 80B
check-pcg32_k16384_fast.cpp 79B
check-pcg32_k1024_fast.cpp 78B
check-pcg32_k64_oneseq.cpp 78B
check-pcg32_k64_fast.cpp 76B
check-pcg32_k2_fast.cpp 75B
check-pcg32_oneseq.cpp 74B
check-pcg64_oneseq.cpp 74B
check-pcg32_k16384.cpp 74B
check-pcg32_k1024.cpp 73B
check-pcg64_fast.cpp 72B
check-pcg32_fast.cpp 72B
check-pcg32_k64.cpp 71B
check-pcg32_k2.cpp 70B
check-pcg32.cpp 67B
check-pcg64.cpp 67B
.gitignore 1KB
.gitignore 368B
.gitignore 300B
.gitignore 47B
pcg_random.hpp 72KB
pcg_uint128.hpp 28KB
pcg_extras.hpp 20KB
Makefile 9KB
Makefile 2KB
Makefile 1KB
README.md 2KB
CONTRIBUTING.md 686B
check-pcg128_once_insecure.out 4KB
check-pcg128_oneseq_once_insecure.out 4KB
check-pcg64_once_insecure.out 3KB
check-pcg64_k1024.out 3KB
check-pcg64_k32.out 3KB
check-pcg64.out 3KB
check-pcg64_oneseq_once_insecure.out 3KB
check-pcg64_k1024_fast.out 3KB
check-pcg64_k32_oneseq.out 3KB
check-pcg64_k32_fast.out 3KB
check-pcg64_oneseq.out 3KB
check-pcg64_fast.out 3KB
check-pcg16_once_insecure.out 3KB
check-pcg8_once_insecure.out 3KB
check-pcg16_oneseq_once_insecure.out 3KB
check-pcg8_oneseq_once_insecure.out 3KB
check-pcg32_k16384.out 3KB
check-pcg32_once_insecure.out 3KB
check-pcg32_k1024.out 3KB
check-pcg32_k64.out 3KB
check-pcg32_k2.out 3KB
check-pcg32_oneseq_once_insecure.out 3KB
check-pcg32_k16384_fast.out 3KB
check-pcg32.out 3KB
check-pcg32_k1024_fast.out 3KB
check-pcg32_k64_oneseq.out 3KB
check-pcg32_k64_fast.out 3KB
check-pcg32_k2_fast.out 3KB
check-pcg32_oneseq.out 3KB
check-pcg32_fast.out 3KB
check-pcg64_c1024.out 2KB
check-pcg64_c32.out 2KB
check-pcg64_c1024_fast.out 2KB
check-pcg64_c32_oneseq.out 2KB
check-pcg64_c32_fast.out 2KB
check-pcg32_c1024.out 2KB
check-pcg32_c64.out 2KB
check-pcg32_c1024_fast.out 2KB
共 106 条
- 1
- 2
资源评论
暮苍梧~
- 粉丝: 41
- 资源: 258
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功