From 92b950333c6c7002bdbf1b60af44a249dc0cef9c Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 19 Dec 2021 12:21:44 +0100 Subject: First commit for Version 3 of STC. Main changes are consistent rename of '_del' to '_drop' and '_compare' to '_cmp'. Also i_key_ref (earlier i_key_sptr) and i_val_ref replaced by more general i_key_bind/i_val_bind. --- benchmarks/plotbench/cpque_benchmark.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'benchmarks/plotbench/cpque_benchmark.cpp') 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 #define i_val float -#define i_cmp -c_default_compare +#define i_cmp -c_default_cmp #define i_tag f #include @@ -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); } -- cgit v1.2.3