-#ifdef DEBUG
-void print_heap(int first, int heap_size, Vertex **heap, int depth, Vertex *vertices) {
- // if(depth == 0) cout << "** START_HEAP ********************************************************" << endl;
- // if(first < heap_size) {
- // print_heap((first + 1) * 2 - 1, heap_size, heap, depth + 1, vertices);
- // for(int d = 0; d < depth; d++) cout << " ";
- // cout << "[" << heap[first] - vertices << "] ";
- // if(heap[first]->distance_from_source == FLT_MAX) cout << "inf";
- // else cout << heap[first]->distance_from_source;
- // cout << endl;
- // print_heap((first + 1) * 2, heap_size, heap, depth + 1, vertices);
- // }
- // if(depth == 0) cout << "** END_HEAP **********************************************************" << endl;
-}
-
-void check_heap(Vertex **heap, int heap_size, Vertex *vertices, int nb_vertices) {
- Vertex **p, **h;
- int *used = new int[nb_vertices];
- for(int v = 0; v < nb_vertices; v++) used[v] = 0;
- for(int k = 0; k < heap_size; k++) {
- used[heap[k] - vertices]++;
- h = heap + k;
- if(h != (*h)->heap_position) abort();
- if(k > 0) {
- p = heap + (h - heap + 1) / 2 - 1;
- if((*h)->distance_from_source < (*p)->distance_from_source) abort();
- }
- }
- for(int v = 0; v < nb_vertices; v++) {
- cout << used[v];
- if(used[v] > 1) abort();
- }
- cout << endl;
- delete[] used;
-}
-#endif
-