summaryrefslogtreecommitdiffhomepage
path: root/benchmarks/plotbench/cpque_benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/plotbench/cpque_benchmark.cpp')
-rw-r--r--benchmarks/plotbench/cpque_benchmark.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/benchmarks/plotbench/cpque_benchmark.cpp b/benchmarks/plotbench/cpque_benchmark.cpp
index 19a9c701..33e55719 100644
--- a/benchmarks/plotbench/cpque_benchmark.cpp
+++ b/benchmarks/plotbench/cpque_benchmark.cpp
@@ -3,7 +3,7 @@
#include <stc/crandom.h>
#define i_val float
-#define i_cmp -c_default_compare
+#define i_cmp -c_default_cmp
#define i_tag f
#include <stc/cpque.h>
@@ -14,11 +14,12 @@ int main()
int N = 10000000, M = 10;
cpque_f pq = cpque_f_init();
+ cpque_f_resize(&pq, N, 0.0f);
rng = stc64_init(seed);
clock_t start = clock();
- c_forrange (i, int, N)
- cpque_f_push_back(&pq, (float) stc64_randf(&rng)*100000);
+ c_forrange (i, N)
+ pq.data[i] = (float) stc64_randf(&rng)*100000;
cpque_f_make_heap(&pq);
printf("Built priority queue: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
@@ -44,5 +45,5 @@ int main()
}
puts("");
- cpque_f_del(&pq);
+ cpque_f_drop(&pq);
}