|
|
@ -46,7 +46,7 @@ int main(int argc, char *argv[]) |
|
|
|
HNSWContext *ctx = hnsw_init_context(argv[1], GLOBAL_DIM, data_size); |
|
|
|
end = clock(); |
|
|
|
printf("HNSW Context Initialied OK!\n"); |
|
|
|
printf("HNSW initialization cost: %.4f seconds\n", ((float) (end - start)) / CLOCKS_PER_SEC); |
|
|
|
printf("HNSW initialization cost: %.4f seconds\n", ((float)(end - start)) / CLOCKS_PER_SEC); |
|
|
|
VecData q_vec; |
|
|
|
q_vec.vec = (float *)malloc(sizeof(float) * GLOBAL_DIM); |
|
|
|
int q_results[K]; |
|
|
@ -62,7 +62,7 @@ int main(int argc, char *argv[]) |
|
|
|
start = clock(); |
|
|
|
hnsw_approximate_knn(ctx, &q_vec, q_results, K); |
|
|
|
end = clock(); |
|
|
|
query_cost += ((float) (end - start)) / CLOCKS_PER_SEC; |
|
|
|
query_cost += ((float)(end - start)) / CLOCKS_PER_SEC; |
|
|
|
total_recall_values += cal_recall_value(q_results, true_results, K); |
|
|
|
} |
|
|
|
|
|
|
|