diff --git a/deltapq_approx_tree_main.cpp b/deltapq_approx_tree_main.cpp index 338e30f..955c6f4 100644 --- a/deltapq_approx_tree_main.cpp +++ b/deltapq_approx_tree_main.cpp @@ -246,6 +246,11 @@ int main(int argc, char* argv[]){ int M_arg; M_arg = PQ_M + sizeof(int); diff_argument = PQ_M + sizeof(int); + m_sub_distances = new float*[PQ_M]; // m_sub_distances defined in .h file + for (int i = 0; i < PQ_M; i++) { + m_sub_distances[i] = new float[PQ_K]; + memset(m_sub_distances[i], 0, sizeof(float)*PQ_K); + } bool file_read = create_approx_tree(dataset, vecs, dummycodes, dummymarks, M_arg, PQ_K, num_codes, diff_argument, nodes, m_sub_distances, diff --git a/pq_tree.cpp b/pq_tree.cpp index d37c6b4..6eac5c1 100644 --- a/pq_tree.cpp +++ b/pq_tree.cpp @@ -391,9 +391,6 @@ vector > PQTree::SampledQuery(vector &query, int id) { return results; } #ifdef PLAIN_PQ -auto comp_max_heap = [](const pair &a, const pair &b) { - return a.second < b.second; -}; void print_heap(vector>& test) { for (int i = 0; i < test.size(); i ++) { cout << test[i].first << ", " << test[i].second << " ";