diff options
| author | Tyge Løvset <[email protected]> | 2020-12-16 10:58:04 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-16 10:58:04 +0100 |
| commit | a147a1be246472d079f72fc22e065080d1588e29 (patch) | |
| tree | d01c8965999f86cd46a51cf6ac3e2920adb238a0 /examples/list.c | |
| parent | 12d7c1b3ca437af8734acc8e7cbfdba08b8c36df (diff) | |
| download | STC-modified-a147a1be246472d079f72fc22e065080d1588e29.tar.gz STC-modified-a147a1be246472d079f72fc22e065080d1588e29.zip | |
Reverted back API to easier naming scheme of crandom.h types and methods.
Highly optimized generation of unbiased uniform bounded random numbers. Only 33% overhead.
Diffstat (limited to 'examples/list.c')
| -rw-r--r-- | examples/list.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/list.c b/examples/list.c index fbfa8830..4f6d16e1 100644 --- a/examples/list.c +++ b/examples/list.c @@ -9,11 +9,11 @@ int main() { const int n = 2000000;
clist_fx list = clist_inits;
- cstc64_t eng = cstc64_init(1234);
- cstc64_uniformf_t dist = cstc64_uniformf_init(100.0f, n);
+ crand_t rng = crand_init(1234);
+ crand_uniformf_t dist = crand_uniformf_init(100.0f, n);
int m = 0;
c_forrange (i, int, n)
- clist_fx_push_back(&list, cstc64_uniformf(&eng, &dist)), ++m;
+ clist_fx_push_back(&list, crand_uniformf(&rng, &dist)), ++m;
double sum = 0.0;
printf("sumarize %d:\n", m);
c_foreach (i, clist_fx, list)
|
