diff options
| author | Tyge Løvset <[email protected]> | 2020-08-29 22:46:05 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-08-29 22:46:05 +0200 |
| commit | 8efecc5d6b8d4dcd6a7bdf9540a11355b4631782 (patch) | |
| tree | 701373837cfce4bd8dd0115a76517656a79c9c32 /examples/priority.c | |
| parent | 47de9987a623e8374915af40d67d72dcb56e4283 (diff) | |
| download | STC-modified-8efecc5d6b8d4dcd6a7bdf9540a11355b4631782.tar.gz STC-modified-8efecc5d6b8d4dcd6a7bdf9540a11355b4631782.zip | |
Updated crandom.h API! update to benchmark.c . Optimized cmap iter.
Diffstat (limited to 'examples/priority.c')
| -rw-r--r-- | examples/priority.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/priority.c b/examples/priority.c index 2d5c23bd..598f448a 100644 --- a/examples/priority.c +++ b/examples/priority.c @@ -9,19 +9,19 @@ declare_cvec(i, int64_t); declare_cvec_pqueue(i, >); // min-heap (increasing values)
int main() {
- crandom_eng32_t pcg = crandom_eng32_init(time(NULL));
- crandom_distrib_i32_t dist = crandom_uniform_i32_init(0, 100000000);
+ crand_rng32_t pcg = crand_rng32_init(time(NULL));
+ crand_uniform_i32_t dist = crand_uniform_i32_init(pcg, 0, 100000000);
cvec_i heap = cvec_init;
// Push ten million random numbers to priority queue
for (int i=0; i<10000000; ++i)
- cvec_i_pqueue_push(&heap, crandom_uniform_i32(&pcg, dist));
+ cvec_i_pqueue_push(&heap, crand_uniform_i32(&dist));
// push some negative numbers too.
c_push(&heap, cvec_i_pqueue, c_items(-231, -32, -873, -4, -343));
for (int i=0; i<10000000; ++i)
- cvec_i_pqueue_push(&heap, crandom_uniform_i32(&pcg, dist));
+ cvec_i_pqueue_push(&heap, crand_uniform_i32(&dist));
// Extract the hundred smallest.
|
