diff options
| author | Tyge Løvset <[email protected]> | 2020-09-13 11:43:18 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-13 11:43:18 +0200 |
| commit | b3a1581b7dabd0fe8989f605bdcf1fee93f657d9 (patch) | |
| tree | c006823101255063ff597fbc9e3dc5a0ee0ad7cf /examples/priority.c | |
| parent | 53b89639a8d00af879389b55edb29276dd31e0db (diff) | |
| download | STC-modified-b3a1581b7dabd0fe8989f605bdcf1fee93f657d9.tar.gz STC-modified-b3a1581b7dabd0fe8989f605bdcf1fee93f657d9.zip | |
reverted back to separate random engine and distribution parameters.
Diffstat (limited to 'examples/priority.c')
| -rw-r--r-- | examples/priority.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/priority.c b/examples/priority.c index 82e78621..e857761c 100644 --- a/examples/priority.c +++ b/examples/priority.c @@ -12,18 +12,18 @@ declare_cpqueue(i, cvec_i, >); // min-heap (increasing values) int main() {
size_t N = 10000000;
crand_rng64_t pcg = crand_rng64_init(time(NULL));
- crand_uniform_i64_t dist = crand_uniform_i64_init(pcg, 0, N * 10);
+ crand_uniform_i64_t dist = crand_uniform_i64_init(0, N * 10);
cpqueue_i heap = cpqueue_i_init();
// Push ten million random numbers to priority queue
for (int i=0; i<N; ++i)
- cpqueue_i_push(&heap, crand_uniform_i64(&dist));
+ cpqueue_i_push(&heap, crand_uniform_i64(&pcg, &dist));
// push some negative numbers too.
c_push(&heap, cpqueue_i, c_items(-231, -32, -873, -4, -343));
for (int i=0; i<N; ++i)
- cpqueue_i_push(&heap, crand_uniform_i64(&dist));
+ cpqueue_i_push(&heap, crand_uniform_i64(&pcg, &dist));
// Extract the hundred smallest.
|
